Semtech / SX126xLib

Dependents:   SX126xDevKit SX1262PingPong SX126X_TXonly SX126X_PingPong_Demo ... more

Fork of SX126xLib by Gregory Cristian

Embed: (wiki syntax)

« Back to documentation index

SX126xHal Class Reference

Actual implementation of a SX126x radio. More...

#include <sx126x-hal.h>

Inherits SX126x.

Public Member Functions

 SX126xHal (PinName mosi, PinName miso, PinName sclk, PinName nss, PinName busy, PinName dio1, PinName dio2, PinName dio3, PinName rst, PinName freqSel, PinName deviceSelect, PinName antSwPower, RadioCallbacks_t *callbacks)
 Constructor for SX126xHal with SPI support.
virtual ~SX126xHal (void)
 Destructor for SX126xHal.
virtual void Reset (void)
 Soft resets the radio.
virtual void Wakeup (void)
 Wakes up the radio.
virtual void WriteCommand (RadioCommands_t opcode, uint8_t *buffer, uint16_t size)
 Send a command that write data to the radio.
virtual void ReadCommand (RadioCommands_t opcode, uint8_t *buffer, uint16_t size)
 Send a command that read data from the radio.
virtual void WriteRegister (uint16_t address, uint8_t *buffer, uint16_t size)
 Write data to the radio memory.
virtual void WriteReg (uint16_t address, uint8_t value)
 Write a single byte of data to the radio memory.
virtual void ReadRegister (uint16_t address, uint8_t *buffer, uint16_t size)
 Read data from the radio memory.
virtual uint8_t ReadReg (uint16_t address)
 Read a single byte of data from the radio memory.
virtual void WriteBuffer (uint8_t offset, uint8_t *buffer, uint8_t size)
 Write data to the buffer holding the payload in the radio.
virtual void ReadBuffer (uint8_t offset, uint8_t *buffer, uint8_t size)
 Read data from the buffer holding the payload in the radio.
virtual uint8_t GetDioStatus (void)
 Returns the status of DIOs pins.
virtual uint8_t GetDeviceType (void)
 Returns the device type.
virtual uint8_t GetFreqSelect (void)
 Returns the matching frequency.
virtual void AntSwOn (void)
 RF Switch power on.
virtual void AntSwOff (void)
 RF Switch power off.
void Init (void)
 Initializes the radio driver.
virtual RadioOperatingModes_t GetOperatingMode (void)
 Gets the current Operation Mode of the Radip.
virtual void CheckDeviceReady (void)
 Wakeup the radio if it is in Sleep mode and check that Busy is low.
void SetPayload (uint8_t *payload, uint8_t size)
 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, uint32_t timeout)
 Sends a payload.
uint8_t SetSyncWord (uint8_t *syncWord)
 Sets the Sync Word given by index used in GFSK.
void SetCrcSeed (uint16_t seed)
 Sets the Initial value for the LFSR used for the CRC calculation.
void SetCrcPolynomial (uint16_t seed)
 Sets the seed used for the CRC calculation.
void SetWhiteningSeed (uint16_t seed)
 Sets the Initial value of the LFSR used for the whitening in GFSK protocols.
uint32_t GetRandom (void)
 Gets a 32 bits random value generated by the radio.
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 (uint32_t timeout)
 Sets the radio in transmission mode.
void SetRxBoosted (uint32_t timeout)
 Sets the radio in reception Boosted mode.
void SetRx (uint32_t timeout)
 Sets the radio in reception mode.
void SetRxDutyCycle (uint32_t rxTime, uint32_t sleepTime)
 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 SetTxInfinitePreamble (void)
 Sets the radio in continuous preamble transmission mode.
void SetStopRxTimerOnPreambleDetect (bool enable)
 Decide which interrupt will stop the internal radio rx timer.
void SetLoRaSymbNumTimeout (uint8_t SymbNum)
 Set the number of symbol the radio will wait to validate a reception.
void SetRegulatorMode (RadioRegulatorMode_t mode)
 Sets the power regulators operating mode.
void Calibrate (CalibrationParams_t calibParam)
 Calibrates the given radio block.
void CalibrateImage (uint32_t freq)
 Calibrates the Image rejection depending of the frequency.
void SetPaConfig (uint8_t paDutyCycle, uint8_t HpMax, uint8_t deviceSel, uint8_t paLUT)
 Sets the transmission parameters.
