Adding support for India ISM Band.

Fork of LoRaWAN-lib by Semtech

Committer:
spcores
Date:
Thu Mar 31 16:05:20 2016 +0000
Revision:
4:06708c793508
Parent:
3:b9d87593a8ae
Child:
5:77f44e83b37d
WIP Support for India ISM Band

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mluis 0:91d1a7783bb9 1 /*
mluis 0:91d1a7783bb9 2 / _____) _ | |
mluis 0:91d1a7783bb9 3 ( (____ _____ ____ _| |_ _____ ____| |__
mluis 0:91d1a7783bb9 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
mluis 0:91d1a7783bb9 5 _____) ) ____| | | || |_| ____( (___| | | |
mluis 0:91d1a7783bb9 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
mluis 0:91d1a7783bb9 7 (C)2013 Semtech
mluis 0:91d1a7783bb9 8
mluis 0:91d1a7783bb9 9 Description: LoRa MAC layer board dependent definitions
mluis 0:91d1a7783bb9 10
mluis 0:91d1a7783bb9 11 License: Revised BSD License, see LICENSE.TXT file include in the project
mluis 0:91d1a7783bb9 12
mluis 0:91d1a7783bb9 13 Maintainer: Miguel Luis and Gregory Cristian
mluis 0:91d1a7783bb9 14 */
mluis 0:91d1a7783bb9 15 #ifndef __LORAMAC_BOARD_H__
mluis 0:91d1a7783bb9 16 #define __LORAMAC_BOARD_H__
mluis 0:91d1a7783bb9 17
mluis 0:91d1a7783bb9 18 /*!
mluis 0:91d1a7783bb9 19 * Returns individual channel mask
mluis 0:91d1a7783bb9 20 *
mluis 0:91d1a7783bb9 21 * \param[IN] channelIndex Channel index 1 based
mluis 0:91d1a7783bb9 22 * \retval channelMask
mluis 0:91d1a7783bb9 23 */
mluis 0:91d1a7783bb9 24 #define LC( channelIndex ) ( uint16_t )( 1 << ( channelIndex - 1 ) )
mluis 0:91d1a7783bb9 25
mluis 0:91d1a7783bb9 26 #if defined( USE_BAND_433 )
mluis 0:91d1a7783bb9 27
mluis 0:91d1a7783bb9 28 /*!
mluis 0:91d1a7783bb9 29 * LoRaMac maximum number of channels
mluis 0:91d1a7783bb9 30 */
mluis 0:91d1a7783bb9 31 #define LORA_MAX_NB_CHANNELS 16
mluis 0:91d1a7783bb9 32
mluis 0:91d1a7783bb9 33 /*!
mluis 0:91d1a7783bb9 34 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 35 */
mluis 0:91d1a7783bb9 36 #define LORAMAC_MIN_DATARATE DR_0
mluis 0:91d1a7783bb9 37
mluis 0:91d1a7783bb9 38 /*!
mluis 0:91d1a7783bb9 39 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 40 */
mluis 0:91d1a7783bb9 41 #define LORAMAC_MAX_DATARATE DR_7
mluis 0:91d1a7783bb9 42
mluis 0:91d1a7783bb9 43 /*!
mluis 0:91d1a7783bb9 44 * Default datarate used by the node
mluis 0:91d1a7783bb9 45 */
mluis 0:91d1a7783bb9 46 #define LORAMAC_DEFAULT_DATARATE DR_0
mluis 0:91d1a7783bb9 47
mluis 0:91d1a7783bb9 48 /*!
mluis 1:91e4e6c60d1e 49 * Minimal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 50 */
mluis 1:91e4e6c60d1e 51 #define LORAMAC_MIN_RX1_DR_OFFSET 0
mluis 1:91e4e6c60d1e 52
mluis 1:91e4e6c60d1e 53 /*!
mluis 1:91e4e6c60d1e 54 * Maximal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 55 */
mluis 1:91e4e6c60d1e 56 #define LORAMAC_MAX_RX1_DR_OFFSET 5
mluis 1:91e4e6c60d1e 57
mluis 1:91e4e6c60d1e 58 /*!
mluis 0:91d1a7783bb9 59 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 60 */
mluis 0:91d1a7783bb9 61 #define LORAMAC_MIN_TX_POWER TX_POWER_M5_DBM
mluis 0:91d1a7783bb9 62
mluis 0:91d1a7783bb9 63 /*!
mluis 0:91d1a7783bb9 64 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 65 */
mluis 0:91d1a7783bb9 66 #define LORAMAC_MAX_TX_POWER TX_POWER_10_DBM
mluis 0:91d1a7783bb9 67
mluis 0:91d1a7783bb9 68 /*!
mluis 0:91d1a7783bb9 69 * Default Tx output power used by the node
mluis 0:91d1a7783bb9 70 */
mluis 0:91d1a7783bb9 71 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_10_DBM
mluis 0:91d1a7783bb9 72
mluis 0:91d1a7783bb9 73 /*!
mluis 0:91d1a7783bb9 74 * LoRaMac TxPower definition
mluis 0:91d1a7783bb9 75 */
mluis 0:91d1a7783bb9 76 #define TX_POWER_10_DBM 0
mluis 0:91d1a7783bb9 77 #define TX_POWER_07_DBM 1
mluis 0:91d1a7783bb9 78 #define TX_POWER_04_DBM 2
mluis 0:91d1a7783bb9 79 #define TX_POWER_01_DBM 3
mluis 0:91d1a7783bb9 80 #define TX_POWER_M2_DBM 4
mluis 0:91d1a7783bb9 81 #define TX_POWER_M5_DBM 5
mluis 0:91d1a7783bb9 82
mluis 0:91d1a7783bb9 83 /*!
mluis 0:91d1a7783bb9 84 * LoRaMac datarates definition
mluis 0:91d1a7783bb9 85 */
mluis 0:91d1a7783bb9 86 #define DR_0 0 // SF12 - BW125
mluis 0:91d1a7783bb9 87 #define DR_1 1 // SF11 - BW125
mluis 0:91d1a7783bb9 88 #define DR_2 2 // SF10 - BW125
mluis 0:91d1a7783bb9 89 #define DR_3 3 // SF9 - BW125
mluis 0:91d1a7783bb9 90 #define DR_4 4 // SF8 - BW125
mluis 0:91d1a7783bb9 91 #define DR_5 5 // SF7 - BW125
mluis 0:91d1a7783bb9 92 #define DR_6 6 // SF7 - BW250
mluis 0:91d1a7783bb9 93 #define DR_7 7 // FSK
mluis 0:91d1a7783bb9 94
mluis 0:91d1a7783bb9 95 /*!
mluis 0:91d1a7783bb9 96 * Second reception window channel definition.
mluis 0:91d1a7783bb9 97 */
mluis 0:91d1a7783bb9 98 // Channel = { Frequency [Hz], Datarate }
mluis 0:91d1a7783bb9 99 #define RX_WND_2_CHANNEL { 434665000, DR_0 }
mluis 0:91d1a7783bb9 100
mluis 0:91d1a7783bb9 101 /*!
mluis 0:91d1a7783bb9 102 * LoRaMac maximum number of bands
mluis 0:91d1a7783bb9 103 */
mluis 0:91d1a7783bb9 104 #define LORA_MAX_NB_BANDS 1
mluis 0:91d1a7783bb9 105
mluis 0:91d1a7783bb9 106 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
mluis 0:91d1a7783bb9 107 #define BAND0 { 100, TX_POWER_10_DBM, 0, 0 } // 1.0 %
mluis 0:91d1a7783bb9 108
mluis 0:91d1a7783bb9 109 /*!
mluis 0:91d1a7783bb9 110 * LoRaMac default channels
mluis 0:91d1a7783bb9 111 */
mluis 0:91d1a7783bb9 112 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
mluis 0:91d1a7783bb9 113 #define LC1 { 433175000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 114 #define LC2 { 433375000, { ( ( DR_7 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 115 #define LC3 { 433575000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 116
mluis 0:91d1a7783bb9 117 #elif defined( USE_BAND_780 )
mluis 0:91d1a7783bb9 118
mluis 0:91d1a7783bb9 119 /*!
mluis 0:91d1a7783bb9 120 * LoRaMac maximum number of channels
mluis 0:91d1a7783bb9 121 */
mluis 0:91d1a7783bb9 122 #define LORA_MAX_NB_CHANNELS 16
mluis 0:91d1a7783bb9 123
mluis 0:91d1a7783bb9 124 /*!
mluis 0:91d1a7783bb9 125 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 126 */
mluis 0:91d1a7783bb9 127 #define LORAMAC_MIN_DATARATE DR_0
mluis 0:91d1a7783bb9 128
mluis 0:91d1a7783bb9 129 /*!
mluis 0:91d1a7783bb9 130 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 131 */
mluis 0:91d1a7783bb9 132 #define LORAMAC_MAX_DATARATE DR_7
mluis 0:91d1a7783bb9 133
mluis 0:91d1a7783bb9 134 /*!
mluis 0:91d1a7783bb9 135 * Default datarate used by the node
mluis 0:91d1a7783bb9 136 */
mluis 0:91d1a7783bb9 137 #define LORAMAC_DEFAULT_DATARATE DR_0
mluis 0:91d1a7783bb9 138
mluis 0:91d1a7783bb9 139 /*!
mluis 1:91e4e6c60d1e 140 * Minimal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 141 */
mluis 1:91e4e6c60d1e 142 #define LORAMAC_MIN_RX1_DR_OFFSET 0
mluis 1:91e4e6c60d1e 143
mluis 1:91e4e6c60d1e 144 /*!
mluis 1:91e4e6c60d1e 145 * Maximal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 146 */
mluis 1:91e4e6c60d1e 147 #define LORAMAC_MAX_RX1_DR_OFFSET 5
mluis 1:91e4e6c60d1e 148
mluis 1:91e4e6c60d1e 149 /*!
mluis 0:91d1a7783bb9 150 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 151 */
mluis 0:91d1a7783bb9 152 #define LORAMAC_MIN_TX_POWER TX_POWER_M5_DBM
mluis 0:91d1a7783bb9 153
mluis 0:91d1a7783bb9 154 /*!
mluis 0:91d1a7783bb9 155 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 156 */
mluis 0:91d1a7783bb9 157 #define LORAMAC_MAX_TX_POWER TX_POWER_10_DBM
mluis 0:91d1a7783bb9 158
mluis 0:91d1a7783bb9 159 /*!
mluis 0:91d1a7783bb9 160 * Default Tx output power used by the node
mluis 0:91d1a7783bb9 161 */
mluis 0:91d1a7783bb9 162 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_10_DBM
mluis 0:91d1a7783bb9 163
mluis 0:91d1a7783bb9 164 /*!
mluis 0:91d1a7783bb9 165 * LoRaMac TxPower definition
mluis 0:91d1a7783bb9 166 */
mluis 0:91d1a7783bb9 167 #define TX_POWER_10_DBM 0
mluis 0:91d1a7783bb9 168 #define TX_POWER_07_DBM 1
mluis 0:91d1a7783bb9 169 #define TX_POWER_04_DBM 2
mluis 0:91d1a7783bb9 170 #define TX_POWER_01_DBM 3
mluis 0:91d1a7783bb9 171 #define TX_POWER_M2_DBM 4
mluis 0:91d1a7783bb9 172 #define TX_POWER_M5_DBM 5
mluis 0:91d1a7783bb9 173
mluis 0:91d1a7783bb9 174 /*!
mluis 0:91d1a7783bb9 175 * LoRaMac datarates definition
mluis 0:91d1a7783bb9 176 */
mluis 0:91d1a7783bb9 177 #define DR_0 0 // SF12 - BW125
mluis 0:91d1a7783bb9 178 #define DR_1 1 // SF11 - BW125
mluis 0:91d1a7783bb9 179 #define DR_2 2 // SF10 - BW125
mluis 0:91d1a7783bb9 180 #define DR_3 3 // SF9 - BW125
mluis 0:91d1a7783bb9 181 #define DR_4 4 // SF8 - BW125
mluis 0:91d1a7783bb9 182 #define DR_5 5 // SF7 - BW125
mluis 0:91d1a7783bb9 183 #define DR_6 6 // SF7 - BW250
mluis 0:91d1a7783bb9 184 #define DR_7 7 // FSK
mluis 0:91d1a7783bb9 185
mluis 0:91d1a7783bb9 186 /*!
mluis 0:91d1a7783bb9 187 * Second reception window channel definition.
mluis 0:91d1a7783bb9 188 */
mluis 0:91d1a7783bb9 189 // Channel = { Frequency [Hz], Datarate }
mluis 0:91d1a7783bb9 190 #define RX_WND_2_CHANNEL { 786000000, DR_0 }
mluis 0:91d1a7783bb9 191
mluis 0:91d1a7783bb9 192 /*!
mluis 0:91d1a7783bb9 193 * LoRaMac maximum number of bands
mluis 0:91d1a7783bb9 194 */
mluis 0:91d1a7783bb9 195 #define LORA_MAX_NB_BANDS 1
mluis 0:91d1a7783bb9 196
mluis 0:91d1a7783bb9 197 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
mluis 0:91d1a7783bb9 198 #define BAND0 { 100, TX_POWER_10_DBM, 0, 0 } // 1.0 %
mluis 0:91d1a7783bb9 199
mluis 0:91d1a7783bb9 200 /*!
mluis 0:91d1a7783bb9 201 * LoRaMac default channels
mluis 0:91d1a7783bb9 202 */
mluis 0:91d1a7783bb9 203 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
mluis 0:91d1a7783bb9 204 #define LC1 { 779500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 205 #define LC2 { 779700000, { ( ( DR_7 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 206 #define LC3 { 779900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
mluis 0:91d1a7783bb9 207
spcores 4:06708c793508 208 /************************************************************************************/
spcores 4:06708c793508 209 /******** India Frequency Declaration Start **********/
spcores 4:06708c793508 210 /******** Added by: Sachin Pukale | 31.03.2016 **********/
spcores 4:06708c793508 211 /************************************************************************************/
spcores 4:06708c793508 212 #elif defined( USE_BAND_865 )
spcores 4:06708c793508 213
spcores 4:06708c793508 214 /*!
spcores 4:06708c793508 215 * LoRaMac maximum number of channels
spcores 4:06708c793508 216 */
spcores 4:06708c793508 217 #define LORA_MAX_NB_CHANNELS 8 //SP: original 16
spcores 4:06708c793508 218
spcores 4:06708c793508 219 /*!
spcores 4:06708c793508 220 * Minimal datarate that can be used by the node
spcores 4:06708c793508 221 */
spcores 4:06708c793508 222 #define LORAMAC_MIN_DATARATE DR_0
spcores 4:06708c793508 223
spcores 4:06708c793508 224 /*!
spcores 4:06708c793508 225 * Minimal datarate that can be used by the node
spcores 4:06708c793508 226 */
spcores 4:06708c793508 227 #define LORAMAC_MAX_DATARATE DR_7
spcores 4:06708c793508 228
spcores 4:06708c793508 229 /*!
spcores 4:06708c793508 230 * Default datarate used by the node
spcores 4:06708c793508 231 */
spcores 4:06708c793508 232 #define LORAMAC_DEFAULT_DATARATE DR_4 //DR_0
spcores 4:06708c793508 233
spcores 4:06708c793508 234 /*!
spcores 4:06708c793508 235 * Minimal Rx1 receive datarate offset
spcores 4:06708c793508 236 */
spcores 4:06708c793508 237 #define LORAMAC_MIN_RX1_DR_OFFSET 0
spcores 4:06708c793508 238
spcores 4:06708c793508 239 /*!
spcores 4:06708c793508 240 * Maximal Rx1 receive datarate offset
spcores 4:06708c793508 241 */
spcores 4:06708c793508 242 #define LORAMAC_MAX_RX1_DR_OFFSET 5
spcores 4:06708c793508 243
spcores 4:06708c793508 244 /*!
spcores 4:06708c793508 245 * LoRaMac TxPower definition
spcores 4:06708c793508 246 */
spcores 4:06708c793508 247
spcores 4:06708c793508 248 #define TC_POWER_27_DBM 0 //SP:Added support for 27dBM channel(Power = 500mW)
spcores 4:06708c793508 249 #define TX_POWER_20_DBM 1
spcores 4:06708c793508 250 #define TX_POWER_14_DBM 2
spcores 4:06708c793508 251 #define TX_POWER_11_DBM 3
spcores 4:06708c793508 252 #define TX_POWER_08_DBM 4
spcores 4:06708c793508 253 #define TX_POWER_05_DBM 5
spcores 4:06708c793508 254 #define TX_POWER_02_DBM 6
spcores 4:06708c793508 255
spcores 4:06708c793508 256
spcores 4:06708c793508 257 /*!
spcores 4:06708c793508 258 * Minimal Tx output power that can be used by the node
spcores 4:06708c793508 259 */
spcores 4:06708c793508 260 #define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM
spcores 4:06708c793508 261
spcores 4:06708c793508 262 /*!
spcores 4:06708c793508 263 * Minimal Tx output power that can be used by the node
spcores 4:06708c793508 264 */
spcores 4:06708c793508 265 #define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM
spcores 4:06708c793508 266
spcores 4:06708c793508 267 /*!
spcores 4:06708c793508 268 * Default Tx output power used by the node
spcores 4:06708c793508 269 */
spcores 4:06708c793508 270 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM
spcores 4:06708c793508 271
spcores 4:06708c793508 272
spcores 4:06708c793508 273 /*!
spcores 4:06708c793508 274 * LoRaMac datarates definition
spcores 4:06708c793508 275 */
spcores 4:06708c793508 276 #define DR_0 0 // SF12 - BW125
spcores 4:06708c793508 277 #define DR_1 1 // SF11 - BW125
spcores 4:06708c793508 278 #define DR_2 2 // SF10 - BW125
spcores 4:06708c793508 279 #define DR_3 3 // SF9 - BW125
spcores 4:06708c793508 280 #define DR_4 4 // SF8 - BW125
spcores 4:06708c793508 281 #define DR_5 5 // SF7 - BW125
spcores 4:06708c793508 282 #define DR_6 6 // SF7 - BW250
spcores 4:06708c793508 283 #define DR_7 7 // FSK
spcores 4:06708c793508 284
spcores 4:06708c793508 285 /*!
spcores 4:06708c793508 286 * Second reception window channel definition.
spcores 4:06708c793508 287 */
spcores 4:06708c793508 288 // Channel = { Frequency [Hz], Datarate }
spcores 4:06708c793508 289 #define RX_WND_2_CHANNEL { 866500000, DR_4 } //SP:Default Rate at SF8 for India
spcores 4:06708c793508 290
spcores 4:06708c793508 291 /*!
spcores 4:06708c793508 292 * LoRaMac maximum number of bands
spcores 4:06708c793508 293 */
spcores 4:06708c793508 294 #define LORA_MAX_NB_BANDS 1 //5
spcores 4:06708c793508 295
spcores 4:06708c793508 296 /*!
spcores 4:06708c793508 297 * LoRaMac EU865 default bands
spcores 4:06708c793508 298 */
spcores 4:06708c793508 299 typedef enum
spcores 4:06708c793508 300 {
spcores 4:06708c793508 301 BAND_G1_0,
spcores 4:06708c793508 302 /*
spcores 4:06708c793508 303 BAND_G1_1,
spcores 4:06708c793508 304 BAND_G1_2,
spcores 4:06708c793508 305 BAND_G1_3,
spcores 4:06708c793508 306 BAND_G1_4,
spcores 4:06708c793508 307 */
spcores 4:06708c793508 308 }BandId_t;
spcores 4:06708c793508 309
spcores 4:06708c793508 310 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
spcores 4:06708c793508 311 #define BAND0 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
spcores 4:06708c793508 312 /*
spcores 4:06708c793508 313 #define BAND1 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
spcores 4:06708c793508 314 #define BAND2 { 1000, TX_POWER_14_DBM, 0, 0 } // 0.1 %
spcores 4:06708c793508 315 #define BAND3 { 10 , TX_POWER_14_DBM, 0, 0 } // 10.0 %
spcores 4:06708c793508 316 #define BAND4 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
spcores 4:06708c793508 317 */
spcores 4:06708c793508 318
spcores 4:06708c793508 319 /*!
spcores 4:06708c793508 320 * LoRaMac default channels
spcores 4:06708c793508 321 */
spcores 4:06708c793508 322 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
spcores 4:06708c793508 323 #define LC1 { 865062500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
spcores 4:06708c793508 324 #define LC2 { 865402500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
spcores 4:06708c793508 325 #define LC3 { 865985000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
spcores 4:06708c793508 326 /************************************************************************************/
spcores 4:06708c793508 327 /******** India Frequency Declaration End **********/
spcores 4:06708c793508 328 /************************************************************************************/
spcores 4:06708c793508 329
mluis 0:91d1a7783bb9 330 #elif defined( USE_BAND_868 )
mluis 0:91d1a7783bb9 331
mluis 0:91d1a7783bb9 332 /*!
mluis 0:91d1a7783bb9 333 * LoRaMac maximum number of channels
mluis 0:91d1a7783bb9 334 */
mluis 0:91d1a7783bb9 335 #define LORA_MAX_NB_CHANNELS 16
mluis 0:91d1a7783bb9 336
mluis 0:91d1a7783bb9 337 /*!
mluis 0:91d1a7783bb9 338 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 339 */
mluis 0:91d1a7783bb9 340 #define LORAMAC_MIN_DATARATE DR_0
mluis 0:91d1a7783bb9 341
mluis 0:91d1a7783bb9 342 /*!
mluis 0:91d1a7783bb9 343 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 344 */
mluis 0:91d1a7783bb9 345 #define LORAMAC_MAX_DATARATE DR_7
mluis 0:91d1a7783bb9 346
mluis 0:91d1a7783bb9 347 /*!
mluis 0:91d1a7783bb9 348 * Default datarate used by the node
mluis 0:91d1a7783bb9 349 */
mluis 0:91d1a7783bb9 350 #define LORAMAC_DEFAULT_DATARATE DR_0
mluis 0:91d1a7783bb9 351
mluis 0:91d1a7783bb9 352 /*!
mluis 1:91e4e6c60d1e 353 * Minimal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 354 */
mluis 1:91e4e6c60d1e 355 #define LORAMAC_MIN_RX1_DR_OFFSET 0
mluis 1:91e4e6c60d1e 356
mluis 1:91e4e6c60d1e 357 /*!
mluis 1:91e4e6c60d1e 358 * Maximal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 359 */
mluis 1:91e4e6c60d1e 360 #define LORAMAC_MAX_RX1_DR_OFFSET 5
mluis 1:91e4e6c60d1e 361
mluis 1:91e4e6c60d1e 362 /*!
mluis 0:91d1a7783bb9 363 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 364 */
mluis 0:91d1a7783bb9 365 #define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM
mluis 0:91d1a7783bb9 366
mluis 0:91d1a7783bb9 367 /*!
mluis 0:91d1a7783bb9 368 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 369 */
mluis 0:91d1a7783bb9 370 #define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM
mluis 0:91d1a7783bb9 371
mluis 0:91d1a7783bb9 372 /*!
mluis 0:91d1a7783bb9 373 * Default Tx output power used by the node
mluis 0:91d1a7783bb9 374 */
mluis 0:91d1a7783bb9 375 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM
mluis 0:91d1a7783bb9 376
mluis 0:91d1a7783bb9 377 /*!
mluis 0:91d1a7783bb9 378 * LoRaMac TxPower definition
mluis 0:91d1a7783bb9 379 */
mluis 0:91d1a7783bb9 380 #define TX_POWER_20_DBM 0
mluis 0:91d1a7783bb9 381 #define TX_POWER_14_DBM 1
mluis 0:91d1a7783bb9 382 #define TX_POWER_11_DBM 2
mluis 0:91d1a7783bb9 383 #define TX_POWER_08_DBM 3
mluis 0:91d1a7783bb9 384 #define TX_POWER_05_DBM 4
mluis 0:91d1a7783bb9 385 #define TX_POWER_02_DBM 5
mluis 0:91d1a7783bb9 386
mluis 0:91d1a7783bb9 387 /*!
mluis 0:91d1a7783bb9 388 * LoRaMac datarates definition
mluis 0:91d1a7783bb9 389 */
mluis 0:91d1a7783bb9 390 #define DR_0 0 // SF12 - BW125
mluis 0:91d1a7783bb9 391 #define DR_1 1 // SF11 - BW125
mluis 0:91d1a7783bb9 392 #define DR_2 2 // SF10 - BW125
mluis 0:91d1a7783bb9 393 #define DR_3 3 // SF9 - BW125
mluis 0:91d1a7783bb9 394 #define DR_4 4 // SF8 - BW125
mluis 0:91d1a7783bb9 395 #define DR_5 5 // SF7 - BW125
mluis 0:91d1a7783bb9 396 #define DR_6 6 // SF7 - BW250
mluis 0:91d1a7783bb9 397 #define DR_7 7 // FSK
mluis 0:91d1a7783bb9 398
mluis 0:91d1a7783bb9 399 /*!
mluis 0:91d1a7783bb9 400 * Second reception window channel definition.
mluis 0:91d1a7783bb9 401 */
mluis 0:91d1a7783bb9 402 // Channel = { Frequency [Hz], Datarate }
mluis 0:91d1a7783bb9 403 #define RX_WND_2_CHANNEL { 869525000, DR_0 }
mluis 0:91d1a7783bb9 404
mluis 0:91d1a7783bb9 405 /*!
mluis 0:91d1a7783bb9 406 * LoRaMac maximum number of bands
mluis 0:91d1a7783bb9 407 */
mluis 0:91d1a7783bb9 408 #define LORA_MAX_NB_BANDS 5
mluis 0:91d1a7783bb9 409
mluis 0:91d1a7783bb9 410 /*!
mluis 0:91d1a7783bb9 411 * LoRaMac EU868 default bands
mluis 0:91d1a7783bb9 412 */
mluis 0:91d1a7783bb9 413 typedef enum
mluis 0:91d1a7783bb9 414 {
mluis 0:91d1a7783bb9 415 BAND_G1_0,
mluis 0:91d1a7783bb9 416 BAND_G1_1,
mluis 0:91d1a7783bb9 417 BAND_G1_2,
mluis 0:91d1a7783bb9 418 BAND_G1_3,
mluis 0:91d1a7783bb9 419 BAND_G1_4,
mluis 0:91d1a7783bb9 420 }BandId_t;
mluis 0:91d1a7783bb9 421
mluis 0:91d1a7783bb9 422 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
mluis 0:91d1a7783bb9 423 #define BAND0 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
mluis 0:91d1a7783bb9 424 #define BAND1 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
mluis 0:91d1a7783bb9 425 #define BAND2 { 1000, TX_POWER_14_DBM, 0, 0 } // 0.1 %
mluis 0:91d1a7783bb9 426 #define BAND3 { 10 , TX_POWER_14_DBM, 0, 0 } // 10.0 %
mluis 0:91d1a7783bb9 427 #define BAND4 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
mluis 0:91d1a7783bb9 428
mluis 0:91d1a7783bb9 429 /*!
mluis 0:91d1a7783bb9 430 * LoRaMac default channels
mluis 0:91d1a7783bb9 431 */
mluis 0:91d1a7783bb9 432 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
mluis 0:91d1a7783bb9 433 #define LC1 { 868100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
mluis 0:91d1a7783bb9 434 #define LC2 { 868300000, { ( ( DR_6 << 4 ) | DR_0 ) }, 1 }
mluis 0:91d1a7783bb9 435 #define LC3 { 868500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
mluis 0:91d1a7783bb9 436
mluis 0:91d1a7783bb9 437 #elif defined( USE_BAND_915 ) || defined( USE_BAND_915_HYBRID )
mluis 0:91d1a7783bb9 438
mluis 0:91d1a7783bb9 439 /*!
mluis 0:91d1a7783bb9 440 * LoRaMac maximum number of channels
mluis 0:91d1a7783bb9 441 */
mluis 0:91d1a7783bb9 442 #define LORA_MAX_NB_CHANNELS 72
mluis 0:91d1a7783bb9 443
mluis 0:91d1a7783bb9 444 /*!
mluis 0:91d1a7783bb9 445 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 446 */
mluis 0:91d1a7783bb9 447 #define LORAMAC_MIN_DATARATE DR_0
mluis 0:91d1a7783bb9 448
mluis 0:91d1a7783bb9 449 /*!
mluis 0:91d1a7783bb9 450 * Minimal datarate that can be used by the node
mluis 0:91d1a7783bb9 451 */
mluis 0:91d1a7783bb9 452 #define LORAMAC_MAX_DATARATE DR_4
mluis 0:91d1a7783bb9 453
mluis 0:91d1a7783bb9 454 /*!
mluis 0:91d1a7783bb9 455 * Default datarate used by the node
mluis 0:91d1a7783bb9 456 */
mluis 0:91d1a7783bb9 457 #define LORAMAC_DEFAULT_DATARATE DR_0
mluis 0:91d1a7783bb9 458
mluis 0:91d1a7783bb9 459 /*!
mluis 1:91e4e6c60d1e 460 * Minimal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 461 */
mluis 1:91e4e6c60d1e 462 #define LORAMAC_MIN_RX1_DR_OFFSET 0
mluis 1:91e4e6c60d1e 463
mluis 1:91e4e6c60d1e 464 /*!
mluis 1:91e4e6c60d1e 465 * Maximal Rx1 receive datarate offset
mluis 1:91e4e6c60d1e 466 */
mluis 1:91e4e6c60d1e 467 #define LORAMAC_MAX_RX1_DR_OFFSET 3
mluis 1:91e4e6c60d1e 468
mluis 1:91e4e6c60d1e 469 /*!
mluis 0:91d1a7783bb9 470 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 471 */
mluis 0:91d1a7783bb9 472 #define LORAMAC_MIN_TX_POWER TX_POWER_10_DBM
mluis 0:91d1a7783bb9 473
mluis 0:91d1a7783bb9 474 /*!
mluis 0:91d1a7783bb9 475 * Minimal Tx output power that can be used by the node
mluis 0:91d1a7783bb9 476 */
mluis 0:91d1a7783bb9 477 #define LORAMAC_MAX_TX_POWER TX_POWER_30_DBM
mluis 0:91d1a7783bb9 478
mluis 0:91d1a7783bb9 479 /*!
mluis 0:91d1a7783bb9 480 * Default Tx output power used by the node
mluis 0:91d1a7783bb9 481 */
mluis 0:91d1a7783bb9 482 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_20_DBM
mluis 0:91d1a7783bb9 483
mluis 0:91d1a7783bb9 484 /*!
mluis 0:91d1a7783bb9 485 * LoRaMac TxPower definition
mluis 0:91d1a7783bb9 486 */
mluis 0:91d1a7783bb9 487 #define TX_POWER_30_DBM 0
mluis 0:91d1a7783bb9 488 #define TX_POWER_28_DBM 1
mluis 0:91d1a7783bb9 489 #define TX_POWER_26_DBM 2
mluis 0:91d1a7783bb9 490 #define TX_POWER_24_DBM 3
mluis 0:91d1a7783bb9 491 #define TX_POWER_22_DBM 4
mluis 0:91d1a7783bb9 492 #define TX_POWER_20_DBM 5
mluis 0:91d1a7783bb9 493 #define TX_POWER_18_DBM 6
mluis 0:91d1a7783bb9 494 #define TX_POWER_16_DBM 7
mluis 0:91d1a7783bb9 495 #define TX_POWER_14_DBM 8
mluis 0:91d1a7783bb9 496 #define TX_POWER_12_DBM 9
mluis 0:91d1a7783bb9 497 #define TX_POWER_10_DBM 10
mluis 0:91d1a7783bb9 498
mluis 0:91d1a7783bb9 499 /*!
mluis 0:91d1a7783bb9 500 * LoRaMac datarates definition
mluis 0:91d1a7783bb9 501 */
mluis 0:91d1a7783bb9 502 #define DR_0 0 // SF10 - BW125 |
mluis 0:91d1a7783bb9 503 #define DR_1 1 // SF9 - BW125 |
mluis 0:91d1a7783bb9 504 #define DR_2 2 // SF8 - BW125 +-> Up link
mluis 0:91d1a7783bb9 505 #define DR_3 3 // SF7 - BW125 |
mluis 0:91d1a7783bb9 506 #define DR_4 4 // SF8 - BW500 |
mluis 0:91d1a7783bb9 507 #define DR_5 5 // RFU
mluis 0:91d1a7783bb9 508 #define DR_6 6 // RFU
mluis 0:91d1a7783bb9 509 #define DR_7 7 // RFU
mluis 0:91d1a7783bb9 510 #define DR_8 8 // SF12 - BW500 |
mluis 0:91d1a7783bb9 511 #define DR_9 9 // SF11 - BW500 |
mluis 0:91d1a7783bb9 512 #define DR_10 10 // SF10 - BW500 |
mluis 0:91d1a7783bb9 513 #define DR_11 11 // SF9 - BW500 |
mluis 0:91d1a7783bb9 514 #define DR_12 12 // SF8 - BW500 +-> Down link
mluis 0:91d1a7783bb9 515 #define DR_13 13 // SF7 - BW500 |
mluis 0:91d1a7783bb9 516 #define DR_14 14 // RFU |
mluis 0:91d1a7783bb9 517 #define DR_15 15 // RFU |
mluis 0:91d1a7783bb9 518
mluis 0:91d1a7783bb9 519 /*!
mluis 0:91d1a7783bb9 520 * Second reception window channel definition.
mluis 0:91d1a7783bb9 521 */
mluis 0:91d1a7783bb9 522 // Channel = { Frequency [Hz], Datarate }
mluis 0:91d1a7783bb9 523 #define RX_WND_2_CHANNEL { 923300000, DR_8 }
mluis 0:91d1a7783bb9 524
mluis 0:91d1a7783bb9 525 /*!
mluis 0:91d1a7783bb9 526 * LoRaMac maximum number of bands
mluis 0:91d1a7783bb9 527 */
mluis 0:91d1a7783bb9 528 #define LORA_MAX_NB_BANDS 1
mluis 0:91d1a7783bb9 529
mluis 0:91d1a7783bb9 530 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
mluis 0:91d1a7783bb9 531 #define BAND0 { 1, TX_POWER_20_DBM, 0, 0 } // 100.0 %
mluis 0:91d1a7783bb9 532
mluis 0:91d1a7783bb9 533 /*!
mluis 0:91d1a7783bb9 534 * LoRaMac default channels
mluis 0:91d1a7783bb9 535 */
mluis 0:91d1a7783bb9 536 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
mluis 0:91d1a7783bb9 537 /*
mluis 0:91d1a7783bb9 538 * US band channels are initialized using a loop in LoRaMacInit function
mluis 0:91d1a7783bb9 539 * \code
mluis 0:91d1a7783bb9 540 * // 125 kHz channels
mluis 0:91d1a7783bb9 541 * for( uint8_t i = 0; i < LORA_MAX_NB_CHANNELS - 8; i++ )
mluis 0:91d1a7783bb9 542 * {
mluis 0:91d1a7783bb9 543 * Channels[i].Frequency = 902.3e6 + i * 200e3;
mluis 0:91d1a7783bb9 544 * Channels[i].DrRange.Value = ( DR_3 << 4 ) | DR_0;
mluis 0:91d1a7783bb9 545 * Channels[i].Band = 0;
mluis 0:91d1a7783bb9 546 * }
mluis 2:14a5d6ad92d5 547 * // 500 kHz channels
mluis 0:91d1a7783bb9 548 * for( uint8_t i = LORA_MAX_NB_CHANNELS - 8; i < LORA_MAX_NB_CHANNELS; i++ )
mluis 0:91d1a7783bb9 549 * {
mluis 0:91d1a7783bb9 550 * Channels[i].Frequency = 903.0e6 + ( i - ( LORA_MAX_NB_CHANNELS - 8 ) ) * 1.6e6;
mluis 0:91d1a7783bb9 551 * Channels[i].DrRange.Value = ( DR_4 << 4 ) | DR_4;
mluis 0:91d1a7783bb9 552 * Channels[i].Band = 0;
mluis 0:91d1a7783bb9 553 * }
mluis 0:91d1a7783bb9 554 * \endcode
mluis 0:91d1a7783bb9 555 */
mluis 0:91d1a7783bb9 556 #else
mluis 0:91d1a7783bb9 557 #error "Please define a frequency band in the compiler options."
mluis 0:91d1a7783bb9 558 #endif
mluis 0:91d1a7783bb9 559
mluis 0:91d1a7783bb9 560 #endif // __LORAMAC_BOARD_H__