Contiki 2.6

contiki-conf.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2006, Technical University of Munich
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the Institute nor the names of its contributors
00014  *    may be used to endorse or promote products derived from this software
00015  *    without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  *
00029  * This file is part of the Contiki operating system.
00030  *
00031  * @(#)$$
00032  */
00033 
00034 /**
00035  * \file
00036  *         Configuration for AVR Zigbit Contiki kernel
00037  *
00038  * \author
00039  *         Simon Barner <barner@in.tum.de>
00040  */
00041 
00042 #ifndef __CONTIKI_CONF_H__
00043 #define __CONTIKI_CONF_H__
00044 
00045 /* Platform name, type, and MCU clock rate */
00046 #define PLATFORM_NAME  "Zigbit"
00047 #define PLATFORM_TYPE  ZIGBIT
00048 #ifndef F_CPU
00049 #define F_CPU          8000000UL
00050 #endif
00051 
00052 #include <stdint.h>
00053 
00054 /* The AVR tick interrupt usually is done with an 8 bit counter around 128 Hz.
00055  * 125 Hz needs slightly more overhead during the interrupt, as does a 32 bit
00056  * clock_time_t.
00057  */
00058 /* Clock ticks per second */
00059 #define CLOCK_CONF_SECOND 125
00060 #if 1
00061 /* 16 bit counter overflows every ~10 minutes */
00062 typedef unsigned short clock_time_t;
00063 #define CLOCK_LT(a,b)  ((signed short)((a)-(b)) < 0)
00064 #define INFINITE_TIME 0xffff
00065 #define RIME_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
00066 #define COLLECT_CONF_BROADCAST_ANNOUNCEMENT_MAX_TIME INFINITE_TIME/CLOCK_CONF_SECOND /* Default uses 600 */
00067 #else
00068 typedef unsigned long clock_time_t;
00069 #define CLOCK_LT(a,b)  ((signed long)((a)-(b)) < 0)
00070 #define INFINITE_TIME 0xffffffff
00071 #endif
00072 /* These routines are not part of the contiki core but can be enabled in cpu/avr/clock.c */
00073 void clock_delay_msec(uint16_t howlong);
00074 void clock_adjust_ticks(clock_time_t howmany);
00075 
00076 /* COM port to be used for SLIP connection */
00077 #define SLIP_PORT RS232_PORT_0
00078 
00079 /* Pre-allocated memory for loadable modules heap space (in bytes)*/
00080 #define MMEM_CONF_SIZE 256
00081 
00082 /* Use the following address for code received via the codeprop
00083  * facility
00084  */
00085 #define EEPROMFS_ADDR_CODEPROP 0x8000
00086 
00087 #define CCIF
00088 #define CLIF
00089 
00090 #define RIMEADDR_CONF_SIZE       8
00091 #define PACKETBUF_CONF_HDR_SIZE    0
00092 
00093 //define UIP_CONF_IPV6            1 //Let the makefile do this, allows hello-world to compile
00094 #if UIP_CONF_IPV6
00095 #define UIP_CONF_ICMP6           1
00096 #define UIP_CONF_UDP             1
00097 #define UIP_CONF_TCP             1
00098 #endif
00099 
00100 /* The new NETSTACK interface requires RF230BB */
00101 #if RF230BB
00102 #define SICSLOWPAN_CONF_COMPRESSION       SICSLOWPAN_COMPRESSION_HC06
00103 #define SICSLOWPAN_CONF_CONVENTIONAL_MAC  1     //for barebones driver, sicslowpan calls radio->read function
00104 #undef PACKETBUF_CONF_HDR_SIZE                  //RF230BB takes the packetbuf default for header size
00105 #define UIP_CONF_LLH_LEN         0
00106 
00107 /* No radio cycling */
00108 #if UIP_CONF_IPV6
00109 #define NETSTACK_CONF_NETWORK     sicslowpan_driver
00110 #else
00111 #define NETSTACK_CONF_NETWORK     rime_driver
00112 #endif
00113 #define NETSTACK_CONF_MAC         nullmac_driver
00114 #define NETSTACK_CONF_RDC         sicslowmac_driver
00115 #define NETSTACK_CONF_FRAMER      framer_802154
00116 #define NETSTACK_CONF_RADIO       rf230_driver
00117 #define CHANNEL_802_15_4          26
00118 #define RF230_CONF_AUTOACK        1
00119 #define RF230_CONF_AUTORETRIES    2
00120 #define SICSLOWPAN_CONF_FRAG      1
00121 //Most browsers reissue GETs after 3 seconds which stops frag reassembly, longer MAXAGE does no good
00122 #define SICSLOWPAN_CONF_MAXAGE    3
00123 #define QUEUEBUF_CONF_NUM         1
00124 #define QUEUEBUF_CONF_REF_NUM     1
00125 /* Default uip_aligned_buf and sicslowpan_aligned_buf sizes of 1280 overflows RAM */
00126 #define UIP_CONF_BUFFER_SIZE    240
00127 
00128 #else
00129 /* Original combined RF230/mac code will not compile with current contiki stack */
00130 //#define PACKETBUF_CONF_HDR_SIZE    0            //RF230 handles headers internally
00131 /* 0 for IPv6, or 1 for HC1, 2 for HC01 */
00132 #define SICSLOWPAN_CONF_COMPRESSION_IPV6 0 
00133 #define SICSLOWPAN_CONF_COMPRESSION_HC1  1 
00134 #define SICSLOWPAN_CONF_COMPRESSION_HC01 2       //NB '2' is now HC06 in the core mac!
00135 //FTH081105
00136 #define SICSLOWPAN_CONF_COMPRESSION       SICSLOWPAN_CONF_COMPRESSION_HC01 
00137 #define SICSLOWPAN_CONF_MAXAGE 5
00138 #define UIP_CONF_LLH_LEN         14
00139 #endif /*RF230BB */
00140 
00141 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
00142 #define SICSLOWPAN_CONF_FRAG              1 
00143 
00144 #define UIP_CONF_LL_802154       1 
00145 
00146 #define UIP_CONF_MAX_CONNECTIONS 2
00147 #define UIP_CONF_MAX_LISTENPORTS 2
00148 #define UIP_CONF_UDP_CONNS       2
00149 
00150 #define UIP_CONF_IP_FORWARD      0
00151 #define UIP_CONF_FWCACHE_SIZE    0
00152 
00153 #define UIP_CONF_IPV6_CHECKS     1
00154 #define UIP_CONF_IPV6_QUEUE_PKT  0 
00155 #define UIP_CONF_IPV6_REASSEMBLY 0
00156 #define UIP_CONF_NETIF_MAX_ADDRESSES  3
00157 #define UIP_CONF_ND6_MAX_PREFIXES     3
00158 #define UIP_CONF_ND6_MAX_NEIGHBORS    4  
00159 #define UIP_CONF_ND6_MAX_DEFROUTERS   2
00160 #define UIP_CONF_UDP_CHECKSUMS   1
00161 #define UIP_CONF_TCP_SPLIT       1
00162 
00163 
00164 /* These names are deprecated, use C99 names. */
00165 /*
00166 typedef unsigned char u8_t;
00167 typedef unsigned short u16_t;
00168 typedef unsigned long u32_t;
00169 typedef int32_t s32_t;
00170 */
00171 typedef unsigned short uip_stats_t;
00172 typedef unsigned long off_t;
00173 
00174 
00175 #endif /* __CONTIKI_CONF_H__ */