Driver for the SX1280 RF Transceiver
Dependents:
SX1280PingPong
RangignMaster
RangingSlave
MSNV2-Terminal_V1-6
... more
« Back to documentation index
Radio Class Reference
Class holding the basic communications with a radio.
More...
#include <radio.h >
Inherited by SX1280 .
Public Member Functions
Radio (RadioCallbacks_t *callbacks)
Constructor for radio class Sets the callbacks functions pointers.
virtual void Reset (void)=0
Resets the radio.
virtual RadioStatus_t GetStatus (void)=0
Gets the current radio status.
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 uint16_t GetFirmwareVersion (void)=0
Return firmware version.
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
Class holding the basic communications with a radio.
It sets the functions to read/write registers, send commands and read/write payload. It also provides functions to run callback functions depending on the interrupts generated from the radio.
Definition at line 142 of file radio.h .
Constructor & Destructor Documentation
Constructor for radio class Sets the callbacks functions pointers.
Parameters:
[in] callbacks The structure of callbacks function pointers to be called on radio interrupts
Definition at line 205 of file radio.h .
Member Function Documentation
virtual uint16_t GetFirmwareVersion
(
void
)
[pure virtual]
Return firmware version.
Return values:
firmware The firmware version
Implemented in SX1280 .
Gets the current radio status.
Return values:
Implemented in SX1280 .
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] offset Offset where to start reading
[out] buffer Buffer pointer
[in] size Buffer size
Implemented in SX1280Hal , and SX1280 .
virtual void ReadCommand
(
RadioCommands_t
opcode ,
uint8_t *
buffer ,
uint16_t
size
)
[pure virtual]
Reads the given command from the radio.
Parameters:
[in] opcode Command opcode
[in] buffer Command parameters byte array
[in] size Command parameters byte array size
Implemented in SX1280Hal , and SX1280 .
virtual uint8_t ReadRegister
(
uint16_t
address )
[pure virtual]
Reads the radio register at the specified address.
Parameters:
[in] address Register address
Return values:
Implemented in SX1280Hal , and SX1280 .
virtual void ReadRegister
(
uint16_t
address ,
uint8_t *
buffer ,
uint16_t
size
)
[pure virtual]
Reads multiple radio registers starting at address.
Parameters:
[in] address First Radio register address
[out] buffer Buffer where to copy the registers data
[in] size Number of registers to be read
Implemented in SX1280Hal , and SX1280 .
virtual void Reset
(
void
)
[pure virtual]
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] offset Offset where to start writing
[in] buffer Buffer pointer
[in] size Buffer size
Implemented in SX1280Hal , and SX1280 .
virtual void WriteCommand
(
RadioCommands_t
opcode ,
uint8_t *
buffer ,
uint16_t
size
)
[pure virtual]
Writes the given command to the radio.
Parameters:
[in] opcode Command opcode
[in] buffer Command parameters byte array
[in] size Command parameters byte array size
Implemented in SX1280Hal , and SX1280 .
virtual void WriteRegister
(
uint16_t
address ,
uint8_t
value
)
[pure virtual]
Writes the radio register at the specified address.
Parameters:
[in] address Register address
[in] value New register value
Implemented in SX1280Hal , and SX1280 .
virtual void WriteRegister
(
uint16_t
address ,
uint8_t *
buffer ,
uint16_t
size
)
[pure virtual]
Writes multiple radio registers starting at address.
Parameters:
[in] address First Radio register address
[in] buffer Buffer containing the new register's values
[in] size Number of registers to be written
Implemented in SX1280Hal , and SX1280 .
Field Documentation
void( * cadDone )(bool cadFlag) [protected]
Callback on Channel Activity Detection done interrupt.
Parameters:
[out] cadFlag Flag for channel activity detected or not
Definition at line 194 of file radio.h .
Callback on ranging done interrupt.
Parameters:
[out] val A flag indicating the type of interrupt (Master/Slave and Valid/Error)
Definition at line 187 of file radio.h .
void( * rxDone )(void) [protected]
Callback on Rx done interrupt.
Definition at line 153 of file radio.h .
void( * rxError )(IrqErrorCode_t errCode) [protected]
Callback on Rx error interrupt.
Parameters:
[out] errCode A code indicating the type of interrupt (SyncWord error or CRC error)
Definition at line 180 of file radio.h .
Callback on Rx header received interrupt.
Definition at line 163 of file radio.h .
Callback on Rx SyncWord interrupt.
Definition at line 158 of file radio.h .
Callback on Rx timeout interrupt.
Definition at line 173 of file radio.h .
void( * txDone )(void) [protected]
Callback on Tx done interrupt.
Definition at line 148 of file radio.h .
Callback on Tx timeout interrupt.
Definition at line 168 of file radio.h .