Contiki-NG
contiki-conf.h
1/*
2 * Copyright (c) 2006, Swedish Institute of Computer Science.
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 *
31 */
32
33#ifndef CONTIKI_CONF_H_
34#define CONTIKI_CONF_H_
35
36/* include the project config */
37#ifdef PROJECT_CONF_PATH
38#include PROJECT_CONF_PATH
39#endif /* PROJECT_CONF_PATH */
40
41#ifdef INCLUDE_SUBPLATFORM_CONF
42#include "subplatform-conf.h"
43#endif /* INCLUDE_SUBPLATFORM_CONF */
44
45#define PLATFORM_CONF_PROVIDES_MAIN_LOOP 1
46
47#define LOG_CONF_ENABLED 1
48
49#define COOJA 1
50
51#define ASSERT_CONF_RETURNS 1
52
53#ifndef EEPROM_CONF_SIZE
54#define EEPROM_CONF_SIZE 1024
55#endif
56
57#define w_memcpy memcpy
58
59#ifdef NETSTACK_CONF_H
60
61/* These header overrides the below default configuration */
62#define NETSTACK__QUOTEME(s) NETSTACK_QUOTEME(s)
63#define NETSTACK_QUOTEME(s) #s
64#include NETSTACK__QUOTEME(NETSTACK_CONF_H)
65
66#else /* NETSTACK_CONF_H */
67
68/* Default network config */
69#define CSMA_CONF_SEND_SOFT_ACK 1
70#define CSMA_CONF_ACK_WAIT_TIME RTIMER_SECOND / 500
71#define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME 0
72
73#endif /* NETSTACK_CONF_H */
74
75/* Radio setup */
76#define NETSTACK_CONF_RADIO cooja_radio_driver
77
78/* Default network config */
79#if NETSTACK_CONF_WITH_IPV6
80
81
82/* configure network size and density */
83#ifndef NETSTACK_MAX_ROUTE_ENTRIES
84#define NETSTACK_MAX_ROUTE_ENTRIES 300
85#endif /* NETSTACK_MAX_ROUTE_ENTRIES */
86#ifndef NBR_TABLE_CONF_MAX_NEIGHBORS
87#define NBR_TABLE_CONF_MAX_NEIGHBORS 300
88#endif /* NBR_TABLE_CONF_MAX_NEIGHBORS */
89
90/* configure queues */
91#ifndef QUEUEBUF_CONF_NUM
92#define QUEUEBUF_CONF_NUM 64
93#endif /* QUEUEBUF_CONF_NUM */
94
95#ifndef UIP_CONF_IPV6_QUEUE_PKT
96#define UIP_CONF_IPV6_QUEUE_PKT 1
97#endif /* UIP_CONF_IPV6_QUEUE_PKT */
98
99#endif /* NETSTACK_CONF_WITH_IPV6 */
100
101#define CC_CONF_VA_ARGS 1
102#define CC_CONF_INLINE inline
103
104/* These names are deprecated, use C99 names. */
105#include <inttypes.h>
106typedef uint8_t u8_t;
107typedef uint16_t u16_t;
108typedef uint32_t u32_t;
109typedef int32_t s32_t;
110
111typedef unsigned short uip_stats_t;
112
113#define CLOCK_CONF_SECOND 1000L
114typedef unsigned long clock_time_t;
115
116/* Use 64-bit rtimer (default in Contiki-NG is 32) */
117#define RTIMER_CONF_CLOCK_SIZE 8
118
119/* 1 len byte, 2 bytes CRC */
120#define RADIO_PHY_OVERHEAD 3
121/* 250kbps data rate. One byte = 32us */
122#define RADIO_BYTE_AIR_TIME 32
123#define RADIO_DELAY_BEFORE_TX 0
124#define RADIO_DELAY_BEFORE_RX 0
125#define RADIO_DELAY_BEFORE_DETECT 0
126
127#define UIP_ARCH_IPCHKSUM 1
128
129#define CFS_CONF_OFFSET_TYPE long
130
131#define PLATFORM_CONF_SUPPORTS_STACK_CHECK 0
132
133/*---------------------------------------------------------------------------*/
134/* Support for the new GPIO HAL */
135#define GPIO_HAL_CONF_ARCH_HDR_PATH "dev/gpio-hal-arch.h"
136#define GPIO_HAL_CONF_ARCH_SW_TOGGLE 1
137#define GPIO_HAL_CONF_PORT_PIN_NUMBERING 0
138#define GPIO_HAL_CONF_PIN_COUNT 4
139
140/* Virtual LED pins 0, 1, 2 (Green, Red, Yellow) */
141#define COOJA_LED_GREEN_PIN 0
142#define COOJA_LED_RED_PIN 1
143#define COOJA_LED_YELLOW_PIN 2
144
145/* Virtual button on pin 3 */
146#define COOJA_BTN_PIN 3
147
148#define BUTTON_HAL_CONF_DEBOUNCE_DURATION 0
149
150/* Notify various examples that we have Buttons and LEDs */
151#define PLATFORM_HAS_BUTTON 1
152#define PLATFORM_SUPPORTS_BUTTON_HAL 1
153#define PLATFORM_HAS_LEDS 1
154/*---------------------------------------------------------------------------*/
155/* Virtual LED colors */
156#define LEDS_CONF_COUNT 3
157#define LEDS_CONF_GREEN 1
158#define LEDS_CONF_RED 2
159#define LEDS_CONF_YELLOW 4
160/*---------------------------------------------------------------------------*/
161#endif /* CONTIKI_CONF_H_ */