void SetRxTxFallbackMode (uint8_t fallbackMode)
 Defines into which mode the chip goes after a TX / RX done.
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 SetRfFrequency (uint32_t frequency)
 Sets the RF frequency.
void SetPacketType (RadioPacketTypes_t packetType)
 Sets the radio for the given protocol.
RadioPacketTypes_t GetPacketType (void)
 Gets the current radio protocol.
void SetTxParams (int8_t power, RadioRampTimes_t rampTime)
 Sets the transmission parameters.
void SetModulationParams (ModulationParams_t *modParams)
 Set the modulation parameters.
void SetPacketParams (PacketParams_t *packetParams)
 Sets the packet parameters.
void SetCadParams (RadioLoRaCadSymbols_t cadSymbolNum, uint8_t cadDetPeak, uint8_t cadDetMin, RadioCadExitModes_t cadExitMode, uint32_t cadTimeout)
 Sets the Channel Activity Detection (CAD) parameters.
void SetBufferBaseAddresses (uint8_t txBaseAddress, uint8_t rxBaseAddress)
 Sets the data buffer base address for transmission and reception.
virtual RadioStatus_t GetStatus (void)
 Gets the current radio status.
int8_t GetRssiInst (void)
 Returns the instantaneous RSSI value for the last packet received.
void GetRxBufferStatus (uint8_t *payloadLength, uint8_t *rxStartBuffer)
 Gets the last received packet buffer status.
void GetPacketStatus (PacketStatus_t *pktStatus)
 Gets the last received packet payload length.
RadioError_t GetDeviceErrors (void)
 Returns the possible system erros.
void ClearIrqStatus (uint16_t irq)
 Clears the IRQs.
void SetPollingMode (void)
 Set the driver in polling mode.
void SetInterruptMode (void)
 Set the driver in interrupt mode.
void ProcessIrqs (void)
 Process the analysis of radio IRQs and calls callback functions depending on radio state.

Protected Member Functions

virtual void SpiInit (void)
 Initializes SPI object used to communicate with the radio.
virtual void IoIrqInit (DioIrqHandler irqHandler)
 Sets the callback functions to be run on DIO1..3 interrupt.
void OnDioIrq (void)
 DIOs interrupt callback.

Protected Attributes

SPI * RadioSpi
 The SPI object used to communicate with the radio.
DigitalOut RadioNss
 The pin connected to Radio chip select (active low)
DigitalInOut RadioReset
 The reset pin connected to the radio.
DigitalIn BUSY
 The pin connected to BUSY.
InterruptIn * DIO1
 The pin connected to DIO1.
InterruptIn * DIO2
 The pin connected to DIO2.
InterruptIn * DIO3
 The pin connected to DIO3.
AnalogIn FreqSelect
 The pin connected to a pull-up/down to select Frequency of the matching.
AnalogIn DeviceSelect
 The pin connected to a pull-up/down to select device.
DigitalOut antSwitchPower
 The pin connected to the RF Switch Power.
void(* txDone )(void)
 Callback on Tx done interrupt.
void(* rxDone )(void)
 Callback on Rx done interrupt.
void(* rxPreambleDetect )(void)
 Callback on Rx preamble detection 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(* cadDone )(bool cadFlag)
 Callback on Channel Activity Detection done interrupt.

Detailed Description

Actual implementation of a SX126x radio.

Definition at line 29 of file sx126x-hal.h.


Constructor & Destructor Documentation

SX126xHal ( PinName  mosi,
PinName  miso,
PinName  sclk,
PinName  nss,
PinName  busy,
PinName  dio1,
PinName  dio2,
PinName  dio3,
PinName  rst,
PinName  freqSel,
PinName  deviceSelect,
PinName  antSwPower,
RadioCallbacks_t callbacks 
)

Constructor for SX126xHal with SPI support.

Represents the physical connectivity with the radio and set callback functions on radio interrupts

Definition at line 59 of file sx126x-hal.cpp.

~SX126xHal ( void   ) [virtual]

Destructor for SX126xHal.

Take care of the correct destruction of the communication objects

Definition at line 79 of file sx126x-hal.cpp.


Member Function Documentation

void AntSwOff ( void   ) [virtual]

RF Switch power off.

Implements SX126x.

