Contiki 3.x
contiki-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Texas Instruments Incorporated - http://www.ti.com/
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 /**
31  * \addtogroup cc26xx-srf-tag
32  * @{
33  *
34  * \file
35  * Configuration for the srf06-cc26xx platform
36  */
37 #ifndef CONTIKI_CONF_H
38 #define CONTIKI_CONF_H
39 
40 #include <stdint.h>
41 /*---------------------------------------------------------------------------*/
42 /* Include Project Specific conf */
43 #ifdef PROJECT_CONF_H
44 #include PROJECT_CONF_H
45 #endif /* PROJECT_CONF_H */
46 /*---------------------------------------------------------------------------*/
47 /**
48  * \name Network Stack Configuration
49  *
50  * @{
51  */
52 #ifndef NETSTACK_CONF_NETWORK
53 #if NETSTACK_CONF_WITH_IPV6
54 #define NETSTACK_CONF_NETWORK sicslowpan_driver
55 #else
56 #define NETSTACK_CONF_NETWORK rime_driver
57 #endif /* NETSTACK_CONF_WITH_IPV6 */
58 #endif /* NETSTACK_CONF_NETWORK */
59 
60 #ifndef NETSTACK_CONF_MAC
61 #define NETSTACK_CONF_MAC csma_driver
62 #endif
63 
64 #ifndef NETSTACK_CONF_RDC
65 #define NETSTACK_CONF_RDC contikimac_driver
66 #endif
67 
68 /* Configure NullRDC for when it's selected */
69 #define NULLRDC_CONF_802154_AUTOACK 1
70 
71 /* Configure ContikiMAC for when it's selected */
72 #define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0
73 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
74 #define WITH_FAST_SLEEP 1
75 
76 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
77 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
78 #endif
79 
80 #ifndef NETSTACK_CONF_FRAMER
81 #define NETSTACK_CONF_FRAMER framer_802154
82 #endif
83 
84 #if CPU_FAMILY_CC13XX
85 #define NETSTACK_CONF_RADIO prop_mode_driver
86 
87 #ifndef RF_CORE_CONF_CHANNEL
88 #define RF_CORE_CONF_CHANNEL 0
89 #endif
90 
91 #define NULLRDC_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 400)
92 #define NULLRDC_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000)
93 #define NULLRDC_CONF_802154_AUTOACK_HW 0
94 #define NULLRDC_CONF_SEND_802154_ACK 1
95 
96 #define CONTIKIMAC_CONF_CCA_CHECK_TIME (RTIMER_ARCH_SECOND / 1600)
97 #define CONTIKIMAC_CONF_CCA_SLEEP_TIME (RTIMER_ARCH_SECOND / 210)
98 #define CONTIKIMAC_CONF_LISTEN_TIME_AFTER_PACKET_DETECTED (RTIMER_ARCH_SECOND / 20)
99 #define CONTIKIMAC_CONF_SEND_SW_ACK 1
100 #define CONTIKIMAC_CONF_AFTER_ACK_DETECTECT_WAIT_TIME (RTIMER_SECOND / 1000)
101 #define CONTIKIMAC_CONF_INTER_PACKET_INTERVAL (RTIMER_SECOND / 250)
102 #else
103 #define NETSTACK_CONF_RADIO ieee_mode_driver
104 
105 #ifndef RF_CORE_CONF_CHANNEL
106 #define RF_CORE_CONF_CHANNEL 25
107 #endif
108 
109 #define NULLRDC_CONF_802154_AUTOACK_HW 1
110 #define NULLRDC_CONF_SEND_802154_ACK 0
111 #endif
112 
113 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125
114 
115 /* 6LoWPAN */
116 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
117 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
118 #define SICSLOWPAN_CONF_FRAG 1
119 #define SICSLOWPAN_CONF_MAXAGE 8
120 /** @} */
121 /*---------------------------------------------------------------------------*/
122 /**
123  * \name IEEE address configuration
124  *
125  * Used to generate our RIME & IPv6 address
126  * @{
127  */
128 /**
129  * \brief Location of the IEEE address
130  * 0 => Read from InfoPage,
131  * 1 => Use a hardcoded address, configured by IEEE_ADDR_CONF_ADDRESS
132  */
133 #ifndef IEEE_ADDR_CONF_HARDCODED
134 #define IEEE_ADDR_CONF_HARDCODED 0
135 #endif
136 
137 /**
138  * \brief The hardcoded IEEE address to be used when IEEE_ADDR_CONF_HARDCODED
139  * is defined as 1
140  */
141 #ifndef IEEE_ADDR_CONF_ADDRESS
142 #define IEEE_ADDR_CONF_ADDRESS { 0x00, 0x12, 0x4B, 0x00, 0x89, 0xAB, 0xCD, 0xEF }
143 #endif
144 /** @} */
145 /*---------------------------------------------------------------------------*/
146 /**
147  * \name RF configuration
148  *
149  * @{
150  */
151 /* RF Config */
152 #ifndef IEEE802154_CONF_PANID
153 #define IEEE802154_CONF_PANID 0xABCD /**< Default PAN ID */
154 #endif
155 
156 #ifndef IEEE_MODE_CONF_AUTOACK
157 #define IEEE_MODE_CONF_AUTOACK 1 /**< RF H/W generates ACKs */
158 #endif
159 
160 #ifndef IEEE_MODE_CONF_PROMISCOUS
161 #define IEEE_MODE_CONF_PROMISCOUS 0 /**< 1 to enable promiscous mode */
162 #endif
163 
164 #ifndef RF_BLE_CONF_ENABLED
165 #define RF_BLE_CONF_ENABLED 0 /**< 0 to disable BLE support */
166 #endif
167 
168 #ifndef PROP_MODE_CONF_SNIFFER
169 #define PROP_MODE_CONF_SNIFFER 0 /**< 1 to enable sniffer mode */
170 #endif
171 /** @} */
172 /*---------------------------------------------------------------------------*/
173 /** @} */
174 /**
175  * \name IPv6, RIME and network buffer configuration
176  *
177  * @{
178  */
179 /* Don't let contiki-default-conf.h decide if we are an IPv6 build */
180 #ifndef NETSTACK_CONF_WITH_IPV6
181 #define NETSTACK_CONF_WITH_IPV6 0
182 #endif
183 
184 #if NETSTACK_CONF_WITH_IPV6
185 /*---------------------------------------------------------------------------*/
186 /* Addresses, Sizes and Interfaces */
187 #define LINKADDR_CONF_SIZE 8
188 #define UIP_CONF_LL_802154 1
189 #define UIP_CONF_LLH_LEN 0
190 
191 /* The size of the uIP main buffer */
192 #ifndef UIP_CONF_BUFFER_SIZE
193 #define UIP_CONF_BUFFER_SIZE 1000
194 #endif
195 
196 /* ND and Routing */
197 #ifndef UIP_CONF_ROUTER
198 #define UIP_CONF_ROUTER 1
199 #endif
200 
201 #define UIP_CONF_ND6_SEND_RA 0
202 #define UIP_CONF_IP_FORWARD 0
203 #define RPL_CONF_STATS 0
204 
205 #ifndef RPL_CONF_OF
206 #define RPL_CONF_OF rpl_mrhof
207 #endif
208 
209 #define UIP_CONF_ND6_REACHABLE_TIME 600000
210 #define UIP_CONF_ND6_RETRANS_TIMER 10000
211 
212 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
213 #define NBR_TABLE_CONF_MAX_NEIGHBORS 20
214 #endif
215 #ifndef UIP_CONF_MAX_ROUTES
216 #define UIP_CONF_MAX_ROUTES 20
217 #endif
218 
219 #ifndef UIP_CONF_TCP
220 #define UIP_CONF_TCP 1
221 #endif
222 #ifndef UIP_CONF_TCP_MSS
223 #define UIP_CONF_TCP_MSS 64
224 #endif
225 
226 #define UIP_CONF_UDP 1
227 #define UIP_CONF_UDP_CHECKSUMS 1
228 #define UIP_CONF_ICMP6 1
229 /*---------------------------------------------------------------------------*/
230 #else /* NETSTACK_CONF_WITH_IPV6 */
231 /* Network setup for non-IPv6 (rime). */
232 #define UIP_CONF_IP_FORWARD 1
233 
234 #define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
235 
236 #endif /* NETSTACK_CONF_WITH_IPV6 */
237 /** @} */
238 /*---------------------------------------------------------------------------*/
239 /**
240  * \name Generic Configuration directives
241  *
242  * @{
243  */
244 #ifndef ENERGEST_CONF_ON
245 #define ENERGEST_CONF_ON 0 /**< Energest Module */
246 #endif
247 /** @} */
248 /*---------------------------------------------------------------------------*/
249 /**
250  * \name Character I/O Configuration
251  *
252  * @{
253  */
254 #ifndef CC26XX_UART_CONF_ENABLE
255 #define CC26XX_UART_CONF_ENABLE 1 /**< Enable/Disable UART I/O */
256 #endif
257 
258 #ifndef CC26XX_UART_CONF_BAUD_RATE
259 #define CC26XX_UART_CONF_BAUD_RATE 115200 /**< Default UART0 baud rate */
260 #endif
261 
262 /* Enable I/O over the Debugger Devpack - Only relevant for the SensorTag */
263 #ifndef BOARD_CONF_DEBUGGER_DEVPACK
264 #define BOARD_CONF_DEBUGGER_DEVPACK 1
265 #endif
266 
267 /* Turn off example-provided putchars */
268 #define SLIP_BRIDGE_CONF_NO_PUTCHAR 1
269 #define SLIP_RADIO_CONF_NO_PUTCHAR 1
270 
271 #ifndef SLIP_ARCH_CONF_ENABLED
272 /*
273  * Determine whether we need SLIP
274  * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
275  * keep using SLIP
276  */
277 #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
278 #define SLIP_ARCH_CONF_ENABLED 1
279 #endif
280 #endif
281 /** @} */
282 /*---------------------------------------------------------------------------*/
283 /**
284  * \name Button configurations
285  *
286  * Configure a button as power on/off: We use the right button for both boards.
287  * @{
288  */
289 #ifndef BUTTON_SENSOR_CONF_ENABLE_SHUTDOWN
290 #define BUTTON_SENSOR_CONF_ENABLE_SHUTDOWN 1
291 #endif
292 
293 /* Notify various examples that we have Buttons */
294 #define PLATFORM_HAS_BUTTON 1
295 
296 /*
297  * Override button symbols from dev/button-sensor.h, for the examples that
298  * include it
299  */
300 #define button_sensor button_left_sensor
301 #define button_sensor2 button_right_sensor
302 /** @} */
303 /*---------------------------------------------------------------------------*/
304 /* Platform-specific define to signify sensor reading failure */
305 #define CC26XX_SENSOR_READING_ERROR 0x80000000
306 /*---------------------------------------------------------------------------*/
307 /**
308  * \name Compiler configuration and platform-specific type definitions
309  *
310  * Those values are not meant to be modified by the user
311  * @{
312  */
313 #define CLOCK_CONF_SECOND 128
314 
315 /* Compiler configurations */
316 #define CCIF
317 #define CLIF
318 
319 /* Platform typedefs */
320 typedef uint32_t clock_time_t;
321 typedef uint32_t uip_stats_t;
322 
323 /* Clock (time) comparison macro */
324 #define CLOCK_LT(a, b) ((signed long)((a) - (b)) < 0)
325 
326 /*
327  * rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define
328  * RTIMER_CLOCK_DIFF to override this
329  */
330 typedef uint32_t rtimer_clock_t;
331 #define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b)))
332 /** @} */
333 /*---------------------------------------------------------------------------*/
334 /* board.h assumes that basic configuration is done */
335 #include "board.h"
336 /*---------------------------------------------------------------------------*/
337 #endif /* CONTIKI_CONF_H */
338 
339 /** @} */