Contiki 2.5
contiki-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, STMicroelectronics.
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  * This file is part of the Contiki OS
31  *
32  * $Id: contiki-conf.h,v 1.2 2010/10/27 14:05:24 salvopitru Exp $
33  */
34 /*---------------------------------------------------------------------------*/
35 /**
36 * \file
37 * contiki-conf.h for MB851.
38 * \author
39 * Salvatore Pitrulli <salvopitru@users.sourceforge.net>
40 */
41 /*---------------------------------------------------------------------------*/
42 
43 
44 #ifndef __CONTIKI_CONF_H__
45 #define __CONTIKI_CONF_H__
46 
47 #include PLATFORM_HEADER
48 
49 #include <inttypes.h>
50 #include <string.h> // For memcpm().
51 
52 #define CC_CONF_REGISTER_ARGS 0
53 #define CC_CONF_FUNCTION_POINTER_ARGS 1
54 #define CC_CONF_FASTCALL
55 #define CC_CONF_VA_ARGS 1
56 #define CC_CONF_INLINE inline
57 
58 #define CCIF
59 #define CLIF
60 
61 typedef uint8_t u8_t;
62 typedef uint16_t u16_t;
63 typedef uint32_t u32_t;
64 typedef int32_t s32_t;
65 typedef unsigned short uip_stats_t;
66 
67 
68 //#define FIXED_NET_ADDRESS 1
69 //#define NET_ADDR_A 0x2001
70 //#define NET_ADDR_B 0xdb8
71 //#define NET_ADDR_C 0xbbbb
72 //#define NET_ADDR_D 0xabcd
73 
74 #define UART1_CONF_TX_WITH_INTERRUPT 0
75 #define WITH_SERIAL_LINE_INPUT 1
76 #define ENERGEST_CONF_ON 0
77 #define TELNETD_CONF_NUMLINES 6
78 
79 #define QUEUEBUF_CONF_NUM 2
80 
81 
82 #define NETSTACK_CONF_RADIO stm32w_radio_driver
83 
84 #if WITH_UIP6
85 
86 /* No radio cycling */
87 #define NETSTACK_CONF_NETWORK sicslowpan_driver
88 #define NETSTACK_CONF_MAC nullmac_driver
89 #define NETSTACK_CONF_RDC sicslowmac_driver
90 #define NETSTACK_CONF_FRAMER framer_802154
91 
92 #define RIMEADDR_CONF_SIZE 8
93 #define UIP_CONF_LL_802154 1
94 
95 #define UIP_CONF_ROUTER 1
96 #define UIP_CONF_IPV6_RPL 1
97 #define UIP_CONF_ND6_SEND_RA 0
98 //#define RPL_BORDER_ROUTER 0
99 
100 /* A trick to resolve a compilation error with IAR. */
101 #ifdef __ICCARM__
102 #define UIP_CONF_DS6_AADDR_NBU 1
103 #endif
104 
105 #define UIP_CONF_IPV6 1
106 #define UIP_CONF_IPV6_QUEUE_PKT 0 // This is a very costly feature as it increases the RAM usage by approximately UIP_ND6_MAX_NEIGHBORS * UIP_LINK_MTU bytes.
107 #define UIP_CONF_IPV6_CHECKS 1
108 #define UIP_CONF_IPV6_REASSEMBLY 0
109 #define UIP_CONF_ND6_MAX_PREFIXES 2
110 #define UIP_CONF_ND6_MAX_NEIGHBORS 2
111 #define UIP_CONF_ND6_MAX_DEFROUTERS 1
112 #define UIP_CONF_IP_FORWARD 0
113 #define UIP_CONF_BUFFER_SIZE 140
114 #define UIP_CONF_MAX_CONNECTIONS 6
115 #define UIP_CONF_MAX_LISTENPORTS 6
116 #define UIP_CONF_UDP_CONNS 3
117 
118 #define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
119 #define SICSLOWPAN_CONF_COMPRESSION_HC1 1
120 #define SICSLOWPAN_CONF_COMPRESSION_HC06 2
121 #define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_CONF_COMPRESSION_HC06
122 #define SICSLOWPAN_CONF_FRAG 1
123 #define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
124 #define SICSLOWPAN_CONF_MAXAGE 2
125 
126 #define UIP_CONF_ICMP6 0
127 #endif /* WITH_UIP6 */
128 
129 #define UIP_CONF_UDP 1
130 #define UIP_CONF_TCP 1
131 
132 #define IEEE802154_CONF_PANID 0x1234
133 #define STM32W_NODE_ID 0x5678 // to be deleted
134 #define RF_CHANNEL 16
135 #define RADIO_RXBUFS 2 // Set to a number greater than 1 to decrease packet loss probability at high rates (e.g, with fragmented packets)
136 #define UIP_CONF_LLH_LEN 0
137 
138 typedef unsigned long clock_time_t;
139 
140 #define CLOCK_CONF_SECOND 1000
141 
142 typedef unsigned long long rtimer_clock_t;
143 #define RTIMER_CLOCK_LT(a,b) ((signed short)((a)-(b)) < 0)
144 
145 /* LEDs ports MB851 */
146 #define LEDS_CONF_RED_PIN 5
147 #define LEDS_CONF_GREEN_PIN 6
148 #define LEDS_CONF_PORT PORTB
149 #define LEDS_CONF_RED (1<<LEDS_CONF_RED_PIN)
150 #define LEDS_CONF_GREEN (1<<LEDS_CONF_GREEN_PIN)
151 
152 
153 #define UIP_ARCH_ADD32 1
154 #define UIP_ARCH_CHKSUM 0
155 
156 #define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
157 
158 
159 #ifdef PROJECT_CONF_H
160 #include PROJECT_CONF_H
161 #endif /* PROJECT_CONF_H */
162 
163 
164 #endif /* __CONTIKI_CONF_H__ */