1

Dependencies:   X_NUCLEO_IKS01A1 LoRaWAN-lib SX1276Lib mbed

Committer:
emerette
Date:
Fri Nov 09 21:52:19 2018 +0000
Revision:
8:88e8a1c7b88a
Parent:
7:730764a067dc
1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emerette 8:88e8a1c7b88a 1 /*
ubhat 0:42863a11464a 2 / _____) _ | |
ubhat 0:42863a11464a 3 ( (____ _____ ____ _| |_ _____ ____| |__
ubhat 0:42863a11464a 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
ubhat 0:42863a11464a 5 _____) ) ____| | | || |_| ____( (___| | | |
ubhat 0:42863a11464a 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
ubhat 0:42863a11464a 7 (C)2015 Semtech
ubhat 0:42863a11464a 8
ubhat 0:42863a11464a 9 Description: End device communication parameters
ubhat 0:42863a11464a 10
ubhat 0:42863a11464a 11 License: Revised BSD License, see LICENSE.TXT file include in the project
ubhat 0:42863a11464a 12
ubhat 0:42863a11464a 13 Maintainer: Uttam Bhat
ubhat 0:42863a11464a 14 */
ubhat 0:42863a11464a 15
ubhat 0:42863a11464a 16 #ifndef __LORA_CONFIG_H__
ubhat 0:42863a11464a 17 #define __LORA_CONFIG_H__
ubhat 0:42863a11464a 18
ubhat 0:42863a11464a 19 /*!
ubhat 0:42863a11464a 20 * Configure End-Device to use 8-channels corresponding to Block A
ubhat 0:42863a11464a 21 * Comment/Uncomment to disable/enable Hybrid mode
ubhat 0:42863a11464a 22 */
ubhat 0:42863a11464a 23 #define USE_BAND_915_HYBRID
ubhat 0:42863a11464a 24
ubhat 0:42863a11464a 25 #ifndef USE_BAND_915_HYBRID
ubhat 0:42863a11464a 26 /*!
ubhat 0:42863a11464a 27 * Configure End-Device to use 64-channels across to Block A thru Block H
ubhat 0:42863a11464a 28 */
ubhat 0:42863a11464a 29 #define USE_BAND_915
ubhat 0:42863a11464a 30
ubhat 6:711a4e008afa 31 #else
ubhat 6:711a4e008afa 32
ubhat 6:711a4e008afa 33 // define channel block: e.g. USE_BAND_915_HYBRID_BLOCK_A, USE_BAND_915_HYBRID_BLOCK_B ... USE_BAND_915_HYBRID_BLOCK_H etc.
emerette 8:88e8a1c7b88a 34 #define USE_BAND_915_HYBRID_BLOCK_A
ubhat 6:711a4e008afa 35
ubhat 0:42863a11464a 36 #endif
ubhat 0:42863a11464a 37
ubhat 7:730764a067dc 38 #define USEC 1000000 // 1sec = 10^6 usec
ubhat 7:730764a067dc 39
ubhat 0:42863a11464a 40 /*!
ubhat 0:42863a11464a 41 * Join requests trials periodicity. It is the time between RX1/RX2 and next TX
ubhat 0:42863a11464a 42 */
ubhat 7:730764a067dc 43 #define OVER_THE_AIR_ACTIVATION_DUTYCYCLE (5 * USEC) // value in us
ubhat 0:42863a11464a 44
ubhat 0:42863a11464a 45 /*!
ubhat 6:711a4e008afa 46 * Defines the time in Hours after which dutycycle should change
ubhat 6:711a4e008afa 47 */
ubhat 7:730764a067dc 48 #define APP_DELAY_HOUR 3 // value in hour
ubhat 6:711a4e008afa 49
ubhat 6:711a4e008afa 50 /*!
ubhat 0:42863a11464a 51 * Defines the application data transmission periodicity. It is the time between RX1/RX2 and next TX
ubhat 0:42863a11464a 52 */
emerette 8:88e8a1c7b88a 53 #define APP_TX_DUTYCYCLE (8 * USEC) // value in us
ubhat 6:711a4e008afa 54
ubhat 6:711a4e008afa 55 /*!
ubhat 6:711a4e008afa 56 * Defines the randomness in the dutycycle.
ubhat 6:711a4e008afa 57 */
emerette 8:88e8a1c7b88a 58 #define APP_TX_DUTYCYCLE_RND (1 * USEC) // value in us
ubhat 6:711a4e008afa 59
ubhat 6:711a4e008afa 60 /*!
ubhat 7:730764a067dc 61 * Defines the time in Hours after which dutycycle should change
ubhat 6:711a4e008afa 62 */
emerette 8:88e8a1c7b88a 63 #define APP_TX_DUTYCYCLE_HOUR 1 // value in hour
ubhat 7:730764a067dc 64
ubhat 7:730764a067dc 65 /*!
ubhat 7:730764a067dc 66 * Defines the application data transmission periodicity. It is the time between RX1/RX2 and next TX
ubhat 7:730764a067dc 67 */
emerette 8:88e8a1c7b88a 68 #define APP_TX_DUTYCYCLE_1 8 * USEC // value in us
ubhat 6:711a4e008afa 69
ubhat 6:711a4e008afa 70 /*!
ubhat 6:711a4e008afa 71 * Defines the randomness in the dutycycle.
ubhat 6:711a4e008afa 72 */
emerette 8:88e8a1c7b88a 73 #define APP_TX_DUTYCYCLE_RND_1 1 * USEC // value in us
ubhat 7:730764a067dc 74
ubhat 7:730764a067dc 75 /*!
ubhat 7:730764a067dc 76 * Defines the application data transmission periodicity after APP_TX_DUTYCYCLE_HOUR hours. It is the time between RX1/RX2 and next TX
ubhat 7:730764a067dc 77 */
emerette 8:88e8a1c7b88a 78 #define APP_TX_DUTYCYCLE_2 8 * USEC // value in us
ubhat 7:730764a067dc 79
ubhat 7:730764a067dc 80 /*!
ubhat 7:730764a067dc 81 * Defines the randomness in the dutycycle.
ubhat 7:730764a067dc 82 */
emerette 8:88e8a1c7b88a 83 #define APP_TX_DUTYCYCLE_RND_2 1 * USEC // value in us
ubhat 6:711a4e008afa 84
ubhat 6:711a4e008afa 85 /*!
ubhat 6:711a4e008afa 86 * Defines the application data transmission periodicity after ( 2 x APP_TX_DUTYCYCLE_HOUR ) hours. It is the time between RX1/RX2 and next TX
ubhat 6:711a4e008afa 87 */
emerette 8:88e8a1c7b88a 88 #define APP_TX_DUTYCYCLE_3 8 * USEC // value in us
ubhat 6:711a4e008afa 89
ubhat 6:711a4e008afa 90 /*!
ubhat 6:711a4e008afa 91 * Defines the randomness in the dutycycle.
ubhat 6:711a4e008afa 92 */
emerette 8:88e8a1c7b88a 93 #define APP_TX_DUTYCYCLE_RND_3 1 * USEC // value in us
ubhat 6:711a4e008afa 94
ubhat 0:42863a11464a 95
ubhat 0:42863a11464a 96 /*!
ubhat 0:42863a11464a 97 * LoRaWAN confirmed messages
ubhat 0:42863a11464a 98 * \remark 1 : Confirmed messages enabled. Must receive ACK from network server
ubhat 0:42863a11464a 99 0 : Confirmed messages disabled.
ubhat 0:42863a11464a 100 */
ubhat 6:711a4e008afa 101 #define LORAWAN_CONFIRMED_MSG_ON 0
ubhat 0:42863a11464a 102
ubhat 0:42863a11464a 103 /*!
ubhat 0:42863a11464a 104 * LoRaWAN Adaptive Data Rate
ubhat 0:42863a11464a 105 *
ubhat 0:42863a11464a 106 * \remark Please note that when ADR is enabled the end-device uses default datarate of DR_0
ubhat 0:42863a11464a 107 */
emerette 8:88e8a1c7b88a 108 #define LORAWAN_ADR_ON 0
ubhat 0:42863a11464a 109
ubhat 0:42863a11464a 110 /*!
ubhat 0:42863a11464a 111 * Default mote datarate
ubhat 0:42863a11464a 112 * \remark DR_0 : 980 bps; DR_1 : 1760 bps; DR_2 : 3125 bps; DR_3 : 5470 bps; DR_4 : 12500 bps
ubhat 0:42863a11464a 113 */
ubhat 0:42863a11464a 114 #define LORAWAN_DEFAULT_DATARATE DR_0
ubhat 0:42863a11464a 115
ubhat 0:42863a11464a 116 /*!
ubhat 0:42863a11464a 117 * LoRaWAN application port
ubhat 0:42863a11464a 118 */
ubhat 4:aad57e03bf82 119 #define LORAWAN_APP_PORT 5
ubhat 0:42863a11464a 120
ubhat 0:42863a11464a 121 /*!
ubhat 0:42863a11464a 122 * LoRaWAN User defined Tx Power
ubhat 0:42863a11464a 123 *
ubhat 0:42863a11464a 124 * \remark The Tx power level is set as TX_POWER_P_DBM, where 10 <= P <= 30 and P is even value { i.e. P = 10, 12, 14 ... 28 or 30 }
ubhat 0:42863a11464a 125 */
ubhat 0:42863a11464a 126 #define LORAWAN_TX_POWER TX_POWER_20_DBM
ubhat 0:42863a11464a 127
ubhat 0:42863a11464a 128 #if ( LORAWAN_APP_PORT == 5 )
ubhat 0:42863a11464a 129 /*====================================================
ubhat 4:aad57e03bf82 130 RAMP DATA APPLICATION DEMO (PORT 5)
ubhat 0:42863a11464a 131 ====================================================*/
ubhat 0:42863a11464a 132
ubhat 0:42863a11464a 133 /*!
ubhat 0:42863a11464a 134 * User application data buffer size
ubhat 0:42863a11464a 135 */
ubhat 0:42863a11464a 136 #define LORAWAN_APP_DATA_SIZE 11
ubhat 0:42863a11464a 137
ubhat 0:42863a11464a 138 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
ubhat 0:42863a11464a 139
ubhat 2:78df92a365c2 140 #elif ( LORAWAN_APP_PORT == 8 )
ubhat 0:42863a11464a 141 /*====================================================
ubhat 2:78df92a365c2 142 IKS01A1 SENSOR DATA (PORT 8)
ubhat 0:42863a11464a 143 ====================================================*/
ubhat 0:42863a11464a 144
ubhat 2:78df92a365c2 145 #define USE_IKS01A1_SENSOR
ubhat 0:42863a11464a 146 /*!
ubhat 0:42863a11464a 147 * User application data buffer size
ubhat 0:42863a11464a 148 */
ubhat 0:42863a11464a 149 #define LORAWAN_APP_DATA_SIZE 11
ubhat 0:42863a11464a 150
ubhat 0:42863a11464a 151 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
ubhat 0:42863a11464a 152
ubhat 3:4bca7f8f731a 153 #elif ( LORAWAN_APP_PORT == 9 )
ubhat 3:4bca7f8f731a 154 /*====================================================
ubhat 3:4bca7f8f731a 155 IKS01A1 SENSOR DATA (PORT 9) + CAYENNE LPP
ubhat 3:4bca7f8f731a 156 ====================================================*/
ubhat 3:4bca7f8f731a 157
ubhat 3:4bca7f8f731a 158 #define USE_IKS01A1_SENSOR
ubhat 3:4bca7f8f731a 159
ubhat 3:4bca7f8f731a 160 #define USE_CAYENNE_LPP
ubhat 3:4bca7f8f731a 161 /*!
ubhat 3:4bca7f8f731a 162 * User application data buffer size
ubhat 3:4bca7f8f731a 163 */
ubhat 3:4bca7f8f731a 164 #define LORAWAN_APP_DATA_SIZE 11
ubhat 3:4bca7f8f731a 165
ubhat 3:4bca7f8f731a 166 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
ubhat 3:4bca7f8f731a 167
ubhat 0:42863a11464a 168 #elif ( LORAWAN_APP_PORT == 11 )
ubhat 0:42863a11464a 169 /*====================================================
ubhat 0:42863a11464a 170 PUSH BUTTON DEMO (PORT 11)
ubhat 0:42863a11464a 171 ====================================================*/
ubhat 0:42863a11464a 172
ubhat 0:42863a11464a 173 /*!
ubhat 0:42863a11464a 174 * User application data buffer size
ubhat 0:42863a11464a 175 */
ubhat 0:42863a11464a 176 #define LORAWAN_APP_DATA_SIZE 2
ubhat 0:42863a11464a 177
ubhat 0:42863a11464a 178 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
ubhat 0:42863a11464a 179
ubhat 0:42863a11464a 180 #endif
ubhat 0:42863a11464a 181
ubhat 0:42863a11464a 182 #endif // __LORA_CONFIG_H__