Contiki-NG
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 /*---------------------------------------------------------------------------*/
59 /**
60  * \name Serial Boot Loader Backdoor configuration
61  *
62  * @{
63  */
64 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR
65 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR 1 /**<Enable the boot loader backdoor */
66 #endif
67 
68 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN
69 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_PORT_A_PIN 3 /**< Pin PA_3 (user button), activates the boot loader */
70 #endif
71 
72 #ifndef FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH
73 #define FLASH_CCA_CONF_BOOTLDR_BACKDOOR_ACTIVE_HIGH 0 /**< A logic low level activates the boot loader */
74 #endif
75 /** @} */
76 /*---------------------------------------------------------------------------*/
77 /**
78  * \name CC2538 System Control configuration
79  *
80  * @{
81  */
82 #ifndef SYS_CTRL_CONF_OSC32K_USE_XTAL
83 #define SYS_CTRL_CONF_OSC32K_USE_XTAL 1 /**< Use the on-board 32.768-kHz crystal */
84 #endif
85 /** @} */
86 /*---------------------------------------------------------------------------*/
87 /* board.h assumes that basic configuration is done */
88 #include "board.h"
89 
90 #define PLATFORM_SUPPORTS_BUTTON_HAL PLATFORM_HAS_BUTTON
91 /*---------------------------------------------------------------------------*/
92 /**
93  * \name Radio Configuration
94  *
95  * @{
96  */
97 /* Configure CSMA for when it's selected */
98 
99 #if CC1200_CONF_SUBGHZ_50KBPS_MODE
100 #define NETSTACK_CONF_RADIO cc1200_driver
101 #define CC1200_CONF_RF_CFG cc1200_802154g_863_870_fsk_50kbps
102 #define ANTENNA_SW_SELECT_DEF_CONF ANTENNA_SW_SELECT_SUBGHZ
103 #define CC1200_CONF_USE_GPIO2 0
104 #define CC1200_CONF_USE_RX_WATCHDOG 0
105 
106 #define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 200)
107 #define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1500)
108 
109 #endif
110 
111 /* This can be overriden to use the cc1200_driver instead */
112 #ifndef NETSTACK_CONF_RADIO
113 #define NETSTACK_CONF_RADIO cc2538_rf_driver
114 #endif
115 
116 /*
117  * RE-Mote specific:
118  * If dual RF enabled, we set the RF switch to enable the CC1200 and use 2.4GHz
119  * on the available uFl/chip antenna (not mounted as default). In contiki main
120  * platform routine we set the right antenna depending on NETSTACK_CONF_RADIO,
121  * but as changing the RF antenna also implies enabling/disabling the CC1200,
122  * is better to start off with the right configuration
123  */
124 #if REMOTE_DUAL_RF_ENABLED
125 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_SUBGHZ
126 #else /* REMOTE_DUAL_RF_ENABLED */
127 #ifndef ANTENNA_SW_SELECT_DEF_CONF
128 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_2_4GHZ
129 #else /* ANTENNA_SW_SELECT_DEF_CONF */
130 #define ANTENNA_SW_SELECT_DEFAULT ANTENNA_SW_SELECT_DEF_CONF
131 #endif /* ANTENNA_SW_SELECT_DEF_CONF */
132 #endif /* REMOTE_DUAL_RF_ENABLED */
133 
134 /** @} */
135 /*---------------------------------------------------------------------------*/
136 /**
137  * \name LPM configuration
138  * @{
139  */
140 #ifndef LPM_CONF_ENABLE
141 #define LPM_CONF_ENABLE 1 /**< Set to 0 to disable LPM entirely */
142 #endif
143 
144 /**
145  * \brief Maximum PM
146  *
147  * The SoC will never drop to a Power Mode deeper than the one specified here.
148  * 0 for PM0, 1 for PM1 and 2 for PM2
149  */
150 #ifndef LPM_CONF_MAX_PM
151 #define LPM_CONF_MAX_PM 2
152 #endif
153 
154 #ifndef LPM_CONF_STATS
155 #define LPM_CONF_STATS 0 /**< Set to 1 to enable LPM-related stats */
156 #endif
157 /** @} */
158 /*---------------------------------------------------------------------------*/
159 /**
160  * \name RTC
161  *
162  * @{
163  */
164 #ifdef PLATFORM_HAS_RTC
165 
166 #ifndef RTC_CONF_INIT
167 #define RTC_CONF_INIT 0 /**< Whether to initialize the RTC */
168 #endif
169 
170 #ifndef RTC_CONF_SET_FROM_SYS
171 #define RTC_CONF_SET_FROM_SYS 0 /**< Whether to set the RTC from the build system */
172 #endif
173 
174 #else
175 #undef RTC_CONF_INIT
176 #define RTC_CONF_INIT 0
177 #endif
178 /** @} */
179 /*---------------------------------------------------------------------------*/
180 /* Include CPU-related configuration */
181 #include "cc2538-conf.h"
182 /*---------------------------------------------------------------------------*/
183 #endif /* CONTIKI_CONF_H_ */
184 /*---------------------------------------------------------------------------*/
185 /** @} */