Definition at line 351 of file sx126x-hal.cpp.

void AntSwOn ( void   ) [virtual]

RF Switch power on.

Implements SX126x.

Definition at line 346 of file sx126x-hal.cpp.

void Calibrate ( CalibrationParams_t  calibParam ) [inherited]

Calibrates the given radio block.

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

Definition at line 341 of file sx126x.cpp.

void CalibrateImage ( uint32_t  freq ) [inherited]

Calibrates the Image rejection depending of the frequency.

Parameters:
[in]freqThe operating frequency

Definition at line 346 of file sx126x.cpp.

void CheckDeviceReady ( void   ) [virtual, inherited]

Wakeup the radio if it is in Sleep mode and check that Busy is low.

Definition at line 90 of file sx126x.cpp.

void ClearIrqStatus ( uint16_t  irq ) [inherited]

Clears the IRQs.

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

Definition at line 818 of file sx126x.cpp.

RadioError_t GetDeviceErrors ( void   ) [inherited]

Returns the possible system erros.

Return values:
sysErrorsValue representing the possible sys failures

Definition at line 810 of file sx126x.cpp.

uint8_t GetDeviceType ( void   ) [virtual]

Returns the device type.

Return values:
0,:SX1261, 1: SX1262, 2: SX1268

Implements SX126x.

Definition at line 292 of file sx126x-hal.cpp.

uint8_t GetDioStatus ( void   ) [virtual]

Returns the status of DIOs pins.

Return values:
dioStatusA byte where each bit represents a DIO state: [ DIO3 | DIO2 | DIO1 | BUSY ]

Implements SX126x.

Definition at line 287 of file sx126x-hal.cpp.

uint8_t GetFreqSelect ( void   ) [virtual]

Returns the matching frequency.

Return values:
1,:868 MHz 0: 915 MHz

Implements SX126x.

Definition at line 311 of file sx126x-hal.cpp.

uint16_t GetIrqStatus ( void   ) [inherited]

Returns the current IRQ status.

Return values:
irqStatusIRQ status

Definition at line 417 of file sx126x.cpp.

RadioOperatingModes_t GetOperatingMode ( void   ) [virtual, inherited]

Gets the current Operation Mode of the Radip.

Return values:
RadioOperatingModes_tlast operating mode

Definition at line 85 of file sx126x.cpp.

void GetPacketStatus ( PacketStatus_t pktStatus ) [inherited]

Gets the last received packet payload length.

Parameters:
[out]pktStatusA structure of packet status

Definition at line 777 of file sx126x.cpp.

RadioPacketTypes_t GetPacketType ( void   ) [inherited]

Gets the current radio protocol.

Return values:
packetType[PACKET_TYPE_GFSK, PACKET_TYPE_LORA]

Definition at line 479 of file sx126x.cpp.

uint8_t GetPayload ( uint8_t *  payload,
uint8_t *  size,
uint8_t  maxSize 
) [inherited]

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 105 of file sx126x.cpp.

uint32_t GetRandom ( void   ) [inherited]

Gets a 32 bits random value generated by the radio.

Remarks:
The radio must be in reception mode before executing this function
Return values:
randomValue32 bits random value

Definition at line 184 of file sx126x.cpp.

int8_t GetRssiInst ( void   ) [inherited]

Returns the instantaneous RSSI value for the last packet received.

Return values:
rssiInstInstantaneous RSSI

Definition at line 750 of file sx126x.cpp.

void GetRxBufferStatus ( uint8_t *  payloadLength,
uint8_t *  rxStartBuffer 
) [inherited]

Gets the last received packet buffer status.

Parameters:
[out]payloadLengthLast received packet payload length
[out]rxStartBufferLast received packet buffer address pointer

Definition at line 758 of file sx126x.cpp.

RadioStatus_t GetStatus ( void   ) [virtual, inherited]

Gets the current radio status.

Return values:
statusRadio status

Implements Radio.

Definition at line 740 of file sx126x.cpp.

void Init ( void   ) [inherited]

Initializes the radio driver.

pin OPT is used to detect if the board has a TCXO or a XTAL

OPT = 0 >> TCXO; OPT = 1 >> XTAL

Definition at line 40 of file sx126x.cpp.

void IoIrqInit ( DioIrqHandler  irqHandler ) [protected, virtual]

Sets the callback functions to be run on DIO1..3 interrupt.

