Contiki 3.x
contiki-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Eistec AB.
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 contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * This file is part of the Mulle platform port of the Contiki operating system.
30  *
31  */
32 
33 /**
34  * \file
35  * Contiki platform configuration file for the Mulle platform.
36  * \author
37  * Joakim Gebart <joakim.gebart@eistec.se>
38  *
39  * \note These settings can be overridden by each project's project-conf.h
40  * (Set PROJECT_CONF_H in the project's Makefile)
41  */
42 #ifndef __CONTIKI_CONF_H__
43 #define __CONTIKI_CONF_H__
44 
45 #include <stdint.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #define CCIF
52 #define CLIF
53 
54 typedef uint8_t u8_t;
55 typedef uint16_t u16_t;
56 typedef uint32_t u32_t;
57 typedef int32_t s32_t;
58 
59 typedef uint32_t clock_time_t;
60 typedef uint16_t uip_stats_t;
61 
62 #define CLOCK_CONF_SECOND 64
63 
64 typedef uint64_t rtimer_clock_t;
65 #define RTIMER_CLOCK_LT(a, b) ((int64_t)((a) - (b)) < 0)
66 
67 #define CFS_CONF_OFFSET_TYPE long
68 
69 #ifdef PROJECT_CONF_H
70 #include PROJECT_CONF_H
71 #endif /* PROJECT_CONF_H */
72 
73 /* Tell example applications that there are leds on board that can be controlled from software. */
74 #define PLATFORM_HAS_LEDS 1
75 /* Radio RSSI sensor using values from rf230 driver */
76 #define PLATFORM_HAS_RADIO 1
77 /* Battery voltage sensor using Mulle voltage API */
78 #define PLATFORM_HAS_BATTERY 1
79 
80 /* Compatibility define for working with ugly msp430 specific parameter in UART API */
81 #define BAUD2UBR(b) b
82 
83 #define LEDS_CONF_RED (1 << 15)
84 #define LEDS_CONF_GREEN (1 << 13)
85 #define LEDS_CONF_YELLOW (1 << 14)
86 
87 /* Select UART modules to be claimed by the UART driver (dev/uart.c) below: */
88 #define UART0_CONF_ENABLE 0
89 #define UART1_CONF_ENABLE 1
90 #define UART2_CONF_ENABLE 0
91 #define UART3_CONF_ENABLE 0
92 #define UART4_CONF_ENABLE 0
93 #define UART5_CONF_ENABLE 0
94 
95 /* TX buffer size for UART1 (must be a power of two <= 128) */
96 /* Try keeping this large (>= 64) to allow faster transfers for SLIP etc. */
97 #ifndef UART1_CONF_TXBUFSIZE
98 #define UART1_CONF_TXBUFSIZE 128
99 #endif
100 
101 /* TX buffer size for not otherwise specified UART modules (must be a power of two <= 128) */
102 /* Keep this low to reduce memory consumption as one buffer per UART, even
103  * unused ones, are statically allocated. */
104 #ifndef UART_CONF_DEFAULT_TXBUFSIZE
105 #define UART_CONF_DEFAULT_TXBUFSIZE 8
106 #endif
107 
108 #if WITH_UIP6
109 #ifndef NETSTACK_CONF_NETWORK
110 #define NETSTACK_CONF_NETWORK sicslowpan_driver
111 #endif /* NETSTACK_CONF_NETWORK */
112 #ifndef NETSTACK_CONF_MAC
113 #define NETSTACK_CONF_MAC csma_driver
114 #endif /* NETSTACK_CONF_MAC */
115 #ifndef NETSTACK_CONF_RDC
116 #define NETSTACK_CONF_RDC nullrdc_driver
117 #endif /* NETSTACK_CONF_RDC */
118 #ifndef NETSTACK_CONF_FRAMER
119 #define NETSTACK_CONF_FRAMER framer_802154
120 #endif /* NETSTACK_CONF_FRAMER */
121 #ifndef NETSTACK_CONF_RADIO
122 #define NETSTACK_CONF_RADIO rf230_driver
123 #endif /* NETSTACK_CONF_RADIO */
124 
125 #define SICSLOWPAN_CONF_MAXAGE 1
126 #define RF230_CONF_RX_BUFFERS 10
127 #define RF230_CONF_AUTOACK 0
128 #define RF230_CONF_AUTORETRIES 3
129 #define LINKADDR_CONF_SIZE 8
130 
131 #ifndef UIP_CONF_BUFFER_SIZE
132 #define UIP_CONF_BUFFER_SIZE 1514
133 #endif /* UIP_CONF_BUFFER_SIZE */
134 
135 #ifndef QUEUEBUF_CONF_NUM
136 #define QUEUEBUF_CONF_NUM 16
137 #endif /* QUEUEBUF_CONF_NUM */
138 
139 #ifndef UIP_CONF_ROUTER
140 #define UIP_CONF_ROUTER 1
141 #endif /* UIP_CONF_ROUTER */
142 
143 #ifndef UIP_CONF_IPV6_RPL
144 #define UIP_CONF_IPV6_RPL 1
145 #endif /* UIP_CONF_IPV6_RPL */
146 
147 #define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
148 #define SICSLOWPAN_CONF_COMPRESSION_HC1 1
149 #define SICSLOWPAN_CONF_COMPRESSION_HC01 2
150 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_CONF_COMPRESSION_HC01
151 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 0
152 #define SICSLOWPAN_CONF_FRAG 1
153 
154 #define UIP_CONF_UDP 1
155 #define UIP_CONF_UDP_CHECKSUMS 1
156 
157 /* configure number of neighbors and routes */
158 #define UIP_CONF_DS6_NBR_NBU 15
159 #define UIP_CONF_DS6_ROUTE_NBU 15
160 #define NEIGHBOR_CONF_MAX_NEIGHBORS 15
161 
162 #ifndef UIP_CONF_ND6_SEND_RA
163 #define UIP_CONF_ND6_SEND_RA 0
164 #endif
165 #ifndef UIP_CONF_ND6_REACHABLE_TIME
166 /* RFC 4861 default value (REACHABLE_TIME): 30000 ms */
167 #define UIP_CONF_ND6_REACHABLE_TIME 600000
168 #endif
169 #ifndef UIP_CONF_ND6_RETRANS_TIMER
170 /* RFC 4861 default value (RETRANS_TIMER): 1000 ms */
171 #define UIP_CONF_ND6_RETRANS_TIMER 10000
172 #endif
173 
174 #define UIP_CONF_IPV6 1
175 #define UIP_CONF_IPV6_QUEUE_PKT 1
176 #define UIP_CONF_IPV6_CHECKS 1
177 #define UIP_CONF_IPV6_REASSEMBLY 0
178 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
179 #define UIP_CONF_ND6_MAX_PREFIXES 3
180 #define UIP_CONF_ND6_MAX_NEIGHBORS 5
181 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
182 #define UIP_CONF_IP_FORWARD 0
183 
184 #define UIP_CONF_ICMP_DEST_UNREACH 1
185 #define UIP_CONF_DHCP_LIGHT
186 #define UIP_CONF_LL_802154 1
187 
188 #ifndef UIP_CONF_LLH_LEN
189 #define UIP_CONF_LLH_LEN 0
190 #endif /* UIP_CONF_LLH_LEN */
191 
192 #ifndef UIP_CONF_RECEIVE_WINDOW
193 #define UIP_CONF_RECEIVE_WINDOW 60
194 #endif /* UIP_CONF_RECEIVE_WINDOW */
195 
196 #define UIP_CONF_TCP_MSS 48
197 #define UIP_CONF_MAX_CONNECTIONS 4
198 #define UIP_CONF_MAX_LISTENPORTS 8
199 #define UIP_CONF_UDP_CONNS 15
200 #define UIP_CONF_FWCACHE_SIZE 15
201 #define UIP_CONF_BROADCAST 1
202 #define UIP_CONF_UDP 1
203 #define UIP_CONF_UDP_CHECKSUMS 1
204 #define UIP_CONF_PINGADDRCONF 0
205 #define UIP_CONF_LOGGING 0
206 
207 #define UIP_CONF_TCP_SPLIT 1
208 #ifndef UIP_CONF_TCP
209 #define UIP_CONF_TCP 0
210 #endif
211 
212 #endif /* WITH_UIP6 */
213 
214 #define PACKETBUF_CONF_ATTRS_INLINE 1
215 
216 #ifndef RF_CHANNEL
217 #define RF_CHANNEL 0
218 #endif /* RF_CHANNEL */
219 
220 #ifndef IEEE802154_CONF_PANID
221 #define IEEE802154_CONF_PANID 0x777
222 #endif /* IEEE802154_CONF_PANID */
223 
224 #ifndef COAP_MAX_OPEN_TRANSACTIONS
225 /* Multiplies with chunk size, be aware of memory constraints. */
226 #define COAP_MAX_OPEN_TRANSACTIONS 11
227 #endif /* COAP_MAX_OPEN_TRANSACTIONS */
228 
229 /* Must be <= open transaction number. */
230 #define COAP_MAX_OBSERVERS (COAP_MAX_OPEN_TRANSACTIONS - 1)
231 
232 /* Tell Contiki that we are not using PETSCII (retarded default) */
233 #define WITH_ASCII 1
234 
235 #ifdef __cplusplus
236 }
237 #endif
238 
239 #endif /* __CONTIKI_CONF_H__ */