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