Driver for the SX1276 RF Transceiver

Dependents:   LoRaWAN_actility LoRaWAN_MBED LoRaWANSharedTest

Committer:
GregCr
Date:
Fri Sep 19 14:16:35 2014 +0000
Revision:
7:2b555111463f
Parent:
6:e7f02929cd3d
Child:
11:ce0cdab5137a
Added support for CAD; Changed Rssi into an int16_t

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregCr 0:e6ceb13d2d05 1 /*
GregCr 0:e6ceb13d2d05 2 / _____) _ | |
GregCr 0:e6ceb13d2d05 3 ( (____ _____ ____ _| |_ _____ ____| |__
GregCr 0:e6ceb13d2d05 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
GregCr 0:e6ceb13d2d05 5 _____) ) ____| | | || |_| ____( (___| | | |
GregCr 0:e6ceb13d2d05 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
GregCr 0:e6ceb13d2d05 7 ( C )2014 Semtech
GregCr 0:e6ceb13d2d05 8
GregCr 0:e6ceb13d2d05 9 Description: Interface for the radios, contains the main functions that a radio needs, and 5 callback functions
GregCr 0:e6ceb13d2d05 10
GregCr 0:e6ceb13d2d05 11 License: Revised BSD License, see LICENSE.TXT file include in the project
GregCr 0:e6ceb13d2d05 12
GregCr 0:e6ceb13d2d05 13 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
GregCr 0:e6ceb13d2d05 14 */
GregCr 0:e6ceb13d2d05 15 #ifndef __RADIO_H__
GregCr 0:e6ceb13d2d05 16 #define __RADIO_H__
GregCr 0:e6ceb13d2d05 17
GregCr 0:e6ceb13d2d05 18 #include "mbed.h"
GregCr 0:e6ceb13d2d05 19
GregCr 0:e6ceb13d2d05 20 #include "./enums/enums.h"
GregCr 0:e6ceb13d2d05 21
GregCr 0:e6ceb13d2d05 22 /*!
GregCr 0:e6ceb13d2d05 23 * Interface for the radios, contains the main functions that a radio needs, and 5 callback functions
GregCr 0:e6ceb13d2d05 24 */
GregCr 0:e6ceb13d2d05 25 class Radio
GregCr 0:e6ceb13d2d05 26 {
GregCr 0:e6ceb13d2d05 27 protected:
GregCr 0:e6ceb13d2d05 28
GregCr 0:e6ceb13d2d05 29 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 30 // Callback functions pointers
GregCr 0:e6ceb13d2d05 31 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 32
GregCr 0:e6ceb13d2d05 33 /*!
GregCr 0:e6ceb13d2d05 34 * @brief Tx Done callback prototype.
GregCr 0:e6ceb13d2d05 35 */
GregCr 0:e6ceb13d2d05 36 void ( *txDone )( );
GregCr 0:e6ceb13d2d05 37
GregCr 0:e6ceb13d2d05 38 /*!
GregCr 0:e6ceb13d2d05 39 * @brief Tx Timeout callback prototype.
GregCr 0:e6ceb13d2d05 40 */
GregCr 0:e6ceb13d2d05 41 void ( *txTimeout ) ( );
GregCr 0:e6ceb13d2d05 42
GregCr 0:e6ceb13d2d05 43 /*!
GregCr 0:e6ceb13d2d05 44 * @brief Rx Done callback prototype.
GregCr 0:e6ceb13d2d05 45 *
GregCr 0:e6ceb13d2d05 46 * @param [IN] payload Received buffer pointer
GregCr 0:e6ceb13d2d05 47 * @param [IN] size Received buffer size
GregCr 0:e6ceb13d2d05 48 * @param [IN] rssi RSSI value computed while receiving the frame [dBm]
GregCr 0:e6ceb13d2d05 49 * @param [IN] snr Raw SNR value given by the radio hardware
GregCr 0:e6ceb13d2d05 50 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 51 * LoRa: SNR value in dB
GregCr 0:e6ceb13d2d05 52 */
GregCr 7:2b555111463f 53 void ( *rxDone ) ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr );
GregCr 0:e6ceb13d2d05 54
GregCr 0:e6ceb13d2d05 55 /*!
GregCr 0:e6ceb13d2d05 56 * @brief Rx Timeout callback prototype.
GregCr 0:e6ceb13d2d05 57 */
GregCr 0:e6ceb13d2d05 58 void ( *rxTimeout ) ( );
GregCr 0:e6ceb13d2d05 59
GregCr 0:e6ceb13d2d05 60 /*!
GregCr 0:e6ceb13d2d05 61 * @brief Rx Error callback prototype.
GregCr 0:e6ceb13d2d05 62 */
GregCr 0:e6ceb13d2d05 63 void ( *rxError ) ( );
GregCr 0:e6ceb13d2d05 64
GregCr 6:e7f02929cd3d 65 /*!
GregCr 6:e7f02929cd3d 66 * \brief FHSS Change Channel callback prototype.
GregCr 6:e7f02929cd3d 67 *
GregCr 6:e7f02929cd3d 68 * \param [IN] CurrentChannel Index number of the current channel
GregCr 6:e7f02929cd3d 69 */
GregCr 6:e7f02929cd3d 70 void ( *fhssChangeChannel )( uint8_t CurrentChannel );
GregCr 7:2b555111463f 71
GregCr 7:2b555111463f 72 /*!
GregCr 7:2b555111463f 73 * @brief CAD Done callback prototype.
GregCr 7:2b555111463f 74 */
GregCr 7:2b555111463f 75 void ( *cadDone ) ( );
GregCr 6:e7f02929cd3d 76
GregCr 0:e6ceb13d2d05 77 public:
GregCr 0:e6ceb13d2d05 78 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 79 // Constructor
GregCr 0:e6ceb13d2d05 80 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 81 /*!
GregCr 0:e6ceb13d2d05 82 * @brief Constructor of the radio object, the parameters are the callback functions described in the header.
GregCr 0:e6ceb13d2d05 83 * @param [IN] txDone
GregCr 0:e6ceb13d2d05 84 * @param [IN] txTimeout
GregCr 0:e6ceb13d2d05 85 * @param [IN] rxDone
GregCr 0:e6ceb13d2d05 86 * @param [IN] rxTimeout
GregCr 0:e6ceb13d2d05 87 * @param [IN] rxError
GregCr 0:e6ceb13d2d05 88 */
GregCr 7:2b555111463f 89 Radio( void ( *txDone )( ), void ( *txTimeout ) ( ), void ( *rxDone ) ( uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr ),
GregCr 7:2b555111463f 90 void ( *rxTimeout ) ( ), void ( *rxError ) ( ), void ( *fhssChangeChannel ) ( uint8_t channelIndex ), void ( *cadDone ) ( ) );
GregCr 0:e6ceb13d2d05 91 virtual ~Radio( ) {};
GregCr 0:e6ceb13d2d05 92
GregCr 0:e6ceb13d2d05 93 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 94 // Pure virtual functions
GregCr 0:e6ceb13d2d05 95 //-------------------------------------------------------------------------
GregCr 0:e6ceb13d2d05 96
GregCr 0:e6ceb13d2d05 97 /*!
GregCr 0:e6ceb13d2d05 98 * Return current radio status
GregCr 0:e6ceb13d2d05 99 *
GregCr 0:e6ceb13d2d05 100 * @param status Radio status.[RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
GregCr 0:e6ceb13d2d05 101 */
GregCr 0:e6ceb13d2d05 102 virtual RadioState GetState( void ) = 0;
GregCr 0:e6ceb13d2d05 103
GregCr 0:e6ceb13d2d05 104 /*!
GregCr 0:e6ceb13d2d05 105 * @brief Sets the channel frequency
GregCr 0:e6ceb13d2d05 106 *
GregCr 0:e6ceb13d2d05 107 * @param [IN] freq Channel RF frequency
GregCr 0:e6ceb13d2d05 108 */
GregCr 0:e6ceb13d2d05 109 virtual void SetChannel( uint32_t freq ) = 0;
GregCr 0:e6ceb13d2d05 110
GregCr 0:e6ceb13d2d05 111 /*!
GregCr 0:e6ceb13d2d05 112 * @brief Sets the channels configuration
GregCr 0:e6ceb13d2d05 113 *
GregCr 0:e6ceb13d2d05 114 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 115 * @param [IN] freq Channel RF frequency
GregCr 0:e6ceb13d2d05 116 * @param [IN] rssiThresh RSSI threshold
GregCr 0:e6ceb13d2d05 117 *
GregCr 0:e6ceb13d2d05 118 * @retval isFree [true: Channel is free, false: Channel is not free]
GregCr 0:e6ceb13d2d05 119 */
GregCr 0:e6ceb13d2d05 120 virtual bool IsChannelFree( ModemType modem, uint32_t freq, int8_t rssiThresh ) = 0;
GregCr 0:e6ceb13d2d05 121
GregCr 0:e6ceb13d2d05 122 /*!
GregCr 0:e6ceb13d2d05 123 * @brief Generates a 32 bits random value based on the RSSI readings
GregCr 0:e6ceb13d2d05 124 *
GregCr 0:e6ceb13d2d05 125 * \remark This function sets the radio in LoRa modem mode and disables
GregCr 0:e6ceb13d2d05 126 * all interrupts.
GregCr 0:e6ceb13d2d05 127 * After calling this function either Radio.SetRxConfig or
GregCr 0:e6ceb13d2d05 128 * Radio.SetTxConfig functions must be called.
GregCr 0:e6ceb13d2d05 129 *
GregCr 0:e6ceb13d2d05 130 * @retval randomValue 32 bits random value
GregCr 0:e6ceb13d2d05 131 */
GregCr 0:e6ceb13d2d05 132 virtual uint32_t Random( void )= 0;
GregCr 0:e6ceb13d2d05 133
GregCr 0:e6ceb13d2d05 134 /*!
GregCr 0:e6ceb13d2d05 135 * @brief Sets the reception parameters
GregCr 0:e6ceb13d2d05 136 *
GregCr 0:e6ceb13d2d05 137 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 138 * @param [IN] bandwidth Sets the bandwidth
GregCr 0:e6ceb13d2d05 139 * FSK : >= 2600 and <= 250000 Hz
GregCr 0:e6ceb13d2d05 140 * LoRa: [0: 125 kHz, 1: 250 kHz,
GregCr 0:e6ceb13d2d05 141 * 2: 500 kHz, 3: Reserved]
GregCr 0:e6ceb13d2d05 142 * @param [IN] datarate Sets the Datarate
GregCr 0:e6ceb13d2d05 143 * FSK : 600..300000 bits/s
GregCr 0:e6ceb13d2d05 144 * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
GregCr 0:e6ceb13d2d05 145 * 10: 1024, 11: 2048, 12: 4096 chips]
GregCr 0:e6ceb13d2d05 146 * @param [IN] coderate Sets the coding rate ( LoRa only )
GregCr 0:e6ceb13d2d05 147 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 148 * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
GregCr 0:e6ceb13d2d05 149 * @param [IN] bandwidthAfc Sets the AFC Bandwidth ( FSK only )
GregCr 0:e6ceb13d2d05 150 * FSK : >= 2600 and <= 250000 Hz
GregCr 0:e6ceb13d2d05 151 * LoRa: N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 152 * @param [IN] preambleLen Sets the Preamble length ( LoRa only )
GregCr 0:e6ceb13d2d05 153 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 154 * LoRa: Length in symbols ( the hardware adds 4 more symbols )
GregCr 0:e6ceb13d2d05 155 * @param [IN] symbTimeout Sets the RxSingle timeout value ( LoRa only )
GregCr 0:e6ceb13d2d05 156 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 157 * LoRa: timeout in symbols
GregCr 0:e6ceb13d2d05 158 * @param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
GregCr 0:e6ceb13d2d05 159 * @param [IN] crcOn Enables/Disables the CRC [0: OFF, 1: ON]
GregCr 6:e7f02929cd3d 160 * @param [IN] FreqHopOn Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
GregCr 6:e7f02929cd3d 161 * @param [IN] HopPeriod Number of symbols bewteen each hop (LoRa only)
GregCr 0:e6ceb13d2d05 162 * @param [IN] iqInverted Inverts IQ signals ( LoRa only )
GregCr 0:e6ceb13d2d05 163 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 164 * LoRa: [0: not inverted, 1: inverted]
GregCr 0:e6ceb13d2d05 165 * @param [IN] rxContinuous Sets the reception in continuous mode
GregCr 0:e6ceb13d2d05 166 * [false: single mode, true: continuous mode]
GregCr 0:e6ceb13d2d05 167 */
GregCr 0:e6ceb13d2d05 168 virtual void SetRxConfig ( ModemType modem, uint32_t bandwidth,
GregCr 0:e6ceb13d2d05 169 uint32_t datarate, uint8_t coderate,
GregCr 0:e6ceb13d2d05 170 uint32_t bandwidthAfc, uint16_t preambleLen,
GregCr 0:e6ceb13d2d05 171 uint16_t symbTimeout, bool fixLen,
GregCr 6:e7f02929cd3d 172 bool crcOn, bool FreqHopOn, uint8_t HopPeriod,
GregCr 6:e7f02929cd3d 173 bool iqInverted, bool rxContinuous ) = 0;
GregCr 0:e6ceb13d2d05 174
GregCr 0:e6ceb13d2d05 175 /*!
GregCr 0:e6ceb13d2d05 176 * @brief Sets the transmission parameters
GregCr 0:e6ceb13d2d05 177 *
GregCr 0:e6ceb13d2d05 178 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 179 * @param [IN] power Sets the output power [dBm]
GregCr 0:e6ceb13d2d05 180 * @param [IN] fdev Sets the frequency deviation ( FSK only )
GregCr 0:e6ceb13d2d05 181 * FSK : [Hz]
GregCr 0:e6ceb13d2d05 182 * LoRa: 0
GregCr 0:e6ceb13d2d05 183 * @param [IN] bandwidth Sets the bandwidth ( LoRa only )
GregCr 0:e6ceb13d2d05 184 * FSK : 0
GregCr 0:e6ceb13d2d05 185 * LoRa: [0: 125 kHz, 1: 250 kHz,
GregCr 0:e6ceb13d2d05 186 * 2: 500 kHz, 3: Reserved]
GregCr 0:e6ceb13d2d05 187 * @param [IN] datarate Sets the Datarate
GregCr 0:e6ceb13d2d05 188 * FSK : 600..300000 bits/s
GregCr 0:e6ceb13d2d05 189 * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
GregCr 0:e6ceb13d2d05 190 * 10: 1024, 11: 2048, 12: 4096 chips]
GregCr 0:e6ceb13d2d05 191 * @param [IN] coderate Sets the coding rate ( LoRa only )
GregCr 0:e6ceb13d2d05 192 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 193 * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
GregCr 0:e6ceb13d2d05 194 * @param [IN] preambleLen Sets the preamble length
GregCr 0:e6ceb13d2d05 195 * @param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
GregCr 0:e6ceb13d2d05 196 * @param [IN] crcOn Enables disables the CRC [0: OFF, 1: ON]
GregCr 6:e7f02929cd3d 197 * @param [IN] FreqHopOn Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
GregCr 6:e7f02929cd3d 198 * @param [IN] HopPeriod Number of symbols bewteen each hop (LoRa only)
GregCr 0:e6ceb13d2d05 199 * @param [IN] iqInverted Inverts IQ signals ( LoRa only )
GregCr 0:e6ceb13d2d05 200 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 201 * LoRa: [0: not inverted, 1: inverted]
GregCr 0:e6ceb13d2d05 202 * @param [IN] timeout Transmission timeout [us]
GregCr 0:e6ceb13d2d05 203 */
GregCr 0:e6ceb13d2d05 204 virtual void SetTxConfig( ModemType modem, int8_t power, uint32_t fdev,
GregCr 6:e7f02929cd3d 205 uint32_t bandwidth, uint32_t datarate,
GregCr 6:e7f02929cd3d 206 uint8_t coderate, uint16_t preambleLen,
GregCr 6:e7f02929cd3d 207 bool fixLen, bool crcOn, bool FreqHopOn,
GregCr 6:e7f02929cd3d 208 uint8_t HopPeriod, bool iqInverted, uint32_t timeout ) = 0;
GregCr 0:e6ceb13d2d05 209
GregCr 0:e6ceb13d2d05 210 /*!
GregCr 0:e6ceb13d2d05 211 * @brief Checks if the given RF frequency is supported by the hardware
GregCr 0:e6ceb13d2d05 212 *
GregCr 0:e6ceb13d2d05 213 * @param [IN] frequency RF frequency to be checked
GregCr 0:e6ceb13d2d05 214 * @retval isSupported [true: supported, false: unsupported]
GregCr 0:e6ceb13d2d05 215 */
GregCr 0:e6ceb13d2d05 216 virtual bool CheckRfFrequency( uint32_t frequency ) = 0;
GregCr 0:e6ceb13d2d05 217
GregCr 0:e6ceb13d2d05 218 /*!
GregCr 0:e6ceb13d2d05 219 * @brief Computes the packet time on air for the given payload
GregCr 0:e6ceb13d2d05 220 *
GregCr 0:e6ceb13d2d05 221 * \Remark Can only be called once SetRxConfig or SetTxConfig have been called
GregCr 0:e6ceb13d2d05 222 *
GregCr 0:e6ceb13d2d05 223 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 224 * @param [IN] pktLen Packet payload length
GregCr 0:e6ceb13d2d05 225 *
GregCr 0:e6ceb13d2d05 226 * @retval airTime Computed airTime for the given packet payload length
GregCr 0:e6ceb13d2d05 227 */
GregCr 0:e6ceb13d2d05 228 virtual double TimeOnAir ( ModemType modem, uint8_t pktLen ) = 0;
GregCr 0:e6ceb13d2d05 229
GregCr 0:e6ceb13d2d05 230 /*!
GregCr 0:e6ceb13d2d05 231 * @brief Sends the buffer of size. Prepares the packet to be sent and sets
GregCr 0:e6ceb13d2d05 232 * the radio in transmission
GregCr 0:e6ceb13d2d05 233 *
GregCr 0:e6ceb13d2d05 234 * @param [IN]: buffer Buffer pointer
GregCr 0:e6ceb13d2d05 235 * @param [IN]: size Buffer size
GregCr 0:e6ceb13d2d05 236 */
GregCr 0:e6ceb13d2d05 237 virtual void Send( uint8_t *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 238
GregCr 0:e6ceb13d2d05 239 /*!
GregCr 0:e6ceb13d2d05 240 * @brief Sets the radio in sleep mode
GregCr 0:e6ceb13d2d05 241 */
GregCr 0:e6ceb13d2d05 242 virtual void Sleep( void ) = 0;
GregCr 0:e6ceb13d2d05 243
GregCr 0:e6ceb13d2d05 244 /*!
GregCr 0:e6ceb13d2d05 245 * @brief Sets the radio in standby mode
GregCr 0:e6ceb13d2d05 246 */
GregCr 7:2b555111463f 247 virtual void Standby( void ) = 0;
GregCr 7:2b555111463f 248
GregCr 7:2b555111463f 249 /*!
GregCr 7:2b555111463f 250 * @brief Sets the radio in CAD mode
GregCr 7:2b555111463f 251 */
GregCr 7:2b555111463f 252 virtual void StartCad( void ) = 0;
GregCr 0:e6ceb13d2d05 253
GregCr 0:e6ceb13d2d05 254 /*!
GregCr 0:e6ceb13d2d05 255 * @brief Sets the radio in reception mode for the given time
GregCr 0:e6ceb13d2d05 256 * @param [IN] timeout Reception timeout [us]
GregCr 0:e6ceb13d2d05 257 * [0: continuous, others timeout]
GregCr 0:e6ceb13d2d05 258 */
GregCr 0:e6ceb13d2d05 259 virtual void Rx( uint32_t timeout ) = 0;
GregCr 0:e6ceb13d2d05 260
GregCr 0:e6ceb13d2d05 261 /*!
GregCr 0:e6ceb13d2d05 262 * @brief Sets the radio in transmission mode for the given time
GregCr 0:e6ceb13d2d05 263 * @param [IN] timeout Transmission timeout [us]
GregCr 0:e6ceb13d2d05 264 * [0: continuous, others timeout]
GregCr 0:e6ceb13d2d05 265 */
GregCr 0:e6ceb13d2d05 266 virtual void Tx( uint32_t timeout ) = 0;
GregCr 0:e6ceb13d2d05 267
GregCr 0:e6ceb13d2d05 268 /*!
GregCr 0:e6ceb13d2d05 269 * @brief Reads the current RSSI value
GregCr 0:e6ceb13d2d05 270 *
GregCr 0:e6ceb13d2d05 271 * @retval rssiValue Current RSSI value in [dBm]
GregCr 0:e6ceb13d2d05 272 */
GregCr 7:2b555111463f 273 virtual int16_t GetRssi ( ModemType modem ) = 0;
GregCr 0:e6ceb13d2d05 274
GregCr 0:e6ceb13d2d05 275 /*!
GregCr 0:e6ceb13d2d05 276 * @brief Writes the radio register at the specified address
GregCr 0:e6ceb13d2d05 277 *
GregCr 0:e6ceb13d2d05 278 * @param [IN]: addr Register address
GregCr 0:e6ceb13d2d05 279 * @param [IN]: data New register value
GregCr 0:e6ceb13d2d05 280 */
GregCr 0:e6ceb13d2d05 281 virtual void Write ( uint8_t addr, uint8_t data ) = 0;
GregCr 0:e6ceb13d2d05 282
GregCr 0:e6ceb13d2d05 283 /*!
GregCr 0:e6ceb13d2d05 284 * @brief Reads the radio register at the specified address
GregCr 0:e6ceb13d2d05 285 *
GregCr 0:e6ceb13d2d05 286 * @param [IN]: addr Register address
GregCr 0:e6ceb13d2d05 287 * @retval data Register value
GregCr 0:e6ceb13d2d05 288 */
GregCr 0:e6ceb13d2d05 289 virtual uint8_t Read ( uint8_t addr ) = 0;
GregCr 0:e6ceb13d2d05 290
GregCr 0:e6ceb13d2d05 291 /*!
GregCr 0:e6ceb13d2d05 292 * @brief Writes multiple radio registers starting at address
GregCr 0:e6ceb13d2d05 293 *
GregCr 0:e6ceb13d2d05 294 * @param [IN] addr First Radio register address
GregCr 0:e6ceb13d2d05 295 * @param [IN] buffer Buffer containing the new register's values
GregCr 0:e6ceb13d2d05 296 * @param [IN] size Number of registers to be written
GregCr 0:e6ceb13d2d05 297 */
GregCr 0:e6ceb13d2d05 298 virtual void Write( uint8_t addr, uint8_t *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 299
GregCr 0:e6ceb13d2d05 300 /*!
GregCr 0:e6ceb13d2d05 301 * @brief Reads multiple radio registers starting at address
GregCr 0:e6ceb13d2d05 302 *
GregCr 0:e6ceb13d2d05 303 * @param [IN] addr First Radio register address
GregCr 0:e6ceb13d2d05 304 * @param [OUT] buffer Buffer where to copy the registers data
GregCr 0:e6ceb13d2d05 305 * @param [IN] size Number of registers to be read
GregCr 0:e6ceb13d2d05 306 */
GregCr 0:e6ceb13d2d05 307 virtual void Read ( uint8_t addr, uint8_t *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 308
GregCr 0:e6ceb13d2d05 309 /*!
GregCr 0:e6ceb13d2d05 310 * @brief Writes the buffer contents to the SX1276 FIFO
GregCr 0:e6ceb13d2d05 311 *
GregCr 0:e6ceb13d2d05 312 * @param [IN] buffer Buffer containing data to be put on the FIFO.
GregCr 0:e6ceb13d2d05 313 * @param [IN] size Number of bytes to be written to the FIFO
GregCr 0:e6ceb13d2d05 314 */
GregCr 0:e6ceb13d2d05 315 virtual void WriteFifo( uint8_t *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 316
GregCr 0:e6ceb13d2d05 317 /*!
GregCr 0:e6ceb13d2d05 318 * @brief Reads the contents of the SX1276 FIFO
GregCr 0:e6ceb13d2d05 319 *
GregCr 0:e6ceb13d2d05 320 * @param [OUT] buffer Buffer where to copy the FIFO read data.
GregCr 0:e6ceb13d2d05 321 * @param [IN] size Number of bytes to be read from the FIFO
GregCr 0:e6ceb13d2d05 322 */
GregCr 0:e6ceb13d2d05 323 virtual void ReadFifo( uint8_t *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 324 };
GregCr 0:e6ceb13d2d05 325
GregCr 0:e6ceb13d2d05 326 #endif // __RADIO_H__
GregCr 0:e6ceb13d2d05 327