Contiki-NG
CC2650STK.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 CC2650STK.h
34  *
35  * @brief CC2650STK Board Specific header file.
36  *
37  * The CC2650STK header file should be included in an application as
38  * follows:
39  * @code
40  * #include "CC2650STK.h"
41  * @endcode
42  * ============================================================================
43  */
44 #ifndef __CC2650STK_BOARD_H__
45 #define __CC2650STK_BOARD_H__
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 #include "contiki-conf.h"
52 
53 /* Includes */
54 #include <ti/drivers/PIN.h>
55 #include <ti/devices/DeviceFamily.h>
56 #include DeviceFamily_constructPath(driverlib/ioc.h)
57 
58 /* Externs */
59 extern const PIN_Config BoardGpioInitTable[];
60 
61 /* Defines */
62 #define CC2650STK
63 
64 /* Mapping of pins to board signals using general board aliases
65  * <board signal alias> <pin mapping>
66  */
67 
68 /* Audio */
69 #define CC2650STK_MIC_POWER IOID_13
70 #define CC2650STK_MIC_POWER_ON 1
71 #define CC2650STK_MIC_POWER_OFF 0
72 #define CC2650STK_AUDIO_DI IOID_2
73 #define CC2650STK_AUDIO_CLK IOID_11
74 
75 /* Buzzer */
76 #define CC2650STK_BUZZER IOID_21
77 #define CC2650STK_BUZZER_ON 1
78 #define CC2650STK_BUZZER_OFF 0
79 
80 /* DevPack */
81 #define CC2650STK_AUDIOFS_TDO IOID_16
82 #define CC2650STK_AUDIODO IOID_22
83 #define CC2650STK_DP2 IOID_23
84 #define CC2650STK_DP1 IOID_24
85 #define CC2650STK_DP0 IOID_25
86 #define CC2650STK_DP3 IOID_27
87 #define CC2650STK_DP4_UARTRX IOID_28
88 #define CC2650STK_DP5_UARTTX IOID_29
89 #define CC2650STK_DEVPK_ID IOID_30
90 #define CC2650STK_SPI_DEVPK_CS IOID_20
91 
92 /* Discrete Outputs */
93 #define CC2650STK_PIN_LED0 IOID_10
94 #define CC2650STK_PIN_LED1 IOID_15
95 #define CC2650STK_LED_ON 1
96 #define CC2650STK_LED_OFF 0
97 
98 
99 /* Discrete Inputs */
100 #define CC2650STK_KEY_LEFT IOID_0
101 #define CC2650STK_KEY_RIGHT IOID_4
102 #define CC2650STK_RELAY IOID_3
103 
104 /* GPIO */
105 #define CC2650STK_GPIO_LED_ON 1
106 #define CC2650STK_GPIO_LED_OFF 0
107 
108 /* I2C */
109 #define CC2650STK_I2C0_SDA0 IOID_5
110 #define CC2650STK_I2C0_SCL0 IOID_6
111 #define CC2650STK_I2C0_SDA1 IOID_8
112 #define CC2650STK_I2C0_SCL1 IOID_9
113 
114 /* LED-Audio DevPack */
115 #define CC2650STK_DEVPK_LIGHT_BLUE IOID_23
116 #define CC2650STK_DEVPK_LIGHT_GREEN IOID_24
117 #define CC2650STK_DEVPK_LIGHT_WHITE IOID_25
118 #define CC2650STK_DEVPK_LIGHT_RED IOID_27
119 
120 /* Power */
121 #define CC2650STK_MPU_POWER IOID_12
122 #define CC2650STK_MPU_POWER_ON 1
123 #define CC2650STK_MPU_POWER_OFF 0
124 
125 /* PWM */
126 #define CC2650STK_PWMPIN0 CC2650STK_PIN_LED1
127 #define CC2650STK_PWMPIN1 CC2650STK_PIN_LED1
128 #define CC2650STK_PWMPIN2 PIN_UNASSIGNED
129 #define CC2650STK_PWMPIN3 PIN_UNASSIGNED
130 #define CC2650STK_PWMPIN4 PIN_UNASSIGNED
131 #define CC2650STK_PWMPIN5 PIN_UNASSIGNED
132 #define CC2650STK_PWMPIN6 PIN_UNASSIGNED
133 #define CC2650STK_PWMPIN7 PIN_UNASSIGNED
134 
135 /* Sensors */
136 #define CC2650STK_MPU_INT IOID_7
137 #define CC2650STK_TMP_RDY IOID_1
138 
139 /* SPI */
140 #define CC2650STK_SPI_FLASH_CS IOID_14
141 #define CC2650STK_FLASH_CS_ON 0
142 #define CC2650STK_FLASH_CS_OFF 1
143 
144 /* SPI Board */
145 #define CC2650STK_SPI0_MISO IOID_18
146 #define CC2650STK_SPI0_MOSI IOID_19
147 #define CC2650STK_SPI0_CLK IOID_17
148 #define CC2650STK_SPI0_CSN PIN_UNASSIGNED
149 #define CC2650STK_SPI1_MISO PIN_UNASSIGNED
150 #define CC2650STK_SPI1_MOSI PIN_UNASSIGNED
151 #define CC2650STK_SPI1_CLK PIN_UNASSIGNED
152 #define CC2650STK_SPI1_CSN PIN_UNASSIGNED
153 
154 /* UART */
155 #define CC2650STK_UART_TX CC2650STK_DP5_UARTTX
156 #define CC2650STK_UART_RX CC2650STK_DP4_UARTRX
157 
158 /*!
159  * @brief Initialize the general board specific settings
160  *
161  * This function initializes the general board specific settings.
162  */
163 void CC2650STK_initGeneral(void);
164 
165 /*!
166  * @brief Turn off the external flash on LaunchPads
167  *
168  */
169 void CC2650STK_shutDownExtFlash(void);
170 
171 /*!
172  * @brief Wake up the external flash present on the board files
173  *
174  * This function toggles the chip select for the amount of time needed
175  * to wake the chip up.
176  */
177 void CC2650STK_wakeUpExtFlash(void);
178 
179 /*!
180  * @def CC2650STK_CryptoName
181  * @brief Enum of Crypto names
182  */
183 typedef enum CC2650STK_CryptoName {
184  CC2650STK_CRYPTO0 = 0,
185 
186  CC2650STK_CRYPTOCOUNT
187 } CC2650STK_CryptoName;
188 
189 /*!
190  * @def CC2650STK_GPIOName
191  * @brief Enum of GPIO names
192  */
193 typedef enum CC2650STK_GPIOName {
194  CC2650STK_GPIO_S1 = 0,
195  CC2650STK_GPIO_S2,
196  CC2650STK_GPIO_LED0,
197  CC2650STK_GPIO_SPI_FLASH_CS,
198 
199  CC2650STK_GPIOCOUNT
200 } CC2650STK_GPIOName;
201 
202 /*!
203  * @def CC2650STK_GPTimerName
204  * @brief Enum of GPTimers parts
205  */
206 typedef enum CC2650STK_GPTimerName {
207  CC2650STK_GPTIMER0A = 0,
208  CC2650STK_GPTIMER0B,
209  CC2650STK_GPTIMER1A,
210  CC2650STK_GPTIMER1B,
211  CC2650STK_GPTIMER2A,
212  CC2650STK_GPTIMER2B,
213  CC2650STK_GPTIMER3A,
214  CC2650STK_GPTIMER3B,
215 
216  CC2650STK_GPTIMERPARTSCOUNT
217 } CC2650STK_GPTimerName;
218 
219 /*!
220  * @def CC2650STK_GPTimers
221  * @brief Enum of GPTimers
222  */
223 typedef enum CC2650STK_GPTimers {
224  CC2650STK_GPTIMER0 = 0,
225  CC2650STK_GPTIMER1,
226  CC2650STK_GPTIMER2,
227  CC2650STK_GPTIMER3,
228 
229  CC2650STK_GPTIMERCOUNT
230 } CC2650STK_GPTimers;
231 
232 /*!
233  * @def CC2650STK_I2CName
234  * @brief Enum of I2C names
235  */
236 typedef enum CC2650STK_I2CName {
237 #if TI_I2C_CONF_I2C0_ENABLE
238  CC2650STK_I2C0 = 0,
239 #endif
240 
241  CC2650STK_I2CCOUNT
242 } CC2650STK_I2CName;
243 
244 /*!
245  * @def CC2650STK_NVSName
246  * @brief Enum of NVS names
247  */
248 typedef enum CC2650STK_NVSName {
249 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
250  CC2650STK_NVSCC26XX0 = 0,
251 #endif
252 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
253  CC2650STK_NVSSPI25X0,
254 #endif
255 
256  CC2650STK_NVSCOUNT
257 } CC2650STK_NVSName;
258 
259 /*!
260  * @def CC2650STK_PDMName
261  * @brief Enum of PDM names
262  */
263 typedef enum CC2650STK_PDMName {
264  CC2650STK_PDM0 = 0,
265 
266  CC2650STK_PDMCOUNT
267 } CC2650STK_PDMName;
268 
269 /*!
270  * @def CC2650STK_PWMName
271  * @brief Enum of PWM outputs
272  */
273 typedef enum CC2650STK_PWMName {
274  CC2650STK_PWM0 = 0,
275  CC2650STK_PWM1,
276  CC2650STK_PWM2,
277  CC2650STK_PWM3,
278  CC2650STK_PWM4,
279  CC2650STK_PWM5,
280  CC2650STK_PWM6,
281  CC2650STK_PWM7,
282 
283  CC2650STK_PWMCOUNT
284 } CC2650STK_PWMName;
285 
286 /*!
287  * @def CC2650STK_SPIName
288  * @brief Enum of SPI names
289  */
290 typedef enum CC2650STK_SPIName {
291 #if TI_SPI_CONF_SPI0_ENABLE
292  CC2650STK_SPI0 = 0,
293 #endif
294 #if TI_SPI_CONF_SPI1_ENABLE
295  CC2650STK_SPI1,
296 #endif
297 
298  CC2650STK_SPICOUNT
299 } CC2650STK_SPIName;
300 
301 /*!
302  * @def CC2650STK_TRNGName
303  * @brief Enum of TRNGs
304  */
305 typedef enum CC2650STK_TRNGName {
306  CC2650STK_TRNG0 = 0,
307 
308  CC2650STK_TRNGCOUNT
309 } CC2650STK_TRNGName;
310 
311 /*!
312  * @def CC2650STK_UARTName
313  * @brief Enum of UARTs
314  */
315 typedef enum CC2650STK_UARTName {
316 #if TI_UART_CONF_UART0_ENABLE
317  CC2650STK_UART0 = 0,
318 #endif
319 
320 
321  CC2650STK_UARTCOUNT
322 } CC2650STK_UARTName;
323 
324 /*!
325  * @def CC2650STK_UDMAName
326  * @brief Enum of DMA buffers
327  */
328 typedef enum CC2650STK_UDMAName {
329  CC2650STK_UDMA0 = 0,
330 
331  CC2650STK_UDMACOUNT
332 } CC2650STK_UDMAName;
333 
334 /*!
335  * @def CC2650STK_WatchdogName
336  * @brief Enum of Watchdogs
337  */
338 typedef enum CC2650STK_WatchdogName {
339  CC2650STK_WATCHDOG0 = 0,
340 
341  CC2650STK_WATCHDOGCOUNT
342 } CC2650STK_WatchdogName;
343 
344 #ifdef __cplusplus
345 }
346 #endif
347 
348 #endif /* __CC2650STK_BOARD_H__ */
void CC2650STK_wakeUpExtFlash(void)
Wake up the external flash present on the board files.
void CC2650STK_shutDownExtFlash(void)
Turn off the external flash on LaunchPads.
void CC2650STK_initGeneral(void)
Initialize the general board specific settings.
Definition: CC2650STK.c:642