Contiki-NG
CC1350STK.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 CC1350STK.h
34  *
35  * @brief CC1350STK Board Specific header file.
36  *
37  * The CC1350STK header file should be included in an application as
38  * follows:
39  * @code
40  * #include "CC1350STK.h"
41  * @endcode
42  * ============================================================================
43  */
44 #ifndef __CC1350STK_BOARD_H__
45 #define __CC1350STK_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 CC1350STK
63 
64 /* Mapping of pins to board signals using general board aliases
65  * <board signal alias> <pin mapping>
66  */
67 
68 /* Audio */
69 #define CC1350STK_MIC_POWER IOID_13
70 #define CC1350STK_MIC_POWER_ON 1
71 #define CC1350STK_MIC_POWER_OFF 0
72 #define CC1350STK_AUDIO_DI IOID_2
73 #define CC1350STK_AUDIO_CLK IOID_3
74 
75 /* Buzzer */
76 #define CC1350STK_BUZZER IOID_21
77 #define CC1350STK_BUZZER_ON 1
78 #define CC1350STK_BUZZER_OFF 0
79 
80 /* DevPack */
81 #define CC1350STK_AUDIOFS_TDO IOID_16
82 #define CC1350STK_AUDIODO IOID_22
83 #define CC1350STK_DP2 IOID_23
84 #define CC1350STK_DP1 IOID_24
85 #define CC1350STK_DP0 IOID_25
86 #define CC1350STK_DP3 IOID_27
87 #define CC1350STK_DP4_UARTRX IOID_28
88 #define CC1350STK_DP5_UARTTX IOID_29
89 #define CC1350STK_DEVPK_ID IOID_30
90 #define CC1350STK_SPI_DEVPK_CS IOID_20
91 
92 /* Discrete Outputs */
93 #define CC1350STK_PIN_LED1 IOID_10
94 #define CC1350STK_LED_ON 1
95 #define CC1350STK_LED_OFF 0
96 
97 
98 /* Discrete Inputs */
99 #define CC1350STK_KEY_LEFT IOID_15
100 #define CC1350STK_KEY_RIGHT IOID_4
101 #define CC1350STK_RELAY IOID_1
102 
103 /* GPIO */
104 #define CC1350STK_GPIO_LED_ON 1
105 #define CC1350STK_GPIO_LED_OFF 0
106 
107 /* I2C */
108 #define CC1350STK_I2C0_SDA0 IOID_5
109 #define CC1350STK_I2C0_SCL0 IOID_6
110 #define CC1350STK_I2C0_SDA1 IOID_8
111 #define CC1350STK_I2C0_SCL1 IOID_9
112 
113 /* LED-Audio DevPack */
114 #define CC1350STK_DEVPK_LIGHT_BLUE IOID_23
115 #define CC1350STK_DEVPK_LIGHT_GREEN IOID_24
116 #define CC1350STK_DEVPK_LIGHT_WHITE IOID_25
117 #define CC1350STK_DEVPK_LIGHT_RED IOID_27
118 
119 /* Power */
120 #define CC1350STK_MPU_POWER IOID_12
121 #define CC1350STK_MPU_POWER_ON 1
122 #define CC1350STK_MPU_POWER_OFF 0
123 
124 /* PWM */
125 #define CC1350STK_PWMPIN0 CC1350STK_PIN_LED1
126 #define CC1350STK_PWMPIN1 CC1350STK_PIN_LED1
127 #define CC1350STK_PWMPIN2 PIN_UNASSIGNED
128 #define CC1350STK_PWMPIN3 PIN_UNASSIGNED
129 #define CC1350STK_PWMPIN4 PIN_UNASSIGNED
130 #define CC1350STK_PWMPIN5 PIN_UNASSIGNED
131 #define CC1350STK_PWMPIN6 PIN_UNASSIGNED
132 #define CC1350STK_PWMPIN7 PIN_UNASSIGNED
133 
134 /* Sensors */
135 #define CC1350STK_MPU_INT IOID_7
136 #define CC1350STK_TMP_RDY IOID_11
137 
138 /* SPI */
139 #define CC1350STK_SPI_FLASH_CS IOID_14
140 #define CC1350STK_FLASH_CS_ON 0
141 #define CC1350STK_FLASH_CS_OFF 1
142 
143 /* SPI Board */
144 #define CC1350STK_SPI0_MISO IOID_18
145 #define CC1350STK_SPI0_MOSI IOID_19
146 #define CC1350STK_SPI0_CLK IOID_17
147 #define CC1350STK_SPI0_CSN PIN_UNASSIGNED
148 #define CC1350STK_SPI1_MISO PIN_UNASSIGNED
149 #define CC1350STK_SPI1_MOSI PIN_UNASSIGNED
150 #define CC1350STK_SPI1_CLK PIN_UNASSIGNED
151 #define CC1350STK_SPI1_CSN PIN_UNASSIGNED
152 
153 /* UART */
154 #define CC1350STK_UART_TX CC1350STK_DP5_UARTTX
155 #define CC1350STK_UART_RX CC1350STK_DP4_UARTRX
156 
157 /*!
158  * @brief Initialize the general board specific settings
159  *
160  * This function initializes the general board specific settings.
161  */
162 void CC1350STK_initGeneral(void);
163 
164 /*!
165  * @brief Turn off the external flash on LaunchPads
166  *
167  */
168 void CC1350STK_shutDownExtFlash(void);
169 
170 /*!
171  * @brief Wake up the external flash present on the board files
172  *
173  * This function toggles the chip select for the amount of time needed
174  * to wake the chip up.
175  */
176 void CC1350STK_wakeUpExtFlash(void);
177 
178 /*!
179  * @def CC1350STK_CryptoName
180  * @brief Enum of Crypto names
181  */
182 typedef enum CC1350STK_CryptoName {
183  CC1350STK_CRYPTO0 = 0,
184 
185  CC1350STK_CRYPTOCOUNT
186 } CC1350STK_CryptoName;
187 
188 /*!
189  * @def CC1350STK_GPIOName
190  * @brief Enum of GPIO names
191  */
192 typedef enum CC1350STK_GPIOName {
193  CC1350STK_GPIO_S1 = 0,
194  CC1350STK_GPIO_S2,
195  CC1350STK_GPIO_LED0,
196  CC1350STK_GPIO_SPI_FLASH_CS,
197 
198  CC1350STK_GPIOCOUNT
199 } CC1350STK_GPIOName;
200 
201 /*!
202  * @def CC1350STK_GPTimerName
203  * @brief Enum of GPTimers parts
204  */
205 typedef enum CC1350STK_GPTimerName {
206  CC1350STK_GPTIMER0A = 0,
207  CC1350STK_GPTIMER0B,
208  CC1350STK_GPTIMER1A,
209  CC1350STK_GPTIMER1B,
210  CC1350STK_GPTIMER2A,
211  CC1350STK_GPTIMER2B,
212  CC1350STK_GPTIMER3A,
213  CC1350STK_GPTIMER3B,
214 
215  CC1350STK_GPTIMERPARTSCOUNT
216 } CC1350STK_GPTimerName;
217 
218 /*!
219  * @def CC1350STK_GPTimers
220  * @brief Enum of GPTimers
221  */
222 typedef enum CC1350STK_GPTimers {
223  CC1350STK_GPTIMER0 = 0,
224  CC1350STK_GPTIMER1,
225  CC1350STK_GPTIMER2,
226  CC1350STK_GPTIMER3,
227 
228  CC1350STK_GPTIMERCOUNT
229 } CC1350STK_GPTimers;
230 
231 /*!
232  * @def CC1350STK_I2CName
233  * @brief Enum of I2C names
234  */
235 typedef enum CC1350STK_I2CName {
236 #if TI_I2C_CONF_I2C0_ENABLE
237  CC1350STK_I2C0 = 0,
238 #endif
239 
240  CC1350STK_I2CCOUNT
241 } CC1350STK_I2CName;
242 
243 /*!
244  * @def CC1350STK_NVSName
245  * @brief Enum of NVS names
246  */
247 typedef enum CC1350STK_NVSName {
248 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
249  CC1350STK_NVSCC26XX0 = 0,
250 #endif
251 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
252  CC1350STK_NVSSPI25X0,
253 #endif
254 
255  CC1350STK_NVSCOUNT
256 } CC1350STK_NVSName;
257 
258 /*!
259  * @def CC1350STK_PDMName
260  * @brief Enum of PDM names
261  */
262 typedef enum CC1350STK_PDMName {
263  CC1350STK_PDM0 = 0,
264 
265  CC1350STK_PDMCOUNT
266 } CC1350STK_PDMName;
267 
268 /*!
269  * @def CC1350STK_PWMName
270  * @brief Enum of PWM outputs
271  */
272 typedef enum CC1350STK_PWMName {
273  CC1350STK_PWM0 = 0,
274  CC1350STK_PWM1,
275  CC1350STK_PWM2,
276  CC1350STK_PWM3,
277  CC1350STK_PWM4,
278  CC1350STK_PWM5,
279  CC1350STK_PWM6,
280  CC1350STK_PWM7,
281 
282  CC1350STK_PWMCOUNT
283 } CC1350STK_PWMName;
284 
285 /*!
286  * @def CC1350STK_SPIName
287  * @brief Enum of SPI names
288  */
289 typedef enum CC1350STK_SPIName {
290 #if TI_SPI_CONF_SPI0_ENABLE
291  CC1350STK_SPI0 = 0,
292 #endif
293 #if TI_SPI_CONF_SPI1_ENABLE
294  CC1350STK_SPI1,
295 #endif
296 
297  CC1350STK_SPICOUNT
298 } CC1350STK_SPIName;
299 
300 /*!
301  * @def CC1350STK_TRNGName
302  * @brief Enum of TRNGs
303  */
304 typedef enum CC1350STK_TRNGName {
305  CC1350STK_TRNG0 = 0,
306 
307  CC1350STK_TRNGCOUNT
308 } CC1350STK_TRNGName;
309 
310 /*!
311  * @def CC1350STK_UARTName
312  * @brief Enum of UARTs
313  */
314 typedef enum CC1350STK_UARTName {
315 #if TI_UART_CONF_UART0_ENABLE
316  CC1350STK_UART0 = 0,
317 #endif
318 
319  CC1350STK_UARTCOUNT
320 } CC1350STK_UARTName;
321 
322 /*!
323  * @def CC1350STK_UDMAName
324  * @brief Enum of DMA buffers
325  */
326 typedef enum CC1350STK_UDMAName {
327  CC1350STK_UDMA0 = 0,
328 
329  CC1350STK_UDMACOUNT
330 } CC1350STK_UDMAName;
331 
332 /*!
333  * @def CC1350STK_WatchdogName
334  * @brief Enum of Watchdogs
335  */
336 typedef enum CC1350STK_WatchdogName {
337  CC1350STK_WATCHDOG0 = 0,
338 
339  CC1350STK_WATCHDOGCOUNT
340 } CC1350STK_WatchdogName;
341 
342 #ifdef __cplusplus
343 }
344 #endif
345 
346 #endif /* __CC1350STK_BOARD_H__ */
void CC1350STK_shutDownExtFlash(void)
Turn off the external flash on LaunchPads.
void CC1350STK_wakeUpExtFlash(void)
Wake up the external flash present on the board files.
void CC1350STK_initGeneral(void)
Initialize the general board specific settings.
Definition: CC1350STK.c:642