Parameters:
[in]irqHandlerA function pointer of the function to be run on every DIO interrupt

Implements SX126x.

Definition at line 109 of file sx126x-hal.cpp.

void OnDioIrq ( void   ) [protected, inherited]

DIOs interrupt callback.

Remarks:
Called to handle all 3 DIOs pins

Definition at line 839 of file sx126x.cpp.

void ProcessIrqs ( void   ) [inherited]

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

Definition at line 856 of file sx126x.cpp.

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

Read data from the buffer holding the payload in the radio.

Parameters:
[in]offsetThe offset to start reading the payload
[out]bufferA pointer to a buffer holding the data from the radio
[in]sizeThe number of byte to be read

Implements SX126x.

Definition at line 269 of file sx126x-hal.cpp.

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

Send a command that read data from the radio.

Parameters:
[in]opcodeOpcode of the command
[out]bufferBuffer holding data from the radio
[in]sizeSize of the buffer

Implements SX126x.

Definition at line 185 of file sx126x-hal.cpp.

uint8_t ReadReg ( uint16_t  address ) [virtual]

Read a single byte of data from the radio memory.

Parameters:
[in]addressThe address of the first byte to write in the radio
Return values:
valueThe value of the byte at the given address in radio's memory

Implements SX126x.

Definition at line 244 of file sx126x-hal.cpp.

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

Read data from the radio memory.

Parameters:
[in]addressThe address of the first byte to read from the radio
[out]bufferThe buffer that holds data read from radio
[in]sizeThe number of bytes to read from radio's memory

Implements SX126x.

Definition at line 225 of file sx126x-hal.cpp.

void Reset ( void   ) [virtual]

Soft resets the radio.

Implements SX126x.

Definition at line 124 of file sx126x-hal.cpp.

void SendPayload ( uint8_t *  payload,
uint8_t  size,
uint32_t  timeout 
) [inherited]

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

Definition at line 118 of file sx126x.cpp.

void SetBufferBaseAddresses ( uint8_t  txBaseAddress,
uint8_t  rxBaseAddress 
) [inherited]

Sets the data buffer base address for transmission and reception.

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

Definition at line 727 of file sx126x.cpp.

void SetCad ( void   ) [inherited]

Sets the radio in CAD mode.

Definition at line 301 of file sx126x.cpp.

void SetCadParams ( RadioLoRaCadSymbols_t  cadSymbolNum,
uint8_t  cadDetPeak,
uint8_t  cadDetMin,
RadioCadExitModes_t  cadExitMode,
uint32_t  cadTimeout 
) [inherited]

Sets the Channel Activity Detection (CAD) parameters.

Parameters:
[in]cadSymbolNumThe number of symbol to use for CAD operations [LORA_CAD_01_SYMBOL, LORA_CAD_02_SYMBOL, LORA_CAD_04_SYMBOL, LORA_CAD_08_SYMBOL, LORA_CAD_16_SYMBOL]
[in]cadDetPeakLimite for detection of SNR peak used in the CAD
[in]cadDetMinSet the minimum symbol recognition for CAD
[in]cadExitModeOperation to be done at the end of CAD action [LORA_CAD_ONLY, LORA_CAD_RX, LORA_CAD_LBT]
[in]cadTimeoutDefines the timeout value to abort the CAD activity

Definition at line 712 of file sx126x.cpp.

void SetCrcPolynomial ( uint16_t  seed ) [inherited]

Sets the seed used for the CRC calculation.

Parameters:
[in]seedThe seed value

Definition at line 148 of file sx126x.cpp.

void SetCrcSeed ( uint16_t  seed ) [inherited]

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

Parameters:
[in]seedInitial LFSR value ( 2 bytes )

Definition at line 130 of file sx126x.cpp.

void SetDioIrqParams ( uint16_t  irqMask,
uint16_t  dio1Mask,
uint16_t  dio2Mask,
uint16_t  dio3Mask 
) [inherited]

Sets the IRQ mask and DIO masks.

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

Definition at line 398 of file sx126x.cpp.

void SetFs ( void   ) [inherited]

Sets the radio in FS mode.

Definition at line 228 of file sx126x.cpp.

