Contiki 3.x
contiki-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Zolertia - http://www.zolertia.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  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29  * OF THE POSSIBILITY OF SUCH DAMAGE.
30  */
31 /**
32  * \addtogroup zoul
33  * @{
34  *
35  * \defgroup zoul-platforms Zolertia platforms based on the Zoul core module
36  *
37  * The Zoul allows a fast reuse and easy integration to most applications and
38  * products. Its small size and module format eases to place in different PCB
39  * designs and to integrate in existing products. The Zoul-based platforms
40  * share most of the Zoul core implementation.
41  *
42  * \file
43  * Configuration for the Zoul-based platforms
44  */
45 #ifndef CONTIKI_CONF_H_
46 #define CONTIKI_CONF_H_
47 
48 #include <stdint.h>
49 #include <string.h>
50 /*---------------------------------------------------------------------------*/
51 /* Include Project Specific conf */
52 #ifdef PROJECT_CONF_H
53 #include PROJECT_CONF_H
54 #endif /* PROJECT_CONF_H */
55 /*---------------------------------------------------------------------------*/
56 /**
57  * \name Compiler configuration and platform-specific type definitions
58  *
59  * Those values are not meant to be modified by the user
60  * @{
61  */
62 #define CLOCK_CONF_SECOND 128
63 
64 /* Compiler configurations */
65 #define CCIF
66 #define CLIF
67 
68 /* Platform typedefs */
69 typedef uint32_t clock_time_t;
70 typedef uint32_t uip_stats_t;
71 
72 /*
73  * rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define
74  * RTIMER_CLOCK_DIFF to override this
75  */
76 typedef uint32_t rtimer_clock_t;
77 #define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b)))
78 /** @} */
79 /*---------------------------------------------------------------------------*/
80 #define TSCH_CONF_HW_FRAME_FILTERING 0
81 
82 /* 352us from calling transmit() until the SFD byte has been sent */
83 #define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(352))
84 /* 192us as in datasheet but ACKs are not always received, so adjusted to 250us */
85 #define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(250))
86 #define RADIO_DELAY_BEFORE_DETECT 0
87 /*---------------------------------------------------------------------------*/
88 /**
89  * \name Serial Boot Loader Backdoor configuration
90  *
91  * @{
92  */
93 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
94 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
95 #endif
96 
97 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
98 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 3 /**< Pin PA_3 (user button), activates the boot loader */
99 #endif
100 
101 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
102 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
103 #endif
104 /** @} */
105 
106 /*---------------------------------------------------------------------------*/
107 /**
108  * \name CFS configuration
109  *
110  * @{
111  */
112 #ifndef COFFEE_CONF_SIZE
113 #define COFFEE_CONF_SIZE (4 * COFFEE_SECTOR_SIZE)
114 #endif
115 /** @} */
116 /*---------------------------------------------------------------------------*/
117 /**
118  * \name Watchdog Timer configuration
119  *
120  * @{
121  */
122 #ifndef WATCHDOG_CONF_ENABLE
123 #define WATCHDOG_CONF_ENABLE 1 /**< Enable the watchdog timer */
124 #endif
125 /** @} */
126 /*---------------------------------------------------------------------------*/
127 /**
128  * \name USB 'core' configuration
129  *
130  * Those values are not meant to be modified by the user, except where stated
131  * otherwise
132  * @{
133  */
134 #define CTRL_EP_SIZE 8
135 #define USB_EP1_SIZE 32
136 #define USB_EP2_SIZE 64
137 #define USB_EP3_SIZE 64
138 #define USB_ARCH_WRITE_NOTIFY 0
139 
140 #ifndef USB_ARCH_CONF_DMA
141 #define USB_ARCH_CONF_DMA 1 /**< Change to Enable/Disable USB DMA */
142 
143 #endif
144 /** @} */
145 /*---------------------------------------------------------------------------*/
146 /**
147  * \name Generic Configuration directives
148  *
149  * @{
150  */
151 #ifndef ENERGEST_CONF_ON
152 #define ENERGEST_CONF_ON 0 /**< Energest Module */
153 #endif
154 
155 #ifndef STARTUP_CONF_VERBOSE
156 #define STARTUP_CONF_VERBOSE 1 /**< Set to 0 to decrease startup verbosity */
157 #endif
158 /** @} */
159 /*---------------------------------------------------------------------------*/
160 /**
161  * \name uDMA Configuration and channel allocations
162  *
163  * @{
164  */
165 #define USB_ARCH_CONF_RX_DMA_CHAN 0 /**< USB -> RAM DMA channel */
166 #define USB_ARCH_CONF_TX_DMA_CHAN 1 /**< RAM -> USB DMA channel */
167 #define CC2538_RF_CONF_TX_DMA_CHAN 2 /**< RF -> RAM DMA channel */
168 #define CC2538_RF_CONF_RX_DMA_CHAN 3 /**< RAM -> RF DMA channel */
169 #define UDMA_CONF_MAX_CHANNEL CC2538_RF_CONF_RX_DMA_CHAN
170 /** @} */
171 /*---------------------------------------------------------------------------*/
172 /**
173  * \name Character I/O Configuration
174  *
175  * @{
176  */
177 #ifndef UART_CONF_ENABLE
178 #define UART_CONF_ENABLE 1 /**< Enable/Disable UART I/O */
179 #endif
180 
181 #ifndef UART0_CONF_BAUD_RATE
182 #define UART0_CONF_BAUD_RATE 115200 /**< Default UART0 baud rate */
183 #endif
184 
185 #ifndef UART1_CONF_BAUD_RATE
186 #define UART1_CONF_BAUD_RATE 115200 /**< Default UART1 baud rate */
187 #endif
188 
189 #ifndef SLIP_ARCH_CONF_USB
190 #define SLIP_ARCH_CONF_USB 0 /**< SLIP over UART by default */
191 #endif
192 
193 #ifndef CC2538_RF_CONF_SNIFFER_USB
194 #define CC2538_RF_CONF_SNIFFER_USB 0 /**< Sniffer out over UART by default */
195 #endif
196 
197 #ifndef DBG_CONF_USB
198 #define DBG_CONF_USB 0 /**< All debugging over UART by default */
199 #endif
200 
201 #ifndef SERIAL_LINE_CONF_UART
202 #define SERIAL_LINE_CONF_UART 0 /**< UART to use with serial line */
203 #endif
204 
205 #if !SLIP_ARCH_CONF_USB
206 #ifndef SLIP_ARCH_CONF_UART
207 #define SLIP_ARCH_CONF_UART 0 /**< UART to use with SLIP */
208 #endif
209 #endif
210 
211 #if !CC2538_RF_CONF_SNIFFER_USB
212 #ifndef CC2538_RF_CONF_SNIFFER_UART
213 #define CC2538_RF_CONF_SNIFFER_UART 0 /**< UART to use with sniffer */
214 #endif
215 #endif
216 
217 #if !DBG_CONF_USB
218 #ifndef DBG_CONF_UART
219 #define DBG_CONF_UART 0 /**< UART to use for debugging */
220 #endif
221 #endif
222 
223 #ifndef UART1_CONF_UART
224 #define UART1_CONF_UART 0 /**< UART to use for examples relying on
225  the uart1_* API */
226 #endif
227 
228 /* Turn off example-provided putchars */
229 #define SLIP_BRIDGE_CONF_NO_PUTCHAR 1
230 #define SLIP_RADIO_CONF_NO_PUTCHAR 1
231 
232 #ifndef SLIP_ARCH_CONF_ENABLED
233 /*
234  * Determine whether we need SLIP
235  * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
236  * keep using SLIP
237  */
238 #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
239 #define SLIP_ARCH_CONF_ENABLED 1
240 #endif
241 #endif
242 
243 /*
244  * When set, the radio turns off address filtering and sends all captured
245  * frames down a peripheral (UART or USB, depending on the value of
246  * CC2538_RF_CONF_SNIFFER_USB)
247  */
248 #ifndef CC2538_RF_CONF_SNIFFER
249 #define CC2538_RF_CONF_SNIFFER 0
250 #endif
251 
252 /**
253  * \brief Define this as 1 to build a headless node.
254  *
255  * The UART will not be initialised its clock will be gated, offering some
256  * energy savings. The USB will not be initialised either
257  */
258 #ifndef CC2538_CONF_QUIET
259 #define CC2538_CONF_QUIET 0
260 #endif
261 
262 /* CC2538_CONF_QUIET is hard and overrides all other related defines */
263 #if CC2538_CONF_QUIET
264 #undef USB_SERIAL_CONF_ENABLE
265 #define USB_SERIAL_CONF_ENABLE 0
266 
267 #undef UART_CONF_ENABLE
268 #define UART_CONF_ENABLE 0
269 
270 #undef STARTUP_CONF_VERBOSE
271 #define STARTUP_CONF_VERBOSE 0
272 
273 /* Little sanity check: We can't have quiet sniffers */
274 #if CC2538_RF_CONF_SNIFFER
275 #error "CC2538_RF_CONF_SNIFFER == 1 and CC2538_CONF_QUIET == 1"
276 #error "These values are conflicting. Please set either to 0"
277 #endif
278 #endif /* CC2538_CONF_QUIET */
279 
280 /**
281  * \brief Enable the USB core only if we need it
282  */
283 #ifndef USB_SERIAL_CONF_ENABLE
284 #define USB_SERIAL_CONF_ENABLE \
285  ((SLIP_ARCH_CONF_USB & SLIP_ARCH_CONF_ENABLED) | \
286  DBG_CONF_USB | \
287  (CC2538_RF_CONF_SNIFFER & CC2538_RF_CONF_SNIFFER_USB))
288 #endif
289 
290 /*
291  * If debugging and SLIP use the same peripheral, this will be 1. Don't modify
292  * this
293  */
294 #if SLIP_ARCH_CONF_ENABLED
295 #define DBG_CONF_SLIP_MUX (SLIP_ARCH_CONF_USB == DBG_CONF_USB && \
296  (SLIP_ARCH_CONF_USB || \
297  SLIP_ARCH_CONF_UART == DBG_CONF_UART))
298 #endif
299 
300 /*
301  * Automatic detection of whether a specific UART is in use
302  */
303 #define UART_IN_USE_BY_SERIAL_LINE(u) (SERIAL_LINE_CONF_UART == (u))
304 #define UART_IN_USE_BY_SLIP(u) (SLIP_ARCH_CONF_ENABLED && \
305  !SLIP_ARCH_CONF_USB && \
306  SLIP_ARCH_CONF_UART == (u))
307 #define UART_IN_USE_BY_RF_SNIFFER(u) (CC2538_RF_CONF_SNIFFER && \
308  !CC2538_RF_CONF_SNIFFER_USB && \
309  CC2538_RF_CONF_SNIFFER_UART == (u))
310 #define UART_IN_USE_BY_DBG(u) (!DBG_CONF_USB && DBG_CONF_UART == (u))
311 #define UART_IN_USE_BY_UART1(u) (UART1_CONF_UART == (u))
312 
313 #define UART_IN_USE(u) ( \
314  UART_CONF_ENABLE && \
315  (UART_IN_USE_BY_SERIAL_LINE(u) || \
316  UART_IN_USE_BY_SLIP(u) || \
317  UART_IN_USE_BY_RF_SNIFFER(u) || \
318  UART_IN_USE_BY_DBG(u) || \
319  UART_IN_USE_BY_UART1(u)) \
320 )
321 /** @} */
322 /*---------------------------------------------------------------------------*/
323 /* board.h assumes that basic configuration is done */
324 #include "board.h"
325 /*---------------------------------------------------------------------------*/
326 /**
327  * \name Network Stack Configuration
328  *
329  * @{
330  */
331 #ifndef NETSTACK_CONF_NETWORK
332 #if NETSTACK_CONF_WITH_IPV6
333 #define NETSTACK_CONF_NETWORK sicslowpan_driver
334 #else
335 #define NETSTACK_CONF_NETWORK rime_driver
336 #endif /* NETSTACK_CONF_WITH_IPV6 */
337 #endif /* NETSTACK_CONF_NETWORK */
338 
339 #ifndef NETSTACK_CONF_MAC
340 #define NETSTACK_CONF_MAC csma_driver
341 #endif
342 
343 #ifndef NETSTACK_CONF_RDC
344 #define NETSTACK_CONF_RDC contikimac_driver
345 #endif
346 
347 /* Configure NullRDC for when it's selected */
348 #define NULLRDC_802154_AUTOACK 1
349 #define NULLRDC_802154_AUTOACK_HW 1
350 
351 /* Configure ContikiMAC for when it's selected */
352 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
353 #define WITH_FAST_SLEEP 1
354 
355 #ifndef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
356 #define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
357 #endif
358 
359 #ifndef NETSTACK_CONF_FRAMER
360 #if NETSTACK_CONF_WITH_IPV6
361 #define NETSTACK_CONF_FRAMER framer_802154
362 #else /* NETSTACK_CONF_WITH_IPV6 */
363 #define NETSTACK_CONF_FRAMER contikimac_framer
364 #endif /* NETSTACK_CONF_WITH_IPV6 */
365 #endif /* NETSTACK_CONF_FRAMER */
366 
367 /* This can be overriden to use the cc1200_driver instead */
368 #if ZOUL_RADIO == 1120
369  #define NETSTACK_CONF_RADIO cc1120_driver
370 #elif ZOUL_RADIO == 1200
371  #define NETSTACK_CONF_RADIO cc1200_driver
372 #elif ZOUL_RADIO == 0
373  #warning "NULL RADIO"
374  #define NETSTACK_CONF_RADIO nullradio_driver
375 #else
376  #define NETSTACK_CONF_RADIO cc2538_rf_driver
377 #endif
378 
379 /*
380  * RE-Mote specific:
381  * If dual RF enabled, we set the RF switch to enable the CC1200 and use 2.4GHz
382  * on the available uFl/chip antenna (not mounted as default). In contiki main
383  * platform routine we set the right antenna depending on NETSTACK_CONF_RADIO,
384  * but as changing the RF antenna also implies enabling/disabling the CC1200,
385  * is better to start off with the right configuration
386  */
387 #if REMOTE_DUAL_RF_ENABLED
388 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ
389 #else /* REMOTE_DUAL_RF_ENABLED */
390 #ifndef ANTENNA_SW_SELECT_DEF_CONF
391 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ
392 #else /* ANTENNA_SW_SELECT_DEF_CONF */
393 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF
394 #endif /* ANTENNA_SW_SELECT_DEF_CONF */
395 #endif /* REMOTE_DUAL_RF_ENABLED */
396 
397 /** @} */
398 /*---------------------------------------------------------------------------*/
399 /**
400  * \name LPM configuration
401  * @{
402  */
403 #ifndef LPM_CONF_ENABLE
404 #define LPM_CONF_ENABLE 1 /**< Set to 0 to disable LPM entirely */
405 #endif
406 
407 /**
408  * \brief Maximum PM
409  *
410  * The SoC will never drop to a Power Mode deeper than the one specified here.
411  * 0 for PM0, 1 for PM1 and 2 for PM2
412  */
413 #ifndef LPM_CONF_MAX_PM
414 #define LPM_CONF_MAX_PM 2
415 #endif
416 
417 #ifndef LPM_CONF_STATS
418 #define LPM_CONF_STATS 0 /**< Set to 1 to enable LPM-related stats */
419 #endif
420 /** @} */
421 /*---------------------------------------------------------------------------*/
422 /**
423  * \name IEEE address configuration
424  *
425  * Used to generate our RIME & IPv6 address
426  * @{
427  */
428 /**
429  * \brief Location of the IEEE address
430  * 0 => Read from InfoPage,
431  * 1 => Use a hardcoded address, configured by IEEE_ADDR_CONF_ADDRESS
432  */
433 #ifndef IEEE_ADDR_CONF_HARDCODED
434 #define IEEE_ADDR_CONF_HARDCODED 0
435 #endif
436 
437 /**
438  * \brief The hardcoded IEEE address to be used when IEEE_ADDR_CONF_HARDCODED
439  * is defined as 1
440  */
441 #ifndef IEEE_ADDR_CONF_ADDRESS
442 #define IEEE_ADDR_CONF_ADDRESS { 0x00, 0x12, 0x4B, 0x00, 0x89, 0xAB, 0xCD, 0xEF }
443 #endif
444 
445 /**
446  * \brief Location of the IEEE address in the InfoPage when
447  * IEEE_ADDR_CONF_HARDCODED is defined as 0
448  * 0 => Use the primary address location
449  * 1 => Use the secondary address location
450  */
451 #ifndef IEEE_ADDR_CONF_USE_SECONDARY_LOCATION
452 #define IEEE_ADDR_CONF_USE_SECONDARY_LOCATION 0
453 #endif
454 /** @} */
455 /*---------------------------------------------------------------------------*/
456 /**
457  * \name RF configuration
458  *
459  * @{
460  */
461 /* RF Config */
462 #ifndef IEEE802154_CONF_PANID
463 #define IEEE802154_CONF_PANID 0xABCD
464 #endif
465 
466 #ifndef CC2538_RF_CONF_CHANNEL
467 #define CC2538_RF_CONF_CHANNEL 26
468 #endif /* CC2538_RF_CONF_CHANNEL */
469 
470 #ifndef CC2538_RF_CONF_AUTOACK
471 #define CC2538_RF_CONF_AUTOACK 1 /**< RF H/W generates ACKs */
472 #endif /* CC2538_CONF_AUTOACK */
473 
474 #ifndef CC2538_RF_CONF_TX_USE_DMA
475 #define CC2538_RF_CONF_TX_USE_DMA 1 /**< RF TX over DMA */
476 #endif
477 
478 #ifndef CC2538_RF_CONF_RX_USE_DMA
479 #define CC2538_RF_CONF_RX_USE_DMA 1 /**< RF RX over DMA */
480 #endif
481 /** @} */
482 /*---------------------------------------------------------------------------*/
483 /**
484  * \name IPv6, RIME and network buffer configuration
485  *
486  * @{
487  */
488 
489 /* Don't let contiki-default-conf.h decide if we are an IPv6 build */
490 #ifndef NETSTACK_CONF_WITH_IPV6
491 #define NETSTACK_CONF_WITH_IPV6 0
492 #endif
493 
494 #if NETSTACK_CONF_WITH_IPV6
495 /* Addresses, Sizes and Interfaces */
496 /* 8-byte addresses here, 2 otherwise */
497 #define LINKADDR_CONF_SIZE 8
498 #define UIP_CONF_LL_802154 1
499 #define UIP_CONF_LLH_LEN 0
500 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
501 
502 /* TCP, UDP, ICMP */
503 #ifndef UIP_CONF_TCP
504 #define UIP_CONF_TCP 1
505 #endif
506 #ifndef UIP_CONF_TCP_MSS
507 #define UIP_CONF_TCP_MSS 64
508 #endif
509 #define UIP_CONF_UDP 1
510 #define UIP_CONF_UDP_CHECKSUMS 1
511 #define UIP_CONF_ICMP6 1
512 
513 /* ND and Routing */
514 #ifndef UIP_CONF_ROUTER
515 #define UIP_CONF_ROUTER 1
516 #endif
517 
518 #define UIP_CONF_ND6_SEND_RA 0
519 #define UIP_CONF_IP_FORWARD 0
520 #define RPL_CONF_STATS 0
521 
522 #ifndef RPL_CONF_OF
523 #define RPL_CONF_OF rpl_mrhof
524 #endif
525 
526 #define UIP_CONF_ND6_REACHABLE_TIME 600000
527 #define UIP_CONF_ND6_RETRANS_TIMER 10000
528 
529 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
530 #define NBR_TABLE_CONF_MAX_NEIGHBORS 16
531 #endif
532 #ifndef UIP_CONF_MAX_ROUTES
533 #define UIP_CONF_MAX_ROUTES 16
534 #endif
535 
536 /* uIP */
537 #ifndef UIP_CONF_BUFFER_SIZE
538 #define UIP_CONF_BUFFER_SIZE 1300
539 #endif
540 
541 #define UIP_CONF_IPV6_QUEUE_PKT 0
542 #define UIP_CONF_IPV6_CHECKS 1
543 #define UIP_CONF_IPV6_REASSEMBLY 0
544 #define UIP_CONF_MAX_LISTENPORTS 8
545 
546 /* 6lowpan */
547 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
548 #ifndef SICSLOWPAN_CONF_COMPRESSION_THRESHOLD
549 #define SICSLOWPAN_CONF_COMPRESSION_THRESHOLD 63
550 #endif
551 #ifndef SICSLOWPAN_CONF_FRAG
552 #define SICSLOWPAN_CONF_FRAG 1
553 #endif
554 #define SICSLOWPAN_CONF_MAXAGE 8
555 
556 /* Define our IPv6 prefixes/contexts here */
557 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 1
558 #ifndef SICSLOWPAN_CONF_ADDR_CONTEXT_0
559 #define SICSLOWPAN_CONF_ADDR_CONTEXT_0 { \
560  addr_contexts[0].prefix[0] = UIP_DS6_DEFAULT_PREFIX_0; \
561  addr_contexts[0].prefix[1] = UIP_DS6_DEFAULT_PREFIX_1; \
562 }
563 #endif
564 
565 #define MAC_CONF_CHANNEL_CHECK_RATE 8
566 
567 #ifndef QUEUEBUF_CONF_NUM
568 #define QUEUEBUF_CONF_NUM 8
569 #endif
570 /*---------------------------------------------------------------------------*/
571 #else /* NETSTACK_CONF_WITH_IPV6 */
572 /* Network setup for non-IPv6 (rime). */
573 #define UIP_CONF_IP_FORWARD 1
574 
575 #ifndef UIP_CONF_BUFFER_SIZE
576 #define UIP_CONF_BUFFER_SIZE 108
577 #endif
578 
579 #define RIME_CONF_NO_POLITE_ANNOUCEMENTS 0
580 
581 #ifndef QUEUEBUF_CONF_NUM
582 #define QUEUEBUF_CONF_NUM 8
583 #endif
584 
585 #endif /* NETSTACK_CONF_WITH_IPV6 */
586 /** @} */
587 /*---------------------------------------------------------------------------*/
588 /**
589  * \name Security
590  *
591  * @{
592  */
593 #ifndef CRYPTO_CONF_INIT
594 #define CRYPTO_CONF_INIT 1 /**< Whether to init cryptoprocessor */
595 #endif
596 
597 #ifndef AES_128_CONF
598 #define AES_128_CONF cc2538_aes_128_driver /**< AES-128 driver */
599 #endif
600 
601 #ifndef CCM_STAR_CONF
602 #define CCM_STAR_CONF cc2538_ccm_star_driver /**< AES-CCM* driver */
603 #endif
604 /** @} */
605 /*---------------------------------------------------------------------------*/
606 
607 /* **************************************************************************** */
608 /* ------------------------------ CC1120 Related ------------------------------ */
609 /* **************************************************************************** */
610 
611 //#define CC1120DEBUG 1
612 //#define CC1120TXDEBUG 1
613 #define CC1120TXERDEBUG 1
614 //#define CC1120RXDEBUG 1
615 #define CC1120RXERDEBUG 1
616 //#define CC1120INTDEBUG 1
617 //#define C1120PROCESSDEBUG 1
618 //#define CC1120ARCHDEBUG 1
619 //#define CC1120STATEDEBUG 1
620 //#define CC1120_DEBUG_PINS 1
621 
622 #define RF_CHANNEL 42
623 
624 #define CC1120_CS_THRESHOLD 0x9C //0xE7 /*-100dBm */
625 
626 /* Other possible sensible values:
627  * 0xC4 -60dBm.
628  * 0xBF -65dBm.
629  * 0xBA -70dBm.
630  * 0xB5 -75dBm.
631  * 0xB0 -80dBm.
632  * 0xAB -85dBm.
633  * 0xA6 -90dBm.
634  * 0xA5 -91dBm.
635  * 0xA4 -92dBm.
636  * 0xA3 -93dBm.
637  * 0xA2 -94dBm.
638  * 0xA1 -95dBm.
639  * 0xA0 -96dBm.
640  * 0x9F -97dBm.
641  * 0x9E -98dBm.
642  * 0x9D -99dBm.
643  * 0x9C -100dBm.
644  * 0x9B -101dBm.
645  * 0x9A -102dBm.
646  * 0x99 -103dBm
647  * 0x98 -104dBm.
648  * 0x97 -105dBm.
649  * 0x96 -106dBm.
650  * 0x95 -107dBm.
651  * 0x94 -108dBm.
652  * 0x93 -109dBm.
653  * 0x92 -110dBm.
654  */
655 //#define CC1120_RSSI_OFFSET 0x9A
656 
657 #define CC1120LEDS 1
658 
659 #define CC1120_LBT_TIMEOUT RTIMER_ARCH_SECOND //80
660 #define CC1120_ACK_WAIT RTIMER_ARCH_SECOND/667 /* ~1.5ms. */
661 
662 #define CC1120_INTER_PACKET_INTERVAL RTIMER_ARCH_SECOND/300 //275 //222
663 
664 #define CC1120_EN_TIMEOUT RTIMER_ARCH_SECOND/500
665 
666 #define CC1120_FHSS_ETSI_50 1
667 #define CC1120_FHSS_FCC_50 0
668 
669 #define CC1120_OFF_STATE CC1120_STATE_XOFF
670 
671 //#define CC1120_GPIO_MODE 0
672 //#define CC1120_GPIO_MODE 1
673 #define CC1120_GPIO_MODE 2
674 
675 #define CC1120_GPIO0_FUNC CC1120_GPIO_MCU_WAKEUP
676 //#define CC1120_GPIO0_FUNC (CC1120_GPIO_PKT_SYNC_RXTX| CC1120_GPIO_INV_MASK)
677 #define CC1120_GPIO2_FUNC CC1120_GPIO_RX0TX1_CFG
678 #define CC1120_GPIO3_FUNC CC1120_GPIO_RX0TX1_CFG
679 //#define CC1120_GPIO3_FUNC CC1120_GPIO_MARC_2PIN_STATUS0
680 //#define CC1120_GPIO2_FUNC CC1120_GPIO_MARC_2PIN_STATUS0
681 //#define CC1120_GPIO3_FUNC CC1120_GPIO_RXFIFO_THR_PKT
682 //#define CC1120_GPIO3_FUNC CC1120_GPIO_RX0TX1_CFG //CC1120_GPIO_MARC_2PIN_STATUS0 //(CC1120_GPIO_PKT_SYNC_RXTX| CC1120_GPIO_INV_MASK)
683 
684 /* **************************************************************************** */
685 
686 #if ZOUL_RADIO == 1120
687 
688 #define CONTIKIMAC_CONF_CCA_CHECK_TIME RTIMER_ARCH_SECOND/1600
689 #define CONTIKIMAC_CONF_CCA_COUNT_MAX 2
690 #define CONTIKIMAC_CONF_WITH_PHASE_OPTIMIZATION 0
691 #define RDC_CONF_HARDWARE_CSMA 0
692 #define RDC_CONF_HARDWARE_ACK 1
693 #define CONTIKIMAC_CONF_INTER_PACKET_INTERVAL 0 //RTIMER_ARCH_SECOND/400 /* ~2.5ms */
694 #define CONTIKIMAC_CONF_CCA_SLEEP_TIME RTIMER_ARCH_SECOND/210 //210 ~4.8ms 140 /* 140 = ~7.1ms, 286 = ~3.5ms */
695 #define CONTIKIMAC_CONF_LISTEN_TIME_AFTER_PACKET_DETECTED RTIMER_ARCH_SECOND/20 /* ~50ms */
696 #define CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE 36
697 
698 #define NULLRDC_CONF_802154_AUTOACK_HW 1
699 #define CC1120_CONF_AUTOACK 1
700 #define CONTIKIMAC_CONF_WITH_CONTIKIMAC_HEADER 0
701 
702 #endif
703 
704 #endif /* CONTIKI_CONF_H_ */
705 
706 /** @} */