Driver for the SX1280 RF Transceiver

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

Embed: (wiki syntax)

« 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

Radio ( RadioCallbacks_t callbacks )

Constructor for radio class Sets the callbacks functions pointers.

Parameters:
[in]callbacksThe 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:
firmwareThe firmware version

Implemented in SX1280.

virtual RadioStatus_t GetStatus ( void   ) [pure virtual]

Gets the current radio status.

Return values:
statusRadio status

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]offsetOffset where to start reading
[out]bufferBuffer pointer
[in]sizeBuffer 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]opcodeCommand opcode
[in]bufferCommand parameters byte array
[in]sizeCommand 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]addressRegister address
Return values:
valueThe register value

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]addressFirst Radio register address
[out]bufferBuffer where to copy the registers data
[in]sizeNumber of registers to be read

Implemented in SX1280Hal, and SX1280.

virtual void Reset ( void   ) [pure virtual]

Resets the radio.

Implemented in SX1280Hal, and SX1280.

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

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]opcodeCommand opcode
[in]bufferCommand parameters byte array
[in]sizeCommand 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]addressRegister address
[in]valueNew 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]addressFirst Radio register address
[in]bufferBuffer containing the new register's values
[in]sizeNumber 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]cadFlagFlag for channel activity detected or not

Definition at line 194 of file radio.h.

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

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]

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]errCodeA code indicating the type of interrupt (SyncWord error or CRC error)

Definition at line 180 of file radio.h.

void( * rxHeaderDone)(void) [protected]

Callback on Rx header received interrupt.

Definition at line 163 of file radio.h.

void( * rxSyncWordDone)(void) [protected]

Callback on Rx SyncWord interrupt.

Definition at line 158 of file radio.h.

void( * rxTimeout)(void) [protected]

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.

void( * txTimeout)(void) [protected]

Callback on Tx timeout interrupt.

Definition at line 168 of file radio.h.