Contiki-NG
contiki-conf.h
1 /*
2  * Copyright (c) 2006, Swedish Institute of Computer Science.
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
11  * copyright notice, this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided
13  * with the distribution.
14  * 3. The name of the author may not be used to endorse or promote
15  * products derived from this software without specific prior
16  * written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  *
31  */
32 
33 #ifndef CONTIKI_CONF_H_
34 #define CONTIKI_CONF_H_
35 
36 /* include the project config */
37 #ifdef PROJECT_CONF_PATH
38 #include PROJECT_CONF_PATH
39 #endif /* PROJECT_CONF_PATH */
40 
41 #ifdef INCLUDE_SUBPLATFORM_CONF
42 #include "subplatform-conf.h"
43 #endif /* INCLUDE_SUBPLATFORM_CONF */
44 
45 #define PLATFORM_CONF_PROVIDES_MAIN_LOOP 1
46 
47 #define LOG_CONF_ENABLED 1
48 
49 #define COOJA 1
50 
51 #define ASSERT_CONF_RETURNS 1
52 
53 #ifndef EEPROM_CONF_SIZE
54 #define EEPROM_CONF_SIZE 1024
55 #endif
56 
57 #define w_memcpy memcpy
58 
59 #ifdef NETSTACK_CONF_H
60 
61 /* These header overrides the below default configuration */
62 #define NETSTACK__QUOTEME(s) NETSTACK_QUOTEME(s)
63 #define NETSTACK_QUOTEME(s) #s
64 #include NETSTACK__QUOTEME(NETSTACK_CONF_H)
65 
66 #else /* NETSTACK_CONF_H */
67 
68 /* Default network config */
69 #define CSMA_CONF_SEND_SOFT_ACK 1
70 #define CSMA_CONF_ACK_WAIT_TIME RTIMER_SECOND / 500
71 #define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME 0
72 
73 #endif /* NETSTACK_CONF_H */
74 
75 /* Radio setup */
76 #define NETSTACK_CONF_RADIO cooja_radio_driver
77 
78 /* Default network config */
79 #if NETSTACK_CONF_WITH_IPV6
80 
81 
82 /* configure network size and density */
83 #ifndef NETSTACK_MAX_ROUTE_ENTRIES
84 #define NETSTACK_MAX_ROUTE_ENTRIES 300
85 #endif /* NETSTACK_MAX_ROUTE_ENTRIES */
86 #ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
87 #define NBR_TABLE_CONF_MAX_NEIGHBORS 300
88 #endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
89 
90 /* configure queues */
91 #ifndef QUEUEBUF_CONF_NUM
92 #define QUEUEBUF_CONF_NUM 64
93 #endif /* QUEUEBUF_CONF_NUM */
94 
95 #ifndef UIP_CONF_IPV6_QUEUE_PKT
96 #define UIP_CONF_IPV6_QUEUE_PKT 1
97 #endif /* UIP_CONF_IPV6_QUEUE_PKT */
98 
99 #endif /* NETSTACK_CONF_WITH_IPV6 */
100 
101 #define CC_CONF_REGISTER_ARGS 1
102 #define CC_CONF_FUNCTION_POINTER_ARGS 1
103 #define CC_CONF_VA_ARGS 1
104 #define CC_CONF_INLINE inline
105 
106 /* These names are deprecated, use C99 names. */
107 #include <inttypes.h>
108 typedef uint8_t u8_t;
109 typedef uint16_t u16_t;
110 typedef uint32_t u32_t;
111 typedef int32_t s32_t;
112 
113 typedef unsigned short uip_stats_t;
114 
115 #define CLOCK_CONF_SECOND 1000L
116 typedef unsigned long clock_time_t;
117 
118 /* Use 64-bit rtimer (default in Contiki-NG is 32) */
119 #define RTIMER_CONF_CLOCK_SIZE 8
120 
121 /* 1 len byte, 2 bytes CRC */
122 #define RADIO_PHY_OVERHEAD 3
123 /* 250kbps data rate. One byte = 32us */
124 #define RADIO_BYTE_AIR_TIME 32
125 #define RADIO_DELAY_BEFORE_TX 0
126 #define RADIO_DELAY_BEFORE_RX 0
127 #define RADIO_DELAY_BEFORE_DETECT 0
128 
129 #define UIP_ARCH_IPCHKSUM 1
130 
131 #if MAC_CONF_WITH_TSCH
132 /* A bug in cooja causes many EBs to be missed at scan. Increase EB
133  frequency to shorten the join process */
134 #undef TSCH_CONF_EB_PERIOD
135 #define TSCH_CONF_EB_PERIOD (4 * CLOCK_SECOND)
136 #undef TSCH_CONF_MAX_EB_PERIOD
137 #define TSCH_CONF_MAX_EB_PERIOD (4 * CLOCK_SECOND)
138 #endif /* MAC_CONF_WITH_TSCH */
139 
140 #define CFS_CONF_OFFSET_TYPE long
141 
142 #define PLATFORM_CONF_SUPPORTS_STACK_CHECK 0
143 
144 /*---------------------------------------------------------------------------*/
145 /* Support for the new GPIO HAL */
146 #define GPIO_HAL_CONF_ARCH_HDR_PATH "dev/gpio-hal-arch.h"
147 #define GPIO_HAL_CONF_ARCH_SW_TOGGLE 1
148 #define GPIO_HAL_CONF_PORT_PIN_NUMBERING 0
149 #define GPIO_HAL_CONF_PIN_COUNT 4
150 
151 /* Virtual LED pins 0, 1, 2 (Green, Red, Yellow) */
152 #define COOJA_LED_GREEN_PIN 0
153 #define COOJA_LED_RED_PIN 1
154 #define COOJA_LED_YELLOW_PIN 2
155 
156 /* Virtual button on pin 3 */
157 #define COOJA_BTN_PIN 3
158 
159 #define BUTTON_HAL_CONF_DEBOUNCE_DURATION 0
160 /*---------------------------------------------------------------------------*/
161 /* Virtual LED colors */
162 #define LEDS_CONF_COUNT 3
163 #define LEDS_CONF_GREEEN 1
164 #define LEDS_CONF_RED 2
165 #define LEDS_CONF_YELLOW 4
166 /*---------------------------------------------------------------------------*/
167 #endif /* CONTIKI_CONF_H_ */