Driver for the SX1280 RF Transceiver

Dependents:   SX1280PingPong RangignMaster RangingSlave MSNV2-Terminal_V1-6 ... more

Embed: (wiki syntax)

« Back to documentation index

SX1280 Class Reference

Represents the SX1280 and its features. More...

#include <sx1280.h>

Inherits Radio.

Inherited by SX1280Hal.

Public Member Functions

 SX1280 (RadioCallbacks_t *callbacks)
 Instantiates a SX1280 object and provides API functions to communicates with the radio.
void Init (void)
 Initializes the radio driver.
void SetPollingMode (void)
 Set the driver in polling mode.
void SetInterruptMode (void)
 Set the driver in interrupt mode.
void SetRegistersDefault (void)
 Initializes the radio registers to the recommended default values.
virtual uint16_t GetFirmwareVersion (void)
 Returns the current device firmware version.
virtual void Reset (void)=0
 Resets the radio.
virtual void Wakeup (void)=0
 Wake-ups the radio from Sleep mode.
virtual void WriteCommand (RadioCommands_t opcode, uint8_t *buffer, uint16_t size)=0
 Writes the given command to the radio.
virtual void ReadCommand (RadioCommands_t opcode, uint8_t *buffer, uint16_t size)=0
 Reads the given command from the radio.
virtual void WriteRegister (uint16_t address, uint8_t *buffer, uint16_t size)=0
 Writes multiple radio registers starting at address.
virtual void WriteRegister (uint16_t address, uint8_t value)=0
 Writes the radio register at the specified address.
virtual void ReadRegister (uint16_t address, uint8_t *buffer, uint16_t size)=0
 Reads multiple radio registers starting at address.
virtual uint8_t ReadRegister (uint16_t address)=0
 Reads the radio register at the specified address.
virtual void WriteBuffer (uint8_t offset, uint8_t *buffer, uint8_t size)=0
 Writes Radio Data Buffer with buffer of size starting at offset.
virtual void ReadBuffer (uint8_t offset, uint8_t *buffer, uint8_t size)=0
 Reads Radio Data Buffer at offset to buffer of size.
virtual uint8_t GetDioStatus (void)=0
 Gets the current status of the radio DIOs.
virtual RadioOperatingModes_t GetOpMode (void)
 Gets the current Operation Mode of the Radio.
virtual RadioStatus_t GetStatus (void)
 Gets the current radio status.
void SetSleep (SleepParams_t sleepConfig)
 Sets the radio in sleep mode.
void SetStandby (RadioStandbyModes_t mode)
 Sets the radio in configuration mode.
void SetFs (void)
 Sets the radio in FS mode.
void SetTx (TickTime_t timeout)
 Sets the radio in transmission mode.
void SetRx (TickTime_t timeout)
 Sets the radio in reception mode.
void SetRxDutyCycle (RadioTickSizes_t periodBase, uint16_t periodBaseCountRx, uint16_t periodBaseCountSleep)
 Sets the Rx duty cycle management parameters.
void SetCad (void)
 Sets the radio in CAD mode.
void SetTxContinuousWave (void)
 Sets the radio in continuous wave transmission mode.
void SetTxContinuousPreamble (void)
 Sets the radio in continuous preamble transmission mode.
void SetPacketType (RadioPacketTypes_t packetType)
 Sets the radio for the given protocol.
RadioPacketTypes_t GetPacketType (bool returnLocalCopy=false)
 Gets the current radio protocol.
void SetRfFrequency (uint32_t rfFrequency)
 Sets the RF frequency.
void SetTxParams (int8_t power, RadioRampTimes_t rampTime)
 Sets the transmission parameters.
void SetCadParams (RadioLoRaCadSymbols_t cadSymbolNum)
 Sets the number of symbols to be used for Channel Activity Detection operation.
void SetBufferBaseAddresses (uint8_t txBaseAddress, uint8_t rxBaseAddress)
 Sets the data buffer base address for transmission and reception.
void SetModulationParams (ModulationParams_t *modParams)
 Set the modulation parameters.
void SetPacketParams (PacketParams_t *packetParams)
 Sets the packet parameters.
