Adding support for India ISM Band.
Fork of LoRaWAN-lib by
Diff: LoRaMac-board.h
- Revision:
- 4:06708c793508
- Parent:
- 3:b9d87593a8ae
- Child:
- 5:77f44e83b37d
--- a/LoRaMac-board.h Mon Mar 14 09:09:54 2016 +0000 +++ b/LoRaMac-board.h Thu Mar 31 16:05:20 2016 +0000 @@ -205,6 +205,128 @@ #define LC2 { 779700000, { ( ( DR_7 << 4 ) | DR_0 ) }, 0 } #define LC3 { 779900000, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 } +/************************************************************************************/ +/******** India Frequency Declaration Start **********/ +/******** Added by: Sachin Pukale | 31.03.2016 **********/ +/************************************************************************************/ +#elif defined( USE_BAND_865 ) + +/*! + * LoRaMac maximum number of channels + */ +#define LORA_MAX_NB_CHANNELS 8 //SP: original 16 + +/*! + * Minimal datarate that can be used by the node + */ +#define LORAMAC_MIN_DATARATE DR_0 + +/*! + * Minimal datarate that can be used by the node + */ +#define LORAMAC_MAX_DATARATE DR_7 + +/*! + * Default datarate used by the node + */ +#define LORAMAC_DEFAULT_DATARATE DR_4 //DR_0 + +/*! + * Minimal Rx1 receive datarate offset + */ +#define LORAMAC_MIN_RX1_DR_OFFSET 0 + +/*! + * Maximal Rx1 receive datarate offset + */ +#define LORAMAC_MAX_RX1_DR_OFFSET 5 + +/*! + * LoRaMac TxPower definition + */ + +#define TC_POWER_27_DBM 0 //SP:Added support for 27dBM channel(Power = 500mW) +#define TX_POWER_20_DBM 1 +#define TX_POWER_14_DBM 2 +#define TX_POWER_11_DBM 3 +#define TX_POWER_08_DBM 4 +#define TX_POWER_05_DBM 5 +#define TX_POWER_02_DBM 6 + + +/*! + * Minimal Tx output power that can be used by the node + */ +#define LORAMAC_MIN_TX_POWER TX_POWER_02_DBM + +/*! + * Minimal Tx output power that can be used by the node + */ +#define LORAMAC_MAX_TX_POWER TX_POWER_20_DBM + +/*! + * Default Tx output power used by the node + */ +#define LORAMAC_DEFAULT_TX_POWER TX_POWER_14_DBM + + +/*! + * LoRaMac datarates definition + */ +#define DR_0 0 // SF12 - BW125 +#define DR_1 1 // SF11 - BW125 +#define DR_2 2 // SF10 - BW125 +#define DR_3 3 // SF9 - BW125 +#define DR_4 4 // SF8 - BW125 +#define DR_5 5 // SF7 - BW125 +#define DR_6 6 // SF7 - BW250 +#define DR_7 7 // FSK + +/*! + * Second reception window channel definition. + */ +// Channel = { Frequency [Hz], Datarate } +#define RX_WND_2_CHANNEL { 866500000, DR_4 } //SP:Default Rate at SF8 for India + +/*! + * LoRaMac maximum number of bands + */ +#define LORA_MAX_NB_BANDS 1 //5 + +/*! + * LoRaMac EU865 default bands + */ +typedef enum +{ + BAND_G1_0, +/* + BAND_G1_1, + BAND_G1_2, + BAND_G1_3, + BAND_G1_4, +*/ +}BandId_t; + +// Band = { DutyCycle, TxMaxPower, LastTxDoneTime, TimeOff } +#define BAND0 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % +/* +#define BAND1 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % +#define BAND2 { 1000, TX_POWER_14_DBM, 0, 0 } // 0.1 % +#define BAND3 { 10 , TX_POWER_14_DBM, 0, 0 } // 10.0 % +#define BAND4 { 100 , TX_POWER_14_DBM, 0, 0 } // 1.0 % +*/ + +/*! + * LoRaMac default channels + */ +// Channel = { Frequency [Hz], { ( ( DrMax << 4 ) | DrMin ) }, Band } +#define LC1 { 865062500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } +#define LC2 { 865402500, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } +#define LC3 { 865985000, { ( ( DR_5 << 4 ) | DR_0 ) }, 1 } +/************************************************************************************/ +/******** India Frequency Declaration End **********/ +/************************************************************************************/ + #elif defined( USE_BAND_868 ) /*!