Contiki-NG
CC1350_LAUNCHXL.c
1/*
2 * Copyright (c) 2015-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/*
34 * ============================ CC1350_LAUNCHXL.c ============================
35 * This file is responsible for setting up the board specific items for the
36 * CC1350_LAUNCHXL board.
37 */
38
39#include <stdbool.h>
40#include <stddef.h>
41#include <stdint.h>
42
43#include <ti/devices/DeviceFamily.h>
44#include DeviceFamily_constructPath(driverlib/ioc.h)
45#include DeviceFamily_constructPath(driverlib/udma.h)
46#include DeviceFamily_constructPath(inc/hw_ints.h)
47#include DeviceFamily_constructPath(inc/hw_memmap.h)
48
49#include "CC1350_LAUNCHXL.h"
50
51/*
52 * =============================== ADCBuf ===============================
53 */
54#include <ti/drivers/ADCBuf.h>
55#include <ti/drivers/adcbuf/ADCBufCC26XX.h>
56
57ADCBufCC26XX_Object adcBufCC26xxObjects[CC1350_LAUNCHXL_ADCBUFCOUNT];
58
59/*
60 * This table converts a virtual adc channel into a dio and internal analogue
61 * input signal. This table is necessary for the functioning of the adcBuf
62 * driver. Comment out unused entries to save flash. Dio and internal signal
63 * pairs are hardwired. Do not remap them in the table. You may reorder entire
64 * entries. The mapping of dio and internal signals is package dependent.
65 */
66const ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[CC1350_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
67 {CC1350_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
68 {CC1350_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
69 {CC1350_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
70 {CC1350_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
71 {CC1350_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
72 {CC1350_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
73 {CC1350_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
74 {CC1350_LAUNCHXL_DIO30_ANALOG, ADC_COMPB_IN_AUXIO0},
75 {PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
76 {PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
77 {PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
78};
79
80const ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC1350_LAUNCHXL_ADCBUFCOUNT] = {
81 {
82 .intPriority = ~0,
83 .swiPriority = 0,
84 .adcChannelLut = ADCBufCC26XX_adcChannelLut,
85 }
86};
87
88const ADCBuf_Config ADCBuf_config[CC1350_LAUNCHXL_ADCBUFCOUNT] = {
89 {
90 &ADCBufCC26XX_fxnTable,
91 &adcBufCC26xxObjects[CC1350_LAUNCHXL_ADCBUF0],
92 &adcBufCC26xxHWAttrs[CC1350_LAUNCHXL_ADCBUF0]
93 },
94};
95
96const uint_least8_t ADCBuf_count = CC1350_LAUNCHXL_ADCBUFCOUNT;
97
98/*
99 * =============================== ADC ===============================
100 */
101#include <ti/drivers/ADC.h>
102#include <ti/drivers/adc/ADCCC26XX.h>
103
104ADCCC26XX_Object adcCC26xxObjects[CC1350_LAUNCHXL_ADCCOUNT];
105
106const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADCCOUNT] = {
107 {
108 .adcDIO = CC1350_LAUNCHXL_DIO23_ANALOG,
109 .adcCompBInput = ADC_COMPB_IN_AUXIO7,
110 .refSource = ADCCC26XX_FIXED_REFERENCE,
111 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
112 .inputScalingEnabled = true,
113 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
114 .returnAdjustedVal = false
115 },
116 {
117 .adcDIO = CC1350_LAUNCHXL_DIO24_ANALOG,
118 .adcCompBInput = ADC_COMPB_IN_AUXIO6,
119 .refSource = ADCCC26XX_FIXED_REFERENCE,
120 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
121 .inputScalingEnabled = true,
122 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
123 .returnAdjustedVal = false
124 },
125 {
126 .adcDIO = CC1350_LAUNCHXL_DIO25_ANALOG,
127 .adcCompBInput = ADC_COMPB_IN_AUXIO5,
128 .refSource = ADCCC26XX_FIXED_REFERENCE,
129 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
130 .inputScalingEnabled = true,
131 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
132 .returnAdjustedVal = false
133 },
134 {
135 .adcDIO = CC1350_LAUNCHXL_DIO26_ANALOG,
136 .adcCompBInput = ADC_COMPB_IN_AUXIO4,
137 .refSource = ADCCC26XX_FIXED_REFERENCE,
138 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
139 .inputScalingEnabled = true,
140 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
141 .returnAdjustedVal = false
142 },
143 {
144 .adcDIO = CC1350_LAUNCHXL_DIO27_ANALOG,
145 .adcCompBInput = ADC_COMPB_IN_AUXIO3,
146 .refSource = ADCCC26XX_FIXED_REFERENCE,
147 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
148 .inputScalingEnabled = true,
149 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
150 .returnAdjustedVal = false
151 },
152 {
153 .adcDIO = CC1350_LAUNCHXL_DIO28_ANALOG,
154 .adcCompBInput = ADC_COMPB_IN_AUXIO2,
155 .refSource = ADCCC26XX_FIXED_REFERENCE,
156 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
157 .inputScalingEnabled = true,
158 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
159 .returnAdjustedVal = false
160 },
161 {
162 .adcDIO = CC1350_LAUNCHXL_DIO29_ANALOG,
163 .adcCompBInput = ADC_COMPB_IN_AUXIO1,
164 .refSource = ADCCC26XX_FIXED_REFERENCE,
165 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
166 .inputScalingEnabled = true,
167 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
168 .returnAdjustedVal = false
169 },
170 {
171 .adcDIO = CC1350_LAUNCHXL_DIO30_ANALOG,
172 .adcCompBInput = ADC_COMPB_IN_AUXIO0,
173 .refSource = ADCCC26XX_FIXED_REFERENCE,
174 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
175 .inputScalingEnabled = true,
176 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
177 .returnAdjustedVal = false
178 },
179 {
180 .adcDIO = PIN_UNASSIGNED,
181 .adcCompBInput = ADC_COMPB_IN_DCOUPL,
182 .refSource = ADCCC26XX_FIXED_REFERENCE,
183 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
184 .inputScalingEnabled = true,
185 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
186 .returnAdjustedVal = false
187 },
188 {
189 .adcDIO = PIN_UNASSIGNED,
190 .adcCompBInput = ADC_COMPB_IN_VSS,
191 .refSource = ADCCC26XX_FIXED_REFERENCE,
192 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
193 .inputScalingEnabled = true,
194 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
195 .returnAdjustedVal = false
196 },
197 {
198 .adcDIO = PIN_UNASSIGNED,
199 .adcCompBInput = ADC_COMPB_IN_VDDS,
200 .refSource = ADCCC26XX_FIXED_REFERENCE,
201 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
202 .inputScalingEnabled = true,
203 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
204 .returnAdjustedVal = false
205 }
206};
207
208const ADC_Config ADC_config[CC1350_LAUNCHXL_ADCCOUNT] = {
209 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC0]},
210 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC1]},
211 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC2]},
212 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC3]},
213 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC4]},
214 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC5]},
215 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC6]},
216 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADC7], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADC7]},
217 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADCDCOUPL]},
218 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADCVSS]},
219 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_ADCVDDS]},
220};
221
222const uint_least8_t ADC_count = CC1350_LAUNCHXL_ADCCOUNT;
223
224/*
225 * =============================== Crypto ===============================
226 */
227#include <ti/drivers/crypto/CryptoCC26XX.h>
228
229CryptoCC26XX_Object cryptoCC26XXObjects[CC1350_LAUNCHXL_CRYPTOCOUNT];
230
231const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC1350_LAUNCHXL_CRYPTOCOUNT] = {
232 {
233 .baseAddr = CRYPTO_BASE,
234 .powerMngrId = PowerCC26XX_PERIPH_CRYPTO,
235 .intNum = INT_CRYPTO_RESULT_AVAIL_IRQ,
236 .intPriority = ~0,
237 }
238};
239
240const CryptoCC26XX_Config CryptoCC26XX_config[CC1350_LAUNCHXL_CRYPTOCOUNT] = {
241 {
242 .object = &cryptoCC26XXObjects[CC1350_LAUNCHXL_CRYPTO0],
243 .hwAttrs = &cryptoCC26XXHWAttrs[CC1350_LAUNCHXL_CRYPTO0]
244 },
245};
246
247/*
248 * =============================== AESCCM ===============================
249 */
250#include <ti/drivers/AESCCM.h>
251#include <ti/drivers/aesccm/AESCCMCC26XX.h>
252
253AESCCMCC26XX_Object aesccmCC26XXObjects[CC1350_LAUNCHXL_AESCCMCOUNT];
254
255const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC1350_LAUNCHXL_AESCCMCOUNT] = {
256 {
257 .intPriority = ~0,
258 }
259};
260
261const AESCCM_Config AESCCM_config[CC1350_LAUNCHXL_AESCCMCOUNT] = {
262 {
263 .object = &aesccmCC26XXObjects[CC1350_LAUNCHXL_AESCCM0],
264 .hwAttrs = &aesccmCC26XXHWAttrs[CC1350_LAUNCHXL_AESCCM0]
265 },
266};
267
268const uint_least8_t AESCCM_count = CC1350_LAUNCHXL_AESCCMCOUNT;
269
270
271/*
272 * =============================== AESGCM ===============================
273 */
274#include <ti/drivers/AESGCM.h>
275#include <ti/drivers/aesgcm/AESGCMCC26XX.h>
276
277AESGCMCC26XX_Object aesgcmCC26XXObjects[CC1350_LAUNCHXL_AESGCMCOUNT];
278
279const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC1350_LAUNCHXL_AESGCMCOUNT] = {
280 {
281 .intPriority = ~0,
282 }
283};
284
285const AESGCM_Config AESGCM_config[CC1350_LAUNCHXL_AESGCMCOUNT] = {
286 {
287 .object = &aesgcmCC26XXObjects[CC1350_LAUNCHXL_AESGCM0],
288 .hwAttrs = &aesgcmCC26XXHWAttrs[CC1350_LAUNCHXL_AESGCM0]
289 },
290};
291
292const uint_least8_t AESGCM_count = CC1350_LAUNCHXL_AESGCMCOUNT;
293
294/*
295 * =============================== AESCBC ===============================
296 */
297#include <ti/drivers/AESCBC.h>
298#include <ti/drivers/aescbc/AESCBCCC26XX.h>
299
300AESCBCCC26XX_Object aescbcCC26XXObjects[CC1350_LAUNCHXL_AESCBCCOUNT];
301
302const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC1350_LAUNCHXL_AESCBCCOUNT] = {
303 {
304 .intPriority = ~0,
305 }
306};
307
308const AESCBC_Config AESCBC_config[CC1350_LAUNCHXL_AESCBCCOUNT] = {
309 {
310 .object = &aescbcCC26XXObjects[CC1350_LAUNCHXL_AESCBC0],
311 .hwAttrs = &aescbcCC26XXHWAttrs[CC1350_LAUNCHXL_AESCBC0]
312 },
313};
314
315const uint_least8_t AESCBC_count = CC1350_LAUNCHXL_AESCBCCOUNT;
316
317/*
318 * =============================== AESCTR ===============================
319 */
320#include <ti/drivers/AESCTR.h>
321#include <ti/drivers/aesctr/AESCTRCC26XX.h>
322
323AESCTRCC26XX_Object aesctrCC26XXObjects[CC1350_LAUNCHXL_AESCTRCOUNT];
324
325const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC1350_LAUNCHXL_AESCTRCOUNT] = {
326 {
327 .intPriority = ~0,
328 }
329};
330
331const AESCTR_Config AESCTR_config[CC1350_LAUNCHXL_AESCTRCOUNT] = {
332 {
333 .object = &aesctrCC26XXObjects[CC1350_LAUNCHXL_AESCTR0],
334 .hwAttrs = &aesctrCC26XXHWAttrs[CC1350_LAUNCHXL_AESCTR0]
335 },
336};
337
338const uint_least8_t AESCTR_count = CC1350_LAUNCHXL_AESCTRCOUNT;
339
340/*
341 * =============================== AESECB ===============================
342 */
343#include <ti/drivers/AESECB.h>
344#include <ti/drivers/aesecb/AESECBCC26XX.h>
345
346AESECBCC26XX_Object aesecbCC26XXObjects[CC1350_LAUNCHXL_AESECBCOUNT];
347
348const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC1350_LAUNCHXL_AESECBCOUNT] = {
349 {
350 .intPriority = ~0,
351 }
352};
353
354const AESECB_Config AESECB_config[CC1350_LAUNCHXL_AESECBCOUNT] = {
355 {
356 .object = &aesecbCC26XXObjects[CC1350_LAUNCHXL_AESECB0],
357 .hwAttrs = &aesecbCC26XXHWAttrs[CC1350_LAUNCHXL_AESECB0]
358 },
359};
360
361const uint_least8_t AESECB_count = CC1350_LAUNCHXL_AESECBCOUNT;
362
363/*
364 * =============================== AESCTRDRBG ===============================
365 */
366#include <ti/drivers/AESCTRDRBG.h>
367#include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
368
369AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC1350_LAUNCHXL_AESCTRDRBGCOUNT];
370
371const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC1350_LAUNCHXL_AESCTRDRBGCOUNT] = {
372 {
373 .aesctrIndex = CC1350_LAUNCHXL_AESCTR0,
374 }
375};
376
377const AESCTRDRBG_Config AESCTRDRBG_config[CC1350_LAUNCHXL_AESCTRDRBGCOUNT] = {
378 {
379 .object = &aesctrdrbgXXObjects[CC1350_LAUNCHXL_AESCTRDRBG0],
380 .hwAttrs = &aesctrdrbgXXHWAttrs[CC1350_LAUNCHXL_AESCTRDRBG0]
381 },
382};
383
384const uint_least8_t AESCTRDRBG_count = CC1350_LAUNCHXL_AESCTRDRBGCOUNT;
385
386/*
387 * =============================== TRNG ===============================
388 */
389#include <ti/drivers/TRNG.h>
390#include <ti/drivers/trng/TRNGCC26XX.h>
391
392TRNGCC26XX_Object trngCC26XXObjects[CC1350_LAUNCHXL_TRNGCOUNT];
393
394const TRNGCC26XX_HWAttrs trngCC26X2HWAttrs[CC1350_LAUNCHXL_TRNGCOUNT] = {
395 {
396 .intPriority = ~0,
397 .swiPriority = 0,
398 .samplesPerCycle = 240000,
399 }
400};
401
402const TRNG_Config TRNG_config[CC1350_LAUNCHXL_TRNGCOUNT] = {
403 {
404 .object = &trngCC26XXObjects[CC1350_LAUNCHXL_TRNG0],
405 .hwAttrs = &trngCC26X2HWAttrs[CC1350_LAUNCHXL_TRNG0]
406 },
407};
408
409const uint_least8_t TRNG_count = CC1350_LAUNCHXL_TRNGCOUNT;
410
411/*
412 * =============================== GPIO ===============================
413 */
414#include <ti/drivers/GPIO.h>
415#include <ti/drivers/gpio/GPIOCC26XX.h>
416
417/*
418 * Array of Pin configurations
419 * NOTE: The order of the pin configurations must coincide with what was
420 * defined in CC1350_LAUNCHXL.h
421 * NOTE: Pins not used for interrupts should be placed at the end of the
422 * array. Callback entries can be omitted from callbacks array to
423 * reduce memory usage.
424 */
425GPIO_PinConfig gpioPinConfigs[] = {
426 /* Input pins */
427 GPIOCC26XX_DIO_13 | GPIO_DO_NOT_CONFIG, /* Button 0 */
428 GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
429
430 GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC1350_LAUNCHXL_SPI_MASTER_READY */
431 GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC1350_LAUNCHXL_SPI_SLAVE_READY */
432
433 /* Output pins */
434 GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
435 GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
436
437 /* SPI Flash CSN */
438 GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
439
440 /* SD CS */
441 GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,
442};
443
444/*
445 * Array of callback function pointers
446 * NOTE: The order of the pin configurations must coincide with what was
447 * defined in CC1350_LAUNCHXL.h
448 * NOTE: Pins not used for interrupts can be omitted from callbacks array to
449 * reduce memory usage (if placed at end of gpioPinConfigs array).
450 */
451GPIO_CallbackFxn gpioCallbackFunctions[] = {
452 NULL, /* Button 0 */
453 NULL, /* Button 1 */
454 NULL, /* CC1350_LAUNCHXL_SPI_MASTER_READY */
455 NULL, /* CC1350_LAUNCHXL_SPI_SLAVE_READY */
456};
457
458const GPIOCC26XX_Config GPIOCC26XX_config = {
459 .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
460 .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
461 .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
462 .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
463 .intPriority = (~0)
464};
465
466/*
467 * =============================== GPTimer ===============================
468 * Remove unused entries to reduce flash usage both in Board.c and Board.h
469 */
470#include <ti/drivers/timer/GPTimerCC26XX.h>
471
472GPTimerCC26XX_Object gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMERCOUNT];
473
474const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMERPARTSCOUNT] = {
475 { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
476 { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
477 { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
478 { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
479 { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
480 { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
481 { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
482 { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
483};
484
485const GPTimerCC26XX_Config GPTimerCC26XX_config[CC1350_LAUNCHXL_GPTIMERPARTSCOUNT] = {
486 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER0A], GPT_A },
487 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER0B], GPT_B },
488 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER1A], GPT_A },
489 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER1B], GPT_B },
490 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER2A], GPT_A },
491 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER2B], GPT_B },
492 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER3A], GPT_A },
493 { &gptimerCC26XXObjects[CC1350_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_GPTIMER3B], GPT_B },
494};
495
496/*
497 * =============================== I2C ===============================
498*/
499#include <ti/drivers/I2C.h>
500#include <ti/drivers/i2c/I2CCC26XX.h>
501
502#if TI_I2C_CONF_ENABLE
503
504I2CCC26XX_Object i2cCC26xxObjects[CC1350_LAUNCHXL_I2CCOUNT];
505
506const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1350_LAUNCHXL_I2CCOUNT] = {
507#if TI_I2C_CONF_I2C0_ENABLE
508 {
509 .baseAddr = I2C0_BASE,
510 .powerMngrId = PowerCC26XX_PERIPH_I2C0,
511 .intNum = INT_I2C_IRQ,
512 .intPriority = ~0,
513 .swiPriority = 0,
514 .sdaPin = CC1350_LAUNCHXL_I2C0_SDA0,
515 .sclPin = CC1350_LAUNCHXL_I2C0_SCL0,
516 },
517#endif
518};
519
520const I2C_Config I2C_config[CC1350_LAUNCHXL_I2CCOUNT] = {
521#if TI_I2C_CONF_I2C0_ENABLE
522 {
523 .fxnTablePtr = &I2CCC26XX_fxnTable,
524 .object = &i2cCC26xxObjects[CC1350_LAUNCHXL_I2C0],
525 .hwAttrs = &i2cCC26xxHWAttrs[CC1350_LAUNCHXL_I2C0]
526 },
527#endif
528};
529
530const uint_least8_t I2C_count = CC1350_LAUNCHXL_I2CCOUNT;
531
532#endif /* TI_I2C_CONF_ENABLE */
533
534/*
535 * =============================== I2S ===============================
536*/
537#include <ti/drivers/I2S.h>
538#include <ti/drivers/i2s/I2SCC26XX.h>
539
540I2SCC26XX_Object i2sCC26XXObjects[CC1350_LAUNCHXL_I2SCOUNT];
541
542const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC1350_LAUNCHXL_I2SCOUNT] = {
543 {
544 .pinSD1 = CC1350_LAUNCHXL_I2S_ADI,
545 .pinSD0 = CC1350_LAUNCHXL_I2S_ADO,
546 .pinSCK = CC1350_LAUNCHXL_I2S_BCLK,
547 .pinMCLK = CC1350_LAUNCHXL_I2S_MCLK,
548 .pinWS = CC1350_LAUNCHXL_I2S_WCLK,
549 .intPriority = ~0,
550 }
551};
552
553const I2S_Config I2S_config[CC1350_LAUNCHXL_I2SCOUNT] = {
554 {
555 .object = &i2sCC26XXObjects[CC1350_LAUNCHXL_I2S0],
556 .hwAttrs = &i2sCC26XXHWAttrs[CC1350_LAUNCHXL_I2S0]
557 },
558};
559
560const uint_least8_t I2S_count = CC1350_LAUNCHXL_I2SCOUNT;
561
562/*
563 * =============================== NVS ===============================
564 */
565#include <ti/drivers/NVS.h>
566#include <ti/drivers/nvs/NVSSPI25X.h>
567#include <ti/drivers/nvs/NVSCC26XX.h>
568
569#define NVS_REGIONS_BASE 0x1A000
570#define SECTORSIZE 0x1000
571#define REGIONSIZE (SECTORSIZE * 4)
572
573#if TI_NVS_CONF_ENABLE
574
575#if TI_NVS_CONF_NVS_INTERNAL_ENABLE
576
577/*
578 * Reserve flash sectors for NVS driver use by placing an uninitialized byte
579 * array at the desired flash address.
580 */
581#if defined(__TI_COMPILER_VERSION__)
582
583/*
584 * Place uninitialized array at NVS_REGIONS_BASE
585 */
586#pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
587#pragma NOINIT(flashBuf);
588static char flashBuf[REGIONSIZE];
589
590#elif defined(__IAR_SYSTEMS_ICC__)
591
592/*
593 * Place uninitialized array at NVS_REGIONS_BASE
594 */
595static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
596
597#elif defined(__GNUC__)
598
599/*
600 * Place the flash buffers in the .nvs section created in the gcc linker file.
601 * The .nvs section enforces alignment on a sector boundary but may
602 * be placed anywhere in flash memory. If desired the .nvs section can be set
603 * to a fixed address by changing the following in the gcc linker file:
604 *
605 * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
606 * *(.nvs)
607 * } > REGION_TEXT
608 */
609__attribute__ ((section (".nvs")))
610static char flashBuf[REGIONSIZE];
611
612#endif
613
614/* Allocate objects for NVS Internal Regions */
615NVSCC26XX_Object nvsCC26xxObjects[1];
616
617/* Hardware attributes for NVS Internal Regions */
618const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
619 {
620 .regionBase = (void *)flashBuf,
621 .regionSize = REGIONSIZE,
622 },
623};
624
625#endif /* TI_NVS_CONF_NVS_INTERNAL_ENABLE */
626
627#if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
628
629#define SPISECTORSIZE 0x1000
630#define SPIREGIONSIZE (SPISECTORSIZE * 32)
631#define VERIFYBUFSIZE 64
632
633static uint8_t verifyBuf[VERIFYBUFSIZE];
634
635/* Allocate objects for NVS External Regions */
636NVSSPI25X_Object nvsSPI25XObjects[1];
637
638/* Hardware attributes for NVS External Regions */
639const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
640 {
641 .regionBaseOffset = 0,
642 .regionSize = SPIREGIONSIZE,
643 .sectorSize = SPISECTORSIZE,
644 .verifyBuf = verifyBuf,
645 .verifyBufSize = VERIFYBUFSIZE,
646 .spiHandle = NULL,
647 .spiIndex = 0,
648 .spiBitRate = 4000000,
649 .spiCsnGpioIndex = CC1350_LAUNCHXL_GPIO_SPI_FLASH_CS,
650 .statusPollDelayUs = 100,
651 },
652};
653
654#endif /* TI_NVS_CONF_NVS_EXTERNAL_ENABLE */
655
656/* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
657const NVS_Config NVS_config[CC1350_LAUNCHXL_NVSCOUNT] = {
658#if TI_NVS_CONF_NVS_INTERNAL_ENABLE
659 {
660 .fxnTablePtr = &NVSCC26XX_fxnTable,
661 .object = &nvsCC26xxObjects[0],
662 .hwAttrs = &nvsCC26xxHWAttrs[0],
663 },
664#endif
665#if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
666 {
667 .fxnTablePtr = &NVSSPI25X_fxnTable,
668 .object = &nvsSPI25XObjects[0],
669 .hwAttrs = &nvsSPI25XHWAttrs[0],
670 },
671#endif
672};
673
674const uint_least8_t NVS_count = CC1350_LAUNCHXL_NVSCOUNT;
675
676#endif /* TI_NVS_CONF_ENABLE */
677
678/*
679 * =============================== PIN ===============================
680 */
681#include <ti/drivers/PIN.h>
682#include <ti/drivers/pin/PINCC26XX.h>
683
684const PIN_Config BoardGpioInitTable[] = {
685
686 CC1350_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
687 CC1350_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
688 CC1350_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
689 CC1350_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
690 CC1350_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
691 CC1350_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
692 CC1350_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
693 CC1350_LAUNCHXL_DIO1_RF_SUB1GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* RF SW Switch defaults to 2.4 GHz path*/
694 CC1350_LAUNCHXL_DIO30_RF_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* External RF Switch is powered off by default */
695 CC1350_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
696 CC1350_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
697 CC1350_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
698 PIN_TERMINATE
699};
700
701const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
702 .intPriority = ~0,
703 .swiPriority = 0
704};
705
706/*
707 * =============================== Power ===============================
708 */
709#include <ti/drivers/Power.h>
710#include <ti/drivers/power/PowerCC26XX.h>
711#include "clock-arch.h"
712
713const PowerCC26XX_Config PowerCC26XX_config = {
714 .policyInitFxn = NULL,
715 .policyFxn = &clock_arch_standby_policy,
716 .calibrateFxn = &PowerCC26XX_calibrate,
717 .enablePolicy = true,
718 .calibrateRCOSC_LF = true,
719 .calibrateRCOSC_HF = true,
720};
721
722/*
723 * =============================== PWM ===============================
724 * Remove unused entries to reduce flash usage both in Board.c and Board.h
725 */
726#include <ti/drivers/PWM.h>
727#include <ti/drivers/pwm/PWMTimerCC26XX.h>
728
729PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWMCOUNT];
730
731const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWMCOUNT] = {
732 { .pwmPin = CC1350_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER0A },
733 { .pwmPin = CC1350_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER0B },
734 { .pwmPin = CC1350_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER1A },
735 { .pwmPin = CC1350_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER1B },
736 { .pwmPin = CC1350_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER2A },
737 { .pwmPin = CC1350_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER2B },
738 { .pwmPin = CC1350_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER3A },
739 { .pwmPin = CC1350_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC1350_LAUNCHXL_GPTIMER3B },
740};
741
742const PWM_Config PWM_config[CC1350_LAUNCHXL_PWMCOUNT] = {
743 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM0] },
744 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM1] },
745 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM2] },
746 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM3] },
747 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM4] },
748 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM5] },
749 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM6] },
750 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_PWM7] },
751};
752
753const uint_least8_t PWM_count = CC1350_LAUNCHXL_PWMCOUNT;
754
755/*
756 * =============================== RF Driver ===============================
757 */
758#include <ti/drivers/rf/RF.h>
759
760/*
761 * Board-specific callback function to set the correct antenna path.
762 *
763 * This function is called by the RF driver on global driver events.
764 * It contains a default implementation to set the correct antenna path.
765 * This function is defined in the file CC1350_LAUNCHXL_fxns.c
766 */
767extern void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg);
768
769const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
770 .hwiPriority = ~0, /* Lowest HWI priority */
771 .swiPriority = 0, /* Lowest SWI priority */
772 .xoscHfAlwaysNeeded = true, /* Keep XOSC dependency while in standby */
773
774 /* Register the board specific callback */
775 .globalCallback = &rfDriverCallback,
776 /* Subscribe the callback to both events */
777 .globalEventMask = RF_GlobalEventRadioSetup | RF_GlobalEventRadioPowerDown
778};
779
780/*
781 * =============================== SD ===============================
782 */
783#include <ti/drivers/SD.h>
784#include <ti/drivers/sd/SDSPI.h>
785
786#if TI_SD_CONF_ENABLE
787
788#if !(TI_SPI_CONF_SPI0_ENABLE)
789#error "SD driver requires SPI0 enabled"
790#endif
791
792SDSPI_Object sdspiObjects[CC1350_LAUNCHXL_SDCOUNT];
793
794const SDSPI_HWAttrs sdspiHWAttrs[CC1350_LAUNCHXL_SDCOUNT] = {
795 {
796 .spiIndex = CC1350_LAUNCHXL_SPI0,
797 .spiCsGpioIndex = CC1350_LAUNCHXL_SDSPI_CS
798 }
799};
800
801const SD_Config SD_config[CC1350_LAUNCHXL_SDCOUNT] = {
802 {
803 .fxnTablePtr = &SDSPI_fxnTable,
804 .object = &sdspiObjects[CC1350_LAUNCHXL_SDSPI0],
805 .hwAttrs = &sdspiHWAttrs[CC1350_LAUNCHXL_SDSPI0]
806 },
807};
808
809const uint_least8_t SD_count = CC1350_LAUNCHXL_SDCOUNT;
810
811#endif /* TI_SD_CONF_ENABLE */
812
813/*
814 * =============================== SPI DMA ===============================
815 */
816#include <ti/drivers/SPI.h>
817#include <ti/drivers/spi/SPICC26XXDMA.h>
818
819#if TI_SPI_CONF_ENABLE
820
821SPICC26XXDMA_Object spiCC26XXDMAObjects[CC1350_LAUNCHXL_SPICOUNT];
822
823/*
824 * NOTE: The SPI instances below can be used by the SD driver to communicate
825 * with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
826 * to satisfy the SDSPI driver requirement.
827 */
828const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_SPICOUNT] = {
829#if TI_SPI_CONF_SPI0_ENABLE
830 {
831 .baseAddr = SSI0_BASE,
832 .intNum = INT_SSI0_COMB,
833 .intPriority = ~0,
834 .swiPriority = 0,
835 .powerMngrId = PowerCC26XX_PERIPH_SSI0,
836 .defaultTxBufValue = 0xFF,
837 .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
838 .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
839 .mosiPin = CC1350_LAUNCHXL_SPI0_MOSI,
840 .misoPin = CC1350_LAUNCHXL_SPI0_MISO,
841 .clkPin = CC1350_LAUNCHXL_SPI0_CLK,
842 .csnPin = CC1350_LAUNCHXL_SPI0_CSN,
843 .minDmaTransferSize = 10
844 },
845#endif
846#if TI_SPI_CONF_SPI1_ENABLE
847 {
848 .baseAddr = SSI1_BASE,
849 .intNum = INT_SSI1_COMB,
850 .intPriority = ~0,
851 .swiPriority = 0,
852 .powerMngrId = PowerCC26XX_PERIPH_SSI1,
853 .defaultTxBufValue = 0xFF,
854 .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
855 .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
856 .mosiPin = CC1350_LAUNCHXL_SPI1_MOSI,
857 .misoPin = CC1350_LAUNCHXL_SPI1_MISO,
858 .clkPin = CC1350_LAUNCHXL_SPI1_CLK,
859 .csnPin = CC1350_LAUNCHXL_SPI1_CSN,
860 .minDmaTransferSize = 10
861 },
862#endif
863};
864
865const SPI_Config SPI_config[CC1350_LAUNCHXL_SPICOUNT] = {
866#if TI_SPI_CONF_SPI0_ENABLE
867 {
868 .fxnTablePtr = &SPICC26XXDMA_fxnTable,
869 .object = &spiCC26XXDMAObjects[CC1350_LAUNCHXL_SPI0],
870 .hwAttrs = &spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_SPI0]
871 },
872#endif
873#if TI_SPI_CONF_SPI1_ENABLE
874 {
875 .fxnTablePtr = &SPICC26XXDMA_fxnTable,
876 .object = &spiCC26XXDMAObjects[CC1350_LAUNCHXL_SPI1],
877 .hwAttrs = &spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_SPI1]
878 },
879#endif
880};
881
882const uint_least8_t SPI_count = CC1350_LAUNCHXL_SPICOUNT;
883
884#endif /* TI_SPI_CONF_ENABLE */
885
886/*
887 * =============================== UART ===============================
888 */
889#include <ti/drivers/UART.h>
890#include <ti/drivers/uart/UARTCC26XX.h>
891
892#if TI_UART_CONF_ENABLE
893
894UARTCC26XX_Object uartCC26XXObjects[CC1350_LAUNCHXL_UARTCOUNT];
895
896uint8_t uartCC26XXRingBuffer[CC1350_LAUNCHXL_UARTCOUNT][32];
897
898const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1350_LAUNCHXL_UARTCOUNT] = {
899#if TI_UART_CONF_UART0_ENABLE
900 {
901 .baseAddr = UART0_BASE,
902 .powerMngrId = PowerCC26XX_PERIPH_UART0,
903 .intNum = INT_UART0_COMB,
904 .intPriority = ~0,
905 .swiPriority = 0,
906 .txPin = CC1350_LAUNCHXL_UART_TX,
907 .rxPin = CC1350_LAUNCHXL_UART_RX,
908 .ctsPin = PIN_UNASSIGNED,
909 .rtsPin = PIN_UNASSIGNED,
910 .ringBufPtr = uartCC26XXRingBuffer[CC1350_LAUNCHXL_UART0],
911 .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1350_LAUNCHXL_UART0]),
912 .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
913 .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
914 .errorFxn = NULL
915 },
916#endif
917};
918
919const UART_Config UART_config[CC1350_LAUNCHXL_UARTCOUNT] = {
920#if TI_UART_CONF_UART0_ENABLE
921 {
922 .fxnTablePtr = &UARTCC26XX_fxnTable,
923 .object = &uartCC26XXObjects[CC1350_LAUNCHXL_UART0],
924 .hwAttrs = &uartCC26XXHWAttrs[CC1350_LAUNCHXL_UART0]
925 },
926#endif
927};
928
929const uint_least8_t UART_count = CC1350_LAUNCHXL_UARTCOUNT;
930
931#endif /* TI_UART_CONF_ENABLE */
932
933/*
934 * =============================== UDMA ===============================
935 */
936#include <ti/drivers/dma/UDMACC26XX.h>
937
938UDMACC26XX_Object udmaObjects[CC1350_LAUNCHXL_UDMACOUNT];
939
940const UDMACC26XX_HWAttrs udmaHWAttrs[CC1350_LAUNCHXL_UDMACOUNT] = {
941 {
942 .baseAddr = UDMA0_BASE,
943 .powerMngrId = PowerCC26XX_PERIPH_UDMA,
944 .intNum = INT_DMA_ERR,
945 .intPriority = ~0
946 }
947};
948
949const UDMACC26XX_Config UDMACC26XX_config[CC1350_LAUNCHXL_UDMACOUNT] = {
950 {
951 .object = &udmaObjects[CC1350_LAUNCHXL_UDMA0],
952 .hwAttrs = &udmaHWAttrs[CC1350_LAUNCHXL_UDMA0]
953 },
954};
955
956/*
957 * =============================== Watchdog ===============================
958 */
959#include <ti/drivers/Watchdog.h>
960#include <ti/drivers/watchdog/WatchdogCC26XX.h>
961
962WatchdogCC26XX_Object watchdogCC26XXObjects[CC1350_LAUNCHXL_WATCHDOGCOUNT];
963
964const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1350_LAUNCHXL_WATCHDOGCOUNT] = {
965 {
966 .baseAddr = WDT_BASE,
967 .reloadValue = 1000 /* Reload value in milliseconds */
968 },
969};
970
971const Watchdog_Config Watchdog_config[CC1350_LAUNCHXL_WATCHDOGCOUNT] = {
972 {
973 .fxnTablePtr = &WatchdogCC26XX_fxnTable,
974 .object = &watchdogCC26XXObjects[CC1350_LAUNCHXL_WATCHDOG0],
975 .hwAttrs = &watchdogCC26XXHWAttrs[CC1350_LAUNCHXL_WATCHDOG0]
976 },
977};
978
979const uint_least8_t Watchdog_count = CC1350_LAUNCHXL_WATCHDOGCOUNT;
980
981/*
982 * Board-specific initialization function to disable external flash.
983 * This function is defined in the file CC1350_LAUNCHXL_fxns.c
984 */
985extern void Board_initHook(void);
986
987/*
988 * ======== CC1350_LAUNCHXL_initGeneral ========
989 */
991{
992 Power_init();
993
994 if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
995 /* Error with PIN_init */
996 while (1);
997 }
998
999 /* Perform board-specific initialization */
1000 Board_initHook();
1001}
1002
1003/*
1004 * ======== Board_init ========
1005 */
1006void Board_init(void)
1007{
1009}
============================================================================
void CC1350_LAUNCHXL_initGeneral(void)
Initialize the general board specific settings.
Header file for the CC13xx/CC26xx clock implementation.
void clock_arch_standby_policy(void)
Called by the Power driver when dropping to some low-power state.
Definition: clock-arch.c:184
#define SSI1_BASE
Base address for SSI1.
Definition: ssi.h:59
#define SSI0_BASE
Base address for SSI0.
Definition: ssi.h:58