Adding support for India ISM Band.
Fork of LoRaWAN-lib by
LoRaMac-board.h@6:090cec5a0d5f, 2016-04-01 (annotated)
- Committer:
- spcores
- Date:
- Fri Apr 01 06:09:21 2016 +0000
- Revision:
- 6:090cec5a0d5f
- Parent:
- 5:77f44e83b37d
- Child:
- 7:8d84e1ef9e34
Who changed what in which revision?
User | Revision | Line number | New 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 | 5:77f44e83b37d | 217 | #define LORA_MAX_NB_CHANNELS 8 //SP: For 868 band it is 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 | 5:77f44e83b37d | 247 | //#define TC_POWER_27_DBM 0 //SP:Added support for 27dBM channel(Power = 500mW) |
spcores | 5:77f44e83b37d | 248 | #define TX_POWER_20_DBM 0 |
spcores | 5:77f44e83b37d | 249 | #define TX_POWER_14_DBM 1 |
spcores | 5:77f44e83b37d | 250 | #define TX_POWER_11_DBM 2 |
spcores | 5:77f44e83b37d | 251 | #define TX_POWER_08_DBM 3 |
spcores | 5:77f44e83b37d | 252 | #define TX_POWER_05_DBM 4 |
spcores | 5:77f44e83b37d | 253 | #define TX_POWER_02_DBM 5 |
spcores | 4:06708c793508 | 254 | |
spcores | 4:06708c793508 | 255 | /*! |
spcores | 4:06708c793508 | 256 | * Minimal Tx output power that can be used by the node |
spcores | 4:06708c793508 | 257 | */ |
spcores | 4:06708c793508 | 258 | #define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM |
spcores | 4:06708c793508 | 259 | |
spcores | 4:06708c793508 | 260 | /*! |
spcores | 4:06708c793508 | 261 | * Minimal Tx output power that can be used by the node |
spcores | 4:06708c793508 | 262 | */ |
spcores | 4:06708c793508 | 263 | #define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM |
spcores | 4:06708c793508 | 264 | |
spcores | 4:06708c793508 | 265 | /*! |
spcores | 4:06708c793508 | 266 | * Default Tx output power used by the node |
spcores | 4:06708c793508 | 267 | */ |
spcores | 4:06708c793508 | 268 | #define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM |
spcores | 4:06708c793508 | 269 | |
spcores | 4:06708c793508 | 270 | |
spcores | 4:06708c793508 | 271 | /*! |
spcores | 4:06708c793508 | 272 | * LoRaMac datarates definition |
spcores | 4:06708c793508 | 273 | */ |
spcores | 4:06708c793508 | 274 | #define DR_0 0 // SF12 - BW125 |
spcores | 4:06708c793508 | 275 | #define DR_1 1 // SF11 - BW125 |
spcores | 4:06708c793508 | 276 | #define DR_2 2 // SF10 - BW125 |
spcores | 4:06708c793508 | 277 | #define DR_3 3 // SF9 - BW125 |
spcores | 4:06708c793508 | 278 | #define DR_4 4 // SF8 - BW125 |
spcores | 4:06708c793508 | 279 | #define DR_5 5 // SF7 - BW125 |
spcores | 4:06708c793508 | 280 | #define DR_6 6 // SF7 - BW250 |
spcores | 4:06708c793508 | 281 | #define DR_7 7 // FSK |
spcores | 4:06708c793508 | 282 | |
spcores | 4:06708c793508 | 283 | /*! |
spcores | 4:06708c793508 | 284 | * Second reception window channel definition. |
spcores | 4:06708c793508 | 285 | */ |
spcores | 4:06708c793508 | 286 | // Channel = { Frequency [Hz], Datarate } |
spcores | 6:090cec5a0d5f | 287 | #define RX_WND_2_CHANNEL { 866550000, DR_4 } //SP:Default Rate at SF8 for India |
spcores | 4:06708c793508 | 288 | |
spcores | 4:06708c793508 | 289 | /*! |
spcores | 4:06708c793508 | 290 | * LoRaMac maximum number of bands |
spcores | 4:06708c793508 | 291 | */ |
spcores | 4:06708c793508 | 292 | #define LORA_MAX_NB_BANDS 1 //5 |
spcores | 4:06708c793508 | 293 | |
spcores | 4:06708c793508 | 294 | // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff } |
spcores | 5:77f44e83b37d | 295 | #define BAND0 { 100 , TX_POWER_20_DBM, 0, 0 } // 1.0 % |
spcores | 4:06708c793508 | 296 | |
spcores | 4:06708c793508 | 297 | /*! |
spcores | 4:06708c793508 | 298 | * LoRaMac default channels |
spcores | 4:06708c793508 | 299 | */ |
spcores | 4:06708c793508 | 300 | // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band } |
spcores | 4:06708c793508 | 301 | #define LC1 { 865062500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } |
spcores | 4:06708c793508 | 302 | #define LC2 { 865402500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } |
spcores | 4:06708c793508 | 303 | #define LC3 { 865985000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } |
spcores | 4:06708c793508 | 304 | /************************************************************************************/ |
spcores | 4:06708c793508 | 305 | /******** India Frequency Declaration End **********/ |
spcores | 4:06708c793508 | 306 | /************************************************************************************/ |
spcores | 4:06708c793508 | 307 | |
mluis | 0:91d1a7783bb9 | 308 | #elif defined( USE_BAND_868 ) |
mluis | 0:91d1a7783bb9 | 309 | |
mluis | 0:91d1a7783bb9 | 310 | /*! |
mluis | 0:91d1a7783bb9 | 311 | * LoRaMac maximum number of channels |
mluis | 0:91d1a7783bb9 | 312 | */ |
mluis | 0:91d1a7783bb9 | 313 | #define LORA_MAX_NB_CHANNELS 16 |
mluis | 0:91d1a7783bb9 | 314 | |
mluis | 0:91d1a7783bb9 | 315 | /*! |
mluis | 0:91d1a7783bb9 | 316 | * Minimal datarate that can be used by the node |
mluis | 0:91d1a7783bb9 | 317 | */ |
mluis | 0:91d1a7783bb9 | 318 | #define LORAMAC_MIN_DATARATE DR_0 |
mluis | 0:91d1a7783bb9 | 319 | |
mluis | 0:91d1a7783bb9 | 320 | /*! |
mluis | 0:91d1a7783bb9 | 321 | * Minimal datarate that can be used by the node |
mluis | 0:91d1a7783bb9 | 322 | */ |
mluis | 0:91d1a7783bb9 | 323 | #define LORAMAC_MAX_DATARATE DR_7 |
mluis | 0:91d1a7783bb9 | 324 | |
mluis | 0:91d1a7783bb9 | 325 | /*! |
mluis | 0:91d1a7783bb9 | 326 | * Default datarate used by the node |
mluis | 0:91d1a7783bb9 | 327 | */ |
mluis | 0:91d1a7783bb9 | 328 | #define LORAMAC_DEFAULT_DATARATE DR_0 |
mluis | 0:91d1a7783bb9 | 329 | |
mluis | 0:91d1a7783bb9 | 330 | /*! |
mluis | 1:91e4e6c60d1e | 331 | * Minimal Rx1 receive datarate offset |
mluis | 1:91e4e6c60d1e | 332 | */ |
mluis | 1:91e4e6c60d1e | 333 | #define LORAMAC_MIN_RX1_DR_OFFSET 0 |
mluis | 1:91e4e6c60d1e | 334 | |
mluis | 1:91e4e6c60d1e | 335 | /*! |
mluis | 1:91e4e6c60d1e | 336 | * Maximal Rx1 receive datarate offset |
mluis | 1:91e4e6c60d1e | 337 | */ |
mluis | 1:91e4e6c60d1e | 338 | #define LORAMAC_MAX_RX1_DR_OFFSET 5 |
mluis | 1:91e4e6c60d1e | 339 | |
mluis | 1:91e4e6c60d1e | 340 | /*! |
mluis | 0:91d1a7783bb9 | 341 | * Minimal Tx output power that can be used by the node |
mluis | 0:91d1a7783bb9 | 342 | */ |
mluis | 0:91d1a7783bb9 | 343 | #define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM |
mluis | 0:91d1a7783bb9 | 344 | |
mluis | 0:91d1a7783bb9 | 345 | /*! |
mluis | 0:91d1a7783bb9 | 346 | * Minimal Tx output power that can be used by the node |
mluis | 0:91d1a7783bb9 | 347 | */ |
mluis | 0:91d1a7783bb9 | 348 | #define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM |
mluis | 0:91d1a7783bb9 | 349 | |
mluis | 0:91d1a7783bb9 | 350 | /*! |
mluis | 0:91d1a7783bb9 | 351 | * Default Tx output power used by the node |
mluis | 0:91d1a7783bb9 | 352 | */ |
mluis | 0:91d1a7783bb9 | 353 | #define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM |
mluis | 0:91d1a7783bb9 | 354 | |
mluis | 0:91d1a7783bb9 | 355 | /*! |
mluis | 0:91d1a7783bb9 | 356 | * LoRaMac TxPower definition |
mluis | 0:91d1a7783bb9 | 357 | */ |
mluis | 0:91d1a7783bb9 | 358 | #define TX_POWER_20_DBM 0 |
mluis | 0:91d1a7783bb9 | 359 | #define TX_POWER_14_DBM 1 |
mluis | 0:91d1a7783bb9 | 360 | #define TX_POWER_11_DBM 2 |
mluis | 0:91d1a7783bb9 | 361 | #define TX_POWER_08_DBM 3 |
mluis | 0:91d1a7783bb9 | 362 | #define TX_POWER_05_DBM 4 |
mluis | 0:91d1a7783bb9 | 363 | #define TX_POWER_02_DBM 5 |
mluis | 0:91d1a7783bb9 | 364 | |
mluis | 0:91d1a7783bb9 | 365 | /*! |
mluis | 0:91d1a7783bb9 | 366 | * LoRaMac datarates definition |
mluis | 0:91d1a7783bb9 | 367 | */ |
mluis | 0:91d1a7783bb9 | 368 | #define DR_0 0 // SF12 - BW125 |
mluis | 0:91d1a7783bb9 | 369 | #define DR_1 1 // SF11 - BW125 |
mluis | 0:91d1a7783bb9 | 370 | #define DR_2 2 // SF10 - BW125 |
mluis | 0:91d1a7783bb9 | 371 | #define DR_3 3 // SF9 - BW125 |
mluis | 0:91d1a7783bb9 | 372 | #define DR_4 4 // SF8 - BW125 |
mluis | 0:91d1a7783bb9 | 373 | #define DR_5 5 // SF7 - BW125 |
mluis | 0:91d1a7783bb9 | 374 | #define DR_6 6 // SF7 - BW250 |
mluis | 0:91d1a7783bb9 | 375 | #define DR_7 7 // FSK |
mluis | 0:91d1a7783bb9 | 376 | |
mluis | 0:91d1a7783bb9 | 377 | /*! |
mluis | 0:91d1a7783bb9 | 378 | * Second reception window channel definition. |
mluis | 0:91d1a7783bb9 | 379 | */ |
mluis | 0:91d1a7783bb9 | 380 | // Channel = { Frequency [Hz], Datarate } |
mluis | 0:91d1a7783bb9 | 381 | #define RX_WND_2_CHANNEL { 869525000, DR_0 } |
mluis | 0:91d1a7783bb9 | 382 | |
mluis | 0:91d1a7783bb9 | 383 | /*! |
mluis | 0:91d1a7783bb9 | 384 | * LoRaMac maximum number of bands |
mluis | 0:91d1a7783bb9 | 385 | */ |
mluis | 0:91d1a7783bb9 | 386 | #define LORA_MAX_NB_BANDS 5 |
mluis | 0:91d1a7783bb9 | 387 | |
mluis | 0:91d1a7783bb9 | 388 | /*! |
mluis | 0:91d1a7783bb9 | 389 | * LoRaMac EU868 default bands |
mluis | 0:91d1a7783bb9 | 390 | */ |
mluis | 0:91d1a7783bb9 | 391 | typedef enum |
mluis | 0:91d1a7783bb9 | 392 | { |
mluis | 0:91d1a7783bb9 | 393 | BAND_G1_0, |
mluis | 0:91d1a7783bb9 | 394 | BAND_G1_1, |
mluis | 0:91d1a7783bb9 | 395 | BAND_G1_2, |
mluis | 0:91d1a7783bb9 | 396 | BAND_G1_3, |
mluis | 0:91d1a7783bb9 | 397 | BAND_G1_4, |
mluis | 0:91d1a7783bb9 | 398 | }BandId_t; |
mluis | 0:91d1a7783bb9 | 399 | |
mluis | 0:91d1a7783bb9 | 400 | // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff } |
mluis | 0:91d1a7783bb9 | 401 | #define BAND0 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % |
mluis | 0:91d1a7783bb9 | 402 | #define BAND1 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % |
mluis | 0:91d1a7783bb9 | 403 | #define BAND2 { 1000, TX_POWER_14_DBM, 0, 0 } // 0.1 % |
mluis | 0:91d1a7783bb9 | 404 | #define BAND3 { 10 , TX_POWER_14_DBM, 0, 0 } // 10.0 % |
mluis | 0:91d1a7783bb9 | 405 | #define BAND4 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % |
mluis | 0:91d1a7783bb9 | 406 | |
mluis | 0:91d1a7783bb9 | 407 | /*! |
mluis | 0:91d1a7783bb9 | 408 | * LoRaMac default channels |
mluis | 0:91d1a7783bb9 | 409 | */ |
mluis | 0:91d1a7783bb9 | 410 | // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band } |
mluis | 0:91d1a7783bb9 | 411 | #define LC1 { 868100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } |
mluis | 0:91d1a7783bb9 | 412 | #define LC2 { 868300000, { ( ( DR_6 << 4 ) | DR_0 ) }, 1 } |
mluis | 0:91d1a7783bb9 | 413 | #define LC3 { 868500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } |
mluis | 0:91d1a7783bb9 | 414 | |
mluis | 0:91d1a7783bb9 | 415 | #elif defined( USE_BAND_915 ) || defined( USE_BAND_915_HYBRID ) |
mluis | 0:91d1a7783bb9 | 416 | |
mluis | 0:91d1a7783bb9 | 417 | /*! |
mluis | 0:91d1a7783bb9 | 418 | * LoRaMac maximum number of channels |
mluis | 0:91d1a7783bb9 | 419 | */ |
mluis | 0:91d1a7783bb9 | 420 | #define LORA_MAX_NB_CHANNELS 72 |
mluis | 0:91d1a7783bb9 | 421 | |
mluis | 0:91d1a7783bb9 | 422 | /*! |
mluis | 0:91d1a7783bb9 | 423 | * Minimal datarate that can be used by the node |
mluis | 0:91d1a7783bb9 | 424 | */ |
mluis | 0:91d1a7783bb9 | 425 | #define LORAMAC_MIN_DATARATE DR_0 |
mluis | 0:91d1a7783bb9 | 426 | |
mluis | 0:91d1a7783bb9 | 427 | /*! |
mluis | 0:91d1a7783bb9 | 428 | * Minimal datarate that can be used by the node |
mluis | 0:91d1a7783bb9 | 429 | */ |
mluis | 0:91d1a7783bb9 | 430 | #define LORAMAC_MAX_DATARATE DR_4 |
mluis | 0:91d1a7783bb9 | 431 | |
mluis | 0:91d1a7783bb9 | 432 | /*! |
mluis | 0:91d1a7783bb9 | 433 | * Default datarate used by the node |
mluis | 0:91d1a7783bb9 | 434 | */ |
mluis | 0:91d1a7783bb9 | 435 | #define LORAMAC_DEFAULT_DATARATE DR_0 |
mluis | 0:91d1a7783bb9 | 436 | |
mluis | 0:91d1a7783bb9 | 437 | /*! |
mluis | 1:91e4e6c60d1e | 438 | * Minimal Rx1 receive datarate offset |
mluis | 1:91e4e6c60d1e | 439 | */ |
mluis | 1:91e4e6c60d1e | 440 | #define LORAMAC_MIN_RX1_DR_OFFSET 0 |
mluis | 1:91e4e6c60d1e | 441 | |
mluis | 1:91e4e6c60d1e | 442 | /*! |
mluis | 1:91e4e6c60d1e | 443 | * Maximal Rx1 receive datarate offset |
mluis | 1:91e4e6c60d1e | 444 | */ |
mluis | 1:91e4e6c60d1e | 445 | #define LORAMAC_MAX_RX1_DR_OFFSET 3 |
mluis | 1:91e4e6c60d1e | 446 | |
mluis | 1:91e4e6c60d1e | 447 | /*! |
mluis | 0:91d1a7783bb9 | 448 | * Minimal Tx output power that can be used by the node |
mluis | 0:91d1a7783bb9 | 449 | */ |
mluis | 0:91d1a7783bb9 | 450 | #define LORAMAC_MIN_TX_POWER TX_POWER_10_DBM |
mluis | 0:91d1a7783bb9 | 451 | |
mluis | 0:91d1a7783bb9 | 452 | /*! |
mluis | 0:91d1a7783bb9 | 453 | * Minimal Tx output power that can be used by the node |
mluis | 0:91d1a7783bb9 | 454 | */ |
mluis | 0:91d1a7783bb9 | 455 | #define LORAMAC_MAX_TX_POWER TX_POWER_30_DBM |
mluis | 0:91d1a7783bb9 | 456 | |
mluis | 0:91d1a7783bb9 | 457 | /*! |
mluis | 0:91d1a7783bb9 | 458 | * Default Tx output power used by the node |
mluis | 0:91d1a7783bb9 | 459 | */ |
mluis | 0:91d1a7783bb9 | 460 | #define LORAMAC_DEFAULT_TX_POWER TX_POWER_20_DBM |
mluis | 0:91d1a7783bb9 | 461 | |
mluis | 0:91d1a7783bb9 | 462 | /*! |
mluis | 0:91d1a7783bb9 | 463 | * LoRaMac TxPower definition |
mluis | 0:91d1a7783bb9 | 464 | */ |
mluis | 0:91d1a7783bb9 | 465 | #define TX_POWER_30_DBM 0 |
mluis | 0:91d1a7783bb9 | 466 | #define TX_POWER_28_DBM 1 |
mluis | 0:91d1a7783bb9 | 467 | #define TX_POWER_26_DBM 2 |
mluis | 0:91d1a7783bb9 | 468 | #define TX_POWER_24_DBM 3 |
mluis | 0:91d1a7783bb9 | 469 | #define TX_POWER_22_DBM 4 |
mluis | 0:91d1a7783bb9 | 470 | #define TX_POWER_20_DBM 5 |
mluis | 0:91d1a7783bb9 | 471 | #define TX_POWER_18_DBM 6 |
mluis | 0:91d1a7783bb9 | 472 | #define TX_POWER_16_DBM 7 |
mluis | 0:91d1a7783bb9 | 473 | #define TX_POWER_14_DBM 8 |
mluis | 0:91d1a7783bb9 | 474 | #define TX_POWER_12_DBM 9 |
mluis | 0:91d1a7783bb9 | 475 | #define TX_POWER_10_DBM 10 |
mluis | 0:91d1a7783bb9 | 476 | |
mluis | 0:91d1a7783bb9 | 477 | /*! |
mluis | 0:91d1a7783bb9 | 478 | * LoRaMac datarates definition |
mluis | 0:91d1a7783bb9 | 479 | */ |
mluis | 0:91d1a7783bb9 | 480 | #define DR_0 0 // SF10 - BW125 | |
mluis | 0:91d1a7783bb9 | 481 | #define DR_1 1 // SF9 - BW125 | |
mluis | 0:91d1a7783bb9 | 482 | #define DR_2 2 // SF8 - BW125 +-> Up link |
mluis | 0:91d1a7783bb9 | 483 | #define DR_3 3 // SF7 - BW125 | |
mluis | 0:91d1a7783bb9 | 484 | #define DR_4 4 // SF8 - BW500 | |
mluis | 0:91d1a7783bb9 | 485 | #define DR_5 5 // RFU |
mluis | 0:91d1a7783bb9 | 486 | #define DR_6 6 // RFU |
mluis | 0:91d1a7783bb9 | 487 | #define DR_7 7 // RFU |
mluis | 0:91d1a7783bb9 | 488 | #define DR_8 8 // SF12 - BW500 | |
mluis | 0:91d1a7783bb9 | 489 | #define DR_9 9 // SF11 - BW500 | |
mluis | 0:91d1a7783bb9 | 490 | #define DR_10 10 // SF10 - BW500 | |
mluis | 0:91d1a7783bb9 | 491 | #define DR_11 11 // SF9 - BW500 | |
mluis | 0:91d1a7783bb9 | 492 | #define DR_12 12 // SF8 - BW500 +-> Down link |
mluis | 0:91d1a7783bb9 | 493 | #define DR_13 13 // SF7 - BW500 | |
mluis | 0:91d1a7783bb9 | 494 | #define DR_14 14 // RFU | |
mluis | 0:91d1a7783bb9 | 495 | #define DR_15 15 // RFU | |
mluis | 0:91d1a7783bb9 | 496 | |
mluis | 0:91d1a7783bb9 | 497 | /*! |
mluis | 0:91d1a7783bb9 | 498 | * Second reception window channel definition. |
mluis | 0:91d1a7783bb9 | 499 | */ |
mluis | 0:91d1a7783bb9 | 500 | // Channel = { Frequency [Hz], Datarate } |
mluis | 0:91d1a7783bb9 | 501 | #define RX_WND_2_CHANNEL { 923300000, DR_8 } |
mluis | 0:91d1a7783bb9 | 502 | |
mluis | 0:91d1a7783bb9 | 503 | /*! |
mluis | 0:91d1a7783bb9 | 504 | * LoRaMac maximum number of bands |
mluis | 0:91d1a7783bb9 | 505 | */ |
mluis | 0:91d1a7783bb9 | 506 | #define LORA_MAX_NB_BANDS 1 |
mluis | 0:91d1a7783bb9 | 507 | |
mluis | 0:91d1a7783bb9 | 508 | // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff } |
mluis | 0:91d1a7783bb9 | 509 | #define BAND0 { 1, TX_POWER_20_DBM, 0, 0 } // 100.0 % |
mluis | 0:91d1a7783bb9 | 510 | |
mluis | 0:91d1a7783bb9 | 511 | /*! |
mluis | 0:91d1a7783bb9 | 512 | * LoRaMac default channels |
mluis | 0:91d1a7783bb9 | 513 | */ |
mluis | 0:91d1a7783bb9 | 514 | // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band } |
mluis | 0:91d1a7783bb9 | 515 | /* |
mluis | 0:91d1a7783bb9 | 516 | * US band channels are initialized using a loop in LoRaMacInit function |
mluis | 0:91d1a7783bb9 | 517 | * \code |
mluis | 0:91d1a7783bb9 | 518 | * // 125 kHz channels |
mluis | 0:91d1a7783bb9 | 519 | * for( uint8_t i = 0; i < LORA_MAX_NB_CHANNELS - 8; i++ ) |
mluis | 0:91d1a7783bb9 | 520 | * { |
mluis | 0:91d1a7783bb9 | 521 | * Channels[i].Frequency = 902.3e6 + i * 200e3; |
mluis | 0:91d1a7783bb9 | 522 | * Channels[i].DrRange.Value = ( DR_3 << 4 ) | DR_0; |
mluis | 0:91d1a7783bb9 | 523 | * Channels[i].Band = 0; |
mluis | 0:91d1a7783bb9 | 524 | * } |
mluis | 2:14a5d6ad92d5 | 525 | * // 500 kHz channels |
mluis | 0:91d1a7783bb9 | 526 | * for( uint8_t i = LORA_MAX_NB_CHANNELS - 8; i < LORA_MAX_NB_CHANNELS; i++ ) |
mluis | 0:91d1a7783bb9 | 527 | * { |
mluis | 0:91d1a7783bb9 | 528 | * Channels[i].Frequency = 903.0e6 + ( i - ( LORA_MAX_NB_CHANNELS - 8 ) ) * 1.6e6; |
mluis | 0:91d1a7783bb9 | 529 | * Channels[i].DrRange.Value = ( DR_4 << 4 ) | DR_4; |
mluis | 0:91d1a7783bb9 | 530 | * Channels[i].Band = 0; |
mluis | 0:91d1a7783bb9 | 531 | * } |
mluis | 0:91d1a7783bb9 | 532 | * \endcode |
mluis | 0:91d1a7783bb9 | 533 | */ |
mluis | 0:91d1a7783bb9 | 534 | #else |
mluis | 0:91d1a7783bb9 | 535 | #error "Please define a frequency band in the compiler options." |
mluis | 0:91d1a7783bb9 | 536 | #endif |
mluis | 0:91d1a7783bb9 | 537 | |
mluis | 0:91d1a7783bb9 | 538 | #endif // __LORAMAC_BOARD_H__ |