this is avaiable project

Dependents:   LoRaWAN_MBED

Fork of LoRaMacLib by LoRa All

Committer:
pzheng
Date:
Thu Dec 03 09:03:28 2015 +0000
Revision:
10:66e623be7f8a
Parent:
9:b3ddbad8c5e3
Child:
11:29686c1ac910
add the configurations of 470MHz and 915MHz

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GregCr 0:9be122c18509 1 /*
GregCr 0:9be122c18509 2 / _____) _ | |
GregCr 0:9be122c18509 3 ( (____ _____ ____ _| |_ _____ ____| |__
GregCr 0:9be122c18509 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
GregCr 0:9be122c18509 5 _____) ) ____| | | || |_| ____( (___| | | |
GregCr 0:9be122c18509 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
GregCr 0:9be122c18509 7 (C)2013 Semtech
GregCr 0:9be122c18509 8
GregCr 0:9be122c18509 9 Description: LoRa MAC layer board dependent definitions
GregCr 0:9be122c18509 10
GregCr 0:9be122c18509 11 License: Revised BSD License, see LICENSE.TXT file include in the project
GregCr 0:9be122c18509 12
GregCr 0:9be122c18509 13 Maintainer: Miguel Luis and Gregory Cristian
GregCr 0:9be122c18509 14 */
GregCr 0:9be122c18509 15 #ifndef __LORAMAC_BOARD_H__
GregCr 0:9be122c18509 16 #define __LORAMAC_BOARD_H__
GregCr 0:9be122c18509 17
GregCr 0:9be122c18509 18 /*!
GregCr 0:9be122c18509 19 * LoRaMac maximum number of channels
GregCr 0:9be122c18509 20 */
GregCr 0:9be122c18509 21 #define LORA_MAX_NB_CHANNELS 16
GregCr 0:9be122c18509 22
GregCr 0:9be122c18509 23 /*!
GregCr 0:9be122c18509 24 * Minimal datarate that can be used by the node
GregCr 0:9be122c18509 25 */
GregCr 0:9be122c18509 26 #define LORAMAC_MIN_DATARATE DR_0
GregCr 0:9be122c18509 27
GregCr 0:9be122c18509 28 /*!
GregCr 0:9be122c18509 29 * Minimal datarate that can be used by the node
GregCr 0:9be122c18509 30 */
GregCr 0:9be122c18509 31 #define LORAMAC_MAX_DATARATE DR_7
GregCr 0:9be122c18509 32
GregCr 0:9be122c18509 33 /*!
GregCr 0:9be122c18509 34 * Default datarate used by the node
GregCr 0:9be122c18509 35 */
pzheng 9:b3ddbad8c5e3 36 #define LORAMAC_DEFAULT_DATARATE DR_0
GregCr 0:9be122c18509 37
GregCr 0:9be122c18509 38 /*!
GregCr 0:9be122c18509 39 * Minimal Tx output power that can be used by the node
GregCr 0:9be122c18509 40 */
GregCr 0:9be122c18509 41 #define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM
GregCr 0:9be122c18509 42
GregCr 0:9be122c18509 43 /*!
GregCr 0:9be122c18509 44 * Minimal Tx output power that can be used by the node
GregCr 0:9be122c18509 45 */
GregCr 0:9be122c18509 46 #define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM
GregCr 0:9be122c18509 47
GregCr 0:9be122c18509 48 /*!
GregCr 0:9be122c18509 49 * Default Tx output power used by the node
GregCr 0:9be122c18509 50 */
GregCr 0:9be122c18509 51 #define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM
GregCr 0:9be122c18509 52
GregCr 0:9be122c18509 53 /*!
GregCr 0:9be122c18509 54 * Returns individual channel mask
GregCr 0:9be122c18509 55 *
GregCr 0:9be122c18509 56 * \param[IN] channelIndex Channel index 1 based
GregCr 0:9be122c18509 57 * \retval channelMask
GregCr 0:9be122c18509 58 */
GregCr 0:9be122c18509 59 #define LC( channelIndex ) ( uint16_t )( 1 << ( channelIndex - 1 ) )
GregCr 0:9be122c18509 60
GregCr 0:9be122c18509 61 /*!
GregCr 0:9be122c18509 62 * LoRaMac TxPower definition
GregCr 0:9be122c18509 63 */
GregCr 0:9be122c18509 64 #define TX_POWER_20_DBM 0
GregCr 0:9be122c18509 65 #define TX_POWER_14_DBM 1
GregCr 0:9be122c18509 66 #define TX_POWER_11_DBM 2
GregCr 0:9be122c18509 67 #define TX_POWER_08_DBM 3
GregCr 0:9be122c18509 68 #define TX_POWER_05_DBM 4
GregCr 0:9be122c18509 69 #define TX_POWER_02_DBM 5
GregCr 0:9be122c18509 70
GregCr 0:9be122c18509 71 /*!
GregCr 0:9be122c18509 72 * LoRaMac datarates definition
GregCr 0:9be122c18509 73 */
GregCr 0:9be122c18509 74 #define DR_0 0 // SF12 - BW125
GregCr 0:9be122c18509 75 #define DR_1 1 // SF11 - BW125
GregCr 0:9be122c18509 76 #define DR_2 2 // SF10 - BW125
GregCr 0:9be122c18509 77 #define DR_3 3 // SF9 - BW125
GregCr 0:9be122c18509 78 #define DR_4 4 // SF8 - BW125
GregCr 0:9be122c18509 79 #define DR_5 5 // SF7 - BW125
GregCr 0:9be122c18509 80 #define DR_6 6 // SF7 - BW250
GregCr 0:9be122c18509 81 #define DR_7 7 // FSK
GregCr 0:9be122c18509 82
GregCr 0:9be122c18509 83 /*!
GregCr 0:9be122c18509 84 * LoRaMac default channels definition
GregCr 0:9be122c18509 85 */
GregCr 0:9be122c18509 86 #if defined( USE_BAND_868 )
GregCr 0:9be122c18509 87
GregCr 0:9be122c18509 88 /*!
GregCr 0:9be122c18509 89 * Second reception window channel definition.
GregCr 0:9be122c18509 90 */
GregCr 0:9be122c18509 91 // Channel = { Frequency [Hz], Datarate }
GregCr 0:9be122c18509 92 #define RX_WND_2_CHANNEL { 869525000, DR_3 }
GregCr 0:9be122c18509 93
GregCr 0:9be122c18509 94 /*!
GregCr 0:9be122c18509 95 * LoRaMac maximum number of bands
GregCr 0:9be122c18509 96 */
GregCr 0:9be122c18509 97 #define LORA_MAX_NB_BANDS 5
GregCr 0:9be122c18509 98
GregCr 0:9be122c18509 99 /*!
GregCr 0:9be122c18509 100 * LoRaMac EU868 default bands
GregCr 0:9be122c18509 101 */
GregCr 0:9be122c18509 102 typedef enum
GregCr 0:9be122c18509 103 {
GregCr 0:9be122c18509 104 BAND_G1_0,
GregCr 0:9be122c18509 105 BAND_G1_1,
GregCr 0:9be122c18509 106 BAND_G1_2,
GregCr 0:9be122c18509 107 BAND_G1_3,
GregCr 0:9be122c18509 108 BAND_G1_4,
GregCr 0:9be122c18509 109 }BandId_t;
GregCr 0:9be122c18509 110
GregCr 0:9be122c18509 111 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
Alliance 4:c1d2d1319c8f 112 #define BAND0 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
Alliance 4:c1d2d1319c8f 113 #define BAND1 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
Alliance 4:c1d2d1319c8f 114 #define BAND2 { 1000, TX_POWER_14_DBM, 0, 0 } // 0.1 %
Alliance 4:c1d2d1319c8f 115 #define BAND3 { 10 , TX_POWER_14_DBM, 0, 0 } // 10.0 %
Alliance 4:c1d2d1319c8f 116 #define BAND4 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 %
GregCr 0:9be122c18509 117
GregCr 0:9be122c18509 118 /*!
GregCr 0:9be122c18509 119 * LoRaMac default channels
GregCr 0:9be122c18509 120 */
GregCr 0:9be122c18509 121 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
GregCr 0:9be122c18509 122 #define LC1 { 868100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
GregCr 0:9be122c18509 123 #define LC2 { 868300000, { ( ( DR_6 << 4 ) | DR_0 ) }, 1 }
GregCr 0:9be122c18509 124 #define LC3 { 868500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 }
Alliance 8:19a3b4a82c69 125 #define LC4 { 868850000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
Alliance 8:19a3b4a82c69 126 #define LC5 { 869050000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
Alliance 8:19a3b4a82c69 127 #define LC6 { 869525000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
Alliance 8:19a3b4a82c69 128 /*#define LC7 { 867700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
GregCr 0:9be122c18509 129 #define LC8 { 867900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
GregCr 0:9be122c18509 130 #define LC9 { 868800000, { ( ( DR_7 << 4 ) | DR_7 ) }, 2 }
Alliance 8:19a3b4a82c69 131 */
GregCr 0:9be122c18509 132 #elif defined( USE_BAND_915 )
GregCr 0:9be122c18509 133
GregCr 0:9be122c18509 134 /*!
GregCr 0:9be122c18509 135 * Second reception window channel definition.
GregCr 0:9be122c18509 136 */
GregCr 0:9be122c18509 137 // Channel = { Frequency [Hz], Datarate }
pzheng 10:66e623be7f8a 138 #define RX_WND_2_CHANNEL { 923100000, DR_3 }
GregCr 0:9be122c18509 139
GregCr 0:9be122c18509 140 /*!
GregCr 0:9be122c18509 141 * LoRaMac maximum number of bands
GregCr 0:9be122c18509 142 */
GregCr 0:9be122c18509 143 #define LORA_MAX_NB_BANDS 1
GregCr 0:9be122c18509 144
GregCr 0:9be122c18509 145 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
GregCr 0:9be122c18509 146 #define BAND0 { 1, TX_POWER_14_DBM, 0, 0 } // 100.0 %
GregCr 0:9be122c18509 147
GregCr 0:9be122c18509 148 /*!
GregCr 0:9be122c18509 149 * LoRaMac default channels
GregCr 0:9be122c18509 150 */
GregCr 0:9be122c18509 151 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
pzheng 10:66e623be7f8a 152 #define LC1 { 921500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 153 #define LC2 { 921700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 154 #define LC3 { 921900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 155 //Added by pzheng 20151203
pzheng 10:66e623be7f8a 156 #define LC4 { 922100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 157 #define LC5 { 922300000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 158 #define LC6 { 922500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 159 #define LC7 { 922700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 160 #define LC8 { 922900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 161 #define LC9 { 000000000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 162
pzheng 9:b3ddbad8c5e3 163 #elif defined( USE_BAND_433 )
pzheng 9:b3ddbad8c5e3 164
pzheng 9:b3ddbad8c5e3 165 /*!
pzheng 9:b3ddbad8c5e3 166 * Second reception window channel definition.
pzheng 9:b3ddbad8c5e3 167 */
pzheng 9:b3ddbad8c5e3 168 // Channel = { Frequency [Hz], Datarate }
pzheng 9:b3ddbad8c5e3 169 #define RX_WND_2_CHANNEL { 434900000, DR_3 }
pzheng 9:b3ddbad8c5e3 170
pzheng 9:b3ddbad8c5e3 171 /*!
pzheng 9:b3ddbad8c5e3 172 * LoRaMac maximum number of bands
pzheng 9:b3ddbad8c5e3 173 */
pzheng 9:b3ddbad8c5e3 174 #define LORA_MAX_NB_BANDS 1
pzheng 9:b3ddbad8c5e3 175
pzheng 9:b3ddbad8c5e3 176 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
pzheng 9:b3ddbad8c5e3 177 #define BAND0 { 1, TX_POWER_14_DBM, 0, 0 } // 100.0 %
pzheng 9:b3ddbad8c5e3 178
pzheng 9:b3ddbad8c5e3 179 /*!
pzheng 9:b3ddbad8c5e3 180 * LoRaMac default channels
pzheng 9:b3ddbad8c5e3 181 */
pzheng 9:b3ddbad8c5e3 182 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
pzheng 9:b3ddbad8c5e3 183 #define LC1 { 433300000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 184 #define LC2 { 433500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 185 #define LC3 { 433700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 186 #define LC4 { 433900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 187 #define LC5 { 434100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 188 #define LC6 { 434300000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 189 #define LC7 { 434500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 190 #define LC8 { 434700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 9:b3ddbad8c5e3 191 #define LC9 { 000000000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
GregCr 0:9be122c18509 192
pzheng 10:66e623be7f8a 193 //Added by pzheng20151203
pzheng 10:66e623be7f8a 194 #elif defined( USE_BAND_470 )
pzheng 10:66e623be7f8a 195
pzheng 10:66e623be7f8a 196 /*!
pzheng 10:66e623be7f8a 197 * Second reception window channel definition.
pzheng 10:66e623be7f8a 198 */
pzheng 10:66e623be7f8a 199 // Channel = { Frequency [Hz], Datarate }
pzheng 10:66e623be7f8a 200 #define RX_WND_2_CHANNEL { 471300000, DR_3 }
pzheng 10:66e623be7f8a 201
pzheng 10:66e623be7f8a 202 /*!
pzheng 10:66e623be7f8a 203 * LoRaMac maximum number of bands
pzheng 10:66e623be7f8a 204 */
pzheng 10:66e623be7f8a 205 #define LORA_MAX_NB_BANDS 1
pzheng 10:66e623be7f8a 206
pzheng 10:66e623be7f8a 207 // Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff }
pzheng 10:66e623be7f8a 208 #define BAND0 { 1, TX_POWER_14_DBM, 0, 0 } // 100.0 %
pzheng 10:66e623be7f8a 209
pzheng 10:66e623be7f8a 210 /*!
pzheng 10:66e623be7f8a 211 * LoRaMac default channels
pzheng 10:66e623be7f8a 212 */
pzheng 10:66e623be7f8a 213 // Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band }
pzheng 10:66e623be7f8a 214 #define LC1 { 471500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 215 #define LC2 { 471700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 216 #define LC3 { 471900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 217 #define LC4 { 472100000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 218 #define LC5 { 472300000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 219 #define LC6 { 472500000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 220 #define LC7 { 472700000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 221 #define LC8 { 472900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 222 #define LC9 { 000000000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
pzheng 10:66e623be7f8a 223
GregCr 0:9be122c18509 224 #else
GregCr 0:9be122c18509 225 #error "Please define a frequency band in the compiler options."
GregCr 0:9be122c18509 226 #endif
GregCr 0:9be122c18509 227
GregCr 0:9be122c18509 228 #endif // __LORAMAC_BOARD_H__