Contiki-NG
CC1312R1_LAUNCHXL.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-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 CC1312R1_LAUNCHXL.h
34  *
35  * @brief CC1312R1 LaunchPad Board Specific header file.
36  *
37  * The CC1312R1_LAUNCHXL header file should be included in an application as
38  * follows:
39  * @code
40  * #include "CC1312R1_LAUNCHXL.h"
41  * @endcode
42  *
43  * ============================================================================
44  */
45 #ifndef __CC1312R1_LAUNCHXL_BOARD_H__
46 #define __CC1312R1_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 CC1312R1_LAUNCHXL
64 
65 /* Mapping of pins to board signals using general board aliases
66  * <board signal alias> <pin mapping> <comments>
67  */
68 
69 /* Analog capable DIOs */
70 #define CC1312R1_LAUNCHXL_DIO23_ANALOG IOID_23
71 #define CC1312R1_LAUNCHXL_DIO24_ANALOG IOID_24
72 #define CC1312R1_LAUNCHXL_DIO25_ANALOG IOID_25
73 #define CC1312R1_LAUNCHXL_DIO26_ANALOG IOID_26
74 #define CC1312R1_LAUNCHXL_DIO27_ANALOG IOID_27
75 #define CC1312R1_LAUNCHXL_DIO28_ANALOG IOID_28
76 #define CC1312R1_LAUNCHXL_DIO29_ANALOG IOID_29
77 #define CC1312R1_LAUNCHXL_DIO30_ANALOG IOID_30
78 
79 /* Digital IOs */
80 #define CC1312R1_LAUNCHXL_DIO0 IOID_0
81 #define CC1312R1_LAUNCHXL_DIO1 IOID_1
82 #define CC1312R1_LAUNCHXL_DIO12 IOID_12
83 #define CC1312R1_LAUNCHXL_DIO15 IOID_15
84 #define CC1312R1_LAUNCHXL_DIO16_TDO IOID_16
85 #define CC1312R1_LAUNCHXL_DIO17_TDI IOID_17
86 #define CC1312R1_LAUNCHXL_DIO21 IOID_21
87 #define CC1312R1_LAUNCHXL_DIO22 IOID_22
88 
89 /* Discrete Inputs */
90 #define CC1312R1_LAUNCHXL_PIN_BTN1 IOID_13
91 #define CC1312R1_LAUNCHXL_PIN_BTN2 IOID_14
92 
93 /* GPIO */
94 #define CC1312R1_LAUNCHXL_GPIO_LED_ON 1
95 #define CC1312R1_LAUNCHXL_GPIO_LED_OFF 0
96 
97 /* I2C */
98 #define CC1312R1_LAUNCHXL_I2C0_SCL0 IOID_4
99 #define CC1312R1_LAUNCHXL_I2C0_SDA0 IOID_5
100 
101 /* LEDs */
102 #define CC1312R1_LAUNCHXL_PIN_LED_ON 1
103 #define CC1312R1_LAUNCHXL_PIN_LED_OFF 0
104 #define CC1312R1_LAUNCHXL_PIN_RLED IOID_6
105 #define CC1312R1_LAUNCHXL_PIN_GLED IOID_7
106 
107 /* PWM Outputs */
108 #define CC1312R1_LAUNCHXL_PWMPIN0 CC1312R1_LAUNCHXL_PIN_RLED
109 #define CC1312R1_LAUNCHXL_PWMPIN1 CC1312R1_LAUNCHXL_PIN_GLED
110 #define CC1312R1_LAUNCHXL_PWMPIN2 PIN_UNASSIGNED
111 #define CC1312R1_LAUNCHXL_PWMPIN3 PIN_UNASSIGNED
112 #define CC1312R1_LAUNCHXL_PWMPIN4 PIN_UNASSIGNED
113 #define CC1312R1_LAUNCHXL_PWMPIN5 PIN_UNASSIGNED
114 #define CC1312R1_LAUNCHXL_PWMPIN6 PIN_UNASSIGNED
115 #define CC1312R1_LAUNCHXL_PWMPIN7 PIN_UNASSIGNED
116 
117 /* SPI */
118 #define CC1312R1_LAUNCHXL_SPI_FLASH_CS IOID_20
119 #define CC1312R1_LAUNCHXL_FLASH_CS_ON 0
120 #define CC1312R1_LAUNCHXL_FLASH_CS_OFF 1
121 
122 /* SPI Board */
123 #define CC1312R1_LAUNCHXL_SPI0_MISO IOID_8 /* RF1.20 */
124 #define CC1312R1_LAUNCHXL_SPI0_MOSI IOID_9 /* RF1.18 */
125 #define CC1312R1_LAUNCHXL_SPI0_CLK IOID_10 /* RF1.16 */
126 #define CC1312R1_LAUNCHXL_SPI0_CSN PIN_UNASSIGNED
127 #define CC1312R1_LAUNCHXL_SPI1_MISO PIN_UNASSIGNED
128 #define CC1312R1_LAUNCHXL_SPI1_MOSI PIN_UNASSIGNED
129 #define CC1312R1_LAUNCHXL_SPI1_CLK PIN_UNASSIGNED
130 #define CC1312R1_LAUNCHXL_SPI1_CSN PIN_UNASSIGNED
131 
132 /* UART Board */
133 #define CC1312R1_LAUNCHXL_UART0_RX IOID_2 /* RXD */
134 #define CC1312R1_LAUNCHXL_UART0_TX IOID_3 /* TXD */
135 #define CC1312R1_LAUNCHXL_UART0_CTS IOID_19 /* CTS */
136 #define CC1312R1_LAUNCHXL_UART0_RTS IOID_18 /* RTS */
137 #define CC1312R1_LAUNCHXL_UART1_RX PIN_UNASSIGNED
138 #define CC1312R1_LAUNCHXL_UART1_TX PIN_UNASSIGNED
139 #define CC1312R1_LAUNCHXL_UART1_CTS PIN_UNASSIGNED
140 #define CC1312R1_LAUNCHXL_UART1_RTS PIN_UNASSIGNED
141 /* For backward compatibility */
142 #define CC1312R1_LAUNCHXL_UART_RX CC1312R1_LAUNCHXL_UART0_RX
143 #define CC1312R1_LAUNCHXL_UART_TX CC1312R1_LAUNCHXL_UART0_TX
144 #define CC1312R1_LAUNCHXL_UART_CTS CC1312R1_LAUNCHXL_UART0_CTS
145 #define CC1312R1_LAUNCHXL_UART_RTS CC1312R1_LAUNCHXL_UART0_RTS
146 
147 /*!
148  * @brief Initialize the general board specific settings
149  *
150  * This function initializes the general board specific settings.
151  */
153 
154 /*!
155  * @brief Turn off the external flash on LaunchPads
156  *
157  */
159 
160 /*!
161  * @brief Wake up the external flash present on the board files
162  *
163  * This function toggles the chip select for the amount of time needed
164  * to wake the chip up.
165  */
167 
168 /*!
169  * @def CC1312R1_LAUNCHXL_ADCBufName
170  * @brief Enum of ADCBufs
171  */
172 typedef enum CC1312R1_LAUNCHXL_ADCBufName {
173  CC1312R1_LAUNCHXL_ADCBUF0 = 0,
174 
175  CC1312R1_LAUNCHXL_ADCBUFCOUNT
176 } CC1312R1_LAUNCHXL_ADCBufName;
177 
178 /*!
179  * @def CC1312R1_LAUNCHXL_ADCBuf0ChannelName
180  * @brief Enum of ADCBuf channels
181  */
182 typedef enum CC1312R1_LAUNCHXL_ADCBuf0ChannelName {
183  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
184  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL1,
185  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL2,
186  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL3,
187  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL4,
188  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL5,
189  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL6,
190  CC1312R1_LAUNCHXL_ADCBUF0CHANNEL7,
191  CC1312R1_LAUNCHXL_ADCBUF0CHANNELVDDS,
192  CC1312R1_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
193  CC1312R1_LAUNCHXL_ADCBUF0CHANNELVSS,
194 
195  CC1312R1_LAUNCHXL_ADCBUF0CHANNELCOUNT
196 } CC1312R1_LAUNCHXL_ADCBuf0ChannelName;
197 
198 /*!
199  * @def CC1312R1_LAUNCHXL_ADCName
200  * @brief Enum of ADCs
201  */
202 typedef enum CC1312R1_LAUNCHXL_ADCName {
203  CC1312R1_LAUNCHXL_ADC0 = 0,
204  CC1312R1_LAUNCHXL_ADC1,
205  CC1312R1_LAUNCHXL_ADC2,
206  CC1312R1_LAUNCHXL_ADC3,
207  CC1312R1_LAUNCHXL_ADC4,
208  CC1312R1_LAUNCHXL_ADC5,
209  CC1312R1_LAUNCHXL_ADC6,
210  CC1312R1_LAUNCHXL_ADC7,
211  CC1312R1_LAUNCHXL_ADCDCOUPL,
212  CC1312R1_LAUNCHXL_ADCVSS,
213  CC1312R1_LAUNCHXL_ADCVDDS,
214 
215  CC1312R1_LAUNCHXL_ADCCOUNT
216 } CC1312R1_LAUNCHXL_ADCName;
217 
218 /*!
219  * @def CC1312R1_LAUNCHXL_ECDHName
220  * @brief Enum of ECDH names
221  */
222 typedef enum CC1312R1_LAUNCHXL_ECDHName {
223  CC1312R1_LAUNCHXL_ECDH0 = 0,
224 
225  CC1312R1_LAUNCHXL_ECDHCOUNT
226 } CC1312R1_LAUNCHXL_ECDHName;
227 
228 /*!
229  * @def CC1312R1_LAUNCHXL_ECDSAName
230  * @brief Enum of ECDSA names
231  */
232 typedef enum CC1312R1_LAUNCHXL_ECDSAName {
233  CC1312R1_LAUNCHXL_ECDSA0 = 0,
234 
235  CC1312R1_LAUNCHXL_ECDSACOUNT
236 } CC1312R1_LAUNCHXL_ECDSAName;
237 
238 /*!
239  * @def CC1312R1_LAUNCHXL_ECJPAKEName
240  * @brief Enum of ECJPAKE names
241  */
242 typedef enum CC1312R1_LAUNCHXL_ECJPAKEName {
243  CC1312R1_LAUNCHXL_ECJPAKE0 = 0,
244 
245  CC1312R1_LAUNCHXL_ECJPAKECOUNT
246 } CC1312R1_LAUNCHXL_ECJPAKEName;
247 
248 /*!
249  * @def CC1312R1_LAUNCHXL_AESCCMName
250  * @brief Enum of AESCCM names
251  */
252 typedef enum CC1312R1_LAUNCHXL_AESCCMName {
253  CC1312R1_LAUNCHXL_AESCCM0 = 0,
254 
255  CC1312R1_LAUNCHXL_AESCCMCOUNT
256 } CC1312R1_LAUNCHXL_AESCCMName;
257 
258 /*!
259  * @def CC1312R1_LAUNCHXL_AESECBName
260  * @brief Enum of AESECB names
261  */
262 typedef enum CC1312R1_LAUNCHXL_AESECBName {
263  CC1312R1_LAUNCHXL_AESECB0 = 0,
264 
265  CC1312R1_LAUNCHXL_AESECBCOUNT
266 } CC1312R1_LAUNCHXL_AESECBName;
267 
268 /*!
269  * @def CC1312R1_LAUNCHXL_SHA2Name
270  * @brief Enum of SHA2 names
271  */
272 typedef enum CC1312R1_LAUNCHXL_SHA2Name {
273  CC1312R1_LAUNCHXL_SHA20 = 0,
274 
275  CC1312R1_LAUNCHXL_SHA2COUNT
276 } CC1312R1_LAUNCHXL_SHA2Name;
277 
278 /*!
279  * @def CC1312R1_LAUNCHXL_GPIOName
280  * @brief Enum of GPIO names
281  */
282 typedef enum CC1312R1_LAUNCHXL_GPIOName {
283  CC1312R1_LAUNCHXL_GPIO_S1 = 0,
284  CC1312R1_LAUNCHXL_GPIO_S2,
285  CC1312R1_LAUNCHXL_SPI_MASTER_READY,
286  CC1312R1_LAUNCHXL_SPI_SLAVE_READY,
287  CC1312R1_LAUNCHXL_GPIO_LED_GREEN,
288  CC1312R1_LAUNCHXL_GPIO_LED_RED,
289  CC1312R1_LAUNCHXL_GPIO_SPI_FLASH_CS,
290  CC1312R1_LAUNCHXL_SDSPI_CS,
291  CC1312R1_LAUNCHXL_GPIOCOUNT
292 } CC1312R1_LAUNCHXL_GPIOName;
293 
294 /*!
295  * @def CC1312R1_LAUNCHXL_GPTimerName
296  * @brief Enum of GPTimer parts
297  */
298 typedef enum CC1312R1_LAUNCHXL_GPTimerName {
299  CC1312R1_LAUNCHXL_GPTIMER0A = 0,
300  CC1312R1_LAUNCHXL_GPTIMER0B,
301  CC1312R1_LAUNCHXL_GPTIMER1A,
302  CC1312R1_LAUNCHXL_GPTIMER1B,
303  CC1312R1_LAUNCHXL_GPTIMER2A,
304  CC1312R1_LAUNCHXL_GPTIMER2B,
305  CC1312R1_LAUNCHXL_GPTIMER3A,
306  CC1312R1_LAUNCHXL_GPTIMER3B,
307 
308  CC1312R1_LAUNCHXL_GPTIMERPARTSCOUNT
309 } CC1312R1_LAUNCHXL_GPTimerName;
310 
311 /*!
312  * @def CC1312R1_LAUNCHXL_GPTimers
313  * @brief Enum of GPTimers
314  */
315 typedef enum CC1312R1_LAUNCHXL_GPTimers {
316  CC1312R1_LAUNCHXL_GPTIMER0 = 0,
317  CC1312R1_LAUNCHXL_GPTIMER1,
318  CC1312R1_LAUNCHXL_GPTIMER2,
319  CC1312R1_LAUNCHXL_GPTIMER3,
320 
321  CC1312R1_LAUNCHXL_GPTIMERCOUNT
322 } CC1312R1_LAUNCHXL_GPTimers;
323 
324 /*!
325  * @def CC1312R1_LAUNCHXL_I2CName
326  * @brief Enum of I2C names
327  */
328 typedef enum CC1312R1_LAUNCHXL_I2CName {
329 #if TI_I2C_CONF_I2C0_ENABLE
330  CC1312R1_LAUNCHXL_I2C0 = 0,
331 #endif
332 
333  CC1312R1_LAUNCHXL_I2CCOUNT
334 } CC1312R1_LAUNCHXL_I2CName;
335 
336 /*!
337  * @def CC1312R1_LAUNCHXL_NVSName
338  * @brief Enum of NVS names
339  */
340 typedef enum CC1312R1_LAUNCHXL_NVSName {
341 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
342  CC1312R1_LAUNCHXL_NVSCC26XX0 = 0,
343 #endif
344 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
345  CC1312R1_LAUNCHXL_NVSSPI25X0,
346 #endif
347 
348  CC1312R1_LAUNCHXL_NVSCOUNT
349 } CC1312R1_LAUNCHXL_NVSName;
350 
351 /*!
352  * @def CC1312R1_LAUNCHXL_PWMName
353  * @brief Enum of PWM outputs
354  */
355 typedef enum CC1312R1_LAUNCHXL_PWMName {
356  CC1312R1_LAUNCHXL_PWM0 = 0,
357  CC1312R1_LAUNCHXL_PWM1,
358  CC1312R1_LAUNCHXL_PWM2,
359  CC1312R1_LAUNCHXL_PWM3,
360  CC1312R1_LAUNCHXL_PWM4,
361  CC1312R1_LAUNCHXL_PWM5,
362  CC1312R1_LAUNCHXL_PWM6,
363  CC1312R1_LAUNCHXL_PWM7,
364 
365  CC1312R1_LAUNCHXL_PWMCOUNT
366 } CC1312R1_LAUNCHXL_PWMName;
367 
368 /*!
369  * @def CC1312R1_LAUNCHXL_SDName
370  * @brief Enum of SD names
371  */
372 typedef enum CC1312R1_LAUNCHXL_SDName {
373  CC1312R1_LAUNCHXL_SDSPI0 = 0,
374 
375  CC1312R1_LAUNCHXL_SDCOUNT
376 } CC1312R1_LAUNCHXL_SDName;
377 
378 /*!
379  * @def CC1312R1_LAUNCHXL_SPIName
380  * @brief Enum of SPI names
381  */
382 typedef enum CC1312R1_LAUNCHXL_SPIName {
383 #if TI_SPI_CONF_SPI0_ENABLE
384  CC1312R1_LAUNCHXL_SPI0 = 0,
385 #endif
386 #if TI_SPI_CONF_SPI1_ENABLE
387  CC1312R1_LAUNCHXL_SPI1,
388 #endif
389 
390  CC1312R1_LAUNCHXL_SPICOUNT
391 } CC1312R1_LAUNCHXL_SPIName;
392 
393 /*!
394  * @def CC1312R1_LAUNCHXL_TRNGName
395  * @brief Enum of TRNGs
396  */
397 typedef enum CC1312R1_LAUNCHXL_TRNGName {
398  CC1312R1_LAUNCHXL_TRNG0 = 0,
399 
400  CC1312R1_LAUNCHXL_TRNGCOUNT
401 } CC1312R1_LAUNCHXL_TRNGName;
402 
403 /*!
404  * @def CC1312R1_LAUNCHXL_UARTName
405  * @brief Enum of UARTs
406  */
407 typedef enum CC1312R1_LAUNCHXL_UARTName {
408 #if TI_UART_CONF_UART0_ENABLE
409  CC1312R1_LAUNCHXL_UART0 = 0,
410 #endif
411 
412  CC1312R1_LAUNCHXL_UARTCOUNT
413 } CC1312R1_LAUNCHXL_UARTName;
414 
415 /*!
416  * @def CC1312R1_LAUNCHXL_UDMAName
417  * @brief Enum of DMA buffers
418  */
419 typedef enum CC1312R1_LAUNCHXL_UDMAName {
420  CC1312R1_LAUNCHXL_UDMA0 = 0,
421 
422  CC1312R1_LAUNCHXL_UDMACOUNT
423 } CC1312R1_LAUNCHXL_UDMAName;
424 
425 /*!
426  * @def CC1312R1_LAUNCHXL_WatchdogName
427  * @brief Enum of Watchdogs
428  */
429 typedef enum CC1312R1_LAUNCHXL_WatchdogName {
430  CC1312R1_LAUNCHXL_WATCHDOG0 = 0,
431 
432  CC1312R1_LAUNCHXL_WATCHDOGCOUNT
433 } CC1312R1_LAUNCHXL_WatchdogName;
434 
435 
436 #ifdef __cplusplus
437 }
438 #endif
439 
440 #endif /* __CC1312R1_LAUNCHXL_BOARD_H__ */
void CC1312R1_LAUNCHXL_initGeneral(void)
Initialize the general board specific settings.
void CC1312R1_LAUNCHXL_shutDownExtFlash(void)
Turn off the external flash on LaunchPads.
void CC1312R1_LAUNCHXL_wakeUpExtFlash(void)
Wake up the external flash present on the board files.