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