Add experimental RPL code
[contiki-2.x.git] / platform / avr-ravenusb / contiki-conf.h
blobbe795be396dd8933480ddfc2f9b282c4269f815c
1 /*
2 * Copyright (c) 2006, Technical University of Munich
3 * All rights reserved.
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 Institute 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.
17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18 * 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 INSTITUTE OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
29 * This file is part of the Contiki operating system.
31 * @(#)$$
34 /**
35 * \file
36 * Configuration for RZRAVEN USB stick "jackdaw"
38 * \author
39 * Simon Barner <barner@in.tum.de>
40 * David Kopf <dak664@embarqmail.com>
43 #ifndef __CONTIKI_CONF_H__
44 #define __CONTIKI_CONF_H__
46 /* MCU and clock rate */
47 #define MCU_MHZ 8
48 #define PLATFORM PLATFORM_AVR
49 #define RAVEN_REVISION RAVENUSB_C
51 /* Clock ticks per second */
52 #define CLOCK_CONF_SECOND 125
54 /* Since clock_time_t is 16 bits, maximum interval is 524 seconds */
55 #define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME CLOCK_CONF_SECOND * 524UL /*Default uses 600*/
57 /* Maximum time interval (used for timers) */
58 #define INFINITE_TIME 0xffff
60 /* COM port to be used for SLIP connection */
61 #define SLIP_PORT RS232_PORT_0
63 /* Pre-allocated memory for loadable modules heap space (in bytes)*/
64 #define MMEM_CONF_SIZE 256
66 /* Use the following address for code received via the codeprop
67 * facility
69 #define EEPROMFS_ADDR_CODEPROP 0x8000
71 /* Use Atmel 'Route Under MAC', currently just in sniffer mode! */
72 //#define UIP_CONF_USE_RUM 1
74 #define CCIF
75 #define CLIF
77 #define RIMEADDR_CONF_SIZE 8
79 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
80 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
82 #define UIP_CONF_LL_802154 1
83 #define UIP_CONF_LLH_LEN 14
85 #define UIP_CONF_MAX_CONNECTIONS 4
86 #define UIP_CONF_MAX_LISTENPORTS 4
88 #define UIP_CONF_IP_FORWARD 0
89 #define UIP_CONF_FWCACHE_SIZE 0
91 #define UIP_CONF_IPV6 1
92 #define UIP_CONF_IPV6_CHECKS 1
93 #define UIP_CONF_IPV6_QUEUE_PKT 0
94 #define UIP_CONF_IPV6_REASSEMBLY 0
95 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
96 #define UIP_CONF_ND6_MAX_PREFIXES 3
97 #define UIP_CONF_ND6_MAX_NEIGHBORS 4
98 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
100 #define UIP_CONF_UDP 1
101 #define UIP_CONF_UDP_CHECKSUMS 1
103 #define UIP_CONF_TCP 1
104 #define UIP_CONF_TCP_SPLIT 1
106 #define UIP_CONF_STATISTICS 1
107 /* Disable mass storage enumeration for more debug string space */
108 #define USB_CONF_STORAGE 1
109 /* Use either USB CDC or RS232 for stdout (or neither) */
110 #define USB_CONF_CDC 1
111 //#define USB_CONF_RS232 1
113 #ifdef RF230BB
114 #define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1 //for barebones driver, sicslowpan calls radio->read function
116 #if 1 /* Network setup */
117 /* No radio cycling */
118 #define NETSTACK_CONF_NETWORK sicslowpan_driver
119 #define NETSTACK_CONF_MAC nullmac_driver
120 #define NETSTACK_CONF_RDC sicslowmac_driver
121 #define NETSTACK_CONF_FRAMER framer_802154
122 #define NETSTACK_CONF_RADIO rf230_driver
123 #define RF230_CONF_AUTOACK 1
124 #define RF230_CONF_AUTORETRIES 2
125 #define QUEUEBUF_CONF_NUM 1
126 #define QUEUEBUF_CONF_REF_NUM 1
127 #define SICSLOWPAN_CONF_FRAG 1
128 #define SICSLOWPAN_CONF_MAXAGE 5
130 #elif 0
131 /* Contiki-mac radio cycling */
132 #define NETSTACK_CONF_NETWORK sicslowpan_driver
133 #define NETSTACK_CONF_MAC nullmac_driver
134 #define NETSTACK_CONF_RDC contikimac_driver
135 #define NETSTACK_CONF_FRAMER framer_802154
136 #define NETSTACK_CONF_RADIO rf230_driver
137 #define RF230_CONF_AUTOACK 0
138 #define RF230_CONF_AUTORETRIES 0
140 #elif 1
141 /* cx-mac radio cycling */
142 #define NETSTACK_CONF_NETWORK sicslowpan_driver
143 #define NETSTACK_CONF_MAC nullmac_driver
144 #define NETSTACK_CONF_RDC cxmac_driver
145 #define NETSTACK_CONF_FRAMER framer_802154
146 #define NETSTACK_CONF_RADIO rf230_driver
147 #define RF230_CONF_AUTOACK 0
148 #define RF230_CONF_AUTORETRIES 0
149 #define MAC_CONF_CHANNEL_CHECK_RATE 8
150 #define SICSLOWPAN_CONF_FRAG 1
151 #define QUEUEBUF_CONF_NUM 3
152 #define QUEUEBUF_CONF_REF_NUM 1
153 #define SICSLOWPAN_CONF_MAXAGE 5
154 //following gives 50% duty cycle, undef for default 5%
155 #define CXMAC_CONF_ON_TIME (RTIMER_ARCH_SECOND / 16)
157 #else
158 #error Network configuration not specified!
159 #endif /* Network setup */
161 #if 0 /* RPL */
162 /* Not completely working yet. Link local pings work but address prefixes do not get assigned */
163 /* Since the jackdaw has no uip stack additional modules must be included, uncomment the line in /plaftorm/avr-ravenusb/Makefile.avr-ravenusb */
165 //#define UIP_CONF_ROUTER 1
166 #define UIP_CONF_IPV6_RPL 1
167 #undef UIP_CONF_TCP
168 #define UIP_CONF_TCP 0
169 //#undef UIP_FALLBACK_INTERFACE
170 //#define UIP_FALLBACK_INTERFACE rpl_interface
172 #if 0 //too much RAM!
173 /* Handle 10 neighbors */
174 #define UIP_CONF_DS6_NBR_NBU 10
175 /* Handle 10 routes */
176 #define UIP_CONF_DS6_ROUTE_NBU 10
178 #define UIP_CONF_ND6_SEND_RA 0
179 #define UIP_CONF_ND6_REACHABLE_TIME 600000
180 #define UIP_CONF_ND6_RETRANS_TIMER 10000
181 #undef UIP_CONF_IPV6_QUEUE_PKT
182 #define UIP_CONF_IPV6_QUEUE_PKT 1
183 //#define UIP_CONF_IPV6_CHECKS 1
184 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
185 #define UIP_CONF_ND6_MAX_PREFIXES 3
186 #define UIP_CONF_ND6_MAX_NEIGHBORS 4
187 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
188 #define UIP_CONF_IP_FORWARD 0
189 #define UIP_CONF_BUFFER_SIZE 240
190 #define UIP_CONF_ICMP_DEST_UNREACH 1
191 #define UIP_CONF_DHCP_LIGHT
193 #undef UIP_CONF_LLH_LEN
194 #define UIP_CONF_LLH_LEN 0
195 //#define UIP_CONF_RECEIVE_WINDOW 48
196 //#define UIP_CONF_TCP_MSS 48
197 #undef UIP_CONF_UDP_CONNS
198 #define UIP_CONF_UDP_CONNS 12
199 #undef UIP_CONF_FWCACHE_SIZE
200 #define UIP_CONF_FWCACHE_SIZE 30
201 #define UIP_CONF_BROADCAST 1
202 #define UIP_ARCH_IPCHKSUM 1
203 #define UIP_CONF_PINGADDRCONF 0
204 #define UIP_CONF_LOGGING 0
205 #endif
206 #endif /* RPL */
209 #endif /* RF230BB */
211 /* Route-Under-MAC uses 16-bit short addresses */
212 #if UIP_CONF_USE_RUM
213 #undef UIP_CONF_LL_802154
214 #define UIP_DATA_RUM_OFFSET 5
215 #endif
217 #include <stdint.h>
219 typedef int32_t s32_t;
220 typedef unsigned short clock_time_t;
221 typedef unsigned char u8_t;
222 typedef unsigned short u16_t;
223 typedef unsigned long u32_t;
224 typedef unsigned short uip_stats_t;
225 typedef unsigned long off_t;
227 void clock_delay(unsigned int us2);
228 void clock_wait(int ms10);
229 void clock_set_seconds(unsigned long s);
230 unsigned long clock_seconds(void);
232 #endif /* __CONTIKI_CONF_H__ */