1276 hal configured for Ronoth devices

Dependents:   LoDev_RXTX

Committer:
Helmut Tschemernjak
Date:
Thu May 18 18:34:54 2017 +0200
Revision:
53:6d3adad59633
Parent:
51:aef3234bcb71
Child:
54:0d8ea87fbab9
Spelling fix

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 (______/|_____)_|_|_| \__)_____)\____)_| |_|
mluis 22:7f3aab69cca9 7 (C) 2014 Semtech
GregCr 0:e6ceb13d2d05 8
GregCr 0:e6ceb13d2d05 9 Description: Actual implementation of a SX1276 radio, inherits Radio
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 */
Helmut Tschemernjak 34:07e89f23c734 15
Helmut Tschemernjak 34:07e89f23c734 16 /*
Helmut Tschemernjak 38:d9189d958db8 17 * additional development to make it more generic across multiple OS versions
Helmut Tschemernjak 34:07e89f23c734 18 * (c) 2017 Helmut Tschemernjak
Helmut Tschemernjak 34:07e89f23c734 19 * 30826 Garbsen (Hannover) Germany
Helmut Tschemernjak 34:07e89f23c734 20 */
Helmut Tschemernjak 34:07e89f23c734 21
GregCr 0:e6ceb13d2d05 22 #ifndef __SX1276_H__
GregCr 0:e6ceb13d2d05 23 #define __SX1276_H__
GregCr 0:e6ceb13d2d05 24
GregCr 0:e6ceb13d2d05 25 #include "radio.h"
GregCr 0:e6ceb13d2d05 26 #include "./registers/sx1276Regs-Fsk.h"
GregCr 0:e6ceb13d2d05 27 #include "./registers/sx1276Regs-LoRa.h"
Helmut Tschemernjak 38:d9189d958db8 28
Helmut Tschemernjak 38:d9189d958db8 29
GregCr 0:e6ceb13d2d05 30
mluis 16:d447f8d2d2d6 31 /*!
Helmut Tschemernjak 31:e50929bd3f32 32 * Radio wake-up time from sleep
Helmut Tschemernjak 31:e50929bd3f32 33 */
Helmut Tschemernjak 32:f6f0bff38543 34 #define RADIO_WAKEUP_TIME 1 // [ms]
Helmut Tschemernjak 31:e50929bd3f32 35
Helmut Tschemernjak 31:e50929bd3f32 36 /*!
Helmut Tschemernjak 31:e50929bd3f32 37 * Sync word for Private LoRa networks
mluis 16:d447f8d2d2d6 38 */
Helmut Tschemernjak 31:e50929bd3f32 39 #define LORA_MAC_PRIVATE_SYNCWORD 0x12
Helmut Tschemernjak 31:e50929bd3f32 40
Helmut Tschemernjak 31:e50929bd3f32 41 /*!
Helmut Tschemernjak 31:e50929bd3f32 42 * Sync word for Public LoRa networks
Helmut Tschemernjak 31:e50929bd3f32 43 */
Helmut Tschemernjak 31:e50929bd3f32 44 #define LORA_MAC_PUBLIC_SYNCWORD 0x34
Helmut Tschemernjak 31:e50929bd3f32 45
mluis 25:3778e6204cc1 46
mluis 25:3778e6204cc1 47 /*!
mluis 16:d447f8d2d2d6 48 * SX1276 definitions
mluis 16:d447f8d2d2d6 49 */
GregCr 0:e6ceb13d2d05 50 #define XTAL_FREQ 32000000
GregCr 0:e6ceb13d2d05 51 #define FREQ_STEP 61.03515625
GregCr 0:e6ceb13d2d05 52
GregCr 0:e6ceb13d2d05 53 #define RX_BUFFER_SIZE 256
GregCr 0:e6ceb13d2d05 54
GregCr 0:e6ceb13d2d05 55 /*!
GregCr 0:e6ceb13d2d05 56 * Constant values need to compute the RSSI value
GregCr 0:e6ceb13d2d05 57 */
GregCr 0:e6ceb13d2d05 58 #define RSSI_OFFSET_LF -164.0
GregCr 0:e6ceb13d2d05 59 #define RSSI_OFFSET_HF -157.0
GregCr 0:e6ceb13d2d05 60
GregCr 0:e6ceb13d2d05 61 #define RF_MID_BAND_THRESH 525000000
GregCr 0:e6ceb13d2d05 62
Helmut Tschemernjak 34:07e89f23c734 63
Helmut64 26:87796ee62589 64
Helmut Tschemernjak 38:d9189d958db8 65 /*!
Helmut Tschemernjak 38:d9189d958db8 66 * FSK bandwidth definition
Helmut Tschemernjak 38:d9189d958db8 67 */
Helmut Tschemernjak 38:d9189d958db8 68 typedef struct
Helmut Tschemernjak 38:d9189d958db8 69 {
Helmut Tschemernjak 38:d9189d958db8 70 uint32_t bandwidth;
Helmut Tschemernjak 38:d9189d958db8 71 uint8_t RegValue;
Helmut Tschemernjak 38:d9189d958db8 72 }FskBandwidth_t;
Helmut Tschemernjak 38:d9189d958db8 73
Helmut Tschemernjak 38:d9189d958db8 74
Helmut Tschemernjak 38:d9189d958db8 75 /*!
Helmut Tschemernjak 38:d9189d958db8 76 * Radio registers definition
Helmut Tschemernjak 38:d9189d958db8 77 */
Helmut Tschemernjak 38:d9189d958db8 78 typedef struct
Helmut Tschemernjak 38:d9189d958db8 79 {
Helmut Tschemernjak 38:d9189d958db8 80 ModemType Modem;
Helmut Tschemernjak 38:d9189d958db8 81 uint8_t Addr;
Helmut Tschemernjak 38:d9189d958db8 82 uint8_t Value;
Helmut Tschemernjak 38:d9189d958db8 83 }RadioRegisters_t;
Helmut Tschemernjak 38:d9189d958db8 84
Helmut Tschemernjak 39:706c32eda7e7 85
Helmut Tschemernjak 38:d9189d958db8 86 /*!
Helmut Tschemernjak 39:706c32eda7e7 87 * Type of the supported board. [SX1276MB1MAS / SX1276MB1LAS]
Helmut Tschemernjak 38:d9189d958db8 88 */
Helmut Tschemernjak 39:706c32eda7e7 89 typedef enum BoardType
Helmut Tschemernjak 39:706c32eda7e7 90 {
Helmut Tschemernjak 39:706c32eda7e7 91 SX1276MB1MAS = 0,
Helmut Tschemernjak 39:706c32eda7e7 92 SX1276MB1LAS,
Helmut Tschemernjak 39:706c32eda7e7 93 RFM95_SX1276,
Helmut Tschemernjak 39:706c32eda7e7 94 MURATA_SX1276,
Helmut Tschemernjak 39:706c32eda7e7 95 UNKNOWN
Helmut Tschemernjak 39:706c32eda7e7 96 }BoardType_t;
Helmut Tschemernjak 39:706c32eda7e7 97
Helmut Tschemernjak 38:d9189d958db8 98
Helmut Tschemernjak 38:d9189d958db8 99
Helmut Tschemernjak 33:5db0d1e716b1 100 typedef enum {
Helmut Tschemernjak 33:5db0d1e716b1 101 LORA_BANKWIDTH_7kHz = 0, // 7.8 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 102 LORA_BANKWIDTH_10kHz = 1, // 10.4 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 103 LORA_BANKWIDTH_15kHz = 2, // 15.6 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 104 LORA_BANKWIDTH_20kHz = 3, // 20.8 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 105 LORA_BANKWIDTH_31kHz = 4, // 31.2 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 106 LORA_BANKWIDTH_41kHz = 5, // 41.4 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 107 LORA_BANKWIDTH_62kHz = 6, // 62.5 kHz requires TCXO
Helmut Tschemernjak 33:5db0d1e716b1 108
Helmut Tschemernjak 33:5db0d1e716b1 109 LORA_BANKWIDTH_125kHz = 7,
Helmut Tschemernjak 33:5db0d1e716b1 110 LORA_BANKWIDTH_250kHz = 8,
Helmut Tschemernjak 33:5db0d1e716b1 111 LORA_BANKWIDTH_500kHz = 9,
Helmut Tschemernjak 33:5db0d1e716b1 112 LORA_BANKWIDTH_RESERVED = 10,
Helmut Tschemernjak 33:5db0d1e716b1 113 } Lora_bandwidth_t;
Helmut Tschemernjak 33:5db0d1e716b1 114
Helmut Tschemernjak 33:5db0d1e716b1 115
Helmut Tschemernjak 33:5db0d1e716b1 116
Helmut Tschemernjak 33:5db0d1e716b1 117 typedef enum {
Helmut Tschemernjak 33:5db0d1e716b1 118 LORA_SF6 = 6, // 64 chips/symbol, SF6 requires an TCXO!
Helmut Tschemernjak 33:5db0d1e716b1 119 LORA_SF7 = 7, // 128 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 120 LORA_SF8 = 8, // 256 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 121 LORA_SF9 = 9, // 512 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 122 LORA_SF10 = 10, // 1024 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 123 LORA_SF11 = 11, // 2048 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 124 LORA_SF12 = 12, // 4096 chips/symbol
Helmut Tschemernjak 33:5db0d1e716b1 125 } lora_spreading_factor_t;
Helmut Tschemernjak 33:5db0d1e716b1 126
Helmut Tschemernjak 33:5db0d1e716b1 127
Helmut Tschemernjak 33:5db0d1e716b1 128 typedef enum { // cyclic error coding to perform forward error detection and correction
Helmut Tschemernjak 33:5db0d1e716b1 129 LORA_ERROR_CODING_RATE_4_5 = 1, // 1.25x overhead
Helmut Tschemernjak 33:5db0d1e716b1 130 LORA_ERROR_CODING_RATE_4_6 = 2, // 1.50x overhead
Helmut Tschemernjak 33:5db0d1e716b1 131 LORA_ERROR_CODING_RATE_4_7 = 3, // 1.75x overhead
Helmut Tschemernjak 33:5db0d1e716b1 132 LORA_ERROR_CODING_RATE_4_8 = 4, // 2.00x overhead
Helmut Tschemernjak 33:5db0d1e716b1 133 } lora_coding_rate_t;
Helmut Tschemernjak 33:5db0d1e716b1 134
Helmut Tschemernjak 33:5db0d1e716b1 135
Helmut Tschemernjak 33:5db0d1e716b1 136 typedef enum {
Helmut Tschemernjak 33:5db0d1e716b1 137 RF_FREQUENCY_868_0 = 868000000, // Hz
Helmut Tschemernjak 33:5db0d1e716b1 138 RF_FREQUENCY_868_1 = 868100000, // Hz
Helmut Tschemernjak 33:5db0d1e716b1 139 RF_FREQUENCY_868_3 = 868300000, // Hz
Helmut Tschemernjak 33:5db0d1e716b1 140 RF_FREQUENCY_868_5 = 868500000, // Hz
Helmut Tschemernjak 33:5db0d1e716b1 141 } rf_frequency_t;
Helmut Tschemernjak 33:5db0d1e716b1 142
Helmut Tschemernjak 33:5db0d1e716b1 143
Helmut Tschemernjak 33:5db0d1e716b1 144
Helmut Tschemernjak 33:5db0d1e716b1 145 /*!
GregCr 0:e6ceb13d2d05 146 * Actual implementation of a SX1276 radio, inherits Radio
GregCr 0:e6ceb13d2d05 147 */
GregCr 0:e6ceb13d2d05 148 class SX1276 : public Radio
GregCr 0:e6ceb13d2d05 149 {
GregCr 0:e6ceb13d2d05 150 protected:
mluis 25:3778e6204cc1 151
mluis 13:618826a997e2 152 bool isRadioActive;
mluis 25:3778e6204cc1 153
Helmut Tschemernjak 34:07e89f23c734 154 BoardType_t boardConnected; //1 = SX1276MB1LAS; 0 = SX1276MB1MAS
mluis 25:3778e6204cc1 155
GregCr 23:1e143575df0f 156 uint8_t *rxtxBuffer;
mluis 13:618826a997e2 157
mluis 13:618826a997e2 158 /*!
Helmut Tschemernjak 39:706c32eda7e7 159 * Hardware IO IRQ callback function definition
Helmut Tschemernjak 39:706c32eda7e7 160 */
Helmut Tschemernjak 39:706c32eda7e7 161 typedef void ( SX1276::*DioIrqHandler )( void );
Helmut Tschemernjak 39:706c32eda7e7 162
Helmut Tschemernjak 39:706c32eda7e7 163 /*!
mluis 13:618826a997e2 164 * Hardware DIO IRQ functions
mluis 13:618826a997e2 165 */
mluis 13:618826a997e2 166 DioIrqHandler *dioIrq;
mluis 25:3778e6204cc1 167
Helmut Tschemernjak 39:706c32eda7e7 168
mluis 13:618826a997e2 169 /*!
mluis 13:618826a997e2 170 * Tx and Rx timers
mluis 13:618826a997e2 171 */
mluis 13:618826a997e2 172 Timeout txTimeoutTimer;
mluis 13:618826a997e2 173 Timeout rxTimeoutTimer;
mluis 13:618826a997e2 174 Timeout rxTimeoutSyncWord;
mluis 25:3778e6204cc1 175
mluis 13:618826a997e2 176 RadioSettings_t settings;
mluis 25:3778e6204cc1 177
Helmut Tschemernjak 31:e50929bd3f32 178 static const FskBandwidth_t FskBandwidths[];
Helmut Tschemernjak 38:d9189d958db8 179
GregCr 0:e6ceb13d2d05 180 protected:
GregCr 0:e6ceb13d2d05 181
mluis 13:618826a997e2 182 /*!
mluis 13:618826a997e2 183 * Performs the Rx chain calibration for LF and HF bands
mluis 13:618826a997e2 184 * \remark Must be called just after the reset so all registers are at their
mluis 13:618826a997e2 185 * default values
mluis 13:618826a997e2 186 */
mluis 13:618826a997e2 187 void RxChainCalibration( void );
GregCr 0:e6ceb13d2d05 188
GregCr 0:e6ceb13d2d05 189 public:
Helmut Tschemernjak 34:07e89f23c734 190 SX1276( RadioEvents_t *events);
mluis 13:618826a997e2 191 virtual ~SX1276( );
mluis 13:618826a997e2 192
mluis 13:618826a997e2 193 //-------------------------------------------------------------------------
mluis 13:618826a997e2 194 // Redefined Radio functions
mluis 13:618826a997e2 195 //-------------------------------------------------------------------------
mluis 13:618826a997e2 196 /*!
mluis 21:2e496deb7858 197 * @brief Initializes the radio
mluis 21:2e496deb7858 198 *
mluis 21:2e496deb7858 199 * @param [IN] events Structure containing the driver callback functions
mluis 21:2e496deb7858 200 */
mluis 21:2e496deb7858 201 virtual void Init( RadioEvents_t *events );
Helmut Tschemernjak 38:d9189d958db8 202
Helmut Tschemernjak 38:d9189d958db8 203 /*!
Helmut Tschemernjak 38:d9189d958db8 204 * @brief Initializes the radio registers
Helmut Tschemernjak 38:d9189d958db8 205 */
Helmut Tschemernjak 38:d9189d958db8 206 virtual void RadioRegistersInit(void);
Helmut Tschemernjak 38:d9189d958db8 207
mluis 21:2e496deb7858 208 /*!
GregCr 0:e6ceb13d2d05 209 * Return current radio status
GregCr 0:e6ceb13d2d05 210 *
Helmut Tschemernjak 50:43f7160e869c 211 * @param status Radio status. [RF_IDLE, RX_RUNNING, TX_RUNNING, CAD_RUNNING]
GregCr 0:e6ceb13d2d05 212 */
GregCr 19:71a47bb03fbb 213 virtual RadioState GetStatus( void );
mluis 25:3778e6204cc1 214
mluis 13:618826a997e2 215 /*!
mluis 13:618826a997e2 216 * @brief Configures the SX1276 with the given modem
mluis 13:618826a997e2 217 *
mluis 13:618826a997e2 218 * @param [IN] modem Modem to be used [0: FSK, 1: LoRa]
mluis 13:618826a997e2 219 */
mluis 22:7f3aab69cca9 220 virtual void SetModem( RadioModems_t modem );
mluis 13:618826a997e2 221
mluis 13:618826a997e2 222 /*!
GregCr 0:e6ceb13d2d05 223 * @brief Sets the channel frequency
GregCr 0:e6ceb13d2d05 224 *
GregCr 0:e6ceb13d2d05 225 * @param [IN] freq Channel RF frequency
GregCr 0:e6ceb13d2d05 226 */
GregCr 0:e6ceb13d2d05 227 virtual void SetChannel( uint32_t freq );
mluis 25:3778e6204cc1 228
mluis 13:618826a997e2 229 /*!
GregCr 0:e6ceb13d2d05 230 * @brief Sets the channels configuration
GregCr 0:e6ceb13d2d05 231 *
GregCr 0:e6ceb13d2d05 232 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 233 * @param [IN] freq Channel RF frequency
GregCr 0:e6ceb13d2d05 234 * @param [IN] rssiThresh RSSI threshold
GregCr 0:e6ceb13d2d05 235 *
GregCr 0:e6ceb13d2d05 236 * @retval isFree [true: Channel is free, false: Channel is not free]
GregCr 0:e6ceb13d2d05 237 */
mluis 22:7f3aab69cca9 238 virtual bool IsChannelFree( RadioModems_t modem, uint32_t freq, int16_t rssiThresh );
mluis 25:3778e6204cc1 239
mluis 13:618826a997e2 240 /*!
GregCr 0:e6ceb13d2d05 241 * @brief Generates a 32 bits random value based on the RSSI readings
GregCr 0:e6ceb13d2d05 242 *
GregCr 0:e6ceb13d2d05 243 * \remark This function sets the radio in LoRa modem mode and disables
GregCr 0:e6ceb13d2d05 244 * all interrupts.
GregCr 0:e6ceb13d2d05 245 * After calling this function either Radio.SetRxConfig or
GregCr 0:e6ceb13d2d05 246 * Radio.SetTxConfig functions must be called.
GregCr 0:e6ceb13d2d05 247 *
GregCr 0:e6ceb13d2d05 248 * @retval randomValue 32 bits random value
GregCr 0:e6ceb13d2d05 249 */
GregCr 0:e6ceb13d2d05 250 virtual uint32_t Random( void );
mluis 25:3778e6204cc1 251
mluis 13:618826a997e2 252 /*!
GregCr 0:e6ceb13d2d05 253 * @brief Sets the reception parameters
GregCr 0:e6ceb13d2d05 254 *
GregCr 0:e6ceb13d2d05 255 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 256 * @param [IN] bandwidth Sets the bandwidth
GregCr 0:e6ceb13d2d05 257 * FSK : >= 2600 and <= 250000 Hz
GregCr 0:e6ceb13d2d05 258 * LoRa: [0: 125 kHz, 1: 250 kHz,
GregCr 0:e6ceb13d2d05 259 * 2: 500 kHz, 3: Reserved]
GregCr 0:e6ceb13d2d05 260 * @param [IN] datarate Sets the Datarate
GregCr 0:e6ceb13d2d05 261 * FSK : 600..300000 bits/s
GregCr 0:e6ceb13d2d05 262 * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
GregCr 0:e6ceb13d2d05 263 * 10: 1024, 11: 2048, 12: 4096 chips]
GregCr 0:e6ceb13d2d05 264 * @param [IN] coderate Sets the coding rate ( LoRa only )
GregCr 0:e6ceb13d2d05 265 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 266 * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
GregCr 0:e6ceb13d2d05 267 * @param [IN] bandwidthAfc Sets the AFC Bandwidth ( FSK only )
GregCr 0:e6ceb13d2d05 268 * FSK : >= 2600 and <= 250000 Hz
GregCr 0:e6ceb13d2d05 269 * LoRa: N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 270 * @param [IN] preambleLen Sets the Preamble length ( LoRa only )
GregCr 0:e6ceb13d2d05 271 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 272 * LoRa: Length in symbols ( the hardware adds 4 more symbols )
Helmut Tschemernjak 31:e50929bd3f32 273 * @param [IN] symbTimeout Sets the RxSingle timeout value
Helmut Tschemernjak 31:e50929bd3f32 274 * FSK : timeout number of bytes
GregCr 0:e6ceb13d2d05 275 * LoRa: timeout in symbols
GregCr 0:e6ceb13d2d05 276 * @param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
mluis 13:618826a997e2 277 * @param [IN] payloadLen Sets payload length when fixed lenght is used
GregCr 0:e6ceb13d2d05 278 * @param [IN] crcOn Enables/Disables the CRC [0: OFF, 1: ON]
mluis 13:618826a997e2 279 * @param [IN] freqHopOn Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
mluis 13:618826a997e2 280 * @param [IN] hopPeriod Number of symbols bewteen each hop (LoRa only)
GregCr 0:e6ceb13d2d05 281 * @param [IN] iqInverted Inverts IQ signals ( LoRa only )
GregCr 0:e6ceb13d2d05 282 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 283 * LoRa: [0: not inverted, 1: inverted]
GregCr 0:e6ceb13d2d05 284 * @param [IN] rxContinuous Sets the reception in continuous mode
GregCr 0:e6ceb13d2d05 285 * [false: single mode, true: continuous mode]
GregCr 0:e6ceb13d2d05 286 */
mluis 22:7f3aab69cca9 287 virtual void SetRxConfig ( RadioModems_t modem, uint32_t bandwidth,
GregCr 0:e6ceb13d2d05 288 uint32_t datarate, uint8_t coderate,
GregCr 0:e6ceb13d2d05 289 uint32_t bandwidthAfc, uint16_t preambleLen,
GregCr 0:e6ceb13d2d05 290 uint16_t symbTimeout, bool fixLen,
mluis 13:618826a997e2 291 uint8_t payloadLen,
mluis 13:618826a997e2 292 bool crcOn, bool freqHopOn, uint8_t hopPeriod,
GregCr 6:e7f02929cd3d 293 bool iqInverted, bool rxContinuous );
mluis 25:3778e6204cc1 294
mluis 13:618826a997e2 295 /*!
GregCr 0:e6ceb13d2d05 296 * @brief Sets the transmission parameters
GregCr 0:e6ceb13d2d05 297 *
GregCr 0:e6ceb13d2d05 298 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 299 * @param [IN] power Sets the output power [dBm]
GregCr 0:e6ceb13d2d05 300 * @param [IN] fdev Sets the frequency deviation ( FSK only )
GregCr 0:e6ceb13d2d05 301 * FSK : [Hz]
GregCr 0:e6ceb13d2d05 302 * LoRa: 0
GregCr 0:e6ceb13d2d05 303 * @param [IN] bandwidth Sets the bandwidth ( LoRa only )
GregCr 0:e6ceb13d2d05 304 * FSK : 0
GregCr 0:e6ceb13d2d05 305 * LoRa: [0: 125 kHz, 1: 250 kHz,
GregCr 0:e6ceb13d2d05 306 * 2: 500 kHz, 3: Reserved]
GregCr 0:e6ceb13d2d05 307 * @param [IN] datarate Sets the Datarate
GregCr 0:e6ceb13d2d05 308 * FSK : 600..300000 bits/s
GregCr 0:e6ceb13d2d05 309 * LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
GregCr 0:e6ceb13d2d05 310 * 10: 1024, 11: 2048, 12: 4096 chips]
GregCr 0:e6ceb13d2d05 311 * @param [IN] coderate Sets the coding rate ( LoRa only )
GregCr 0:e6ceb13d2d05 312 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 313 * LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
GregCr 0:e6ceb13d2d05 314 * @param [IN] preambleLen Sets the preamble length
GregCr 0:e6ceb13d2d05 315 * @param [IN] fixLen Fixed length packets [0: variable, 1: fixed]
GregCr 0:e6ceb13d2d05 316 * @param [IN] crcOn Enables disables the CRC [0: OFF, 1: ON]
mluis 13:618826a997e2 317 * @param [IN] freqHopOn Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
mluis 13:618826a997e2 318 * @param [IN] hopPeriod Number of symbols bewteen each hop (LoRa only)
GregCr 0:e6ceb13d2d05 319 * @param [IN] iqInverted Inverts IQ signals ( LoRa only )
GregCr 0:e6ceb13d2d05 320 * FSK : N/A ( set to 0 )
GregCr 0:e6ceb13d2d05 321 * LoRa: [0: not inverted, 1: inverted]
Helmut Tschemernjak 31:e50929bd3f32 322 * @param [IN] timeout Transmission timeout [ms]
GregCr 0:e6ceb13d2d05 323 */
mluis 22:7f3aab69cca9 324 virtual void SetTxConfig( RadioModems_t modem, int8_t power, uint32_t fdev,
GregCr 0:e6ceb13d2d05 325 uint32_t bandwidth, uint32_t datarate,
GregCr 0:e6ceb13d2d05 326 uint8_t coderate, uint16_t preambleLen,
mluis 13:618826a997e2 327 bool fixLen, bool crcOn, bool freqHopOn,
mluis 13:618826a997e2 328 uint8_t hopPeriod, bool iqInverted, uint32_t timeout );
mluis 25:3778e6204cc1 329
Helmut Tschemernjak 38:d9189d958db8 330
mluis 13:618826a997e2 331 /*!
Helmut Tschemernjak 31:e50929bd3f32 332 * @brief Checks if the given RF frequency is supported by the hardware
Helmut Tschemernjak 31:e50929bd3f32 333 *
Helmut Tschemernjak 31:e50929bd3f32 334 * @param [IN] frequency RF frequency to be checked
Helmut Tschemernjak 31:e50929bd3f32 335 * @retval isSupported [true: supported, false: unsupported]
Helmut Tschemernjak 31:e50929bd3f32 336 */
Helmut Tschemernjak 31:e50929bd3f32 337 virtual bool CheckRfFrequency( uint32_t frequency ) = 0;
Helmut Tschemernjak 31:e50929bd3f32 338
Helmut Tschemernjak 31:e50929bd3f32 339 /*!
GregCr 0:e6ceb13d2d05 340 * @brief Computes the packet time on air for the given payload
GregCr 0:e6ceb13d2d05 341 *
GregCr 0:e6ceb13d2d05 342 * \Remark Can only be called once SetRxConfig or SetTxConfig have been called
GregCr 0:e6ceb13d2d05 343 *
GregCr 0:e6ceb13d2d05 344 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
GregCr 0:e6ceb13d2d05 345 * @param [IN] pktLen Packet payload length
GregCr 0:e6ceb13d2d05 346 *
GregCr 0:e6ceb13d2d05 347 * @retval airTime Computed airTime for the given packet payload length
GregCr 0:e6ceb13d2d05 348 */
Helmut Tschemernjak 31:e50929bd3f32 349 virtual uint32_t TimeOnAir ( RadioModems_t modem, uint8_t pktLen );
mluis 25:3778e6204cc1 350
mluis 13:618826a997e2 351 /*!
GregCr 0:e6ceb13d2d05 352 * @brief Sends the buffer of size. Prepares the packet to be sent and sets
GregCr 0:e6ceb13d2d05 353 * the radio in transmission
GregCr 0:e6ceb13d2d05 354 *
GregCr 0:e6ceb13d2d05 355 * @param [IN]: buffer Buffer pointer
GregCr 0:e6ceb13d2d05 356 * @param [IN]: size Buffer size
Helmut Tschemernjak 50:43f7160e869c 357 * @param [IN]: buffer Header pointer
Helmut Tschemernjak 50:43f7160e869c 358 * @param [IN]: size Header size
GregCr 0:e6ceb13d2d05 359 */
Helmut Tschemernjak 51:aef3234bcb71 360 virtual void Send(void *buffer, int16_t size, void *header = NULL, int16_t hsize = 0);
mluis 25:3778e6204cc1 361
mluis 13:618826a997e2 362 /*!
GregCr 0:e6ceb13d2d05 363 * @brief Sets the radio in sleep mode
GregCr 0:e6ceb13d2d05 364 */
GregCr 0:e6ceb13d2d05 365 virtual void Sleep( void );
GregCr 0:e6ceb13d2d05 366
mluis 13:618826a997e2 367 /*!
GregCr 0:e6ceb13d2d05 368 * @brief Sets the radio in standby mode
GregCr 0:e6ceb13d2d05 369 */
GregCr 0:e6ceb13d2d05 370 virtual void Standby( void );
Helmut Tschemernjak 31:e50929bd3f32 371
Helmut Tschemernjak 31:e50929bd3f32 372 /*!
Helmut Tschemernjak 31:e50929bd3f32 373 * @brief Sets the radio in CAD mode
Helmut Tschemernjak 31:e50929bd3f32 374 */
Helmut Tschemernjak 31:e50929bd3f32 375 virtual void StartCad( void );
mluis 25:3778e6204cc1 376
mluis 13:618826a997e2 377 /*!
GregCr 0:e6ceb13d2d05 378 * @brief Sets the radio in reception mode for the given time
Helmut Tschemernjak 31:e50929bd3f32 379 * @param [IN] timeout Reception timeout [ms]
GregCr 0:e6ceb13d2d05 380 * [0: continuous, others timeout]
GregCr 0:e6ceb13d2d05 381 */
GregCr 0:e6ceb13d2d05 382 virtual void Rx( uint32_t timeout );
mluis 25:3778e6204cc1 383
mluis 13:618826a997e2 384 /*!
GregCr 0:e6ceb13d2d05 385 * @brief Sets the radio in transmission mode for the given time
Helmut Tschemernjak 31:e50929bd3f32 386 * @param [IN] timeout Transmission timeout [ms]
GregCr 0:e6ceb13d2d05 387 * [0: continuous, others timeout]
GregCr 0:e6ceb13d2d05 388 */
GregCr 0:e6ceb13d2d05 389 virtual void Tx( uint32_t timeout );
mluis 25:3778e6204cc1 390
mluis 13:618826a997e2 391 /*!
Helmut Tschemernjak 31:e50929bd3f32 392 * @brief Sets the radio in continuous wave transmission mode
Helmut Tschemernjak 31:e50929bd3f32 393 *
Helmut Tschemernjak 31:e50929bd3f32 394 * @param [IN]: freq Channel RF frequency
Helmut Tschemernjak 31:e50929bd3f32 395 * @param [IN]: power Sets the output power [dBm]
Helmut Tschemernjak 31:e50929bd3f32 396 * @param [IN]: time Transmission mode timeout [s]
GregCr 7:2b555111463f 397 */
Helmut Tschemernjak 31:e50929bd3f32 398
Helmut Tschemernjak 31:e50929bd3f32 399 virtual void SetTxContinuousWave( uint32_t freq, int8_t power, uint16_t time );
mluis 25:3778e6204cc1 400
mluis 13:618826a997e2 401 /*!
Helmut Tschemernjak 50:43f7160e869c 402 * @brief Returns the maximal transfer unit for a given modem
Helmut Tschemernjak 50:43f7160e869c 403 *
Helmut Tschemernjak 50:43f7160e869c 404 * @retval MTU size in bytes
Helmut Tschemernjak 50:43f7160e869c 405 */
Helmut Tschemernjak 50:43f7160e869c 406 virtual int16_t MaxMTUSize( RadioModems_t modem );
Helmut Tschemernjak 50:43f7160e869c 407
Helmut Tschemernjak 50:43f7160e869c 408 /*!
GregCr 0:e6ceb13d2d05 409 * @brief Reads the current RSSI value
GregCr 0:e6ceb13d2d05 410 *
GregCr 0:e6ceb13d2d05 411 * @retval rssiValue Current RSSI value in [dBm]
GregCr 0:e6ceb13d2d05 412 */
mluis 22:7f3aab69cca9 413 virtual int16_t GetRssi ( RadioModems_t modem );
mluis 25:3778e6204cc1 414
mluis 13:618826a997e2 415 /*!
GregCr 0:e6ceb13d2d05 416 * @brief Writes the radio register at the specified address
GregCr 0:e6ceb13d2d05 417 *
GregCr 0:e6ceb13d2d05 418 * @param [IN]: addr Register address
GregCr 0:e6ceb13d2d05 419 * @param [IN]: data New register value
GregCr 0:e6ceb13d2d05 420 */
GregCr 0:e6ceb13d2d05 421 virtual void Write ( uint8_t addr, uint8_t data ) = 0;
mluis 25:3778e6204cc1 422
mluis 13:618826a997e2 423 /*!
GregCr 0:e6ceb13d2d05 424 * @brief Reads the radio register at the specified address
GregCr 0:e6ceb13d2d05 425 *
GregCr 0:e6ceb13d2d05 426 * @param [IN]: addr Register address
GregCr 0:e6ceb13d2d05 427 * @retval data Register value
GregCr 0:e6ceb13d2d05 428 */
GregCr 0:e6ceb13d2d05 429 virtual uint8_t Read ( uint8_t addr ) = 0;
mluis 25:3778e6204cc1 430
mluis 13:618826a997e2 431 /*!
GregCr 0:e6ceb13d2d05 432 * @brief Writes multiple radio registers starting at address
GregCr 0:e6ceb13d2d05 433 *
GregCr 0:e6ceb13d2d05 434 * @param [IN] addr First Radio register address
GregCr 0:e6ceb13d2d05 435 * @param [IN] buffer Buffer containing the new register's values
GregCr 0:e6ceb13d2d05 436 * @param [IN] size Number of registers to be written
GregCr 0:e6ceb13d2d05 437 */
Helmut Tschemernjak 51:aef3234bcb71 438 virtual void Write( uint8_t addr, void *buffer, uint8_t size ) = 0;
mluis 25:3778e6204cc1 439
mluis 13:618826a997e2 440 /*!
GregCr 0:e6ceb13d2d05 441 * @brief Reads multiple radio registers starting at address
GregCr 0:e6ceb13d2d05 442 *
GregCr 0:e6ceb13d2d05 443 * @param [IN] addr First Radio register address
GregCr 0:e6ceb13d2d05 444 * @param [OUT] buffer Buffer where to copy the registers data
GregCr 0:e6ceb13d2d05 445 * @param [IN] size Number of registers to be read
GregCr 0:e6ceb13d2d05 446 */
Helmut Tschemernjak 51:aef3234bcb71 447 virtual void Read ( uint8_t addr, void *buffer, uint8_t size ) = 0;
mluis 25:3778e6204cc1 448
mluis 13:618826a997e2 449 /*!
mluis 13:618826a997e2 450 * @brief Writes the buffer contents to the SX1276 FIFO
mluis 13:618826a997e2 451 *
mluis 13:618826a997e2 452 * @param [IN] buffer Buffer containing data to be put on the FIFO.
mluis 13:618826a997e2 453 * @param [IN] size Number of bytes to be written to the FIFO
mluis 13:618826a997e2 454 */
Helmut Tschemernjak 51:aef3234bcb71 455 virtual void WriteFifo( void *buffer, uint8_t size ) = 0;
GregCr 0:e6ceb13d2d05 456
mluis 13:618826a997e2 457 /*!
mluis 13:618826a997e2 458 * @brief Reads the contents of the SX1276 FIFO
mluis 13:618826a997e2 459 *
mluis 13:618826a997e2 460 * @param [OUT] buffer Buffer where to copy the FIFO read data.
mluis 13:618826a997e2 461 * @param [IN] size Number of bytes to be read from the FIFO
mluis 13:618826a997e2 462 */
Helmut Tschemernjak 51:aef3234bcb71 463 virtual void ReadFifo( void *buffer, uint8_t size ) = 0;
mluis 13:618826a997e2 464 /*!
mluis 13:618826a997e2 465 * @brief Resets the SX1276
mluis 13:618826a997e2 466 */
mluis 13:618826a997e2 467 virtual void Reset( void ) = 0;
mluis 25:3778e6204cc1 468
mluis 20:e05596ba4166 469 /*!
mluis 20:e05596ba4166 470 * @brief Sets the maximum payload length.
mluis 20:e05596ba4166 471 *
mluis 20:e05596ba4166 472 * @param [IN] modem Radio modem to be used [0: FSK, 1: LoRa]
mluis 20:e05596ba4166 473 * @param [IN] max Maximum payload length in bytes
mluis 20:e05596ba4166 474 */
mluis 22:7f3aab69cca9 475 virtual void SetMaxPayloadLength( RadioModems_t modem, uint8_t max );
mluis 25:3778e6204cc1 476
Helmut Tschemernjak 31:e50929bd3f32 477 /*!
Helmut Tschemernjak 31:e50929bd3f32 478 * \brief Sets the network to public or private. Updates the sync byte.
Helmut Tschemernjak 31:e50929bd3f32 479 *
Helmut Tschemernjak 31:e50929bd3f32 480 * \remark Applies to LoRa modem only
Helmut Tschemernjak 31:e50929bd3f32 481 *
Helmut Tschemernjak 31:e50929bd3f32 482 * \param [IN] enable if true, it enables a public network
Helmut Tschemernjak 31:e50929bd3f32 483 */
Helmut Tschemernjak 31:e50929bd3f32 484 virtual void SetPublicNetwork( bool enable );
Helmut Tschemernjak 31:e50929bd3f32 485
Helmut Tschemernjak 31:e50929bd3f32 486
mluis 13:618826a997e2 487 //-------------------------------------------------------------------------
mluis 13:618826a997e2 488 // Board relative functions
mluis 13:618826a997e2 489 //-------------------------------------------------------------------------
Helmut Tschemernjak 39:706c32eda7e7 490
Helmut Tschemernjak 38:d9189d958db8 491 static const RadioRegisters_t RadioRegsInit[];
Helmut Tschemernjak 42:72deced1a4c4 492
Helmut Tschemernjak 42:72deced1a4c4 493 typedef enum {
Helmut Tschemernjak 42:72deced1a4c4 494 RXTimeoutTimer,
Helmut Tschemernjak 42:72deced1a4c4 495 TXTimeoutTimer,
Helmut Tschemernjak 53:6d3adad59633 496 RXTimeoutSyncWordTimer
Helmut Tschemernjak 42:72deced1a4c4 497 } TimeoutTimer_t;
Helmut Tschemernjak 42:72deced1a4c4 498
Helmut Tschemernjak 42:72deced1a4c4 499
GregCr 0:e6ceb13d2d05 500 protected:
mluis 13:618826a997e2 501 /*!
mluis 13:618826a997e2 502 * @brief Initializes the radio I/Os pins interface
mluis 13:618826a997e2 503 */
mluis 13:618826a997e2 504 virtual void IoInit( void ) = 0;
mluis 13:618826a997e2 505
mluis 13:618826a997e2 506 /*!
mluis 13:618826a997e2 507 * @brief Initializes the radio SPI
mluis 13:618826a997e2 508 */
mluis 13:618826a997e2 509 virtual void SpiInit( void ) = 0;
mluis 25:3778e6204cc1 510
mluis 13:618826a997e2 511 /*!
mluis 13:618826a997e2 512 * @brief Initializes DIO IRQ handlers
mluis 13:618826a997e2 513 *
mluis 13:618826a997e2 514 * @param [IN] irqHandlers Array containing the IRQ callback functions
mluis 13:618826a997e2 515 */
mluis 13:618826a997e2 516 virtual void IoIrqInit( DioIrqHandler *irqHandlers ) = 0;
GregCr 0:e6ceb13d2d05 517
mluis 13:618826a997e2 518 /*!
mluis 13:618826a997e2 519 * @brief De-initializes the radio I/Os pins interface.
mluis 13:618826a997e2 520 *
mluis 13:618826a997e2 521 * \remark Useful when going in MCU lowpower modes
mluis 13:618826a997e2 522 */
mluis 13:618826a997e2 523 virtual void IoDeInit( void ) = 0;
GregCr 0:e6ceb13d2d05 524
mluis 13:618826a997e2 525 /*!
Helmut Tschemernjak 31:e50929bd3f32 526 * @brief Sets the radio output power.
Helmut Tschemernjak 31:e50929bd3f32 527 *
Helmut Tschemernjak 31:e50929bd3f32 528 * @param [IN] power Sets the RF output power
Helmut Tschemernjak 31:e50929bd3f32 529 */
Helmut Tschemernjak 31:e50929bd3f32 530 virtual void SetRfTxPower( int8_t power ) = 0;
Helmut Tschemernjak 31:e50929bd3f32 531
Helmut Tschemernjak 31:e50929bd3f32 532 /*!
mluis 13:618826a997e2 533 * @brief Gets the board PA selection configuration
mluis 13:618826a997e2 534 *
mluis 13:618826a997e2 535 * @param [IN] channel Channel frequency in Hz
mluis 13:618826a997e2 536 * @retval PaSelect RegPaConfig PaSelect value
mluis 13:618826a997e2 537 */
mluis 13:618826a997e2 538 virtual uint8_t GetPaSelect( uint32_t channel ) = 0;
GregCr 0:e6ceb13d2d05 539
mluis 13:618826a997e2 540 /*!
mluis 13:618826a997e2 541 * @brief Set the RF Switch I/Os pins in Low Power mode
mluis 13:618826a997e2 542 *
mluis 13:618826a997e2 543 * @param [IN] status enable or disable
mluis 13:618826a997e2 544 */
mluis 13:618826a997e2 545 virtual void SetAntSwLowPower( bool status ) = 0;
GregCr 0:e6ceb13d2d05 546
mluis 13:618826a997e2 547 /*!
mluis 13:618826a997e2 548 * @brief Initializes the RF Switch I/Os pins interface
mluis 13:618826a997e2 549 */
mluis 13:618826a997e2 550 virtual void AntSwInit( void ) = 0;
GregCr 0:e6ceb13d2d05 551
mluis 13:618826a997e2 552 /*!
mluis 13:618826a997e2 553 * @brief De-initializes the RF Switch I/Os pins interface
mluis 13:618826a997e2 554 *
mluis 13:618826a997e2 555 * \remark Needed to decrease the power consumption in MCU lowpower modes
mluis 13:618826a997e2 556 */
mluis 13:618826a997e2 557 virtual void AntSwDeInit( void ) = 0;
GregCr 0:e6ceb13d2d05 558
mluis 13:618826a997e2 559 /*!
Helmut Tschemernjak 31:e50929bd3f32 560 * @brief Controls the antenna switch if necessary.
mluis 13:618826a997e2 561 *
mluis 13:618826a997e2 562 * \remark see errata note
mluis 13:618826a997e2 563 *
Helmut Tschemernjak 31:e50929bd3f32 564 * @param [IN] opMode Current radio operating mode
mluis 13:618826a997e2 565 */
Helmut Tschemernjak 31:e50929bd3f32 566 virtual void SetAntSw( uint8_t opMode ) = 0;
Helmut Tschemernjak 31:e50929bd3f32 567
Helmut Tschemernjak 44:544add59b26d 568 typedef void ( SX1276::*timeoutFuncPtr)( void );
Helmut Tschemernjak 44:544add59b26d 569
Helmut Tschemernjak 44:544add59b26d 570
Helmut Tschemernjak 38:d9189d958db8 571 /*
Helmut Tschemernjak 38:d9189d958db8 572 * The the Timeout for a given Timer.
Helmut Tschemernjak 38:d9189d958db8 573 */
Helmut Tschemernjak 44:544add59b26d 574 virtual void SetTimeout(TimeoutTimer_t timer, timeoutFuncPtr, int timeout_ms = 0) = 0;
Helmut Tschemernjak 42:72deced1a4c4 575
GregCr 0:e6ceb13d2d05 576 protected:
GregCr 0:e6ceb13d2d05 577
mluis 13:618826a997e2 578 /*!
mluis 13:618826a997e2 579 * @brief Sets the SX1276 operating mode
mluis 13:618826a997e2 580 *
mluis 13:618826a997e2 581 * @param [IN] opMode New operating mode
mluis 13:618826a997e2 582 */
mluis 13:618826a997e2 583 virtual void SetOpMode( uint8_t opMode );
GregCr 0:e6ceb13d2d05 584
mluis 13:618826a997e2 585 /*
mluis 13:618826a997e2 586 * SX1276 DIO IRQ callback functions prototype
mluis 13:618826a997e2 587 */
GregCr 0:e6ceb13d2d05 588
mluis 13:618826a997e2 589 /*!
mluis 13:618826a997e2 590 * @brief DIO 0 IRQ callback
mluis 13:618826a997e2 591 */
mluis 13:618826a997e2 592 virtual void OnDio0Irq( void );
GregCr 0:e6ceb13d2d05 593
mluis 13:618826a997e2 594 /*!
mluis 13:618826a997e2 595 * @brief DIO 1 IRQ callback
mluis 13:618826a997e2 596 */
mluis 13:618826a997e2 597 virtual void OnDio1Irq( void );
GregCr 0:e6ceb13d2d05 598
mluis 13:618826a997e2 599 /*!
mluis 13:618826a997e2 600 * @brief DIO 2 IRQ callback
mluis 13:618826a997e2 601 */
mluis 13:618826a997e2 602 virtual void OnDio2Irq( void );
GregCr 0:e6ceb13d2d05 603
mluis 13:618826a997e2 604 /*!
mluis 13:618826a997e2 605 * @brief DIO 3 IRQ callback
mluis 13:618826a997e2 606 */
mluis 13:618826a997e2 607 virtual void OnDio3Irq( void );
GregCr 0:e6ceb13d2d05 608
mluis 13:618826a997e2 609 /*!
mluis 13:618826a997e2 610 * @brief DIO 4 IRQ callback
mluis 13:618826a997e2 611 */
mluis 13:618826a997e2 612 virtual void OnDio4Irq( void );
GregCr 0:e6ceb13d2d05 613
mluis 13:618826a997e2 614 /*!
mluis 13:618826a997e2 615 * @brief DIO 5 IRQ callback
mluis 13:618826a997e2 616 */
mluis 13:618826a997e2 617 virtual void OnDio5Irq( void );
GregCr 0:e6ceb13d2d05 618
mluis 13:618826a997e2 619 /*!
Helmut Tschemernjak 44:544add59b26d 620 * @brief Tx & Rx timeout timer callback
Helmut Tschemernjak 44:544add59b26d 621 */
Helmut Tschemernjak 44:544add59b26d 622 virtual void OnTimeoutIrq( void );
Helmut Tschemernjak 44:544add59b26d 623
Helmut Tschemernjak 44:544add59b26d 624 /*!
mluis 13:618826a997e2 625 * Returns the known FSK bandwidth registers value
mluis 13:618826a997e2 626 *
mluis 13:618826a997e2 627 * \param [IN] bandwidth Bandwidth value in Hz
mluis 13:618826a997e2 628 * \retval regValue Bandwidth register value.
mluis 13:618826a997e2 629 */
mluis 13:618826a997e2 630 static uint8_t GetFskBandwidthRegValue( uint32_t bandwidth );
GregCr 0:e6ceb13d2d05 631 };
GregCr 0:e6ceb13d2d05 632
mluis 22:7f3aab69cca9 633 #endif // __SX1276_H__