void SetInterruptMode ( void   ) [inherited]

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 = SX126x( 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:
SX126x::SetPollingMode

Definition at line 834 of file sx126x.cpp.

void SetLoRaSymbNumTimeout ( uint8_t  SymbNum ) [inherited]

Set the number of symbol the radio will wait to validate a reception.

Parameters:
[in]SymbNumnumber of LoRa symbols

Definition at line 328 of file sx126x.cpp.

void SetModulationParams ( ModulationParams_t modParams ) [inherited]

Set the modulation parameters.

Parameters:
[in]modParamsA structure describing the modulation parameters

Definition at line 545 of file sx126x.cpp.

void SetPacketParams ( PacketParams_t packetParams ) [inherited]

Sets the packet parameters.

Parameters:
[in]packetParamsA structure describing the packet parameters

Definition at line 646 of file sx126x.cpp.

void SetPacketType ( RadioPacketTypes_t  packetType ) [inherited]

Sets the radio for the given protocol.

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

Definition at line 468 of file sx126x.cpp.

void SetPaConfig ( uint8_t  paDutyCycle,
uint8_t  HpMax,
uint8_t  deviceSel,
uint8_t  paLUT 
) [inherited]

Sets the transmission parameters.

Parameters:
[in]paDutyCycleDuty Cycle for the PA
[in]HpMax0 for sx1261, 7 for sx1262
[in]deviceSel1 for sx1261, 0 for sx1262
[in]paLUT0 for 14dBm LUT, 1 for 22dBm LUT

Definition at line 378 of file sx126x.cpp.

void SetPayload ( uint8_t *  payload,
uint8_t  size 
) [inherited]

Saves the payload to be send in the radio buffer.

Parameters:
[in]payloadA pointer to the payload
[in]sizeThe size of the payload

Definition at line 100 of file sx126x.cpp.

void SetPollingMode ( void   ) [inherited]

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 = SX126x( 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:
SX126x::SetInterruptMode

Definition at line 829 of file sx126x.cpp.

void SetRegulatorMode ( RadioRegulatorMode_t  mode ) [inherited]

Sets the power regulators operating mode.

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

Definition at line 333 of file sx126x.cpp.

void SetRfFrequency ( uint32_t  frequency ) [inherited]

Sets the RF frequency.

Parameters:
[in]frequencyRF frequency [Hz]

Definition at line 445 of file sx126x.cpp.

void SetRx ( uint32_t  timeout ) [inherited]

Sets the radio in reception mode.

Parameters:
[in]timeoutStructure describing the reception timeout value

Definition at line 271 of file sx126x.cpp.

void SetRxBoosted ( uint32_t  timeout ) [inherited]

Sets the radio in reception Boosted mode.

Parameters:
[in]timeoutStructure describing the transmission timeout value

Definition at line 253 of file sx126x.cpp.

void SetRxDutyCycle ( uint32_t  rxTime,
uint32_t  sleepTime 
) [inherited]

Sets the Rx duty cycle management parameters.

Parameters:
[in]rxTimeStructure describing reception timeout value
[in]sleepTimeStructure describing sleep timeout value

Definition at line 287 of file sx126x.cpp.

void SetRxTxFallbackMode ( uint8_t  fallbackMode ) [inherited]

Defines into which mode the chip goes after a TX / RX done.

Parameters:
[in]fallbackModeThe mode in which the radio goes

Definition at line 393 of file sx126x.cpp.

void SetSleep ( SleepParams_t  sleepConfig ) [inherited]

Sets the radio in sleep mode.

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

Definition at line 200 of file sx126x.cpp.

void SetStandby ( RadioStandbyModes_t  mode ) [inherited]

Sets the radio in configuration mode.

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

Definition at line 212 of file sx126x.cpp.

void SetStopRxTimerOnPreambleDetect ( bool  enable ) [inherited]

Decide which interrupt will stop the internal radio rx timer.

Parameters:
[in]enable[0: Timer stop after header/syncword detection 1: Timer stop after preamble detection]

Definition at line 323 of file sx126x.cpp.

uint8_t SetSyncWord ( uint8_t *  syncWord ) [inherited]

Sets the Sync Word given by index used in GFSK.

Parameters:
[in]syncWordSyncWord bytes ( 8 bytes )
Return values:
status[0: OK, 1: NOK]

Definition at line 124 of file sx126x.cpp.

void SetTx ( uint32_t  timeout ) [inherited]

Sets the radio in transmission mode.

Parameters:
[in]timeoutStructure describing the transmission timeout value

Definition at line 237 of file sx126x.cpp.

void SetTxContinuousWave ( void   ) [inherited]

Sets the radio in continuous wave transmission mode.

Definition at line 307 of file sx126x.cpp.

void SetTxInfinitePreamble ( void   ) [inherited]

Sets the radio in continuous preamble transmission mode.

Definition at line 315 of file sx126x.cpp.

void SetTxParams ( int8_t  power,
RadioRampTimes_t  rampTime 
) [inherited]

Sets the transmission parameters.

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

Definition at line 484 of file sx126x.cpp.

void SetWhiteningSeed ( uint16_t  seed ) [inherited]

Sets the Initial value of the LFSR used for the whitening in GFSK protocols.

Parameters:
[in]seedInitial LFSR value

Definition at line 166 of file sx126x.cpp.

void SpiInit ( void   ) [protected, virtual]

Initializes SPI object used to communicate with the radio.

Definition at line 99 of file sx126x-hal.cpp.

void Wakeup ( void   ) [virtual]

Wakes up the radio.

Implements SX126x.

Definition at line 137 of file sx126x-hal.cpp.

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

Write data to the buffer holding the payload in the radio.

Parameters:
[in]offsetThe offset to start writing the payload
[in]bufferThe data to be written (the payload)
[in]sizeThe number of byte to be written

Implements SX126x.

Definition at line 252 of file sx126x-hal.cpp.

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

Send a command that write data to the radio.

Parameters:
[in]opcodeOpcode of the command
[in]bufferBuffer to be send to the radio
[in]sizeSize of the buffer to send

Implements SX126x.

Definition at line 159 of file sx126x-hal.cpp.

void WriteReg ( uint16_t  address,
uint8_t  value 
) [virtual]

Write a single byte of data to the radio memory.

Parameters:
[in]addressThe address of the first byte to write in the radio
[in]valueThe data to be written in radio's memory

Implements SX126x.

Definition at line 220 of file sx126x-hal.cpp.

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

Write data to the radio memory.

Parameters:
[in]addressThe address of the first byte to write in the radio
[in]bufferThe data to be written in radio's memory
[in]sizeThe number of bytes to write in radio's memory

Implements SX126x.

Definition at line 202 of file sx126x-hal.cpp.


Field Documentation

DigitalOut antSwitchPower [protected]

The pin connected to the RF Switch Power.

Definition at line 176 of file sx126x-hal.h.

DigitalIn BUSY [protected]

The pin connected to BUSY.

Definition at line 170 of file sx126x-hal.h.

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 141 of file radio.h.

AnalogIn DeviceSelect [protected]

The pin connected to a pull-up/down to select device.

Definition at line 175 of file sx126x-hal.h.

InterruptIn* DIO1 [protected]

The pin connected to DIO1.

Definition at line 171 of file sx126x-hal.h.

InterruptIn* DIO2 [protected]

The pin connected to DIO2.

Definition at line 172 of file sx126x-hal.h.

InterruptIn* DIO3 [protected]

The pin connected to DIO3.

Definition at line 173 of file sx126x-hal.h.

AnalogIn FreqSelect [protected]

The pin connected to a pull-up/down to select Frequency of the matching.

Definition at line 174 of file sx126x-hal.h.

DigitalOut RadioNss [protected]

The pin connected to Radio chip select (active low)

Definition at line 167 of file sx126x-hal.h.

DigitalInOut RadioReset [protected]

The reset pin connected to the radio.

Definition at line 168 of file sx126x-hal.h.

SPI* RadioSpi [protected]

The SPI object used to communicate with the radio.

Definition at line 166 of file sx126x-hal.h.

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

Callback on Rx done interrupt.

Definition at line 102 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 134 of file radio.h.

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

Callback on Rx header received interrupt.

Definition at line 117 of file radio.h.

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

Callback on Rx preamble detection interrupt.

Definition at line 107 of file radio.h.

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

Callback on Rx SyncWord interrupt.

Definition at line 112 of file radio.h.

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

Callback on Rx timeout interrupt.

Definition at line 127 of file radio.h.

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

Callback on Tx done interrupt.

Definition at line 97 of file radio.h.

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

Callback on Tx timeout interrupt.

Definition at line 122 of file radio.h.