Contiki-NG
Loading...
Searching...
No Matches
LPSTK.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017-2019, 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 LPSTK.h
34 *
35 * @brief LPSTK Board Specific header file.
36 *
37 * The LPSTK header file should be included in an application as
38 * follows:
39 * @code
40 * #include "LPSTK.h"
41 * @endcode
42 *
43 * ===========================================================================
44 */
45#ifndef __LPSTK_BOARD_H__
46#define __LPSTK_BOARD_H__
47
48#ifdef __cplusplus
49extern "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 */
60extern const PIN_Config BoardGpioInitTable[];
61
62/* Defines */
63#define LPSTK
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 LPSTK_DIO24_ANALOG IOID_24
74#define LPSTK_DIO26_ANALOG IOID_26
75#define LPSTK_DIO28_ANALOG IOID_28
76#define LPSTK_DIO29_ANALOG IOID_29
77
78/* Buzzer */
79#define LPSTK_BUZZER IOID_21
80#define LPSTK_BUZZER_ON 1
81#define LPSTK_BUZZER_OFF 0
82
83/* Discrete Inputs */
84#define LPSTK_PIN_BTN1 IOID_15
85#define LPSTK_PIN_BTN2 IOID_14
86#define LPSTK_KEY_LEFT LPSTK_PIN_BTN2
87#define LPSTK_KEY_RIGHT LPSTK_PIN_BTN1
88#define LPSTK_RELAY IOID_23
89
90/* GPIO */
91#define LPSTK_GPIO_LED_ON 1
92#define LPSTK_GPIO_LED_OFF 0
93
94/* I2C */
95#define LPSTK_I2C0_SCL0 IOID_4
96#define LPSTK_I2C0_SDA0 IOID_5
97#define LPSTK_I2C0_SCL1 PIN_UNASSIGNED
98#define LPSTK_I2C0_SDA1 PIN_UNASSIGNED
99
100/* I2S */
101#define LPSTK_I2S_ADO IOID_22
102#define LPSTK_I2S_ADI IOID_2
103#define LPSTK_I2S_BCLK IOID_3
104#define LPSTK_I2S_MCLK PIN_UNASSIGNED
105#define LPSTK_I2S_WCLK IOID_16
106
107/* LEDs */
108#define LPSTK_PIN_LED_ON 1
109#define LPSTK_PIN_LED_OFF 0
110#define LPSTK_PIN_RLED IOID_6
111#define LPSTK_PIN_GLED IOID_7
112
113/* Power */
114#define LPSTK_MPU_POWER IOID_11
115#define LPSTK_MPU_POWER_ON 1
116#define LPSTK_MPU_POWER_OFF 0
117
118/* PWM Outputs */
119#define LPSTK_PWMPIN0 LPSTK_PIN_RLED
120#define LPSTK_PWMPIN1 LPSTK_PIN_GLED
121#define LPSTK_PWMPIN2 PIN_UNASSIGNED
122#define LPSTK_PWMPIN3 PIN_UNASSIGNED
123#define LPSTK_PWMPIN4 PIN_UNASSIGNED
124#define LPSTK_PWMPIN5 PIN_UNASSIGNED
125#define LPSTK_PWMPIN6 PIN_UNASSIGNED
126#define LPSTK_PWMPIN7 PIN_UNASSIGNED
127
128/* Sensors */
129#define LPSTK_MPU_INT IOID_30
130#define LPSTK_TMP_RDY IOID_25
131
132/* SPI */
133#define LPSTK_SPI_FLASH_CS IOID_20
134#define LPSTK_FLASH_CS_ON 0
135#define LPSTK_FLASH_CS_OFF 1
136
137/* SPI Board */
138#define LPSTK_SPI0_MISO IOID_8 /* RF1.20 */
139#define LPSTK_SPI0_MOSI IOID_9 /* RF1.18 */
140#define LPSTK_SPI0_CLK IOID_10 /* RF1.16 */
141#define LPSTK_SPI0_CSN IOID_11
142#define LPSTK_SPI1_MISO PIN_UNASSIGNED
143#define LPSTK_SPI1_MOSI PIN_UNASSIGNED
144#define LPSTK_SPI1_CLK PIN_UNASSIGNED
145#define LPSTK_SPI1_CSN PIN_UNASSIGNED
146
147/* UART Board */
148#define LPSTK_UART0_RX IOID_12 /* RXD */
149#define LPSTK_UART0_TX IOID_13 /* TXD */
150#define LPSTK_UART0_CTS IOID_19 /* CTS */
151#define LPSTK_UART0_RTS IOID_18 /* RTS */
152#define LPSTK_UART1_RX PIN_UNASSIGNED
153#define LPSTK_UART1_TX PIN_UNASSIGNED
154#define LPSTK_UART1_CTS PIN_UNASSIGNED
155#define LPSTK_UART1_RTS PIN_UNASSIGNED
156/* For backward compatibility */
157#define LPSTK_UART_RX LPSTK_UART0_RX
158#define LPSTK_UART_TX LPSTK_UART0_TX
159#define LPSTK_UART_CTS LPSTK_UART0_CTS
160#define LPSTK_UART_RTS LPSTK_UART0_RTS
161
162/*!
163 * @brief Initialize the general board specific settings
164 *
165 * This function initializes the general board specific settings.
166 */
167void LPSTK_initGeneral(void);
168
169/*!
170 * @brief Shut down the external flash present on the board files
171 *
172 * This function bitbangs the SPI sequence necessary to turn off
173 * the external flash on LaunchPads.
174 */
175void LPSTK_shutDownExtFlash(void);
176
177/*!
178 * @brief Wake up the external flash present on the board files
179 *
180 * This function toggles the chip select for the amount of time needed
181 * to wake the chip up.
182 */
183void LPSTK_wakeUpExtFlash(void);
184
185/*!
186 * @def LPSTK_ADCBufName
187 * @brief Enum of ADCs
188 */
189typedef enum LPSTK_ADCBufName {
190 LPSTK_ADCBUF0 = 0,
191
192 LPSTK_ADCBUFCOUNT
193} LPSTK_ADCBufName;
194
195/*!
196 * @def LPSTK_ADCBuf0ChannelName
197 * @brief Enum of ADCBuf channels
198 */
199typedef enum LPSTK_ADCBuf0ChannelName {
200 LPSTK_ADCBUF0CHANNEL0 = 0,
201 LPSTK_ADCBUF0CHANNEL1,
202 LPSTK_ADCBUF0CHANNEL2,
203 LPSTK_ADCBUF0CHANNEL3,
204 LPSTK_ADCBUF0CHANNEL4,
205 LPSTK_ADCBUF0CHANNEL5,
206 LPSTK_ADCBUF0CHANNEL6,
207 LPSTK_ADCBUF0CHANNELVDDS,
208 LPSTK_ADCBUF0CHANNELDCOUPL,
209 LPSTK_ADCBUF0CHANNELVSS,
210
211 LPSTK_ADCBUF0CHANNELCOUNT
212} LPSTK_ADCBuf0ChannelName;
213
214/*!
215 * @def LPSTK_ADCName
216 * @brief Enum of ADCs
217 */
218typedef enum LPSTK_ADCName {
219 LPSTK_ADC0 = 0,
220 LPSTK_ADC1,
221 LPSTK_ADC2,
222 LPSTK_ADC3,
223 LPSTK_ADC4,
224 LPSTK_ADC5,
225 LPSTK_ADC6,
226 LPSTK_ADCDCOUPL,
227 LPSTK_ADCVSS,
228 LPSTK_ADCVDDS,
229
230 LPSTK_ADCCOUNT
231} LPSTK_ADCName;
232
233/*!
234 * @def LPSTK_ECDHName
235 * @brief Enum of ECDH names
236 */
237typedef enum LPSTK_ECDHName {
238 LPSTK_ECDH0 = 0,
239
240 LPSTK_ECDHCOUNT
241} LPSTK_ECDHName;
242
243/*!
244 * @def LPSTK_ECDSAName
245 * @brief Enum of ECDSA names
246 */
247typedef enum LPSTK_ECDSAName {
248 LPSTK_ECDSA0 = 0,
249
250 LPSTK_ECDSACOUNT
251} LPSTK_ECDSAName;
252
253/*!
254 * @def LPSTK_ECJPAKEName
255 * @brief Enum of ECJPAKE names
256 */
257typedef enum LPSTK_ECJPAKEName {
258 LPSTK_ECJPAKE0 = 0,
259
260 LPSTK_ECJPAKECOUNT
261} LPSTK_ECJPAKEName;
262
263/*!
264 * @def LPSTK_AESCCMName
265 * @brief Enum of AESCCM names
266 */
267typedef enum LPSTK_AESCCMName {
268 LPSTK_AESCCM0 = 0,
269
270 LPSTK_AESCCMCOUNT
271} LPSTK_AESCCMName;
272
273/*!
274 * @def LPSTK_AESGCMName
275 * @brief Enum of AESGCM names
276 */
277typedef enum LPSTK_AESGCMName {
278 LPSTK_AESGCM0 = 0,
279
280 LPSTK_AESGCMCOUNT
281} LPSTK_AESGCMName;
282
283/*!
284 * @def LPSTK_AESCBCName
285 * @brief Enum of AESCBC names
286 */
287typedef enum LPSTK_AESCBCName {
288 LPSTK_AESCBC0 = 0,
289
290 LPSTK_AESCBCCOUNT
291} LPSTK_AESCBCName;
292
293/*!
294 * @def LPSTK_AESCTRName
295 * @brief Enum of AESCTR names
296 */
297typedef enum LPSTK_AESCTRName {
298 LPSTK_AESCTR0 = 0,
299
300 LPSTK_AESCTRCOUNT
301} LPSTK_AESCTRName;
302
303/*!
304 * @def LPSTK_AESECBName
305 * @brief Enum of AESECB names
306 */
307typedef enum LPSTK_AESECBName {
308 LPSTK_AESECB0 = 0,
309
310 LPSTK_AESECBCOUNT
311} LPSTK_AESECBName;
312
313/*!
314 * @def LPSTK_AESCTRDRBGName
315 * @brief Enum of AESCTRDRBG names
316 */
317typedef enum LPSTK_AESCTRDRBGName {
318 LPSTK_AESCTRDRBG0 = 0,
319
320 LPSTK_AESCTRDRBGCOUNT
321} LPSTK_AESCTRDRBGName;
322
323/*!
324 * @def LPSTK_SHA2Name
325 * @brief Enum of SHA2 names
326 */
327typedef enum LPSTK_SHA2Name {
328 LPSTK_SHA20 = 0,
329
330 LPSTK_SHA2COUNT
331} LPSTK_SHA2Name;
332
333/*!
334 * @def LPSTK_TRNGName
335 * @brief Enum of TRNG names
336 */
337typedef enum LPSTK_TRNGName {
338 LPSTK_TRNG0 = 0,
339
340 LPSTK_TRNGCOUNT
341} LPSTK_TRNGName;
342
343/*!
344 * @def LPSTK_GPIOName
345 * @brief Enum of GPIO names
346 */
347typedef enum LPSTK_GPIOName {
348 LPSTK_GPIO_S1 = 0,
349 LPSTK_GPIO_S2,
350 LPSTK_GPIO_LED_GREEN,
351 LPSTK_GPIO_LED_RED,
352 LPSTK_GPIO_SPI_FLASH_CS,
353
354 LPSTK_GPIOCOUNT
355} LPSTK_GPIOName;
356
357/*!
358 * @def LPSTK_GPTimerName
359 * @brief Enum of GPTimer parts
360 */
361typedef enum LPSTK_GPTimerName {
362 LPSTK_GPTIMER0A = 0,
363 LPSTK_GPTIMER0B,
364 LPSTK_GPTIMER1A,
365 LPSTK_GPTIMER1B,
366 LPSTK_GPTIMER2A,
367 LPSTK_GPTIMER2B,
368 LPSTK_GPTIMER3A,
369 LPSTK_GPTIMER3B,
370
371 LPSTK_GPTIMERPARTSCOUNT
372} LPSTK_GPTimerName;
373
374/*!
375 * @def LPSTK_GPTimers
376 * @brief Enum of GPTimers
377 */
378typedef enum LPSTK_GPTimers {
379 LPSTK_GPTIMER0 = 0,
380 LPSTK_GPTIMER1,
381 LPSTK_GPTIMER2,
382 LPSTK_GPTIMER3,
383
384 LPSTK_GPTIMERCOUNT
385} LPSTK_GPTimers;
386
387/*!
388 * @def LPSTK_I2CName
389 * @brief Enum of I2C names
390 */
391typedef enum LPSTK_I2CName {
392#if TI_I2C_CONF_I2C0_ENABLE
393 LPSTK_I2C0 = 0,
394 LPSTK_I2C1 = 1,
395#endif
396
397 LPSTK_I2CCOUNT
398} LPSTK_I2CName;
399
400/*!
401 * @def LPSTK_I2SName
402 * @brief Enum of I2S names
403 */
404typedef enum LPSTK_I2SName {
405 LPSTK_I2S0 = 0,
406
407 LPSTK_I2SCOUNT
408} LPSTK_I2SName;
409
410/*!
411 * @def LPSTK_PDMName
412 * @brief Enum of I2S names
413 */
414typedef enum LPSTK_PDMCOUNT {
415 LPSTK_PDM0 = 0,
416
417 LPSTK_PDMCOUNT
418} LPSTK_PDMName;
419
420/*!
421 * @def LPSTK_NVSName
422 * @brief Enum of NVS names
423 */
424typedef enum LPSTK_NVSName {
425#if TI_NVS_CONF_NVS_INTERNAL_ENABLE
426 LPSTK_NVSCC26XX0 = 0,
427#endif
428#if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
429 LPSTK_NVSSPI25X0,
430#endif
431
432 LPSTK_NVSCOUNT
433} LPSTK_NVSName;
434
435/*!
436 * @def LPSTK_PWMName
437 * @brief Enum of PWM outputs
438 */
439typedef enum LPSTK_PWMName {
440 LPSTK_PWM0 = 0,
441 LPSTK_PWM1,
442 LPSTK_PWM2,
443 LPSTK_PWM3,
444 LPSTK_PWM4,
445 LPSTK_PWM5,
446 LPSTK_PWM6,
447 LPSTK_PWM7,
448
449 LPSTK_PWMCOUNT
450} LPSTK_PWMName;
451
452/*!
453 * @def LPSTK_SPIName
454 * @brief Enum of SPI names
455 */
456typedef enum LPSTK_SPIName {
457#if TI_SPI_CONF_SPI0_ENABLE
458 LPSTK_SPI0 = 0,
459#endif
460#if TI_SPI_CONF_SPI1_ENABLE
461 LPSTK_SPI1,
462#endif
463
464 LPSTK_SPICOUNT
465} LPSTK_SPIName;
466
467/*!
468 * @def LPSTK_UARTName
469 * @brief Enum of UARTs
470 */
471typedef enum LPSTK_UARTName {
472#if TI_UART_CONF_UART0_ENABLE
473 LPSTK_UART0 = 0,
474#endif
475
476 LPSTK_UARTCOUNT
477} LPSTK_UARTName;
478
479/*!
480 * @def LPSTK_UDMAName
481 * @brief Enum of DMA buffers
482 */
483typedef enum LPSTK_UDMAName {
484 LPSTK_UDMA0 = 0,
485
486 LPSTK_UDMACOUNT
487} LPSTK_UDMAName;
488
489/*!
490 * @def LPSTK_WatchdogName
491 * @brief Enum of Watchdogs
492 */
493typedef enum LPSTK_WatchdogName {
494 LPSTK_WATCHDOG0 = 0,
495
496 LPSTK_WATCHDOGCOUNT
497} LPSTK_WatchdogName;
498
499
500#ifdef __cplusplus
501}
502#endif
503
504#endif /* __LPSTK_BOARD_H__ */
void LPSTK_shutDownExtFlash(void)
Shut down the external flash present on the board files.
Definition LPSTK_fxns.c:122
void LPSTK_wakeUpExtFlash(void)
Wake up the external flash present on the board files.
Definition LPSTK_fxns.c:92
void LPSTK_initGeneral(void)
Initialize the general board specific settings.
Definition LPSTK.c:1052