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 /* Platform-specific (H/W) AES implementation */
104 #ifndef AES_128_CONF
105 #define AES_128_CONF cc26xx_aes_128_driver
106 #endif /* AES_128_CONF */
107 
108 /* This is fixed */
109 #define ieee_mode_driver_max_payload_len 125
110 /* This maybe changed in the future, with software upgrade */
111 #define prop_mode_driver_max_payload_len 125
112 /* This is not used, but needs to be defined in order to compile */
113 #define ble_cc2650_driver_max_payload_len 125
114 
115 /** @} */
116 /*---------------------------------------------------------------------------*/
117 /**
118  * \name IEEE address configuration
119  *
120  * Used to generate our link-local & IPv6 address
121  * @{
122  */
123 /**
124  * \brief Location of the IEEE address
125  * 0 => Read from InfoPage,
126  * 1 => Use a hardcoded address, configured by IEEE_ADDR_CONF_ADDRESS
127  */
128 #ifndef IEEE_ADDR_CONF_HARDCODED
129 #define IEEE_ADDR_CONF_HARDCODED 0
130 #endif
131 
132 /**
133  * \brief The hardcoded IEEE address to be used when IEEE_ADDR_CONF_HARDCODED
134  * is defined as 1
135  */
136 #ifndef IEEE_ADDR_CONF_ADDRESS
137 #define IEEE_ADDR_CONF_ADDRESS { 0x00, 0x12, 0x4B, 0x00, 0x89, 0xAB, 0xCD, 0xEF }
138 #endif
139 /** @} */
140 /*---------------------------------------------------------------------------*/
141 /**
142  * \name RF configuration
143  *
144  * @{
145  */
146 /* RF Config */
147 
148 #ifndef IEEE_MODE_CONF_AUTOACK
149 #define IEEE_MODE_CONF_AUTOACK 1 /**< RF H/W generates ACKs */
150 #endif
151 
152 #ifndef IEEE_MODE_CONF_PROMISCOUS
153 #define IEEE_MODE_CONF_PROMISCOUS 0 /**< 1 to enable promiscous mode */
154 #endif
155 
156 #ifndef RF_BLE_CONF_ENABLED
157 #define RF_BLE_CONF_ENABLED 0 /**< 0 to disable BLE support */
158 #endif
159 /** @} */
160 /*---------------------------------------------------------------------------*/
161 /**
162  * \name Character I/O Configuration
163  *
164  * @{
165  */
166 #ifndef CC26XX_UART_CONF_ENABLE
167 #define CC26XX_UART_CONF_ENABLE 1 /**< Enable/Disable UART I/O */
168 #endif
169 
170 #ifndef CC26XX_UART_CONF_BAUD_RATE
171 #define CC26XX_UART_CONF_BAUD_RATE 115200 /**< Default UART0 baud rate */
172 #endif
173 
174 /* Enable I/O over the Debugger Devpack - Only relevant for the SensorTag */
175 #ifndef BOARD_CONF_DEBUGGER_DEVPACK
176 #define BOARD_CONF_DEBUGGER_DEVPACK 1
177 #endif
178 
179 #ifndef SLIP_ARCH_CONF_ENABLED
180 /*
181  * Determine whether we need SLIP
182  * This will keep working while UIP_FALLBACK_INTERFACE and CMD_CONF_OUTPUT
183  * keep using SLIP
184  */
185 #if defined(UIP_FALLBACK_INTERFACE) || defined(CMD_CONF_OUTPUT)
186 #define SLIP_ARCH_CONF_ENABLED 1
187 #endif
188 #endif
189 /** @} */
190 /*---------------------------------------------------------------------------*/
191 /**
192  * \name JTAG interface configuration
193  *
194  * Enable/Disable the JTAG DAP and TAP interfaces on the chip.
195  * Setting this to 0 will disable access to the debug interface
196  * to secure deployed images.
197  * @{
198  */
199 #ifndef CCXXWARE_CONF_JTAG_INTERFACE_ENABLE
200 #define CCXXWARE_CONF_JTAG_INTERFACE_ENABLE 1
201 #endif
202 /** @} */
203 /*---------------------------------------------------------------------------*/
204 /**
205  * \name ROM Bootloader configuration
206  *
207  * Enable/Disable the ROM bootloader in your image, if the board supports it.
208  * Look in board.h to choose the DIO and corresponding level that will cause
209  * the chip to enter bootloader mode.
210  * @{
211  */
212 
213 /* Backward compatibility */
214 #ifdef ROM_BOOTLOADER_ENABLE
215 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE ROM_BOOTLOADER_ENABLE
216 #endif
217 
218 #ifndef CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE
219 #define CCXXWARE_CONF_ROM_BOOTLOADER_ENABLE 1
220 #endif
221 /** @} */
222 /*---------------------------------------------------------------------------*/
223 #endif /* CC13XX_CC26XX_CONF_H_ */
224 /*---------------------------------------------------------------------------*/
225 /** @} */