void GetRxBufferStatus (uint8_t *rxPayloadLength, uint8_t *rxStartBufferPointer)
 Gets the last received packet buffer status.
void GetPacketStatus (PacketStatus_t *packetStatus)
 Gets the last received packet status.
int8_t GetRssiInst (void)
 Returns the instantaneous RSSI value for the last packet received.
void SetDioIrqParams (uint16_t irqMask, uint16_t dio1Mask, uint16_t dio2Mask, uint16_t dio3Mask)
 Sets the IRQ mask and DIO masks.
uint16_t GetIrqStatus (void)
 Returns the current IRQ status.
void ClearIrqStatus (uint16_t irqMask)
 Clears the IRQs.
void Calibrate (CalibrationParams_t calibParam)
 Calibrates the given radio block.
void SetRegulatorMode (RadioRegulatorModes_t mode)
 Sets the power regulators operating mode.
void SetSaveContext (void)
 Saves the current selected modem configuration into data RAM.
void SetAutoTx (uint16_t time)
 Sets the chip to automatically send a packet after the end of a packet reception.
void StopAutoTx (void)
 Stop the chip to automatically send a packet after the end of a packet reception if previously activated with SX1280::SetAutoTx command.
void SetAutoFs (bool enableAutoFs)
 Sets the chip to stay in FS mode after sending a packet.
void SetLongPreamble (bool enable)
 Enables or disables long preamble detection mode.
void SetPayload (uint8_t *payload, uint8_t size, uint8_t offset=0x00)
 Saves the payload to be send in the radio buffer.
uint8_t GetPayload (uint8_t *payload, uint8_t *size, uint8_t maxSize)
 Reads the payload received. If the received payload is longer than maxSize, then the method returns 1 and do not set size and payload.
void SendPayload (uint8_t *payload, uint8_t size, TickTime_t timeout, uint8_t offset=0x00)
 Sends a payload.
uint8_t SetSyncWord (uint8_t syncWordIdx, uint8_t *syncWord)
 Sets the Sync Word given by index used in GFSK, FLRC and BLE protocols.
void SetSyncWordErrorTolerance (uint8_t errorBits)
 Defines how many error bits are tolerated in sync word detection.
uint8_t SetCrcSeed (uint8_t *seed)
 Sets the Initial value for the LFSR used for the CRC calculation.
void SetBleAccessAddress (uint32_t accessAddress)
 Set the Access Address field of BLE packet.
void SetBleAdvertizerAccessAddress (void)
 Set the Access Address for Advertizer BLE packets.
void SetCrcPolynomial (uint16_t polynomial)
 Sets the seed used for the CRC calculation.
void SetWhiteningSeed (uint8_t seed)
 Sets the Initial value of the LFSR used for the whitening in GFSK, FLRC and BLE protocols.
void EnableManualGain (void)
 Enable manual gain control and disable AGC.
void DisableManualGain (void)
 Disable the manual gain control and enable AGC.
void SetManualGainValue (uint8_t gain)
 Set the gain for the AGC.
void SetLNAGainSetting (const RadioLnaSettings_t lnaSetting)
 Configure the LNA regime of operation.
void SetRangingIdLength (RadioRangingIdCheckLengths_t length)
 Sets the number of bits used to check that ranging request match ranging ID.
void SetDeviceRangingAddress (uint32_t address)
 Sets ranging device id.
void SetRangingRequestAddress (uint32_t address)
 Sets the device id to ping in a ranging request.
double GetRangingResult (RadioRangingResultTypes_t resultType)
 Return the ranging result value.
uint8_t GetRangingPowerDeltaThresholdIndicator (void)
 Return the last ranging result power indicator.
void SetRangingCalibration (uint16_t cal)
 Sets the standard processing delay between Master and Slave.
void RangingClearFilterResult (void)
 Clears the ranging filter.
void RangingSetFilterNumSamples (uint8_t numSample)
 Set the number of samples considered in the built-in filter.
double GetFrequencyError ()
 Return the Estimated Frequency Error in LORA and RANGING operations.
void ProcessIrqs (void)
 Process the analysis of radio IRQs and calls callback functions depending on radio state.
