Contiki 3.x
contiki-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006, Technical University of Munich
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 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.
16  *
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.
28  *
29  * This file is part of the Contiki operating system.
30  *
31  * @(#)$$
32  */
33 
34 /**
35  * \file
36  * Configuration for AVR Zigbit Contiki kernel
37  *
38  * \author
39  * Simon Barner <barner@in.tum.de>
40  */
41 
42 #ifndef CONTIKI_CONF_H_
43 #define CONTIKI_CONF_H_
44 
45 /* Platform name, type, and MCU clock rate */
46 #define PLATFORM_NAME "Zigbit"
47 #define PLATFORM_TYPE ZIGBIT
48 #ifndef F_CPU
49 #define F_CPU 8000000UL
50 #endif
51 
52 #include <stdint.h>
53 #include <avr/eeprom.h>
54 
55 /* Skip the last four bytes of the EEPROM, to leave room for things
56  * like the avrdude erase count and bootloader signaling. */
57 #define EEPROM_CONF_SIZE ((E2END + 1) - 4)
58 
59 /* The AVR tick interrupt usually is done with an 8 bit counter around 128 Hz.
60  * 125 Hz needs slightly more overhead during the interrupt, as does a 32 bit
61  * clock_time_t.
62  */
63 /* Clock ticks per second */
64 #define CLOCK_CONF_SECOND 125
65 #if 1
66 /* 16 bit counter overflows every ~10 minutes */
67 typedef unsigned short clock_time_t;
68 #define CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
69 #define INFINITE_TIME 0xffff
70 #define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
71 #define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
72 #else
73 typedef unsigned long clock_time_t;
74 #define CLOCK_LT(a,b) ((signed long)((a)-(b)) < 0)
75 #define INFINITE_TIME 0xffffffff
76 #endif
77 /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
78 void clock_delay_msec(uint16_t howlong);
79 void clock_adjust_ticks(clock_time_t howmany);
80 
81 /* COM port to be used for SLIP connection */
82 #define SLIP_PORT RS232_PORT_0
83 
84 /* Pre-allocated memory for loadable modules heap space (in bytes)*/
85 #define MMEM_CONF_SIZE 256
86 
87 /* Use the following address for code received via the codeprop
88  * facility
89  */
90 #define EEPROMFS_ADDR_CODEPROP 0x8000
91 
92 #define CCIF
93 #define CLIF
94 #ifndef CC_CONF_INLINE
95 #define CC_CONF_INLINE inline
96 #endif
97 
98 #define LINKADDR_CONF_SIZE 8
99 #define PACKETBUF_CONF_HDR_SIZE 0
100 
101 //define UIP_CONF_IPV6 1 //Let the makefile do this, allows hello-world to compile
102 #if UIP_CONF_IPV6
103 #define UIP_CONF_ICMP6 1
104 #define UIP_CONF_UDP 1
105 #define UIP_CONF_TCP 1
106 #endif
107 
108 /* The new NETSTACK interface requires RF230BB */
109 #if RF230BB
110 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
111 #define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1 //for barebones driver, sicslowpan calls radio->read function
112 #undef PACKETBUF_CONF_HDR_SIZE //RF230BB takes the packetbuf default for header size
113 #define UIP_CONF_LLH_LEN 0
114 
115 /* No radio cycling */
116 #if UIP_CONF_IPV6
117 #define NETSTACK_CONF_NETWORK sicslowpan_driver
118 #else
119 #define NETSTACK_CONF_NETWORK rime_driver
120 #endif
121 #define NETSTACK_CONF_MAC nullmac_driver
122 #define NETSTACK_CONF_RDC sicslowmac_driver
123 #define NETSTACK_CONF_FRAMER framer_802154
124 #define NETSTACK_CONF_RADIO rf230_driver
125 #define CHANNEL_802_15_4 26
126 #define RF230_CONF_AUTOACK 1
127 #define RF230_CONF_FRAME_RETRIES 2
128 #define SICSLOWPAN_CONF_FRAG 1
129 //Most browsers reissue GETs after 3 seconds which stops frag reassembly, longer MAXAGE does no good
130 #define SICSLOWPAN_CONF_MAXAGE 3
131 #define QUEUEBUF_CONF_NUM 1
132 #define QUEUEBUF_CONF_REF_NUM 1
133 /* Default uip_aligned_buf and sicslowpan_aligned_buf sizes of 1280 overflows RAM */
134 #define UIP_CONF_BUFFER_SIZE 240
135 
136 #else
137 /* Original combined RF230/mac code will not compile with current contiki stack */
138 //#define PACKETBUF_CONF_HDR_SIZE 0 //RF230 handles headers internally
139 /* 0 for IPv6, or 1 for HC1, 2 for HC01 */
140 #define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
141 #define SICSLOWPAN_CONF_COMPRESSION_HC1 1
142 #define SICSLOWPAN_CONF_COMPRESSION_HC01 2 //NB '2' is now HC06 in the core mac!
143 //FTH081105
144 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_CONF_COMPRESSION_HC01
145 #define SICSLOWPAN_CONF_MAXAGE 5
146 #define UIP_CONF_LLH_LEN 14
147 #endif /*RF230BB */
148 
149 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
150 #define SICSLOWPAN_CONF_FRAG 1
151 
152 #define UIP_CONF_LL_802154 1
153 
154 #define UIP_CONF_MAX_CONNECTIONS 2
155 #define UIP_CONF_MAX_LISTENPORTS 2
156 #define UIP_CONF_UDP_CONNS 2
157 
158 #define UIP_CONF_IP_FORWARD 0
159 #define UIP_CONF_FWCACHE_SIZE 0
160 
161 #define UIP_CONF_IPV6_CHECKS 1
162 #define UIP_CONF_IPV6_QUEUE_PKT 0
163 #define UIP_CONF_IPV6_REASSEMBLY 0
164 #define UIP_CONF_NETIF_MAX_ADDRESSES 3
165 #define UIP_CONF_ND6_MAX_PREFIXES 3
166 #define UIP_CONF_ND6_MAX_DEFROUTERS 2
167 #define UIP_CONF_UDP_CHECKSUMS 1
168 #define UIP_CONF_TCP_SPLIT 1
169 
170 
171 /* These names are deprecated, use C99 names. */
172 /*
173 typedef unsigned char u8_t;
174 typedef unsigned short u16_t;
175 typedef unsigned long u32_t;
176 typedef int32_t s32_t;
177 */
178 typedef unsigned short uip_stats_t;
179 typedef unsigned long off_t;
180 
181 
182 #endif /* CONTIKI_CONF_H_ */
void clock_delay_msec(uint16_t howlong)
Delay up to 65535 milliseconds.
Definition: clock.c:260
void clock_adjust_ticks(clock_time_t howmany)
Adjust the system current clock time.
Definition: clock.c:289