]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - firmware/CC13x0_LaunchPad/sensor_default_915_config.h
Updated TI Linux Sensor To Cloud to the latest TI 15.4-Stack v2.4, now with CC13x2...
[apps/tidep0084.git] / firmware / CC13x0_LaunchPad / sensor_default_915_config.h
1 /******************************************************************************
3 @file sensor_default_config.h
5  @brief TI-15.4 Stack configuration parameters for Sensor applications
7  Group: WCS LPC
8  $Target Device: DEVICES $
10  ******************************************************************************
11  $License: BSD3 2016 $
12  ******************************************************************************
13  $Release Name: PACKAGE NAME $
14  $Release Date: PACKAGE RELEASE DATE $
15  *****************************************************************************/
16 #ifndef CONFIG_H
17 #define CONFIG_H
19 /******************************************************************************
20  Includes
21  *****************************************************************************/
22 #include "api_mac.h"
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
29 /******************************************************************************
30  Constants and definitions
31  *****************************************************************************/
32 /* config parameters */
33 /*! Security Enable - set to true to turn on security */
34 #define CONFIG_SECURE                true
35 /*! PAN ID */
36 #define CONFIG_PAN_ID                0xFFFF
37 /*! FH disabled as default */
38 #define CONFIG_FH_ENABLE             false
39 /*! link quality */
40 #define CONFIG_LINKQUALITY           1
41 /*! percent filter */
42 #define CONFIG_PERCENTFILTER         0xFF
44 /*!
45  Beacon order, value of 15 indicates non beacon mode,
46  8 is a good value for beacon mode
47 */
48 #define CONFIG_BEACON_ORDER          15
49 /*!
50  Superframe order, value of 15 indicates non beacon mode,
51  8 is a good value for beacon mode
52 */
53 #define CONFIG_SUPERFRAME_ORDER      15
54 /*! Maximum number of message failure, to indicate sync loss */
55 #define CONFIG_MAX_DATA_FAILURES     3
56 /*!
57  Maximum number of attempts for association in FH mode
58  after reception of a PAN Config frame
59  */
60 #define CONFIG_FH_MAX_ASSOCIATION_ATTEMPTS    3
61 /* Interval for scan backoff */
62 #define CONFIG_SCAN_BACKOFF_INTERVAL  5000
63 /* Interval for delay between orphan notifications */
64 #define CONFIG_ORPHAN_BACKOFF_INTERVAL 300000
66 /*! Setting for Phy ID */
67 #define CONFIG_PHY_ID                (APIMAC_STD_US_915_PHY_1)
69 /*! MAC Parameter */
70 /*! Min BE - Minimum Backoff Exponent */
71 #define CONFIG_MIN_BE   3
72 /*! Max BE - Maximum Backoff Exponent */
73 #define CONFIG_MAX_BE   5
74 /*! MAC MAX CSMA Backoffs */
75 #define CONFIG_MAC_MAX_CSMA_BACKOFFS   4
76 /*! macMaxFrameRetries - Maximum Frame Retries */
77 #define CONFIG_MAX_RETRIES   3
79 #if ((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_STD_PHY_ID_END))
80 /*! Setting for channel page */
81 #define CONFIG_CHANNEL_PAGE          (APIMAC_CHANNEL_PAGE_9)
82 #elif ((CONFIG_PHY_ID >= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_END))
83 /*! Setting for channel page */
84 #define CONFIG_CHANNEL_PAGE          (APIMAC_CHANNEL_PAGE_10)
85 #else
86 #error "PHY ID is wrong."
87 #endif
89 /*! scan duration in seconds*/
90 #define CONFIG_SCAN_DURATION         5
92 /*!
93  Coordinator Short Address When Operating with FH Enabled.
94  */
95 #define FH_COORD_SHORT_ADDR 0xAABB
96 /*!
97  Range Extender Mode setting.
98  The following modes are available.
99  APIMAC_NO_EXTENDER - does not have PA/LNA
100  APIMAC_HIGH_GAIN_MODE - high gain mode
101  To enable CC1190, use
102  #define CONFIG_RANGE_EXT_MODE       APIMAC_HIGH_GAIN_MODE
103 */
104 #define CONFIG_RANGE_EXT_MODE       APIMAC_NO_EXTENDER
106 /*! Setting Default Key*/
107 #define KEY_TABLE_DEFAULT_KEY {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,\
108                                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
110 /*!
111  Channel mask used when CONFIG_FH_ENABLE is false.
112  Each bit indicates if the corresponding channel is to be scanned
113  First byte represents channels 0 to 7 and the last byte represents
114  channels 128 to 135.
115  For byte zero in the bit mask, LSB representing Ch0.
116  For byte 1, LSB represents Ch8 and so on.
117  e.g., 0x01 0x10 represents Ch0 and Ch12 are included.
118  The default of 0x0F represents channels 0-3 are selected.
119  APIMAC_STD_US_915_PHY_1 (50kbps/2-FSK/915MHz band) has channels 0 - 128.
120  APIMAC_STD_ETSI_863_PHY_3 (50kbps/2-FSK/863MHz band) has channels 0 - 33.
121  APIMAC_GENERIC_CHINA_433_PHY_128 (50kbps/2-FSK/433MHz band) has channels 0 - 6.
122 */
123 #define CONFIG_CHANNEL_MASK           { 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, \
124                                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
125                                         0x00, 0x00, 0x00, 0x00, 0x00 }
126 /*!
127  Channel mask used when CONFIG_FH_ENABLE is true.
128  Represents the list of channels on which the device can hop.
129  When CONFIG_RX_ON_IDLE is true, the actual sequence will
130  be based on DH1CF function. When it is set to false, the sequence
131  shall be a linear hopping over available channels in ascending order and
132  shall be used to change channel during the join phase.
133  It is represented as a bit string with LSB representing Ch0.
134  e.g., 0x01 0x10 represents Ch0 and Ch12 are included.
135  */
136 #define CONFIG_FH_CHANNEL_MASK        { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
137                                         0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, \
138                                         0x00, 0x00, 0x00, 0x00, 0x00,}
139 /* FH related config variables */
140 /*!
141  List of channels to target the Async frames
142  It is represented as a bit string with LSB representing Ch0
143  e.g., 0x01 0x10 represents Ch0 and Ch12 are included
144  It should cover all channels that could be used by a target device in its
145  hopping sequence. Channels marked beyond number of channels supported by
146  PHY Config will be excluded by stack. To avoid interference on a channel,
147  it should be removed from Async Mask and added to exclude channels
148  (CONFIG_CHANNEL_MASK).
149  */
150 #define FH_ASYNC_CHANNEL_MASK         { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
151                                         0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
152                                         0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
154 /*! Rx on when idle, false for sleepy device, true for non sleepy device */
155 #define CONFIG_RX_ON_IDLE          false
157 /*!
158  The number of non sleepy channel hopping end devices to be supported.
159  It is to be noted that the total number of non sleepy devices supported
160   must be less than 50. Stack will allocate memory proportional
161  to the number of end devices requested.
162  */
163 #define FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS  2
164 /*!
165  The number of non sleepy fixed channel end devices to be supported.
166  It is to be noted that the total number of non sleepy devices supported
167   must be less than 50. Stack will allocate memory proportional
168  to the number of end devices requested.
169  */
170 #define FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS  2
171 /*!
172  Dwell Time: The duration for which a non sleepy end device shall
173  stay on a specific channel before hopping to next channel.
174  */
175 #define CONFIG_DWELL_TIME            250
177 #if (((CONFIG_PHY_ID >= APIMAC_MRFSK_STD_PHY_ID_BEGIN) && (CONFIG_PHY_ID <= APIMAC_MRFSK_GENERIC_PHY_ID_BEGIN)) || \
178     ((CONFIG_PHY_ID >= APIMAC_GENERIC_US_915_PHY_132) && (CONFIG_PHY_ID <= APIMAC_GENERIC_ETSI_863_PHY_133)))
179 /*! Default Polling interval in milliseconds. It will get updated upon reception
180  of a config request message */
181 #define CONFIG_POLLING_INTERVAL      6000
182 /*! PAN Advertisement Solicit trickle timer duration in milliseconds */
183 #define CONFIG_PAN_ADVERT_SOLICIT_CLK_DURATION    6000
184 /*! PAN Config Solicit trickle timer duration in milliseconds */
185 #define CONFIG_PAN_CONFIG_SOLICIT_CLK_DURATION    6000
186 /*! Default Reporting Interval - in milliseconds. It will get updated upon
187  reception of a config request message */
188 #define CONFIG_REPORTING_INTERVAL  180000
189 #else
190 /*! Default Polling interval in milliseconds. It will get updated upon reception
191  of a config request message */
192 #define CONFIG_POLLING_INTERVAL      60000
193 /*! PAN Advertisement Solicit trickle timer duration in milliseconds */
194 #define CONFIG_PAN_ADVERT_SOLICIT_CLK_DURATION    60000
195 /*! PAN Config Solicit trickle timer duration in milliseconds */
196 #define CONFIG_PAN_CONFIG_SOLICIT_CLK_DURATION    60000
197 /*! Default Reporting Interval - in milliseconds. It will get updated upon
198  reception of a config request message */
199 #define CONFIG_REPORTING_INTERVAL  600000
200 #endif
202 /*! FH Poll/Sensor msg start time randomization window */
203 #define CONFIG_FH_START_POLL_DATA_RAND_WINDOW   10000
205 /*! If enabled, the periodic sensor message shall be sent as a fixed size
206  * packet of specified size. If set to 0, the periodic sensor message shall be
207  * of type sensor data specified in smsgs.h
208  */
209 #define SENSOR_TEST_RAMP_DATA_SIZE   0
211 /*! value for ApiMac_FHAttribute_netName */
212 #define CONFIG_FH_NETNAME            {"FHTest"}
214 /*! Range Extender is not supported in uBLE project  */
215 #ifdef FEATURE_UBLE
216 #if CONFIG_RANGE_EXT_MODE
217 #error "CONFIG_RANGE_EXT_MODE should be APIMAC_NO_EXTENDER"
218 #endif
219 #endif
221 /*!
222  Value for Transmit Power in dBm
223  For US and ETSI band, Default value is 10, allowed values are
224  -10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 14dBm.
225  For China band, allowed values are 6, 10, 13, 14 and 15dBm.
226  For CC1190, allowed values are between 18, 23, 25, 26 and 27dBm.
227  When the nodes in the network are close to each other
228  lowering this value will help reduce saturation */
230 #if CONFIG_RANGE_EXT_MODE
231 #define CONFIG_TRANSMIT_POWER        27
232 #else
233 #if ((CONFIG_PHY_ID == APIMAC_GENERIC_CHINA_433_PHY_128) || (CONFIG_PHY_ID == APIMAC_GENERIC_CHINA_LRM_433_PHY_130))
234 #define CONFIG_TRANSMIT_POWER        14
235 #else
236 #define CONFIG_TRANSMIT_POWER        12
237 #endif
238 #endif
240 #if CONFIG_RANGE_EXT_MODE
241 #if (CCFG_FORCE_VDDR_HH == 1)
242 #error "CCFG_FORCE_VDDR_HH should be 0"
243 #endif
244 #else
245 #if ((CONFIG_PHY_ID == APIMAC_GENERIC_CHINA_433_PHY_128) || (CONFIG_PHY_ID == APIMAC_GENERIC_CHINA_LRM_433_PHY_130))
246 #if (CCFG_FORCE_VDDR_HH == 0)
247 #if (CONFIG_TRANSMIT_POWER >= 15)
248 #error "CONFIG_TRANSMIT_POWER should be less than 15"
249 #endif
250 #else
251 #if (CONFIG_TRANSMIT_POWER < 15)
252 /* In 433 MHz band when CCFG_FORCE_VDDR_HH = 1, only possible value of transmit power is 15 */
253 #error "CONFIG_TRANSMIT_POWER should be 15"
254 #endif
255 #endif
256 #else
257 #if (CCFG_FORCE_VDDR_HH == 0)
258 #if (CONFIG_TRANSMIT_POWER >= 14)
259 #error "CONFIG_TRANSMIT_POWER should be less than 14"
260 #endif
261 #else
262 #if (CONFIG_TRANSMIT_POWER < 14)
263 /* In US and ETSI band when CCFG_FORCE_VDDR_HH = 1, only possible value of transmit power is 14 */
264 #error "CONFIG_TRANSMIT_POWER should be 14"
265 #endif
266 #endif
267 #endif
268 #endif
270 /*!
271 * Enable this mode for certfication.
272 * For FH certification, CONFIG_FH_ENABLE should
273 * also be enabled
274 */
275 #define CERTIFICATION_TEST_MODE     false
277 #ifdef POWER_MEAS
278 /*!
279  Power profile to be used when Power MEAS is enabled.
280  Profile 1 - POLL_ACK - Polling Only
281  Profile 2 - DATA_ACK - 20 byte application data + ACK from sensor to collector
282  Profile 3 - POLL_DATA - Poll + received Data from collector
283  Profile 4 - SLEEP - No Poll or Data. In Beacon mode, beacon RX would occur
284  */
285 #define POWER_TEST_PROFILE  DATA_ACK
286 #endif
288 /* Check if all the necessary parameters have been set for FH mode */
289 #if CONFIG_FH_ENABLE
290 #if !defined(FEATURE_ALL_MODES) && !defined(FEATURE_FREQ_HOP_MODE)
291 #error "Do you want to build image with frequency hopping mode? \
292         Define either FEATURE_FREQ_HOP_MODE or FEATURE_ALL_MODES in features.h"
293 #endif
294 #endif
296 /* Check if stack level security is enabled if application security is enabled */
297 #if CONFIG_SECURE
298 #if !defined(FEATURE_MAC_SECURITY)
299 #error "Define FEATURE_MAC_SECURITY or FEATURE_ALL_MODES in features.h to \
300         be able to use security at application level"
301 #endif
302 #endif
304 /* Set beacon order and superframe order to 15 for FH mode to avoid user error */
305 #if CONFIG_FH_ENABLE
306 #if (CONFIG_BEACON_ORDER != 15) && (CONFIG_SUPERFRAME_ORDER != 15)
307 #error "Do you want to build image with frequency hopping mode? \
308     If yes, CONFIG_BEACON_ORDER and CONFIG_SUPERFRAME_ORDER \
309     should both be set to 15"
310 #endif
311 #if (FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS < 2) || (FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS < 2)
312 #error "You have an invalid value for FH neighbors. Set the values \
313         for FH_NUM_NON_SLEEPY_HOPPING_NEIGHBORS and FH_NUM_NON_SLEEPY_FIXED_CHANNEL_NEIGHBORS to at least 2"
314 #endif
315 #endif
317 #ifdef __cplusplus
319 #endif
321 #endif /* CONFIG_H */