void ForcePreambleLength (RadioPreambleLengths_t preambleLength)
 Force the preamble length in GFSK and BLE mode.

Protected Member Functions

virtual void IoIrqInit (DioIrqHandler irqHandler)=0
 Sets a function to be triggered on radio interrupt.
void OnDioIrq (void)
 DIOs interrupt callback.
void SetRangingRole (RadioRangingRoles_t role)
 Set the role of the radio during ranging operations.

Protected Attributes

void(* txDone )(void)
 Callback on Tx done interrupt.
void(* rxDone )(void)
 Callback on Rx done interrupt.
void(* rxSyncWordDone )(void)
 Callback on Rx SyncWord interrupt.
void(* rxHeaderDone )(void)
 Callback on Rx header received interrupt.
void(* txTimeout )(void)
 Callback on Tx timeout interrupt.
void(* rxTimeout )(void)
 Callback on Rx timeout interrupt.
void(* rxError )(IrqErrorCode_t errCode)
 Callback on Rx error interrupt.
void(* rangingDone )(IrqRangingCode_t val)
 Callback on ranging done interrupt.
void(* cadDone )(bool cadFlag)
 Callback on Channel Activity Detection done interrupt.

Detailed Description

Represents the SX1280 and its features.

It implements the commands the SX1280 can understands

Definition at line 949 of file sx1280.h.


Constructor & Destructor Documentation

SX1280 ( RadioCallbacks_t callbacks )

Instantiates a SX1280 object and provides API functions to communicates with the radio.

Parameters:
[in]callbacksPointer to the callbacks structure defining all callbacks function pointers

Definition at line 958 of file sx1280.h.


Member Function Documentation

void Calibrate ( CalibrationParams_t  calibParam )

Calibrates the given radio block.

Parameters:
[in]calibParamThe description of blocks to be calibrated

Definition at line 490 of file sx1280.cpp.

void ClearIrqStatus ( uint16_t  irqMask )

Clears the IRQs.

Parameters:
[in]irqMaskIRQ(s) to be cleared

Definition at line 481 of file sx1280.cpp.

void DisableManualGain ( void   )

Disable the manual gain control and enable AGC.

See also:
SX1280::EnableManualGain

Definition at line 703 of file sx1280.cpp.

void EnableManualGain ( void   )

Enable manual gain control and disable AGC.

See also:
SX1280::SetManualGainValue, SX1280::DisableManualGain

Definition at line 697 of file sx1280.cpp.

void ForcePreambleLength ( RadioPreambleLengths_t  preambleLength )

Force the preamble length in GFSK and BLE mode.

Parameters:
[in]preambleLengthThe desired preamble length

Definition at line 343 of file sx1280.cpp.

virtual uint8_t GetDioStatus ( void   ) [pure virtual]

Gets the current status of the radio DIOs.

