Contiki-NG
CC1352R1_LAUNCHXL.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2018, Texas Instruments Incorporated
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  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 /** ===========================================================================
33  * @file CC1352R1_LAUNCHXL.h
34  *
35  * @brief CC1352R1_LAUNCHXL Board Specific header file.
36  *
37  * The CC1352R1_LAUNCHXL header file should be included in an application as
38  * follows:
39  * @code
40  * #include "CC1352R1_LAUNCHXL.h"
41  * @endcode
42  *
43  * ===========================================================================
44  */
45 #ifndef __CC1352R1_LAUNCHXL_BOARD_H__
46 #define __CC1352R1_LAUNCHXL_BOARD_H__
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 #include "contiki-conf.h"
53 
54 /* Includes */
55 #include <ti/drivers/PIN.h>
56 #include <ti/devices/DeviceFamily.h>
57 #include DeviceFamily_constructPath(driverlib/ioc.h)
58 
59 /* Externs */
60 extern const PIN_Config BoardGpioInitTable[];
61 
62 /* Defines */
63 #define CC1352R1_LAUNCHXL
64 
65 /* Mapping of pins to board signals using general board aliases
66  * <board signal alias> <pin mapping> <comments>
67  */
68 
69 /* Mapping of pins to board signals using general board aliases
70  * <board signal alias> <pin mapping>
71  */
72 /* Analog Capable DIOs */
73 #define CC1352R1_LAUNCHXL_DIO23_ANALOG IOID_23
74 #define CC1352R1_LAUNCHXL_DIO24_ANALOG IOID_24
75 #define CC1352R1_LAUNCHXL_DIO25_ANALOG IOID_25
76 #define CC1352R1_LAUNCHXL_DIO26_ANALOG IOID_26
77 #define CC1352R1_LAUNCHXL_DIO27_ANALOG IOID_27
78 #define CC1352R1_LAUNCHXL_DIO28_ANALOG IOID_28
79 #define CC1352R1_LAUNCHXL_DIO29_ANALOG IOID_29
80 
81 /* Antenna switch */
82 #define CC1352R1_LAUNCHXL_DIO30_RF_SUB1GHZ IOID_30
83 
84 /* Digital IOs */
85 #define CC1352R1_LAUNCHXL_DIO12 IOID_12
86 #define CC1352R1_LAUNCHXL_DIO15 IOID_15
87 #define CC1352R1_LAUNCHXL_DIO16_TDO IOID_16
88 #define CC1352R1_LAUNCHXL_DIO17_TDI IOID_17
89 #define CC1352R1_LAUNCHXL_DIO21 IOID_21
90 #define CC1352R1_LAUNCHXL_DIO22 IOID_22
91 
92 /* Discrete Inputs */
93 #define CC1352R1_LAUNCHXL_PIN_BTN1 IOID_15
94 #define CC1352R1_LAUNCHXL_PIN_BTN2 IOID_14
95 
96 /* GPIO */
97 #define CC1352R1_LAUNCHXL_GPIO_LED_ON 1
98 #define CC1352R1_LAUNCHXL_GPIO_LED_OFF 0
99 
100 /* I2C */
101 #define CC1352R1_LAUNCHXL_I2C0_SCL0 IOID_4
102 #define CC1352R1_LAUNCHXL_I2C0_SDA0 IOID_5
103 
104 
105 /* LEDs */
106 #define CC1352R1_LAUNCHXL_PIN_LED_ON 1
107 #define CC1352R1_LAUNCHXL_PIN_LED_OFF 0
108 #define CC1352R1_LAUNCHXL_PIN_RLED IOID_6
109 #define CC1352R1_LAUNCHXL_PIN_GLED IOID_7
110 
111 /* PWM Outputs */
112 #define CC1352R1_LAUNCHXL_PWMPIN0 CC1352R1_LAUNCHXL_PIN_RLED
113 #define CC1352R1_LAUNCHXL_PWMPIN1 CC1352R1_LAUNCHXL_PIN_GLED
114 #define CC1352R1_LAUNCHXL_PWMPIN2 PIN_UNASSIGNED
115 #define CC1352R1_LAUNCHXL_PWMPIN3 PIN_UNASSIGNED
116 #define CC1352R1_LAUNCHXL_PWMPIN4 PIN_UNASSIGNED
117 #define CC1352R1_LAUNCHXL_PWMPIN5 PIN_UNASSIGNED
118 #define CC1352R1_LAUNCHXL_PWMPIN6 PIN_UNASSIGNED
119 #define CC1352R1_LAUNCHXL_PWMPIN7 PIN_UNASSIGNED
120 
121 /* SPI */
122 #define CC1352R1_LAUNCHXL_SPI_FLASH_CS IOID_20
123 #define CC1352R1_LAUNCHXL_FLASH_CS_ON 0
124 #define CC1352R1_LAUNCHXL_FLASH_CS_OFF 1
125 
126 /* SPI Board */
127 #define CC1352R1_LAUNCHXL_SPI0_MISO IOID_8 /* RF1.20 */
128 #define CC1352R1_LAUNCHXL_SPI0_MOSI IOID_9 /* RF1.18 */
129 #define CC1352R1_LAUNCHXL_SPI0_CLK IOID_10 /* RF1.16 */
130 #define CC1352R1_LAUNCHXL_SPI0_CSN PIN_UNASSIGNED
131 #define CC1352R1_LAUNCHXL_SPI1_MISO PIN_UNASSIGNED
132 #define CC1352R1_LAUNCHXL_SPI1_MOSI PIN_UNASSIGNED
133 #define CC1352R1_LAUNCHXL_SPI1_CLK PIN_UNASSIGNED
134 #define CC1352R1_LAUNCHXL_SPI1_CSN PIN_UNASSIGNED
135 
136 /* UART Board */
137 #define CC1352R1_LAUNCHXL_UART0_RX IOID_12 /* RXD */
138 #define CC1352R1_LAUNCHXL_UART0_TX IOID_13 /* TXD */
139 #define CC1352R1_LAUNCHXL_UART0_CTS IOID_19 /* CTS */
140 #define CC1352R1_LAUNCHXL_UART0_RTS IOID_18 /* RTS */
141 #define CC1352R1_LAUNCHXL_UART1_RX PIN_UNASSIGNED
142 #define CC1352R1_LAUNCHXL_UART1_TX PIN_UNASSIGNED
143 #define CC1352R1_LAUNCHXL_UART1_CTS PIN_UNASSIGNED
144 #define CC1352R1_LAUNCHXL_UART1_RTS PIN_UNASSIGNED
145 /* For backward compatibility */
146 #define CC1352R1_LAUNCHXL_UART_RX CC1352R1_LAUNCHXL_UART0_RX
147 #define CC1352R1_LAUNCHXL_UART_TX CC1352R1_LAUNCHXL_UART0_TX
148 #define CC1352R1_LAUNCHXL_UART_CTS CC1352R1_LAUNCHXL_UART0_CTS
149 #define CC1352R1_LAUNCHXL_UART_RTS CC1352R1_LAUNCHXL_UART0_RTS
150 
151 /*!
152  * @brief Initialize the general board specific settings
153  *
154  * This function initializes the general board specific settings.
155  */
157 
158 /*!
159  * @brief Shut down the external flash present on the board files
160  *
161  * This function bitbangs the SPI sequence necessary to turn off
162  * the external flash on LaunchPads.
163  */
165 
166 /*!
167  * @brief Wake up the external flash present on the board files
168  *
169  * This function toggles the chip select for the amount of time needed
170  * to wake the chip up.
171  */
173 
174 /*!
175  * @def CC1352R1_LAUNCHXL_ADCBufName
176  * @brief Enum of ADCs
177  */
178 typedef enum CC1352R1_LAUNCHXL_ADCBufName {
179  CC1352R1_LAUNCHXL_ADCBUF0 = 0,
180 
181  CC1352R1_LAUNCHXL_ADCBUFCOUNT
182 } CC1352R1_LAUNCHXL_ADCBufName;
183 
184 /*!
185  * @def CC1352R1_LAUNCHXL_ADCBuf0ChannelName
186  * @brief Enum of ADCBuf channels
187  */
188 typedef enum CC1352R1_LAUNCHXL_ADCBuf0ChannelName {
189  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
190  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL1,
191  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL2,
192  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL3,
193  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL4,
194  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL5,
195  CC1352R1_LAUNCHXL_ADCBUF0CHANNEL6,
196  CC1352R1_LAUNCHXL_ADCBUF0CHANNELVDDS,
197  CC1352R1_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
198  CC1352R1_LAUNCHXL_ADCBUF0CHANNELVSS,
199 
200  CC1352R1_LAUNCHXL_ADCBUF0CHANNELCOUNT
201 } CC1352R1_LAUNCHXL_ADCBuf0ChannelName;
202 
203 /*!
204  * @def CC1352R1_LAUNCHXL_ADCName
205  * @brief Enum of ADCs
206  */
207 typedef enum CC1352R1_LAUNCHXL_ADCName {
208  CC1352R1_LAUNCHXL_ADC0 = 0,
209  CC1352R1_LAUNCHXL_ADC1,
210  CC1352R1_LAUNCHXL_ADC2,
211  CC1352R1_LAUNCHXL_ADC3,
212  CC1352R1_LAUNCHXL_ADC4,
213  CC1352R1_LAUNCHXL_ADC5,
214  CC1352R1_LAUNCHXL_ADC6,
215  CC1352R1_LAUNCHXL_ADCDCOUPL,
216  CC1352R1_LAUNCHXL_ADCVSS,
217  CC1352R1_LAUNCHXL_ADCVDDS,
218 
219  CC1352R1_LAUNCHXL_ADCCOUNT
220 } CC1352R1_LAUNCHXL_ADCName;
221 
222 /*!
223  * @def CC1352R1_LAUNCHXL_ECDHName
224  * @brief Enum of ECDH names
225  */
226 typedef enum CC1352R1_LAUNCHXL_ECDHName {
227  CC1352R1_LAUNCHXL_ECDH0 = 0,
228 
229  CC1352R1_LAUNCHXL_ECDHCOUNT
230 } CC1352R1_LAUNCHXL_ECDHName;
231 
232 /*!
233  * @def CC1352R1_LAUNCHXL_ECDSAName
234  * @brief Enum of ECDSA names
235  */
236 typedef enum CC1352R1_LAUNCHXL_ECDSAName {
237  CC1352R1_LAUNCHXL_ECDSA0 = 0,
238 
239  CC1352R1_LAUNCHXL_ECDSACOUNT
240 } CC1352R1_LAUNCHXL_ECDSAName;
241 
242 /*!
243  * @def CC1352R1_LAUNCHXL_ECJPAKEName
244  * @brief Enum of ECJPAKE names
245  */
246 typedef enum CC1352R1_LAUNCHXL_ECJPAKEName {
247  CC1352R1_LAUNCHXL_ECJPAKE0 = 0,
248 
249  CC1352R1_LAUNCHXL_ECJPAKECOUNT
250 } CC1352R1_LAUNCHXL_ECJPAKEName;
251 
252 /*!
253  * @def CC1352R1_LAUNCHXL_AESCCMName
254  * @brief Enum of AESCCM names
255  */
256 typedef enum CC1352R1_LAUNCHXL_AESCCMName {
257  CC1352R1_LAUNCHXL_AESCCM0 = 0,
258 
259  CC1352R1_LAUNCHXL_AESCCMCOUNT
260 } CC1352R1_LAUNCHXL_AESCCMName;
261 
262 /*!
263  * @def CC1352R1_LAUNCHXL_AESECBName
264  * @brief Enum of AESECB names
265  */
266 typedef enum CC1352R1_LAUNCHXL_AESECBName {
267  CC1352R1_LAUNCHXL_AESECB0 = 0,
268 
269  CC1352R1_LAUNCHXL_AESECBCOUNT
270 } CC1352R1_LAUNCHXL_AESECBName;
271 
272 /*!
273  * @def CC1352R1_LAUNCHXL_SHA2Name
274  * @brief Enum of SHA2 names
275  */
276 typedef enum CC1352R1_LAUNCHXL_SHA2Name {
277  CC1352R1_LAUNCHXL_SHA20 = 0,
278 
279  CC1352R1_LAUNCHXL_SHA2COUNT
280 } CC1352R1_LAUNCHXL_SHA2Name;
281 
282 /*!
283  * @def CC1352R1_LAUNCHXL_GPIOName
284  * @brief Enum of GPIO names
285  */
286 typedef enum CC1352R1_LAUNCHXL_GPIOName {
287  CC1352R1_LAUNCHXL_GPIO_S1 = 0,
288  CC1352R1_LAUNCHXL_GPIO_S2,
289  CC1352R1_LAUNCHXL_SPI_MASTER_READY,
290  CC1352R1_LAUNCHXL_SPI_SLAVE_READY,
291  CC1352R1_LAUNCHXL_GPIO_LED_GREEN,
292  CC1352R1_LAUNCHXL_GPIO_LED_RED,
293  CC1352R1_LAUNCHXL_GPIO_SPI_FLASH_CS,
294  CC1352R1_LAUNCHXL_SDSPI_CS,
295  CC1352R1_LAUNCHXL_GPIOCOUNT
296 } CC1352R1_LAUNCHXL_GPIOName;
297 
298 /*!
299  * @def CC1352R1_LAUNCHXL_GPTimerName
300  * @brief Enum of GPTimer parts
301  */
302 typedef enum CC1352R1_LAUNCHXL_GPTimerName {
303  CC1352R1_LAUNCHXL_GPTIMER0A = 0,
304  CC1352R1_LAUNCHXL_GPTIMER0B,
305  CC1352R1_LAUNCHXL_GPTIMER1A,
306  CC1352R1_LAUNCHXL_GPTIMER1B,
307  CC1352R1_LAUNCHXL_GPTIMER2A,
308  CC1352R1_LAUNCHXL_GPTIMER2B,
309  CC1352R1_LAUNCHXL_GPTIMER3A,
310  CC1352R1_LAUNCHXL_GPTIMER3B,
311 
312  CC1352R1_LAUNCHXL_GPTIMERPARTSCOUNT
313 } CC1352R1_LAUNCHXL_GPTimerName;
314 
315 /*!
316  * @def CC1352R1_LAUNCHXL_GPTimers
317  * @brief Enum of GPTimers
318  */
319 typedef enum CC1352R1_LAUNCHXL_GPTimers {
320  CC1352R1_LAUNCHXL_GPTIMER0 = 0,
321  CC1352R1_LAUNCHXL_GPTIMER1,
322  CC1352R1_LAUNCHXL_GPTIMER2,
323  CC1352R1_LAUNCHXL_GPTIMER3,
324 
325  CC1352R1_LAUNCHXL_GPTIMERCOUNT
326 } CC1352R1_LAUNCHXL_GPTimers;
327 
328 /*!
329  * @def CC1352R1_LAUNCHXL_I2CName
330  * @brief Enum of I2C names
331  */
332 typedef enum CC1352R1_LAUNCHXL_I2CName {
333 #if TI_I2C_CONF_I2C0_ENABLE
334  CC1352R1_LAUNCHXL_I2C0 = 0,
335 #endif
336 
337  CC1352R1_LAUNCHXL_I2CCOUNT
338 } CC1352R1_LAUNCHXL_I2CName;
339 
340 /*!
341  * @def CC1352R1_LAUNCHXL_NVSName
342  * @brief Enum of NVS names
343  */
344 typedef enum CC1352R1_LAUNCHXL_NVSName {
345 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
346  CC1352R1_LAUNCHXL_NVSCC26XX0 = 0,
347 #endif
348 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
349  CC1352R1_LAUNCHXL_NVSSPI25X0,
350 #endif
351 
352  CC1352R1_LAUNCHXL_NVSCOUNT
353 } CC1352R1_LAUNCHXL_NVSName;
354 
355 /*!
356  * @def CC1352R1_LAUNCHXL_PWMName
357  * @brief Enum of PWM outputs
358  */
359 typedef enum CC1352R1_LAUNCHXL_PWMName {
360  CC1352R1_LAUNCHXL_PWM0 = 0,
361  CC1352R1_LAUNCHXL_PWM1,
362  CC1352R1_LAUNCHXL_PWM2,
363  CC1352R1_LAUNCHXL_PWM3,
364  CC1352R1_LAUNCHXL_PWM4,
365  CC1352R1_LAUNCHXL_PWM5,
366  CC1352R1_LAUNCHXL_PWM6,
367  CC1352R1_LAUNCHXL_PWM7,
368 
369  CC1352R1_LAUNCHXL_PWMCOUNT
370 } CC1352R1_LAUNCHXL_PWMName;
371 
372 /*!
373  * @def CC1352R1_LAUNCHXL_SDName
374  * @brief Enum of SD names
375  */
376 typedef enum CC1352R1_LAUNCHXL_SDName {
377  CC1352R1_LAUNCHXL_SDSPI0 = 0,
378 
379  CC1352R1_LAUNCHXL_SDCOUNT
380 } CC1352R1_LAUNCHXL_SDName;
381 
382 /*!
383  * @def CC1352R1_LAUNCHXL_SPIName
384  * @brief Enum of SPI names
385  */
386 typedef enum CC1352R1_LAUNCHXL_SPIName {
387 #if TI_SPI_CONF_SPI0_ENABLE
388  CC1352R1_LAUNCHXL_SPI0 = 0,
389 #endif
390 #if TI_SPI_CONF_SPI1_ENABLE
391  CC1352R1_LAUNCHXL_SPI1,
392 #endif
393 
394  CC1352R1_LAUNCHXL_SPICOUNT
395 } CC1352R1_LAUNCHXL_SPIName;
396 
397 /*!
398  * @def CC1352R1_LAUNCHXL_TRNGName
399  * @brief Enum of TRNGs
400  */
401 typedef enum CC1352R1_LAUNCHXL_TRNGName {
402  CC1352R1_LAUNCHXL_TRNG0 = 0,
403 
404  CC1352R1_LAUNCHXL_TRNGCOUNT
405 } CC1352R1_LAUNCHXL_TRNGName;
406 
407 /*!
408  * @def CC1352R1_LAUNCHXL_UARTName
409  * @brief Enum of UARTs
410  */
411 typedef enum CC1352R1_LAUNCHXL_UARTName {
412 #if TI_UART_CONF_UART0_ENABLE
413  CC1352R1_LAUNCHXL_UART0 = 0,
414 #endif
415 #if TI_UART_CONF_UART1_ENABLE
416  CC1352R1_LAUNCHXL_UART1,
417 #endif
418 
419  CC1352R1_LAUNCHXL_UARTCOUNT
420 } CC1352R1_LAUNCHXL_UARTName;
421 
422 /*!
423  * @def CC1352R1_LAUNCHXL_UDMAName
424  * @brief Enum of DMA buffers
425  */
426 typedef enum CC1352R1_LAUNCHXL_UDMAName {
427  CC1352R1_LAUNCHXL_UDMA0 = 0,
428 
429  CC1352R1_LAUNCHXL_UDMACOUNT
430 } CC1352R1_LAUNCHXL_UDMAName;
431 
432 /*!
433  * @def CC1352R1_LAUNCHXL_WatchdogName
434  * @brief Enum of Watchdogs
435  */
436 typedef enum CC1352R1_LAUNCHXL_WatchdogName {
437  CC1352R1_LAUNCHXL_WATCHDOG0 = 0,
438 
439  CC1352R1_LAUNCHXL_WATCHDOGCOUNT
440 } CC1352R1_LAUNCHXL_WatchdogName;
441 
442 
443 #ifdef __cplusplus
444 }
445 #endif
446 
447 #endif /* __CC1352R1_LAUNCHXL_BOARD_H__ */
void CC1352R1_LAUNCHXL_shutDownExtFlash(void)
Shut down the external flash present on the board files.
void CC1352R1_LAUNCHXL_initGeneral(void)
Initialize the general board specific settings.
void CC1352R1_LAUNCHXL_wakeUpExtFlash(void)
Wake up the external flash present on the board files.