Contiki-NG
CC1350DK_7XD.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 CC1350DK_7XD.h
34  *
35  * @brief CC2650 LaunchPad Board Specific header file.
36  *
37  * The CC1350DK_7XD header file should be included in an application as
38  * follows:
39  * @code
40  * #include "CC1350DK_7XD.h"
41  * @endcode
42  *
43  * ============================================================================
44  */
45 #ifndef __CC1350DK_7XD_BOARD_H__
46 #define __CC1350DK_7XD_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 CC1350DK_7XD
64 
65 /* Mapping of pins to board signals using general board aliases
66  * <board signal alias> <pin mapping>
67  */
68 
69 /* Analog Capable DIOs */
70 #define CC1350DK_7XD_DIO23_ANALOG IOID_23
71 #define CC1350DK_7XD_DIO24_ANALOG IOID_24
72 #define CC1350DK_7XD_DIO25_ANALOG IOID_25
73 #define CC1350DK_7XD_DIO26_ANALOG IOID_26
74 #define CC1350DK_7XD_DIO27_ANALOG IOID_27
75 #define CC1350DK_7XD_DIO28_ANALOG IOID_28
76 #define CC1350DK_7XD_DIO29_ANALOG IOID_29
77 #define CC1350DK_7XD_DIO30_ANALOG IOID_30
78 
79 /* Digital IOs */
80 #define CC1350DK_7XD_DIO0 IOID_0
81 #define CC1350DK_7XD_DIO1_RFSW IOID_1
82 #define CC1350DK_7XD_DIO12 IOID_12
83 #define CC1350DK_7XD_DIO15 IOID_15
84 #define CC1350DK_7XD_DIO16_TDO IOID_16
85 #define CC1350DK_7XD_DIO17_TDI IOID_17
86 #define CC1350DK_7XD_DIO21 IOID_21
87 #define CC1350DK_7XD_DIO22 IOID_22
88 
89 /* Discrete Inputs */
90 #define CC1350DK_7XD_PIN_KEY_SELECT IOID_11
91 #define CC1350DK_7XD_PIN_KEY_UP IOID_19
92 #define CC1350DK_7XD_PIN_KEY_DOWN IOID_12
93 #define CC1350DK_7XD_PIN_KEY_LEFT IOID_15
94 #define CC1350DK_7XD_PIN_KEY_RIGHT IOID_18
95 
96 /* GPIO */
97 #define CC1350DK_7XD_GPIO_LED_ON 1
98 #define CC1350DK_7XD_GPIO_LED_OFF 0
99 
100 /* I2C */
101 #define CC1350DK_7XD_I2C0_SCL0 PIN_UNASSIGNED
102 #define CC1350DK_7XD_I2C0_SDA0 PIN_UNASSIGNED
103 
104 /* LEDs */
105 #define CC1350DK_7XD_PIN_LED_ON 1
106 #define CC1350DK_7XD_PIN_LED_OFF 0
107 #define CC1350DK_7XD_PIN_LED1 IOID_25
108 #define CC1350DK_7XD_PIN_LED2 IOID_27
109 #define CC1350DK_7XD_PIN_LED3 IOID_7
110 #define CC1350DK_7XD_PIN_LED4 IOID_6
111 
112 /* PWM Outputs */
113 #define CC1350DK_7XD_PWMPIN0 CC1350DK_7XD_PIN_LED1
114 #define CC1350DK_7XD_PWMPIN1 CC1350DK_7XD_PIN_LED2
115 #define CC1350DK_7XD_PWMPIN2 PIN_UNASSIGNED
116 #define CC1350DK_7XD_PWMPIN3 PIN_UNASSIGNED
117 #define CC1350DK_7XD_PWMPIN4 PIN_UNASSIGNED
118 #define CC1350DK_7XD_PWMPIN5 PIN_UNASSIGNED
119 #define CC1350DK_7XD_PWMPIN6 PIN_UNASSIGNED
120 #define CC1350DK_7XD_PWMPIN7 PIN_UNASSIGNED
121 
122 /* SPI Board */
123 #define CC1350DK_7XD_SPI0_MISO IOID_8
124 #define CC1350DK_7XD_SPI0_MOSI IOID_9
125 #define CC1350DK_7XD_SPI0_CLK IOID_10
126 #define CC1350DK_7XD_SPI0_CSN PIN_UNASSIGNED
127 #define CC1350DK_7XD_SPI1_MISO PIN_UNASSIGNED
128 #define CC1350DK_7XD_SPI1_MOSI PIN_UNASSIGNED
129 #define CC1350DK_7XD_SPI1_CLK PIN_UNASSIGNED
130 #define CC1350DK_7XD_SPI1_CSN PIN_UNASSIGNED
131 
132 /* UART Board */
133 #define CC1350DK_7XD_UART_RX IOID_2
134 #define CC1350DK_7XD_UART_TX IOID_3
135 #define CC1350DK_7XD_UART_CTS IOID_22
136 #define CC1350DK_7XD_UART_RTS IOID_21
137 
138 /* SD Card */
139 #define CC1350DK_7XD_SDCARD_CS IOID_30
140 
141 /* Ambient Light Sensor */
142 #define CC1350DK_7XD_ALS_OUT IOID_23
143 #define CC1350DK_7XD_ALS_PWR IOID_26
144 
145 /* Accelerometer */
146 #define CC1350DK_7XD_ACC_PWR IOID_20
147 #define CC1350DK_7XD_ACC_CS IOID_24
148 
149 /*!
150  * @brief Initialize the general board specific settings
151  *
152  * This function initializes the general board specific settings.
153  */
154 void CC1350DK_7XD_initGeneral(void);
155 
156 /*!
157  * @brief Turn off the external flash on LaunchPads
158  *
159  */
161 
162 /*!
163  * @brief Wake up the external flash present on the board files
164  *
165  * This function toggles the chip select for the amount of time needed
166  * to wake the chip up.
167  */
168 void CC1350DK_7XD_wakeUpExtFlash(void);
169 
170 /*!
171  * @def CC1350DK_7XD_ADCBufName
172  * @brief Enum of ADCs
173  */
174 typedef enum CC1350DK_7XD_ADCBufName {
175  CC1350DK_7XD_ADCBUF0 = 0,
176 
177  CC1350DK_7XD_ADCBUFCOUNT
178 } CC1350DK_7XD_ADCBufName;
179 
180 /*!
181  * @def CC1350DK_7XD_ADCBuf0ChannelName
182  * @brief Enum of ADCBuf channels
183  */
184 typedef enum CC1350DK_7XD_ADCBuf0ChannelName {
185  CC1350DK_7XD_ADCBUF0CHANNELADCALS = 0,
186  CC1350DK_7XD_ADCBUF0CHANNELVDDS,
187  CC1350DK_7XD_ADCBUF0CHANNELDCOUPL,
188  CC1350DK_7XD_ADCBUF0CHANNELVSS,
189 
190  CC1350DK_7XD_ADCBUF0CHANNELCOUNT
191 } CC1350DK_7XD_ADCBuf0ChannelName;
192 
193 /*!
194  * @def CC1350DK_7XD_ADCName
195  * @brief Enum of ADCs
196  */
197 typedef enum CC1350DK_7XD_ADCName {
198  CC1350DK_7XD_ADCALS = 0,
199  CC1350DK_7XD_ADCDCOUPL,
200  CC1350DK_7XD_ADCVSS,
201  CC1350DK_7XD_ADCVDDS,
202 
203  CC1350DK_7XD_ADCCOUNT
204 } CC1350DK_7XD_ADCName;
205 
206 /*!
207  * @def CC1350DK_7XD_CryptoName
208  * @brief Enum of Crypto names
209  */
210 typedef enum CC1350DK_7XD_CryptoName {
211  CC1350DK_7XD_CRYPTO0 = 0,
212 
213  CC1350DK_7XD_CRYPTOCOUNT
214 } CC1350DK_7XD_CryptoName;
215 
216 /*!
217  * @def CC1350DK_7XD_GPIOName
218  * @brief Enum of GPIO names
219  */
220 typedef enum CC1350DK_7XD_GPIOName {
221  CC1350DK_7XD_GPIO_KEY_SELECT = 0,
222  CC1350DK_7XD_GPIO_KEY_UP,
223  CC1350DK_7XD_GPIO_KEY_DOWN,
224  CC1350DK_7XD_GPIO_KEY_LEFT,
225  CC1350DK_7XD_GPIO_KEY_RIGHT,
226  CC1350DK_7XD_SPI_MASTER_READY,
227  CC1350DK_7XD_SPI_SLAVE_READY,
228  CC1350DK_7XD_GPIO_LED1,
229  CC1350DK_7XD_GPIO_LED2,
230  CC1350DK_7XD_GPIO_LED3,
231  CC1350DK_7XD_GPIO_LED4,
232  CC1350DK_7XD_GPIO_SDCARD_CS,
233  CC1350DK_7XD_GPIO_ACC_CS,
234 
235  CC1350DK_7XD_GPIOCOUNT
236 } CC1350DK_7XD_GPIOName;
237 
238 /*!
239  * @def CC1350DK_7XD_GPTimerName
240  * @brief Enum of GPTimer parts
241  */
242 typedef enum CC1350DK_7XD_GPTimerName {
243  CC1350DK_7XD_GPTIMER0A = 0,
244  CC1350DK_7XD_GPTIMER0B,
245  CC1350DK_7XD_GPTIMER1A,
246  CC1350DK_7XD_GPTIMER1B,
247  CC1350DK_7XD_GPTIMER2A,
248  CC1350DK_7XD_GPTIMER2B,
249  CC1350DK_7XD_GPTIMER3A,
250  CC1350DK_7XD_GPTIMER3B,
251 
252  CC1350DK_7XD_GPTIMERPARTSCOUNT
253 } CC1350DK_7XD_GPTimerName;
254 
255 /*!
256  * @def CC1350DK_7XD_GPTimers
257  * @brief Enum of GPTimers
258  */
259 typedef enum CC1350DK_7XD_GPTimers {
260  CC1350DK_7XD_GPTIMER0 = 0,
261  CC1350DK_7XD_GPTIMER1,
262  CC1350DK_7XD_GPTIMER2,
263  CC1350DK_7XD_GPTIMER3,
264 
265  CC1350DK_7XD_GPTIMERCOUNT
266 } CC1350DK_7XD_GPTimers;
267 
268 /*!
269  * @def CC1350DK_7XD_I2CName
270  * @brief Enum of I2C names
271  */
272 typedef enum CC1350DK_7XD_I2CName {
273 #if TI_I2C_CONF_I2C0_ENABLE
274  CC1350DK_7XD_I2C0 = 0,
275 #endif
276 
277  CC1350DK_7XD_I2CCOUNT
278 } CC1350DK_7XD_I2CName;
279 
280 /*!
281  * @def CC1350DK_7XD_NVSName
282  * @brief Enum of NVS names
283  */
284 typedef enum CC1350DK_7XD_NVSName {
285 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
286  CC1350DK_7XD_NVSCC26XX0 = 0,
287 #endif
288 
289  CC1350DK_7XD_NVSCOUNT
290 } CC1350DK_7XD_NVSName;
291 
292 /*!
293  * @def CC1350DK_7XD_PWMName
294  * @brief Enum of PWM outputs
295  */
296 typedef enum CC1350DK_7XD_PWMName {
297  CC1350DK_7XD_PWM0 = 0,
298  CC1350DK_7XD_PWM1,
299  CC1350DK_7XD_PWM2,
300  CC1350DK_7XD_PWM3,
301  CC1350DK_7XD_PWM4,
302  CC1350DK_7XD_PWM5,
303  CC1350DK_7XD_PWM6,
304  CC1350DK_7XD_PWM7,
305 
306  CC1350DK_7XD_PWMCOUNT
307 } CC1350DK_7XD_PWMName;
308 
309 /*!
310  * @def CC1350DK_7XD_SDName
311  * @brief Enum of SD names
312  */
313 typedef enum CC1350DK_7XD_SDName {
314  CC1350DK_7XD_SDSPI0 = 0,
315 
316  CC1350DK_7XD_SDCOUNT
317 } CC1350DK_7XD_SDName;
318 
319 /*!
320  * @def CC1350DK_7XD_SPIName
321  * @brief Enum of SPI names
322  */
323 typedef enum CC1350DK_7XD_SPIName {
324 #if TI_SPI_CONF_SPI0_ENABLE
325  CC1350DK_7XD_SPI0 = 0,
326 #endif
327 #if TI_SPI_CONF_SPI1_ENABLE
328  CC1350DK_7XD_SPI1,
329 #endif
330 
331  CC1350DK_7XD_SPICOUNT
332 } CC1350DK_7XD_SPIName;
333 
334 /*!
335  * @def CC1350DK_7XD_TRNGName
336  * @brief Enum of TRNGs
337  */
338 typedef enum CC1350DK_7XD_TRNGName {
339  CC1350DK_7XD_TRNG0 = 0,
340 
341  CC1350DK_7XD_TRNGCOUNT
342 } CC1350DK_7XD_TRNGName;
343 
344 /*!
345  * @def CC1350DK_7XD_UARTName
346  * @brief Enum of UARTs
347  */
348 typedef enum CC1350DK_7XD_UARTName {
349 #if TI_UART_CONF_UART0_ENABLE
350  CC1350DK_7XD_UART0 = 0,
351 #endif
352 
353  CC1350DK_7XD_UARTCOUNT
354 } CC1350DK_7XD_UARTName;
355 
356 /*!
357  * @def CC1350DK_7XD_UDMAName
358  * @brief Enum of DMA buffers
359  */
360 typedef enum CC1350DK_7XD_UDMAName {
361  CC1350DK_7XD_UDMA0 = 0,
362 
363  CC1350DK_7XD_UDMACOUNT
364 } CC1350DK_7XD_UDMAName;
365 
366 /*!
367  * @def CC1350DK_7XD_WatchdogName
368  * @brief Enum of Watchdogs
369  */
370 typedef enum CC1350DK_7XD_WatchdogName {
371  CC1350DK_7XD_WATCHDOG0 = 0,
372 
373  CC1350DK_7XD_WATCHDOGCOUNT
374 } CC1350DK_7XD_WatchdogName;
375 
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #endif /* __CC1350DK_7XD_BOARD_H__ */
void CC1350DK_7XD_wakeUpExtFlash(void)
Wake up the external flash present on the board files.
void CC1350DK_7XD_initGeneral(void)
Initialize the general board specific settings.
Definition: CC1350DK_7XD.c:708
void CC1350DK_7XD_shutDownExtFlash(void)
Turn off the external flash on LaunchPads.