Contiki-NG
Loading...
Searching...
No Matches
contiki-conf.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, Zolertia - http://www.zolertia.com
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 *
14 * 3. Neither the name of the copyright holder nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 * OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31/**
32 * \addtogroup zoul-core
33 * @{
34 *
35 * \defgroup zoul-platforms Zolertia Zoul platforms
36 *
37 * The Zoul allows a fast reuse and easy integration to most applications and
38 * products. Its small size and module format eases to place in different PCB
39 * designs and to integrate in existing products. The Zoul-based platforms
40 * share most of the Zoul core implementation.
41 *
42 * \file
43 * Configuration for the Zoul-based platforms
44 */
45#ifndef CONTIKI_CONF_H_
46#define CONTIKI_CONF_H_
47
48#include <stdint.h>
49#include <string.h>
50#include <inttypes.h>
51/*---------------------------------------------------------------------------*/
52/* Include Project Specific conf */
53#ifdef PROJECT_CONF_PATH
54#include PROJECT_CONF_PATH
55#endif /* PROJECT_CONF_PATH */
56/*---------------------------------------------------------------------------*/
57#include "cc2538-def.h"
58
59unsigned radio_phy_overhead(void);
60unsigned radio_byte_air_time(void);
61unsigned radio_delay_before_tx(void);
62unsigned radio_delay_before_rx(void);
63unsigned radio_delay_before_detect(void);
64uint16_t *radio_tsch_timeslot_timing(void);
65
66/** @} */
67/*---------------------------------------------------------------------------*/
68
69#define RADIO_PHY_OVERHEAD radio_phy_overhead()
70#define RADIO_BYTE_AIR_TIME radio_byte_air_time()
71#define RADIO_DELAY_BEFORE_TX radio_delay_before_tx()
72#define RADIO_DELAY_BEFORE_RX radio_delay_before_rx()
73#define RADIO_DELAY_BEFORE_DETECT radio_delay_before_detect()
74
75#define TSCH_CONF_DYNAMIC_TIMESLOT_TEMPLATE 1
76#define TSCH_CONF_DEFAULT_TIMESLOT_TIMING radio_tsch_timeslot_timing()
77
78/*---------------------------------------------------------------------------*/
79/**
80 * \name Serial Boot Loader Backdoor configuration
81 *
82 * @{
83 */
84#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
85#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
86#endif
87
88#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
89#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 3 /**< Pin PA_3 (user button), activates the boot loader */
90#endif
91
92#ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
93#define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
94#endif
95/** @} */
96/*---------------------------------------------------------------------------*/
97/**
98 * \name CC2538 System Control configuration
99 *
100 * @{
101 */
102#ifndef SYS_CTRL_CONF_OSC32K_USE_XTAL
103#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1 /**< Use the on-board 32.768-kHz crystal */
104#endif
105/** @} */
106/*---------------------------------------------------------------------------*/
107/* board.h assumes that basic configuration is done */
108#include "board.h"
109
110#define PLATFORM_SUPPORTS_BUTTON_HAL PLATFORM_HAS_BUTTON
111/*---------------------------------------------------------------------------*/
112/**
113 * \name Radio Configuration
114 *
115 * @{
116 */
117#ifndef ZOUL_CONF_USE_CC1200_RADIO
118#define ZOUL_CONF_USE_CC1200_RADIO 0
119#endif
120
121#if ZOUL_CONF_USE_CC1200_RADIO
122#define NETSTACK_CONF_RADIO cc1200_driver
123#define ANTENNA_SW_SELECT_DEF_CONF ANTENNA_SW_SELECT_SUBGHZ
124#define CC1200_CONF_USE_GPIO2 0
125#define CC1200_CONF_USE_RX_WATCHDOG 0
126
127#define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 200)
128#define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1500)
129
130#ifndef CC1200_CONF_RF_CFG
131#define CC1200_CONF_RF_CFG cc1200_802154g_863_870_fsk_50kbps
132#endif
133#endif
134
135/* This can be overriden to use the cc1200_driver instead */
136#ifndef NETSTACK_CONF_RADIO
137#define NETSTACK_CONF_RADIO cc2538_rf_driver
138#endif
139
140/*
141 * RE-Mote specific:
142 * If dual RF enabled, we set the RF switch to enable the CC1200 and use 2.4GHz
143 * on the available uFl/chip antenna (not mounted as default). In contiki main
144 * platform routine we set the right antenna depending on NETSTACK_CONF_RADIO,
145 * but as changing the RF antenna also implies enabling/disabling the CC1200,
146 * is better to start off with the right configuration
147 */
148#if REMOTE_DUAL_RF_ENABLED
149#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ
150#else /* REMOTE_DUAL_RF_ENABLED */
151#ifndef ANTENNA_SW_SELECT_DEF_CONF
152#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ
153#else /* ANTENNA_SW_SELECT_DEF_CONF */
154#define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF
155#endif /* ANTENNA_SW_SELECT_DEF_CONF */
156#endif /* REMOTE_DUAL_RF_ENABLED */
157
158/** @} */
159/*---------------------------------------------------------------------------*/
160/**
161 * \name LPM configuration
162 * @{
163 */
164#ifndef LPM_CONF_ENABLE
165#define LPM_CONF_ENABLE 1 /**< Set to 0 to disable LPM entirely */
166#endif
167
168/**
169 * \brief Maximum PM
170 *
171 * The SoC will never drop to a Power Mode deeper than the one specified here.
172 * 0 for PM0, 1 for PM1 and 2 for PM2
173 */
174#ifndef LPM_CONF_MAX_PM
175#define LPM_CONF_MAX_PM 2
176#endif
177
178#ifndef LPM_CONF_STATS
179#define LPM_CONF_STATS 0 /**< Set to 1 to enable LPM-related stats */
180#endif
181/** @} */
182/*---------------------------------------------------------------------------*/
183/**
184 * \name RTC
185 *
186 * @{
187 */
188#ifdef PLATFORM_HAS_RTC
189
190#ifndef RTC_CONF_INIT
191#define RTC_CONF_INIT 0 /**< Whether to initialize the RTC */
192#endif
193
194#ifndef RTC_CONF_SET_FROM_SYS
195#define RTC_CONF_SET_FROM_SYS 0 /**< Whether to set the RTC from the build system */
196#endif
197
198#else
199#undef RTC_CONF_INIT
200#define RTC_CONF_INIT 0
201#endif
202/** @} */
203/*---------------------------------------------------------------------------*/
204/* Include CPU-related configuration */
205#include "cc2538-conf.h"
206/*---------------------------------------------------------------------------*/
207#endif /* CONTIKI_CONF_H_ */
208/*---------------------------------------------------------------------------*/