Contiki-NG
cc13xx-cc26xx-conf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, George Oikonomou - http://www.spd.gr
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  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
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 /**
33  * \addtogroup cc26xx
34  * @{
35  *
36  * \file
37  * Header with configuration defines common to all CC13xx/CC26xx platforms
38  */
39 /*---------------------------------------------------------------------------*/
40 #ifndef CC13XX_CC26XX_CONF_H_
41 #define CC13XX_CC26XX_CONF_H_
42 /*---------------------------------------------------------------------------*/
43 /**
44  * \name Network Stack Configuration
45  *
46  * @{
47  */
48 
49 /*
50  * If set, the systems keeps the HF crystal oscillator on even when the radio is off.
51  * You need to set this to 1 to use TSCH with its default 2.2ms or larger guard time.
52  */
53 #ifndef CC2650_FAST_RADIO_STARTUP
54 #define CC2650_FAST_RADIO_STARTUP (MAC_CONF_WITH_TSCH)
55 #endif
56 
57 /* Number of Prop Mode RX buffers */
58 #ifndef PROP_MODE_CONF_RX_BUF_CNT
59 #define PROP_MODE_CONF_RX_BUF_CNT 4
60 #endif
61 
62 /*
63  * Auto-configure Prop-mode radio if we are running on CC13xx, unless the
64  * project has specified otherwise. Depending on the final mode, determine a
65  * default channel (again, if unspecified) and configure RDC params
66  */
67 #if CPU_FAMILY_CC13X0
68 #ifndef CC13XX_CONF_PROP_MODE
69 #define CC13XX_CONF_PROP_MODE 1
70 #endif /* CC13XX_CONF_PROP_MODE */
71 #endif /* CPU_FAMILY_CC13X0 */
72 
73 #if CC13XX_CONF_PROP_MODE
74 #ifndef NETSTACK_CONF_RADIO
75 #define NETSTACK_CONF_RADIO prop_mode_driver
76 #endif /* NETSTACK_CONF_RADIO */
77 
78 /* Channels count from 0 upwards in IEEE 802.15.4g */
79 #ifndef IEEE802154_CONF_DEFAULT_CHANNEL
80 #define IEEE802154_CONF_DEFAULT_CHANNEL 0
81 #endif /* IEEE802154_CONF_DEFAULT_CHANNEL */
82 
83 #ifndef CSMA_CONF_ACK_WAIT_TIME
84 #define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 400)
85 #endif /* CSMA_CONF_ACK_WAIT_TIME */
86 
87 #ifndef CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME
88 #define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000)
89 #endif /* CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME */
90 
91 #ifndef CSMA_CONF_SEND_SOFT_ACK
92 #define CSMA_CONF_SEND_SOFT_ACK 1
93 #endif /* CSMA_CONF_SEND_SOFT_ACK */
94 
95 #else /* CC13XX_CONF_PROP_MODE */
96 #ifndef NETSTACK_CONF_RADIO
97 #define NETSTACK_CONF_RADIO ieee_mode_driver
98 #endif
99 
100 #define CSMA_CONF_SEND_SOFT_ACK 0
101 #endif /* CC13XX_CONF_PROP_MODE */
102 
103 #define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125
104 
105 /** @} */
106 /*---------------------------------------------------------------------------*/
107 /**
108  * \name IEEE address configuration
109  *
110  * Used to generate our link-local & IPv6 address
111  * @{
112  */
113 /**
114  * \brief Location of the IEEE address
115  * 0 => Read from InfoPage,
116  * 1 => Use a hardcoded address, configured by IEEE_ADDR_CONF_ADDRESS
117  */
118 #ifndef IEEE_ADDR_CONF_HARDCODED
119 #define IEEE_ADDR_CONF_HARDCODED 0
120 #endif
121 
122 /**
123  * \brief The hardcoded IEEE address to be used when IEEE_ADDR_CONF_HARDCODED
124  * is defined as 1
125  */
126 #ifndef IEEE_ADDR_CONF_ADDRESS
127 #define IEEE_ADDR_CONF_ADDRESS { 0x00, 0x12, 0x4B, 0x00, 0x89, 0xAB, 0xCD, 0xEF }
128 #endif
129 /** @} */
130 /*---------------------------------------------------------------------------*/
131 /**
132  * \name RF configuration
133  *
134  * @{
135  */
136 /* RF Config */
137 
138 #ifndef IEEE_MODE_CONF_AUTOACK
139 #define IEEE_MODE_CONF_AUTOACK 1 /**< RF H/W generates ACKs */
140 #endif
141 
142 #ifndef IEEE_MODE_CONF_PROMISCOUS
143 #define IEEE_MODE_CONF_PROMISCOUS 0 /**< 1 to enable promiscous mode */
144 #endif
145 
146 #ifndef RF_BLE_CONF_ENABLED
147 #define RF_BLE_CONF_ENABLED 0 /**< 0 to disable BLE support */
148 #endif
149 /** @} */
150 /*---------------------------------------------------------------------------*/
151 /**
152  * \name Character I/O Configuration
153  *
154  * @{
155  */
156 #ifndef CC26XX_UART_CONF_ENABLE
157 #define CC26XX_UART_CONF_ENABLE 1 /**< Enable/Disable UART I/O */
158 #endif
159 
160 #ifndef CC26XX_UART_CONF_BAUD_RATE
161 #define CC26XX_UART_CONF_BAUD_RATE 115200 /**< Default UART0 baud rate */
162 #endif
163 
164 /* Enable I/O over the Debugger Devpack - Only relevant for the SensorTag */
165 #ifndef BOARD_CONF_DEBUGGER_DEVPACK
166 #define BOARD_CONF_DEBUGGER_DEVPACK 1
167 #endif
168 
169 #ifndef SLIP_ARCH_CONF_ENABLED
170 /*
171  * Determine whether we need SLIP
172  * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
173  * keep using SLIP
174  */
175 #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
176 #define SLIP_ARCH_CONF_ENABLED 1
177 #endif
178 #endif
179 /** @} */
180 /*---------------------------------------------------------------------------*/
181 /**
182  * \name JTAG interface configuration
183  *
184  * Enable/Disable the JTAG DAP and TAP interfaces on the chip.
185  * Setting this to 0 will disable access to the debug interface
186  * to secure deployed images.
187  * @{
188  */
189 #ifndef CCXXWARE_CONF_JTAG_INTERFACE_ENABLE
190 #define CCXXWARE_CONF_JTAG_INTERFACE_ENABLE 1
191 #endif
192 /** @} */
193 /*---------------------------------------------------------------------------*/
194 /**
195  * \name ROM Bootloader configuration
196  *
197  * Enable/Disable the ROM bootloader in your image, if the board supports it.
198  * Look in board.h to choose the DIO and corresponding level that will cause
199  * the chip to enter bootloader mode.
200  * @{
201  */
202 
203 /* Backward compatibility */
204 #ifdef ROM_BOOTLOADER_ENABLE
205 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE ROM_BOOTLOADER_ENABLE
206 #endif
207 
208 #ifndef CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE
209 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
210 #endif
211 /** @} */
212 /*---------------------------------------------------------------------------*/
213 #endif /* CC13XX_CC26XX_CONF_H_ */
214 /*---------------------------------------------------------------------------*/
215 /** @} */