forked from 49577/ble_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CC26X2R1_LAUNCHXL.h
447 lines (381 loc) · 13.6 KB
/
CC26X2R1_LAUNCHXL.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
/*
* Copyright (c) 2015-2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** ============================================================================
* @file CC26X2R1_LAUNCHXL.h
*
* @brief CC26X2R1_LAUNCHXL Board Specific header file.
*
* The CC26X2R1_LAUNCHXL header file should be included in an application as
* follows:
* @code
* #include "CC26X2R1_LAUNCHXL.h"
* @endcode
*
* ============================================================================
*/
#ifndef __CC26X2R1_LAUNCHXL_BOARD_H__
#define __CC26X2R1_LAUNCHXL_BOARD_H__
#ifdef __cplusplus
extern "C" {
#endif
/* Includes */
#include <ti/drivers/PIN.h>
#include <ti/devices/cc13x2_cc26x2/driverlib/ioc.h>
/* Externs */
extern const PIN_Config BoardGpioInitTable[];
/* Defines */
#define CC26X2R1_LAUNCHXL
/* Mapping of pins to board signals using general board aliases
* <board signal alias> <pin mapping>
*/
/* Mapping of pins to board signals using general board aliases
* <board signal alias> <pin mapping>
*/
/* Analog Capable DIOs */
#define CC26X2R1_LAUNCHXL_DIO23_ANALOG IOID_23
#define CC26X2R1_LAUNCHXL_DIO24_ANALOG IOID_24
#define CC26X2R1_LAUNCHXL_DIO25_ANALOG IOID_25
#define CC26X2R1_LAUNCHXL_DIO26_ANALOG IOID_26
#define CC26X2R1_LAUNCHXL_DIO27_ANALOG IOID_27
#define CC26X2R1_LAUNCHXL_DIO28_ANALOG IOID_28
#define CC26X2R1_LAUNCHXL_DIO29_ANALOG IOID_29
#define CC26X2R1_LAUNCHXL_DIO30_ANALOG IOID_30
/* Digital IOs */
#define CC26X2R1_LAUNCHXL_DIO0 IOID_0
#define CC26X2R1_LAUNCHXL_DIO1_RFSW IOID_1
#define CC26X2R1_LAUNCHXL_DIO12 IOID_12
#define CC26X2R1_LAUNCHXL_DIO15 IOID_15
#define CC26X2R1_LAUNCHXL_DIO16_TDO IOID_16
#define CC26X2R1_LAUNCHXL_DIO17_TDI IOID_17
#define CC26X2R1_LAUNCHXL_DIO21 IOID_21
#define CC26X2R1_LAUNCHXL_DIO22 IOID_22
/* Discrete Inputs */
#define CC26X2R1_LAUNCHXL_PIN_BTN1 IOID_13
#define CC26X2R1_LAUNCHXL_PIN_BTN2 IOID_14
/* GPIO */
#define CC26X2R1_LAUNCHXL_GPIO_LED_ON 1
#define CC26X2R1_LAUNCHXL_GPIO_LED_OFF 0
/* I2C */
#define CC26X2R1_LAUNCHXL_I2C0_SCL0 IOID_4
#define CC26X2R1_LAUNCHXL_I2C0_SDA0 IOID_5
/* Audio */
#define CC26X2R1_LAUNCHXL_I2S_ADO IOID_0
#define CC26X2R1_LAUNCHXL_I2S_ADI IOID_1
/* I2S */
#define CC26X2R1_LAUNCHXL_I2S_BCLK IOID_30
#define CC26X2R1_LAUNCHXL_I2S_MCLK (PIN_Id)IOID_UNUSED
#define CC26X2R1_LAUNCHXL_I2S_WCLK IOID_29
/* LCD (430BOOST - Sharp96 Rev 1.1) */
#define CC26X2R1_LAUNCHXL_LCD_CS IOID_24 /* SPI chip select */
#define CC26X2R1_LAUNCHXL_LCD_EXTCOMIN IOID_12 /* External COM inversion */
#define CC26X2R1_LAUNCHXL_LCD_ENABLE IOID_22 /* LCD enable */
#define CC26X2R1_LAUNCHXL_LCD_POWER IOID_23 /* LCD power control */
#define CC26X2R1_LAUNCHXL_LCD_CS_ON 1
#define CC26X2R1_LAUNCHXL_LCD_CS_OFF 0
/* LEDs */
#define CC26X2R1_LAUNCHXL_PIN_LED_ON 1
#define CC26X2R1_LAUNCHXL_PIN_LED_OFF 0
#define CC26X2R1_LAUNCHXL_PIN_RLED IOID_6
#define CC26X2R1_LAUNCHXL_PIN_GLED IOID_7
/* PWM Outputs */
#define CC26X2R1_LAUNCHXL_PWMPIN0 CC26X2R1_LAUNCHXL_PIN_RLED
#define CC26X2R1_LAUNCHXL_PWMPIN1 CC26X2R1_LAUNCHXL_PIN_GLED
#define CC26X2R1_LAUNCHXL_PWMPIN2 PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_PWMPIN3 PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_PWMPIN4 PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_PWMPIN5 PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_PWMPIN6 PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_PWMPIN7 PIN_UNASSIGNED
/* SPI */
#define CC26X2R1_LAUNCHXL_SPI_FLASH_CS IOID_20
#define CC26X2R1_LAUNCHXL_FLASH_CS_ON 0
#define CC26X2R1_LAUNCHXL_FLASH_CS_OFF 1
/* SPI Board */
#define CC26X2R1_LAUNCHXL_SPI0_MISO IOID_8 /* RF1.20 */
#define CC26X2R1_LAUNCHXL_SPI0_MOSI IOID_9 /* RF1.18 */
#define CC26X2R1_LAUNCHXL_SPI0_CLK IOID_10 /* RF1.16 */
#define CC26X2R1_LAUNCHXL_SPI0_CSN PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_SPI1_MISO PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_SPI1_MOSI PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_SPI1_CLK PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_SPI1_CSN PIN_UNASSIGNED
/* UART Board */
#define CC26X2R1_LAUNCHXL_UART0_RX IOID_2 /* RXD */
#define CC26X2R1_LAUNCHXL_UART0_TX IOID_3 /* TXD */
#define CC26X2R1_LAUNCHXL_UART0_CTS IOID_19 /* CTS */
#define CC26X2R1_LAUNCHXL_UART0_RTS IOID_18 /* RTS */
#define CC26X2R1_LAUNCHXL_UART1_RX PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_UART1_TX PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_UART1_CTS PIN_UNASSIGNED
#define CC26X2R1_LAUNCHXL_UART1_RTS PIN_UNASSIGNED
/* For backward compatibility */
#define CC26X2R1_LAUNCHXL_UART_RX CC26X2R1_LAUNCHXL_UART0_RX
#define CC26X2R1_LAUNCHXL_UART_TX CC26X2R1_LAUNCHXL_UART0_TX
#define CC26X2R1_LAUNCHXL_UART_CTS CC26X2R1_LAUNCHXL_UART0_CTS
#define CC26X2R1_LAUNCHXL_UART_RTS CC26X2R1_LAUNCHXL_UART0_RTS
/*!
* @brief Initialize the general board specific settings
*
* This function initializes the general board specific settings.
*/
void CC26X2R1_LAUNCHXL_initGeneral(void);
/*!
* @brief Shut down the external flash present on the board files
*
* This function bitbangs the SPI sequence necessary to turn off
* the external flash on LaunchPads.
*/
void CC26X2R1_LAUNCHXL_shutDownExtFlash(void);
/*!
* @brief Wake up the external flash present on the board files
*
* This function toggles the chip select for the amount of time needed
* to wake the chip up.
*/
void CC26X2R1_LAUNCHXL_wakeUpExtFlash(void);
/*!
* @def CC26X2R1_LAUNCHXL_ADCBufName
* @brief Enum of ADCs
*/
typedef enum CC26X2R1_LAUNCHXL_ADCBufName {
CC26X2R1_LAUNCHXL_ADCBUF0 = 0,
CC26X2R1_LAUNCHXL_ADCBUFCOUNT
} CC26X2R1_LAUNCHXL_ADCBufName;
/*!
* @def CC26X2R1_LAUNCHXL_ADCBuf0SourceName
* @brief Enum of ADCBuf channels
*/
typedef enum CC26X2R1_LAUNCHXL_ADCBuf0ChannelName {
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL0 = 0,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL1,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL2,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL3,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL4,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL5,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL6,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNEL7,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNELVDDS,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNELDCOUPL,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNELVSS,
CC26X2R1_LAUNCHXL_ADCBUF0CHANNELCOUNT
} CC26X2R1_LAUNCHXL_ADCBuf0ChannelName;
/*!
* @def CC26X2R1_LAUNCHXL_ADCName
* @brief Enum of ADCs
*/
typedef enum CC26X2R1_LAUNCHXL_ADCName {
CC26X2R1_LAUNCHXL_ADC0 = 0,
CC26X2R1_LAUNCHXL_ADC1,
CC26X2R1_LAUNCHXL_ADC2,
CC26X2R1_LAUNCHXL_ADC3,
CC26X2R1_LAUNCHXL_ADC4,
CC26X2R1_LAUNCHXL_ADC5,
CC26X2R1_LAUNCHXL_ADC6,
CC26X2R1_LAUNCHXL_ADC7,
CC26X2R1_LAUNCHXL_ADCDCOUPL,
CC26X2R1_LAUNCHXL_ADCVSS,
CC26X2R1_LAUNCHXL_ADCVDDS,
CC26X2R1_LAUNCHXL_ADCCOUNT
} CC26X2R1_LAUNCHXL_ADCName;
/*!
* @def CC26X2R1_LAUNCHXL_CryptoName
* @brief Enum of Crypto names
*/
typedef enum CC26X2R1_LAUNCHXL_CryptoName {
CC26X2R1_LAUNCHXL_CRYPTO0 = 0,
CC26X2R1_LAUNCHXL_CRYPTOCOUNT
} CC26X2R1_LAUNCHXL_CryptoName;
/*!
* @def CC26X2R1_LAUNCHXL_ECDHName
* @brief Enum of ECDH names
*/
typedef enum CC26X2R1_LAUNCHXL_ECDHName {
CC26X2R1_LAUNCHXL_ECDH0 = 0,
CC26X2R1_LAUNCHXL_ECDHCOUNT
} CC26X2R1_LAUNCHXL_ECDHName;
/*!
* @def CC26X2R1_LAUNCHXL_ECDSAName
* @brief Enum of ECDSA names
*/
typedef enum CC26X2R1_LAUNCHXL_ECDSAName {
CC26X2R1_LAUNCHXL_ECDSA0 = 0,
CC26X2R1_LAUNCHXL_ECDSACOUNT
} CC26X2R1_LAUNCHXL_ECDSAName;
/*!
* @def CC26X2R1_LAUNCHXL_ECJPAKEName
* @brief Enum of ECJPAKE names
*/
typedef enum CC26X2R1_LAUNCHXL_ECJPAKEName {
CC26X2R1_LAUNCHXL_ECJPAKE0 = 0,
CC26X2R1_LAUNCHXL_ECJPAKECOUNT
} CC26X2R1_LAUNCHXL_ECJPAKEName;
/*!
* @def CC26X2R1_LAUNCHXL_AESCCMName
* @brief Enum of AESCCM names
*/
typedef enum CC26X2R1_LAUNCHXL_AESCCMName {
CC26X2R1_LAUNCHXL_AESCCM0 = 0,
CC26X2R1_LAUNCHXL_AESCCMCOUNT
} CC26X2R1_LAUNCHXL_AESCCMName;
/*!
* @def CC26X2R1_LAUNCHXL_AESECBName
* @brief Enum of AESECB names
*/
typedef enum CC26X2R1_LAUNCHXL_AESECBName {
CC26X2R1_LAUNCHXL_AESECB0 = 0,
CC26X2R1_LAUNCHXL_AESECBCOUNT
} CC26X2R1_LAUNCHXL_AESECBName;
/*!
* @def CC26X2R1_LAUNCHXL_SHA2Name
* @brief Enum of SHA2 names
*/
typedef enum CC26X2R1_LAUNCHXL_SHA2Name {
CC26X2R1_LAUNCHXL_SHA20 = 0,
CC26X2R1_LAUNCHXL_SHA2COUNT
} CC26X2R1_LAUNCHXL_SHA2Name;
/*!
* @def CC26X2R1_LAUNCHXL_GPIOName
* @brief Enum of GPIO names
*/
typedef enum CC26X2R1_LAUNCHXL_GPIOName {
CC26X2R1_LAUNCHXL_GPIO_S1 = 0,
CC26X2R1_LAUNCHXL_GPIO_S2,
CC26X2R1_LAUNCHXL_GPIO_LED_GREEN,
CC26X2R1_LAUNCHXL_GPIO_LED_RED,
CC26X2R1_LAUNCHXL_GPIO_SPI_FLASH_CS,
CC26X2R1_LAUNCHXL_SDSPI_CS,
CC26X2R1_LAUNCHXL_GPIOCOUNT
} CC26X2R1_LAUNCHXL_GPIOName;
/*!
* @def CC26X2R1_LAUNCHXL_GPTimerName
* @brief Enum of GPTimer parts
*/
typedef enum CC26X2R1_LAUNCHXL_GPTimerName {
CC26X2R1_LAUNCHXL_GPTIMER0A = 0,
CC26X2R1_LAUNCHXL_GPTIMER0B,
CC26X2R1_LAUNCHXL_GPTIMER1A,
CC26X2R1_LAUNCHXL_GPTIMER1B,
CC26X2R1_LAUNCHXL_GPTIMER2A,
CC26X2R1_LAUNCHXL_GPTIMER2B,
CC26X2R1_LAUNCHXL_GPTIMER3A,
CC26X2R1_LAUNCHXL_GPTIMER3B,
CC26X2R1_LAUNCHXL_GPTIMERPARTSCOUNT
} CC26X2R1_LAUNCHXL_GPTimerName;
/*!
* @def CC26X2R1_LAUNCHXL_GPTimers
* @brief Enum of GPTimers
*/
typedef enum CC26X2R1_LAUNCHXL_GPTimers {
CC26X2R1_LAUNCHXL_GPTIMER0 = 0,
CC26X2R1_LAUNCHXL_GPTIMER1,
CC26X2R1_LAUNCHXL_GPTIMER2,
CC26X2R1_LAUNCHXL_GPTIMER3,
CC26X2R1_LAUNCHXL_GPTIMERCOUNT
} CC26X2R1_LAUNCHXL_GPTimers;
/*!
* @def CC26X2R1_LAUNCHXL_I2CName
* @brief Enum of I2C names
*/
typedef enum CC26X2R1_LAUNCHXL_I2CName {
CC26X2R1_LAUNCHXL_I2C0 = 0,
CC26X2R1_LAUNCHXL_I2CCOUNT
} CC26X2R1_LAUNCHXL_I2CName;
/*!
* @def CC26X2R1_LAUNCHXL_NVSName
* @brief Enum of NVS names
*/
typedef enum CC26X2R1_LAUNCHXL_NVSName {
CC26X2R1_LAUNCHXL_NVSCC26XX0 = 0,
CC26X2R1_LAUNCHXL_NVSSPI25X0,
CC26X2R1_LAUNCHXL_NVSCOUNT
} CC26X2R1_LAUNCHXL_NVSName;
/*!
* @def CC26X2R1_LAUNCHXL_PWM
* @brief Enum of PWM outputs
*/
typedef enum CC26X2R1_LAUNCHXL_PWMName {
CC26X2R1_LAUNCHXL_PWM0 = 0,
CC26X2R1_LAUNCHXL_PWM1,
CC26X2R1_LAUNCHXL_PWM2,
CC26X2R1_LAUNCHXL_PWM3,
CC26X2R1_LAUNCHXL_PWM4,
CC26X2R1_LAUNCHXL_PWM5,
CC26X2R1_LAUNCHXL_PWM6,
CC26X2R1_LAUNCHXL_PWM7,
CC26X2R1_LAUNCHXL_PWMCOUNT
} CC26X2R1_LAUNCHXL_PWMName;
/*!
* @def CC26X2R1_LAUNCHXL_SDName
* @brief Enum of SD names
*/
typedef enum CC26X2R1_LAUNCHXL_SDName {
CC26X2R1_LAUNCHXL_SDSPI0 = 0,
CC26X2R1_LAUNCHXL_SDCOUNT
} CC26X2R1_LAUNCHXL_SDName;
/*!
* @def CC26X2R1_LAUNCHXL_SPIName
* @brief Enum of SPI names
*/
typedef enum CC26X2R1_LAUNCHXL_SPIName {
CC26X2R1_LAUNCHXL_SPI0 = 0,
CC26X2R1_LAUNCHXL_SPI1,
CC26X2R1_LAUNCHXL_SPICOUNT
} CC26X2R1_LAUNCHXL_SPIName;
/*!
* @def CC26X2R1_LAUNCHXL_UARTName
* @brief Enum of UARTs
*/
typedef enum CC26X2R1_LAUNCHXL_UARTName {
CC26X2R1_LAUNCHXL_UART0 = 0,
CC26X2R1_LAUNCHXL_UART1,
CC26X2R1_LAUNCHXL_UARTCOUNT
} CC26X2R1_LAUNCHXL_UARTName;
/*!
* @def CC26X2R1_LAUNCHXL_UDMAName
* @brief Enum of DMA buffers
*/
typedef enum CC26X2R1_LAUNCHXL_UDMAName {
CC26X2R1_LAUNCHXL_UDMA0 = 0,
CC26X2R1_LAUNCHXL_UDMACOUNT
} CC26X2R1_LAUNCHXL_UDMAName;
/*!
* @def CC26X2R1_LAUNCHXL_WatchdogName
* @brief Enum of Watchdogs
*/
typedef enum CC26X2R1_LAUNCHXL_WatchdogName {
CC26X2R1_LAUNCHXL_WATCHDOG0 = 0,
CC26X2R1_LAUNCHXL_WATCHDOGCOUNT
} CC26X2R1_LAUNCHXL_WatchdogName;
#ifdef __cplusplus
}
#endif
#endif /* __CC26X2R1_LAUNCHXL_BOARD_H__ */