Return values:
status[Bit #3: DIO3, Bit #2: DIO2, Bit #1: DIO1, Bit #0: BUSY]

Implemented in SX1280Hal.

uint16_t GetFirmwareVersion ( void   ) [virtual]

Returns the current device firmware version.

Return values:
versionFirmware version

Implements Radio.

Definition at line 56 of file sx1280.cpp.

double GetFrequencyError (  )

Return the Estimated Frequency Error in LORA and RANGING operations.

Return values:
efeThe estimated frequency error [Hz]

Definition at line 856 of file sx1280.cpp.

uint16_t GetIrqStatus ( void   )

Returns the current IRQ status.

Return values:
irqStatusIRQ status

Definition at line 474 of file sx1280.cpp.

RadioOperatingModes_t GetOpMode ( void   ) [virtual]

Gets the current Operation Mode of the Radio.

Return values:
opModeLast operating mode

Definition at line 71 of file sx1280.cpp.

void GetPacketStatus ( PacketStatus_t packetStatus )

Gets the last received packet status.

The packet status structure returned depends on the modem type selected

See also:
PacketStatus_t for the description of availabled informations
Parameters:
[out]packetStatusA structure of packet status

Definition at line 374 of file sx1280.cpp.

RadioPacketTypes_t GetPacketType ( bool  returnLocalCopy = false )

Gets the current radio protocol.

Default behavior return the packet type returned by the radio. To reduce the SPI activity and return the packet type stored by the driver, a second optional argument must be provided evaluating as true boolean

Parameters:
[in]returnLocalCopyIf true, the packet type returned is the last saved in the driver If false, the packet type is obtained from the chip Default: false
Return values:
packetType[PACKET_TYPE_GENERIC, PACKET_TYPE_LORA, PACKET_TYPE_RANGING, PACKET_TYPE_FLRC, PACKET_TYPE_BLE, PACKET_TYPE_NONE]

Definition at line 181 of file sx1280.cpp.

uint8_t GetPayload ( uint8_t *  payload,
uint8_t *  size,
uint8_t  maxSize 
)

Reads the payload received. If the received payload is longer than maxSize, then the method returns 1 and do not set size and payload.

Parameters:
[out]payloadA pointer to a buffer into which the payload will be copied
[out]sizeA pointer to the size of the payload received
[in]maxSizeThe maximal size allowed to copy into the buffer

Definition at line 542 of file sx1280.cpp.

uint8_t GetRangingPowerDeltaThresholdIndicator ( void   )

Return the last ranging result power indicator.

The value returned is not an absolute power measurement. It is a relative power measurement.

Return values:
deltaThresholdA relative power indicator

Definition at line 812 of file sx1280.cpp.

double GetRangingResult ( RadioRangingResultTypes_t  resultType )

Return the ranging result value.

Parameters:
[in]resultTypeSpecifies the type of result. [0: RAW, 1: Averaged, 2: De-biased, 3:Filtered]
Return values:
rangingThe ranging measure filtered according to resultType [m]

Definition at line 771 of file sx1280.cpp.

int8_t GetRssiInst ( void   )

Returns the instantaneous RSSI value for the last packet received.

Return values:
rssiInstInstantaneous RSSI

Definition at line 450 of file sx1280.cpp.

void GetRxBufferStatus ( uint8_t *  rxPayloadLength,
uint8_t *  rxStartBufferPointer 
)

Gets the last received packet buffer status.

Parameters:
[out]rxPayloadLengthLast received packet payload length
[out]rxStartBufferPointerLast received packet buffer address pointer

Definition at line 348 of file sx1280.cpp.

RadioStatus_t GetStatus ( void   ) [virtual]

Gets the current radio status.

Return values:
statusRadio status

Implements Radio.

Definition at line 61 of file sx1280.cpp.

void Init ( void   )

Initializes the radio driver.

Definition at line 40 of file sx1280.cpp.

virtual void IoIrqInit ( DioIrqHandler  irqHandler ) [protected, pure virtual]

Sets a function to be triggered on radio interrupt.

Parameters:
[in]irqHandlerA pointer to a function to be run on interrupt from the radio

Implemented in SX1280Hal.

void OnDioIrq ( void   ) [protected]

DIOs interrupt callback.

Remarks:
Called to handle all 3 DIOs pins

Definition at line 929 of file sx1280.cpp.

void ProcessIrqs ( void   )

Process the analysis of radio IRQs and calls callback functions depending on radio state.

Definition at line 946 of file sx1280.cpp.

void RangingClearFilterResult ( void   )

Clears the ranging filter.

Definition at line 833 of file sx1280.cpp.

void RangingSetFilterNumSamples ( uint8_t  numSample )

Set the number of samples considered in the built-in filter.

Parameters:
[in]numSampleThe number of samples to use built-in filter [8..255]
Remarks:
Value inferior to 8 will be silently set to 8

Definition at line 842 of file sx1280.cpp.

virtual void ReadBuffer ( uint8_t  offset,
uint8_t *  buffer,
uint8_t  size 
) [pure virtual]

Reads Radio Data Buffer at offset to buffer of size.

Parameters:
[in]offsetOffset where to start reading
[out]bufferBuffer pointer
[in]sizeBuffer size

Implements Radio.

Implemented in SX1280Hal.

virtual void ReadCommand ( RadioCommands_t  opcode,
uint8_t *  buffer,
uint16_t  size 
) [pure virtual]

Reads the given command from the radio.

Parameters:
[in]opcodeCommand opcode
[in]bufferCommand parameters byte array
[in]sizeCommand parameters byte array size

Implements Radio.

Implemented in SX1280Hal.

virtual uint8_t ReadRegister ( uint16_t  address ) [pure virtual]

Reads the radio register at the specified address.

Parameters:
[in]addressRegister address
Return values:
dataRegister value

Implements Radio.

Implemented in SX1280Hal.

virtual void ReadRegister ( uint16_t  address,
uint8_t *  buffer,
uint16_t  size 
) [pure virtual]

Reads multiple radio registers starting at address.

Parameters:
[in]addressFirst Radio register address
[out]bufferBuffer where to copy the registers data
[in]sizeNumber of registers to be read

Implements Radio.

Implemented in SX1280Hal.

virtual void Reset ( void   ) [pure virtual]

Resets the radio.

Implements Radio.

Implemented in SX1280Hal.

void SendPayload ( uint8_t *  payload,
uint8_t  size,
TickTime_t  timeout,
uint8_t  offset = 0x00 
)

Sends a payload.

Parameters:
[in]payloadA pointer to the payload to send
[in]sizeThe size of the payload to send
[in]timeoutThe timeout for Tx operation
[in]offsetThe address in FIFO where writting first byte (default = 0x00)

Definition at line 555 of file sx1280.cpp.

void SetAutoFs ( bool  enableAutoFs )

Sets the chip to stay in FS mode after sending a packet.

Parameters:
[in]enableAutoFsTurn on auto FS

Definition at line 527 of file sx1280.cpp.

void SetAutoTx ( uint16_t  time )

Sets the chip to automatically send a packet after the end of a packet reception.

Remarks:
The offset is automatically compensated inside the function
Parameters:
[in]timeThe delay in us after which a Tx is done

Definition at line 511 of file sx1280.cpp.

void SetBleAccessAddress ( uint32_t  accessAddress )

Set the Access Address field of BLE packet.

Parameters:
[in]accessAddressThe access address to be used for next BLE packet sent
See also:
SX1280::SetBleAdvertizerAccessAddress

Definition at line 652 of file sx1280.cpp.

void SetBleAdvertizerAccessAddress ( void   )

Set the Access Address for Advertizer BLE packets.

All advertizer BLE packets must use a particular value for Access Address field. This method sets it.

See also:
SX1280::SetBleAccessAddress

Definition at line 660 of file sx1280.cpp.

void SetBufferBaseAddresses ( uint8_t  txBaseAddress,
uint8_t  rxBaseAddress 
)

Sets the data buffer base address for transmission and reception.

Parameters:
[in]txBaseAddressTransmission base address
[in]rxBaseAddressReception base address

Definition at line 228 of file sx1280.cpp.

void SetCad ( void   )

Sets the radio in CAD mode.

See also:
SX1280::SetCadParams

Definition at line 157 of file sx1280.cpp.

void SetCadParams ( RadioLoRaCadSymbols_t  cadSymbolNum )

Sets the number of symbols to be used for Channel Activity Detection operation.

Parameters:
[in]cadSymbolNumThe number of symbol to use for Channel Activity Detection operations [LORA_CAD_01_SYMBOL, LORA_CAD_02_SYMBOLS, LORA_CAD_04_SYMBOLS, LORA_CAD_08_SYMBOLS, LORA_CAD_16_SYMBOLS]

Definition at line 222 of file sx1280.cpp.

void SetCrcPolynomial ( uint16_t  polynomial )

Sets the seed used for the CRC calculation.

Parameters:
[in]polynomialThe seed value

Definition at line 665 of file sx1280.cpp.

uint8_t SetCrcSeed ( uint8_t *  seed )

Sets the Initial value for the LFSR used for the CRC calculation.

Parameters:
[in]seedInitial LFSR value ( 4 bytes )
Return values:
updated[0: failure, 1: success]

Definition at line 630 of file sx1280.cpp.

void SetDeviceRangingAddress ( uint32_t  address )

Sets ranging device id.

Parameters:
[in]addressDevice address

Definition at line 743 of file sx1280.cpp.

void SetDioIrqParams ( uint16_t  irqMask,
uint16_t  dio1Mask,
uint16_t  dio2Mask,
uint16_t  dio3Mask 
)

Sets the IRQ mask and DIO masks.

Parameters:
[in]irqMaskGeneral IRQ mask
[in]dio1MaskDIO1 mask
[in]dio2MaskDIO2 mask
[in]dio3MaskDIO3 mask

Definition at line 459 of file sx1280.cpp.

void SetFs ( void   )

Sets the radio in FS mode.

Definition at line 100 of file sx1280.cpp.

void SetInterruptMode ( void   )

Set the driver in interrupt mode.

In interrupt mode, the driver communicate with the radio during the interruption by direct calls to ProcessIrqs( ). The main advantage is the possibility to have low power application architecture. This is the default mode.

 // Initializations and callbacks declaration/definition
 radio = SX1280( mosi, miso, sclk, nss, busy, int1, int2, int3, rst, &callbacks );
 radio.Init( );
 radio.SetInterruptMode( );   // Optionnal. Driver default behavior

 while( true )
 {
     // Do some applicative work
 }
See also:
SX1280::SetPollingMode

Definition at line 924 of file sx1280.cpp.

void SetLNAGainSetting ( const RadioLnaSettings_t  lnaSetting )

Configure the LNA regime of operation.

Parameters:
[in]lnaSettingThe LNA setting. Possible values are LNA_LOW_POWER_MODE and LNA_HIGH_SENSITIVITY_MODE

Definition at line 714 of file sx1280.cpp.

void SetLongPreamble ( bool  enable )

Enables or disables long preamble detection mode.

Parameters:
[in]enableTurn on long preamble mode

Definition at line 532 of file sx1280.cpp.

void SetManualGainValue ( uint8_t  gain )

Set the gain for the AGC.

SX1280::EnableManualGain must be called before using this method

Parameters:
[in]gainThe value of gain to set, refer to datasheet for value meaning
See also:
SX1280::EnableManualGain, SX1280::DisableManualGain

Definition at line 709 of file sx1280.cpp.

void SetModulationParams ( ModulationParams_t modParams )

Set the modulation parameters.

Parameters:
[in]modParamsA structure describing the modulation parameters

Definition at line 237 of file sx1280.cpp.

void SetPacketParams ( PacketParams_t packetParams )

Sets the packet parameters.

Parameters:
[in]packetParamsA structure describing the packet parameters

Definition at line 281 of file sx1280.cpp.

void SetPacketType ( RadioPacketTypes_t  packetType )

Sets the radio for the given protocol.

Parameters:
[in]packetType[PACKET_TYPE_GFSK, PACKET_TYPE_LORA, PACKET_TYPE_RANGING, PACKET_TYPE_FLRC, PACKET_TYPE_BLE]
Remarks:
This method has to be called before SetRfFrequency, SetModulationParams and SetPacketParams

Definition at line 173 of file sx1280.cpp.

void SetPayload ( uint8_t *  payload,
uint8_t  size,
uint8_t  offset = 0x00 
)

Saves the payload to be send in the radio buffer.

Parameters:
[in]payloadA pointer to the payload
[in]sizeThe size of the payload
[in]offsetThe address in FIFO where writting first byte (default = 0x00)

Definition at line 537 of file sx1280.cpp.

void SetPollingMode ( void   )

Set the driver in polling mode.

In polling mode the application is responsible to call ProcessIrqs( ) to execute callbacks functions. The default mode is Interrupt Mode.

 // Initializations and callbacks declaration/definition
 radio = SX1280( mosi, miso, sclk, nss, busy, int1, int2, int3, rst, &callbacks );
 radio.Init( );
 radio.SetPollingMode( );

 while( true )
 {
                            //     IRQ processing is automatically done
     radio.ProcessIrqs( );  // <-- here, as well as callback functions
                            //     calls
     // Do some applicative work
 }
See also:
SX1280::SetInterruptMode

Definition at line 885 of file sx1280.cpp.

void SetRangingCalibration ( uint16_t  cal )

Sets the standard processing delay between Master and Slave.

Parameters:
[in]calRxTx delay offset for correcting ranging bias.

The calibration value reflects the group delay of the radio front end and must be re-performed for each new SX1280 PCB design. The value is obtained empirically by either conducted measurement in a known electrical length coaxial RF cable (where the design is connectorised) or by radiated measurement, at a known distance, where an antenna is present. The result of the calibration process is that the SX1280 ranging result accurately reflects the physical range, the calibration procedure therefore removes the average timing error from the time-of-flight measurement for a given design.

The values are Spreading Factor dependents, and depend also of the board design.

Definition at line 820 of file sx1280.cpp.

void SetRangingIdLength ( RadioRangingIdCheckLengths_t  length )

Sets the number of bits used to check that ranging request match ranging ID.

Parameters:
[in]length[0: 8 bits, 1: 16 bits, 2: 24 bits, 3: 32 bits]

Definition at line 731 of file sx1280.cpp.

void SetRangingRequestAddress ( uint32_t  address )

Sets the device id to ping in a ranging request.

Parameters:
[in]addressAddress of the device to ping

Definition at line 757 of file sx1280.cpp.

void SetRangingRole ( RadioRangingRoles_t  role ) [protected]

Set the role of the radio during ranging operations.

Parameters:
[in]roleRole of the radio

Definition at line 848 of file sx1280.cpp.

void SetRegistersDefault ( void   )

Initializes the radio registers to the recommended default values.

Definition at line 48 of file sx1280.cpp.

void SetRegulatorMode ( RadioRegulatorModes_t  mode )

Sets the power regulators operating mode.

Parameters:
[in]mode[0: LDO, 1:DC_DC]

Definition at line 501 of file sx1280.cpp.

void SetRfFrequency ( uint32_t  rfFrequency )

Sets the RF frequency.

Parameters:
[in]rfFrequencyRF frequency [Hz]

Definition at line 199 of file sx1280.cpp.

void SetRx ( TickTime_t  timeout )

Sets the radio in reception mode.

Parameters:
[in]timeoutStructure describing the reception timeout value

Definition at line 125 of file sx1280.cpp.

void SetRxDutyCycle ( RadioTickSizes_t  periodBase,
uint16_t  periodBaseCountRx,
uint16_t  periodBaseCountSleep 
)

Sets the Rx duty cycle management parameters.

Parameters:
[in]periodBaseBase time for Rx and Sleep TickTime sequences
[in]periodBaseCountRxNumber of base time for Rx TickTime sequence
[in]periodBaseCountSleepNumber of base time for Sleep TickTime sequence

Definition at line 144 of file sx1280.cpp.

void SetSaveContext ( void   )

Saves the current selected modem configuration into data RAM.

Definition at line 506 of file sx1280.cpp.

void SetSleep ( SleepParams_t  sleepConfig )

Sets the radio in sleep mode.

Parameters:
[in]sleepConfigThe sleep configuration describing data retention and RTC wake-up

Definition at line 76 of file sx1280.cpp.

void SetStandby ( RadioStandbyModes_t  mode )

Sets the radio in configuration mode.

Parameters:
[in]modeThe standby mode to put the radio into

Definition at line 87 of file sx1280.cpp.

uint8_t SetSyncWord ( uint8_t  syncWordIdx,
uint8_t *  syncWord 
)

Sets the Sync Word given by index used in GFSK, FLRC and BLE protocols.

Remarks:
5th byte isn't used in FLRC and BLE protocols
Parameters:
[in]syncWordIdxIndex of SyncWord to be set [1..3]
[in]syncWordSyncWord bytes ( 5 bytes )
Return values:
status[0: OK, 1: NOK]

Definition at line 561 of file sx1280.cpp.

void SetSyncWordErrorTolerance ( uint8_t  errorBits )

Defines how many error bits are tolerated in sync word detection.

Parameters:
[in]errorBitsNumber of error bits supported to validate the Sync word detection ( default is 4 bit, minimum is 1 bit )

Definition at line 624 of file sx1280.cpp.

void SetTx ( TickTime_t  timeout )

Sets the radio in transmission mode.

Parameters:
[in]timeoutStructure describing the transmission timeout value

Definition at line 106 of file sx1280.cpp.

void SetTxContinuousPreamble ( void   )

Sets the radio in continuous preamble transmission mode.

Definition at line 168 of file sx1280.cpp.

void SetTxContinuousWave ( void   )

Sets the radio in continuous wave transmission mode.

Definition at line 163 of file sx1280.cpp.

void SetTxParams ( int8_t  power,
RadioRampTimes_t  rampTime 
)

Sets the transmission parameters.

Parameters:
[in]powerRF output power [-18..13] dBm
[in]rampTimeTransmission ramp up time

Definition at line 211 of file sx1280.cpp.

void SetWhiteningSeed ( uint8_t  seed )

Sets the Initial value of the LFSR used for the whitening in GFSK, FLRC and BLE protocols.

Parameters:
[in]seedInitial LFSR value

Definition at line 683 of file sx1280.cpp.

void StopAutoTx ( void   )

Stop the chip to automatically send a packet after the end of a packet reception if previously activated with SX1280::SetAutoTx command.

Definition at line 521 of file sx1280.cpp.

virtual void Wakeup ( void   ) [pure virtual]

Wake-ups the radio from Sleep mode.

Implemented in SX1280Hal.

virtual void WriteBuffer ( uint8_t  offset,
uint8_t *  buffer,
uint8_t  size 
) [pure virtual]

Writes Radio Data Buffer with buffer of size starting at offset.

Parameters:
[in]offsetOffset where to start writing
[in]bufferBuffer pointer
[in]sizeBuffer size

Implements Radio.

Implemented in SX1280Hal.

virtual void WriteCommand ( RadioCommands_t  opcode,
uint8_t *  buffer,
uint16_t  size 
) [pure virtual]

Writes the given command to the radio.

Parameters:
[in]opcodeCommand opcode
[in]bufferCommand parameters byte array
[in]sizeCommand parameters byte array size

Implements Radio.

Implemented in SX1280Hal.

virtual void WriteRegister ( uint16_t  address,
uint8_t  value 
) [pure virtual]

Writes the radio register at the specified address.

Parameters:
[in]addressRegister address
[in]valueNew register value

Implements Radio.

Implemented in SX1280Hal.

virtual void WriteRegister ( uint16_t  address,
uint8_t *  buffer,
uint16_t  size 
) [pure virtual]

Writes multiple radio registers starting at address.

Parameters:
[in]addressFirst Radio register address
[in]bufferBuffer containing the new register's values
[in]sizeNumber of registers to be written

Implements Radio.

Implemented in SX1280Hal.


Field Documentation

void( * cadDone)(bool cadFlag) [protected, inherited]

Callback on Channel Activity Detection done interrupt.

Parameters:
[out]cadFlagFlag for channel activity detected or not

Definition at line 194 of file radio.h.

void( * rangingDone)(IrqRangingCode_t val) [protected, inherited]

Callback on ranging done interrupt.

Parameters:
[out]valA flag indicating the type of interrupt (Master/Slave and Valid/Error)

Definition at line 187 of file radio.h.

void( * rxDone)(void) [protected, inherited]

Callback on Rx done interrupt.

Definition at line 153 of file radio.h.

void( * rxError)(IrqErrorCode_t errCode) [protected, inherited]

Callback on Rx error interrupt.

Parameters:
[out]errCodeA code indicating the type of interrupt (SyncWord error or CRC error)

Definition at line 180 of file radio.h.

void( * rxHeaderDone)(void) [protected, inherited]

Callback on Rx header received interrupt.

Definition at line 163 of file radio.h.

void( * rxSyncWordDone)(void) [protected, inherited]

Callback on Rx SyncWord interrupt.

Definition at line 158 of file radio.h.

void( * rxTimeout)(void) [protected, inherited]

Callback on Rx timeout interrupt.

Definition at line 173 of file radio.h.

void( * txDone)(void) [protected, inherited]

Callback on Tx done interrupt.

Definition at line 148 of file radio.h.

void( * txTimeout)(void) [protected, inherited]

Callback on Tx timeout interrupt.

Definition at line 168 of file radio.h.