Contiki-NG
Loading...
Searching...
No Matches
CC1352R1_LAUNCHXL.c
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/*
34 * ====================== CC1352R1_LAUNCHXL.c ===================================
35 * This file is responsible for setting up the board specific items for the
36 * CC1352R1_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 "CC1352R1_LAUNCHXL.h"
50
51/*
52 * =============================== ADCBuf ===============================
53 */
54#include <ti/drivers/ADCBuf.h>
55#include <ti/drivers/adcbuf/ADCBufCC26X2.h>
56
57ADCBufCC26X2_Object adcBufCC26xxObjects[CC1352R1_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 ADCBufCC26X2_AdcChannelLutEntry ADCBufCC26X2_adcChannelLut[CC1352R1_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
67 {CC1352R1_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
68 {CC1352R1_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
69 {CC1352R1_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
70 {CC1352R1_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
71 {CC1352R1_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
72 {CC1352R1_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
73 {CC1352R1_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
74 {PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
75 {PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
76 {PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
77};
78
79const ADCBufCC26X2_HWAttrs adcBufCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCBUFCOUNT] = {
80 {
81 .intPriority = ~0,
82 .swiPriority = 0,
83 .adcChannelLut = ADCBufCC26X2_adcChannelLut,
84 .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER0A,
85 }
86};
87
88const ADCBuf_Config ADCBuf_config[CC1352R1_LAUNCHXL_ADCBUFCOUNT] = {
89 {
90 &ADCBufCC26X2_fxnTable,
91 &adcBufCC26xxObjects[CC1352R1_LAUNCHXL_ADCBUF0],
92 &adcBufCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCBUF0]
93 },
94};
95
96const uint_least8_t ADCBuf_count = CC1352R1_LAUNCHXL_ADCBUFCOUNT;
97
98/*
99 * =============================== ADC ===============================
100 */
101#include <ti/drivers/ADC.h>
102#include <ti/drivers/adc/ADCCC26XX.h>
103
104ADCCC26XX_Object adcCC26xxObjects[CC1352R1_LAUNCHXL_ADCCOUNT];
105
106const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCCOUNT] = {
107 {
108 .adcDIO = CC1352R1_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 = CC1352R1_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 = CC1352R1_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 = CC1352R1_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 = CC1352R1_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 = CC1352R1_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 = CC1352R1_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 = PIN_UNASSIGNED,
172 .adcCompBInput = ADC_COMPB_IN_DCOUPL,
173 .refSource = ADCCC26XX_FIXED_REFERENCE,
174 .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
175 .inputScalingEnabled = true,
176 .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
177 .returnAdjustedVal = false
178 },
179 {
180 .adcDIO = PIN_UNASSIGNED,
181 .adcCompBInput = ADC_COMPB_IN_VSS,
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_VDDS,
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
199const ADC_Config ADC_config[CC1352R1_LAUNCHXL_ADCCOUNT] = {
200 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC0]},
201 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC1]},
202 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC2]},
203 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC3]},
204 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC4]},
205 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC5]},
206 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADC6]},
207 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCDCOUPL]},
208 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCVSS]},
209 {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352R1_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC1352R1_LAUNCHXL_ADCVDDS]},
210};
211
212const uint_least8_t ADC_count = CC1352R1_LAUNCHXL_ADCCOUNT;
213
214/*
215 * =============================== ECDH ===============================
216 */
217#include <ti/drivers/ECDH.h>
218#include <ti/drivers/ecdh/ECDHCC26X2.h>
219
220ECDHCC26X2_Object ecdhCC26X2Objects[CC1352R1_LAUNCHXL_ECDHCOUNT];
221
222const ECDHCC26X2_HWAttrs ecdhCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECDHCOUNT] = {
223 {
224 .intPriority = ~0,
225 }
226};
227
228const ECDH_Config ECDH_config[CC1352R1_LAUNCHXL_ECDHCOUNT] = {
229 {
230 .object = &ecdhCC26X2Objects[CC1352R1_LAUNCHXL_ECDH0],
231 .hwAttrs = &ecdhCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECDH0]
232 },
233};
234
235const uint_least8_t ECDH_count = CC1352R1_LAUNCHXL_ECDHCOUNT;
236
237/*
238 * =============================== ECDSA ===============================
239 */
240#include <ti/drivers/ECDSA.h>
241#include <ti/drivers/ecdsa/ECDSACC26X2.h>
242
243ECDSACC26X2_Object ecdsaCC26X2Objects[CC1352R1_LAUNCHXL_ECDSACOUNT];
244
245const ECDSACC26X2_HWAttrs ecdsaCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECDSACOUNT] = {
246 {
247 .intPriority = ~0,
248 }
249};
250
251const ECDSA_Config ECDSA_config[CC1352R1_LAUNCHXL_ECDSACOUNT] = {
252 {
253 .object = &ecdsaCC26X2Objects[CC1352R1_LAUNCHXL_ECDSA0],
254 .hwAttrs = &ecdsaCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECDSA0]
255 },
256};
257
258const uint_least8_t ECDSA_count = CC1352R1_LAUNCHXL_ECDSACOUNT;
259
260/*
261 * =============================== ECJPAKE ===============================
262 */
263#include <ti/drivers/ECJPAKE.h>
264#include <ti/drivers/ecjpake/ECJPAKECC26X2.h>
265
266ECJPAKECC26X2_Object ecjpakeCC26X2Objects[CC1352R1_LAUNCHXL_ECJPAKECOUNT];
267
268const ECJPAKECC26X2_HWAttrs ecjpakeCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECJPAKECOUNT] = {
269 {
270 .intPriority = ~0,
271 }
272};
273
274const ECJPAKE_Config ECJPAKE_config[CC1352R1_LAUNCHXL_ECJPAKECOUNT] = {
275 {
276 .object = &ecjpakeCC26X2Objects[CC1352R1_LAUNCHXL_ECJPAKE0],
277 .hwAttrs = &ecjpakeCC26X2HWAttrs[CC1352R1_LAUNCHXL_ECJPAKE0]
278 },
279};
280
281const uint_least8_t ECJPAKE_count = CC1352R1_LAUNCHXL_ECJPAKECOUNT;
282
283
284/*
285 * =============================== SHA2 ===============================
286 */
287#include <ti/drivers/SHA2.h>
288#include <ti/drivers/sha2/SHA2CC26X2.h>
289
290SHA2CC26X2_Object sha2CC26X2Objects[CC1352R1_LAUNCHXL_SHA2COUNT];
291
292const SHA2CC26X2_HWAttrs sha2CC26X2HWAttrs[CC1352R1_LAUNCHXL_SHA2COUNT] = {
293 {
294 .intPriority = ~0,
295 }
296};
297
298const SHA2_Config SHA2_config[CC1352R1_LAUNCHXL_SHA2COUNT] = {
299 {
300 .object = &sha2CC26X2Objects[CC1352R1_LAUNCHXL_SHA20],
301 .hwAttrs = &sha2CC26X2HWAttrs[CC1352R1_LAUNCHXL_SHA20]
302 },
303};
304
305const uint_least8_t SHA2_count = CC1352R1_LAUNCHXL_SHA2COUNT;
306
307/*
308 * =============================== AESCCM ===============================
309 */
310#include <ti/drivers/AESCCM.h>
311#include <ti/drivers/aesccm/AESCCMCC26XX.h>
312
313AESCCMCC26XX_Object aesccmCC26XXObjects[CC1352R1_LAUNCHXL_AESCCMCOUNT];
314
315const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCCMCOUNT] = {
316 {
317 .intPriority = ~0,
318 }
319};
320
321const AESCCM_Config AESCCM_config[CC1352R1_LAUNCHXL_AESCCMCOUNT] = {
322 {
323 .object = &aesccmCC26XXObjects[CC1352R1_LAUNCHXL_AESCCM0],
324 .hwAttrs = &aesccmCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCCM0]
325 },
326};
327
328const uint_least8_t AESCCM_count = CC1352R1_LAUNCHXL_AESCCMCOUNT;
329
330/*
331 * =============================== AESGCM ===============================
332 */
333#include <ti/drivers/AESGCM.h>
334#include <ti/drivers/aesgcm/AESGCMCC26XX.h>
335
336AESGCMCC26XX_Object aesgcmCC26XXObjects[CC1352R1_LAUNCHXL_AESGCMCOUNT];
337
338const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESGCMCOUNT] = {
339 {
340 .intPriority = ~0,
341 }
342};
343
344const AESGCM_Config AESGCM_config[CC1352R1_LAUNCHXL_AESGCMCOUNT] = {
345 {
346 .object = &aesgcmCC26XXObjects[CC1352R1_LAUNCHXL_AESGCM0],
347 .hwAttrs = &aesgcmCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESGCM0]
348 },
349};
350
351const uint_least8_t AESGCM_count = CC1352R1_LAUNCHXL_AESGCMCOUNT;
352
353/*
354 * =============================== AESCBC ===============================
355 */
356#include <ti/drivers/AESCBC.h>
357#include <ti/drivers/aescbc/AESCBCCC26XX.h>
358
359AESCBCCC26XX_Object aescbcCC26XXObjects[CC1352R1_LAUNCHXL_AESCBCCOUNT];
360
361const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCBCCOUNT] = {
362 {
363 .intPriority = ~0,
364 }
365};
366
367const AESCBC_Config AESCBC_config[CC1352R1_LAUNCHXL_AESCBCCOUNT] = {
368 {
369 .object = &aescbcCC26XXObjects[CC1352R1_LAUNCHXL_AESCBC0],
370 .hwAttrs = &aescbcCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCBC0]
371 },
372};
373
374const uint_least8_t AESCBC_count = CC1352R1_LAUNCHXL_AESCBCCOUNT;
375
376/*
377 * =============================== AESCTR ===============================
378 */
379#include <ti/drivers/AESCTR.h>
380#include <ti/drivers/aesctr/AESCTRCC26XX.h>
381
382AESCTRCC26XX_Object aesctrCC26XXObjects[CC1352R1_LAUNCHXL_AESCTRCOUNT];
383
384const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCTRCOUNT] = {
385 {
386 .intPriority = ~0,
387 }
388};
389
390const AESCTR_Config AESCTR_config[CC1352R1_LAUNCHXL_AESCTRCOUNT] = {
391 {
392 .object = &aesctrCC26XXObjects[CC1352R1_LAUNCHXL_AESCTR0],
393 .hwAttrs = &aesctrCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESCTR0]
394 },
395};
396
397const uint_least8_t AESCTR_count = CC1352R1_LAUNCHXL_AESCTRCOUNT;
398
399/*
400 * =============================== AESECB ===============================
401 */
402#include <ti/drivers/AESECB.h>
403#include <ti/drivers/aesecb/AESECBCC26XX.h>
404
405AESECBCC26XX_Object aesecbCC26XXObjects[CC1352R1_LAUNCHXL_AESECBCOUNT];
406
407const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESECBCOUNT] = {
408 {
409 .intPriority = ~0,
410 }
411};
412
413const AESECB_Config AESECB_config[CC1352R1_LAUNCHXL_AESECBCOUNT] = {
414 {
415 .object = &aesecbCC26XXObjects[CC1352R1_LAUNCHXL_AESECB0],
416 .hwAttrs = &aesecbCC26XXHWAttrs[CC1352R1_LAUNCHXL_AESECB0]
417 },
418};
419
420const uint_least8_t AESECB_count = CC1352R1_LAUNCHXL_AESECBCOUNT;
421
422/*
423 * =============================== AESCTRDRBG ===============================
424 */
425#include <ti/drivers/AESCTRDRBG.h>
426#include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
427
428AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC1352R1_LAUNCHXL_AESCTRDRBGCOUNT];
429
430const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC1352R1_LAUNCHXL_AESCTRDRBGCOUNT] = {
431 {
432 .aesctrIndex = CC1352R1_LAUNCHXL_AESCTR0,
433 }
434};
435
436const AESCTRDRBG_Config AESCTRDRBG_config[CC1352R1_LAUNCHXL_AESCTRDRBGCOUNT] = {
437 {
438 .object = &aesctrdrbgXXObjects[CC1352R1_LAUNCHXL_AESCTRDRBG0],
439 .hwAttrs = &aesctrdrbgXXHWAttrs[CC1352R1_LAUNCHXL_AESCTRDRBG0]
440 },
441};
442
443const uint_least8_t AESCTRDRBG_count = CC1352R1_LAUNCHXL_AESCTRDRBGCOUNT;
444
445/*
446 * =============================== TRNG ===============================
447 */
448#include <ti/drivers/TRNG.h>
449#include <ti/drivers/trng/TRNGCC26XX.h>
450
451TRNGCC26XX_Object trngCC26XXObjects[CC1352R1_LAUNCHXL_TRNGCOUNT];
452
453const TRNGCC26XX_HWAttrs trngCC26X2HWAttrs[CC1352R1_LAUNCHXL_TRNGCOUNT] = {
454 {
455 .intPriority = ~0,
456 .swiPriority = 0,
457 .samplesPerCycle = 240000,
458 }
459};
460
461const TRNG_Config TRNG_config[CC1352R1_LAUNCHXL_TRNGCOUNT] = {
462 {
463 .object = &trngCC26XXObjects[CC1352R1_LAUNCHXL_TRNG0],
464 .hwAttrs = &trngCC26X2HWAttrs[CC1352R1_LAUNCHXL_TRNG0]
465 },
466};
467
468const uint_least8_t TRNG_count = CC1352R1_LAUNCHXL_TRNGCOUNT;
469
470/*
471 * =============================== GPIO ===============================
472 */
473#include <ti/drivers/GPIO.h>
474#include <ti/drivers/gpio/GPIOCC26XX.h>
475
476/*
477 * Array of Pin configurations
478 * NOTE: The order of the pin configurations must coincide with what was
479 * defined in CC1352R1_LAUNCHXL.h
480 * NOTE: Pins not used for interrupts should be placed at the end of the
481 * array. Callback entries can be omitted from callbacks array to
482 * reduce memory usage.
483 */
484GPIO_PinConfig gpioPinConfigs[] = {
485 /* Input pins */
486 GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* Button 0 */
487 GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
488
489 GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC1352R1_LAUNCHXL_SPI_MASTER_READY */
490 GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC1352R1_LAUNCHXL_SPI_SLAVE_READY */
491
492 /* Output pins */
493 GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
494 GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
495
496 /* SPI Flash CSN */
497 GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
498
499 /* SD CS */
500 GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,
501};
502
503/*
504 * Array of callback function pointers
505 * NOTE: The order of the pin configurations must coincide with what was
506 * defined in CC1352R1_LAUNCH.h
507 * NOTE: Pins not used for interrupts can be omitted from callbacks array to
508 * reduce memory usage (if placed at end of gpioPinConfigs array).
509 */
510GPIO_CallbackFxn gpioCallbackFunctions[] = {
511 NULL, /* Button 0 */
512 NULL, /* Button 1 */
513 NULL, /* CC1352R1_LAUNCHXL_SPI_MASTER_READY */
514 NULL, /* CC1352R1_LAUNCHXL_SPI_SLAVE_READY */
515};
516
517const GPIOCC26XX_Config GPIOCC26XX_config = {
518 .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
519 .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
520 .numberOfPinConfigs = CC1352R1_LAUNCHXL_GPIOCOUNT,
521 .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
522 .intPriority = (~0)
523};
524
525/*
526 * =============================== GPTimer ===============================
527 * Remove unused entries to reduce flash usage both in Board.c and Board.h
528 */
529#include <ti/drivers/timer/GPTimerCC26XX.h>
530
531GPTimerCC26XX_Object gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMERCOUNT];
532
533const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
534 { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
535 { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
536 { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
537 { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
538 { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
539 { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
540 { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
541 { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
542};
543
544const GPTimerCC26XX_Config GPTimerCC26XX_config[CC1352R1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
545 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER0A], GPT_A },
546 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER0B], GPT_B },
547 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER1A], GPT_A },
548 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER1B], GPT_B },
549 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER2A], GPT_A },
550 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER2B], GPT_B },
551 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER3A], GPT_A },
552 { &gptimerCC26XXObjects[CC1352R1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_GPTIMER3B], GPT_B },
553};
554
555/*
556 * =============================== I2C ===============================
557*/
558#include <ti/drivers/I2C.h>
559#include <ti/drivers/i2c/I2CCC26XX.h>
560
561#if TI_I2C_CONF_ENABLE
562
563I2CCC26XX_Object i2cCC26xxObjects[CC1352R1_LAUNCHXL_I2CCOUNT];
564
565const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1352R1_LAUNCHXL_I2CCOUNT] = {
566#if TI_I2C_CONF_I2C0_ENABLE
567 {
568 .baseAddr = I2C0_BASE,
569 .powerMngrId = PowerCC26XX_PERIPH_I2C0,
570 .intNum = INT_I2C_IRQ,
571 .intPriority = ~0,
572 .swiPriority = 0,
573 .sdaPin = CC1352R1_LAUNCHXL_I2C0_SDA0,
574 .sclPin = CC1352R1_LAUNCHXL_I2C0_SCL0,
575 },
576#endif
577};
578
579const I2C_Config I2C_config[CC1352R1_LAUNCHXL_I2CCOUNT] = {
580#if TI_I2C_CONF_I2C0_ENABLE
581 {
582 .fxnTablePtr = &I2CCC26XX_fxnTable,
583 .object = &i2cCC26xxObjects[CC1352R1_LAUNCHXL_I2C0],
584 .hwAttrs = &i2cCC26xxHWAttrs[CC1352R1_LAUNCHXL_I2C0]
585 },
586#endif
587};
588
589const uint_least8_t I2C_count = CC1352R1_LAUNCHXL_I2CCOUNT;
590
591#endif /* TI_I2C_CONF_ENABLE */
592
593/*
594 * =============================== I2S ===============================
595*/
596#include <ti/drivers/I2S.h>
597#include <ti/drivers/i2s/I2SCC26XX.h>
598
599I2SCC26XX_Object i2sCC26XXObjects[CC1352R1_LAUNCHXL_I2SCOUNT];
600
601const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC1352R1_LAUNCHXL_I2SCOUNT] = {
602 {
603 .pinSD1 = CC1352R1_LAUNCHXL_I2S_ADI,
604 .pinSD0 = CC1352R1_LAUNCHXL_I2S_ADO,
605 .pinSCK = CC1352R1_LAUNCHXL_I2S_BCLK,
606 .pinMCLK = CC1352R1_LAUNCHXL_I2S_MCLK,
607 .pinWS = CC1352R1_LAUNCHXL_I2S_WCLK,
608 .intPriority = ~0,
609 }
610};
611
612const I2S_Config I2S_config[CC1352R1_LAUNCHXL_I2SCOUNT] = {
613 {
614 .object = &i2sCC26XXObjects[CC1352R1_LAUNCHXL_I2S0],
615 .hwAttrs = &i2sCC26XXHWAttrs[CC1352R1_LAUNCHXL_I2S0]
616 },
617};
618
619const uint_least8_t I2S_count = CC1352R1_LAUNCHXL_I2SCOUNT;
620
621/*
622 * =============================== NVS ===============================
623 */
624#include <ti/drivers/NVS.h>
625#include <ti/drivers/nvs/NVSSPI25X.h>
626#include <ti/drivers/nvs/NVSCC26XX.h>
627
628#define NVS_REGIONS_BASE 0x48000
629#define SECTORSIZE 0x2000
630#define REGIONSIZE (SECTORSIZE * 4)
631
632#if TI_NVS_CONF_ENABLE
633
634#if TI_NVS_CONF_NVS_INTERNAL_ENABLE
635
636/*
637 * Reserve flash sectors for NVS driver use by placing an uninitialized byte
638 * array at the desired flash address.
639 */
640#if defined(__TI_COMPILER_VERSION__)
641
642/*
643 * Place uninitialized array at NVS_REGIONS_BASE
644 */
645#pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
646#pragma NOINIT(flashBuf);
647static char flashBuf[REGIONSIZE];
648
649#elif defined(__IAR_SYSTEMS_ICC__)
650
651/*
652 * Place uninitialized array at NVS_REGIONS_BASE
653 */
654static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
655
656#elif defined(__GNUC__)
657
658/*
659 * Place the flash buffers in the .nvs section created in the gcc linker file.
660 * The .nvs section enforces alignment on a sector boundary but may
661 * be placed anywhere in flash memory. If desired the .nvs section can be set
662 * to a fixed address by changing the following in the gcc linker file:
663 *
664 * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
665 * *(.nvs)
666 * } > REGION_TEXT
667 */
668__attribute__ ((section (".nvs")))
669static char flashBuf[REGIONSIZE];
670
671#endif
672
673/* Allocate objects for NVS Internal Regions */
674NVSCC26XX_Object nvsCC26xxObjects[1];
675
676/* Hardware attributes for NVS Internal Regions */
677const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
678 {
679 .regionBase = (void *)flashBuf,
680 .regionSize = REGIONSIZE,
681 },
682};
683
684#endif /* TI_NVS_CONF_NVS_INTERNAL_ENABLE */
685
686#if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
687
688#define SPISECTORSIZE 0x1000
689#define SPIREGIONSIZE (SPISECTORSIZE * 32)
690#define VERIFYBUFSIZE 64
691
692static uint8_t verifyBuf[VERIFYBUFSIZE];
693
694/* Allocate objects for NVS External Regions */
695NVSSPI25X_Object nvsSPI25XObjects[1];
696
697/* Hardware attributes for NVS External Regions */
698const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
699 {
700 .regionBaseOffset = 0,
701 .regionSize = SPIREGIONSIZE,
702 .sectorSize = SPISECTORSIZE,
703 .verifyBuf = verifyBuf,
704 .verifyBufSize = VERIFYBUFSIZE,
705 .spiHandle = NULL,
706 .spiIndex = 0,
707 .spiBitRate = 4000000,
708 .spiCsnGpioIndex = CC1352R1_LAUNCHXL_GPIO_SPI_FLASH_CS,
709 .statusPollDelayUs = 100,
710 },
711};
712
713#endif /* TI_NVS_CONF_NVS_EXTERNAL_ENABLE */
714
715/* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
716const NVS_Config NVS_config[CC1352R1_LAUNCHXL_NVSCOUNT] = {
717#if TI_NVS_CONF_NVS_INTERNAL_ENABLE
718 {
719 .fxnTablePtr = &NVSCC26XX_fxnTable,
720 .object = &nvsCC26xxObjects[0],
721 .hwAttrs = &nvsCC26xxHWAttrs[0],
722 },
723#endif
724#if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
725 {
726 .fxnTablePtr = &NVSSPI25X_fxnTable,
727 .object = &nvsSPI25XObjects[0],
728 .hwAttrs = &nvsSPI25XHWAttrs[0],
729 },
730#endif
731};
732
733const uint_least8_t NVS_count = CC1352R1_LAUNCHXL_NVSCOUNT;
734
735#endif /* TI_NVS_CONF_ENABLE */
736
737/*
738 * =============================== PIN ===============================
739 */
740#include <ti/drivers/PIN.h>
741#include <ti/drivers/pin/PINCC26XX.h>
742
743const PIN_Config BoardGpioInitTable[] = {
744
745 CC1352R1_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
746 CC1352R1_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
747 CC1352R1_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
748 CC1352R1_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
749 CC1352R1_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
750 CC1352R1_LAUNCHXL_UART0_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
751 CC1352R1_LAUNCHXL_UART0_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
752 CC1352R1_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
753 CC1352R1_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
754 CC1352R1_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
755 PIN_TERMINATE
756};
757
758const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
759 .intPriority = ~0,
760 .swiPriority = 0
761};
762
763/*
764 * =============================== Power ===============================
765 */
766#include <ti/drivers/Power.h>
767#include <ti/drivers/power/PowerCC26X2.h>
768#include "clock-arch.h"
769
770const PowerCC26X2_Config PowerCC26X2_config = {
771 .policyInitFxn = NULL,
772 .policyFxn = &clock_arch_standby_policy,
773 .calibrateFxn = &PowerCC26XX_calibrate,
774 .enablePolicy = true,
775 .calibrateRCOSC_LF = true,
776 .calibrateRCOSC_HF = true,
777};
778
779/*
780 * =============================== PWM ===============================
781 * Remove unused entries to reduce flash usage both in Board.c and Board.h
782 */
783#include <ti/drivers/PWM.h>
784#include <ti/drivers/pwm/PWMTimerCC26XX.h>
785
786PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWMCOUNT];
787
788const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWMCOUNT] = {
789 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER0A },
790 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER0B },
791 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER1A },
792 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER1B },
793 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER2A },
794 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER2B },
795 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER3A },
796 { .pwmPin = CC1352R1_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC1352R1_LAUNCHXL_GPTIMER3B },
797};
798
799const PWM_Config PWM_config[CC1352R1_LAUNCHXL_PWMCOUNT] = {
800 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM0] },
801 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM1] },
802 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM2] },
803 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM3] },
804 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM4] },
805 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM5] },
806 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM6] },
807 { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352R1_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC1352R1_LAUNCHXL_PWM7] },
808};
809
810const uint_least8_t PWM_count = CC1352R1_LAUNCHXL_PWMCOUNT;
811
812/*
813 * =============================== RF Driver ===============================
814 */
815#include <ti/drivers/rf/RF.h>
816
817const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
818 .hwiPriority = ~0, /* Lowest HWI priority */
819 .swiPriority = 0, /* Lowest SWI priority */
820 .xoscHfAlwaysNeeded = true, /* Keep XOSC dependency while in standby */
821 .globalCallback = NULL, /* No board specific callback */
822 .globalEventMask = 0 /* No events subscribed to */
823};
824
825/*
826 * =============================== SD ===============================
827 */
828#include <ti/drivers/SD.h>
829#include <ti/drivers/sd/SDSPI.h>
830
831#if TI_SD_CONF_ENABLE
832
833#if !(TI_SPI_CONF_SPI0_ENABLE)
834#error "SD driver requires SPI0 enabled"
835#endif
836
837SDSPI_Object sdspiObjects[CC1352R1_LAUNCHXL_SDCOUNT];
838
839const SDSPI_HWAttrs sdspiHWAttrs[CC1352R1_LAUNCHXL_SDCOUNT] = {
840 {
841 .spiIndex = CC1352R1_LAUNCHXL_SPI0,
842 .spiCsGpioIndex = CC1352R1_LAUNCHXL_SDSPI_CS
843 }
844};
845
846const SD_Config SD_config[CC1352R1_LAUNCHXL_SDCOUNT] = {
847 {
848 .fxnTablePtr = &SDSPI_fxnTable,
849 .object = &sdspiObjects[CC1352R1_LAUNCHXL_SDSPI0],
850 .hwAttrs = &sdspiHWAttrs[CC1352R1_LAUNCHXL_SDSPI0]
851 },
852};
853
854const uint_least8_t SD_count = CC1352R1_LAUNCHXL_SDCOUNT;
855
856#endif /* TI_SD_CONF_ENABLE */
857
858/*
859 * =============================== SPI DMA ===============================
860 */
861#include <ti/drivers/SPI.h>
862#include <ti/drivers/spi/SPICC26X2DMA.h>
863
864#if TI_SPI_CONF_ENABLE
865
866SPICC26X2DMA_Object spiCC26X2DMAObjects[CC1352R1_LAUNCHXL_SPICOUNT];
867
868/*
869 * NOTE: The SPI instances below can be used by the SD driver to communicate
870 * with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
871 * to satisfy the SDSPI driver requirement.
872 */
873const SPICC26X2DMA_HWAttrs spiCC26X2DMAHWAttrs[CC1352R1_LAUNCHXL_SPICOUNT] = {
874#if TI_SPI_CONF_SPI0_ENABLE
875 {
876 .baseAddr = SSI0_BASE,
877 .intNum = INT_SSI0_COMB,
878 .intPriority = ~0,
879 .swiPriority = 0,
880 .powerMngrId = PowerCC26XX_PERIPH_SSI0,
881 .defaultTxBufValue = 0xFF,
882 .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
883 .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
884 .mosiPin = CC1352R1_LAUNCHXL_SPI0_MOSI,
885 .misoPin = CC1352R1_LAUNCHXL_SPI0_MISO,
886 .clkPin = CC1352R1_LAUNCHXL_SPI0_CLK,
887 .csnPin = CC1352R1_LAUNCHXL_SPI0_CSN,
888 .minDmaTransferSize = 10
889 },
890#endif
891#if TI_SPI_CONF_SPI1_ENABLE
892 {
893 .baseAddr = SSI1_BASE,
894 .intNum = INT_SSI1_COMB,
895 .intPriority = ~0,
896 .swiPriority = 0,
897 .powerMngrId = PowerCC26XX_PERIPH_SSI1,
898 .defaultTxBufValue = 0xFF,
899 .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
900 .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
901 .mosiPin = CC1352R1_LAUNCHXL_SPI1_MOSI,
902 .misoPin = CC1352R1_LAUNCHXL_SPI1_MISO,
903 .clkPin = CC1352R1_LAUNCHXL_SPI1_CLK,
904 .csnPin = CC1352R1_LAUNCHXL_SPI1_CSN,
905 .minDmaTransferSize = 10
906 },
907#endif
908};
909
910const SPI_Config SPI_config[CC1352R1_LAUNCHXL_SPICOUNT] = {
911#if TI_SPI_CONF_SPI0_ENABLE
912 {
913 .fxnTablePtr = &SPICC26X2DMA_fxnTable,
914 .object = &spiCC26X2DMAObjects[CC1352R1_LAUNCHXL_SPI0],
915 .hwAttrs = &spiCC26X2DMAHWAttrs[CC1352R1_LAUNCHXL_SPI0]
916 },
917#endif
918#if TI_SPI_CONF_SPI1_ENABLE
919 {
920 .fxnTablePtr = &SPICC26X2DMA_fxnTable,
921 .object = &spiCC26X2DMAObjects[CC1352R1_LAUNCHXL_SPI1],
922 .hwAttrs = &spiCC26X2DMAHWAttrs[CC1352R1_LAUNCHXL_SPI1]
923 },
924#endif
925};
926
927const uint_least8_t SPI_count = CC1352R1_LAUNCHXL_SPICOUNT;
928
929#endif /* TI_SPI_CONF_ENABLE */
930
931/*
932 * =============================== UART ===============================
933 */
934#include <ti/drivers/UART.h>
935#include <ti/drivers/uart/UARTCC26XX.h>
936
937#if TI_UART_CONF_ENABLE
938
939UARTCC26XX_Object uartCC26XXObjects[CC1352R1_LAUNCHXL_UARTCOUNT];
940
941uint8_t uartCC26XXRingBuffer[CC1352R1_LAUNCHXL_UARTCOUNT][32];
942
943const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1352R1_LAUNCHXL_UARTCOUNT] = {
944#if TI_UART_CONF_UART0_ENABLE
945 {
946 .baseAddr = UART0_BASE,
947 .powerMngrId = PowerCC26XX_PERIPH_UART0,
948 .intNum = INT_UART0_COMB,
949 .intPriority = ~0,
950 .swiPriority = 0,
951 .txPin = CC1352R1_LAUNCHXL_UART0_TX,
952 .rxPin = CC1352R1_LAUNCHXL_UART0_RX,
953 .ctsPin = PIN_UNASSIGNED,
954 .rtsPin = PIN_UNASSIGNED,
955 .ringBufPtr = uartCC26XXRingBuffer[CC1352R1_LAUNCHXL_UART0],
956 .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1352R1_LAUNCHXL_UART0]),
957 .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
958 .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
959 .errorFxn = NULL
960 },
961#endif
962#if TI_UART_CONF_UART1_ENABLE
963 {
964 .baseAddr = UART1_BASE,
965 .powerMngrId = PowerCC26X2_PERIPH_UART1,
966 .intNum = INT_UART1_COMB,
967 .intPriority = ~0,
968 .swiPriority = 0,
969 .txPin = CC1352R1_LAUNCHXL_UART1_TX,
970 .rxPin = CC1352R1_LAUNCHXL_UART1_RX,
971 .ctsPin = PIN_UNASSIGNED,
972 .rtsPin = PIN_UNASSIGNED,
973 .ringBufPtr = uartCC26XXRingBuffer[CC1352R1_LAUNCHXL_UART1],
974 .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1352R1_LAUNCHXL_UART1]),
975 .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
976 .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
977 .errorFxn = NULL
978 },
979#endif
980};
981
982const UART_Config UART_config[CC1352R1_LAUNCHXL_UARTCOUNT] = {
983#if TI_UART_CONF_UART0_ENABLE
984 {
985 .fxnTablePtr = &UARTCC26XX_fxnTable,
986 .object = &uartCC26XXObjects[CC1352R1_LAUNCHXL_UART0],
987 .hwAttrs = &uartCC26XXHWAttrs[CC1352R1_LAUNCHXL_UART0]
988 },
989#endif
990#if TI_UART_CONF_UART1_ENABLE
991 {
992 .fxnTablePtr = &UARTCC26XX_fxnTable,
993 .object = &uartCC26XXObjects[CC1352R1_LAUNCHXL_UART1],
994 .hwAttrs = &uartCC26XXHWAttrs[CC1352R1_LAUNCHXL_UART1]
995 },
996#endif
997};
998
999const uint_least8_t UART_count = CC1352R1_LAUNCHXL_UARTCOUNT;
1000
1001#endif /* TI_UART_CONF_ENABLE */
1002
1003/*
1004 * =============================== UDMA ===============================
1005 */
1006#include <ti/drivers/dma/UDMACC26XX.h>
1007
1008UDMACC26XX_Object udmaObjects[CC1352R1_LAUNCHXL_UDMACOUNT];
1009
1010const UDMACC26XX_HWAttrs udmaHWAttrs[CC1352R1_LAUNCHXL_UDMACOUNT] = {
1011 {
1012 .baseAddr = UDMA0_BASE,
1013 .powerMngrId = PowerCC26XX_PERIPH_UDMA,
1014 .intNum = INT_DMA_ERR,
1015 .intPriority = ~0
1016 }
1017};
1018
1019const UDMACC26XX_Config UDMACC26XX_config[CC1352R1_LAUNCHXL_UDMACOUNT] = {
1020 {
1021 .object = &udmaObjects[CC1352R1_LAUNCHXL_UDMA0],
1022 .hwAttrs = &udmaHWAttrs[CC1352R1_LAUNCHXL_UDMA0]
1023 },
1024};
1025
1026
1027
1028/*
1029 * =============================== Watchdog ===============================
1030 */
1031#include <ti/drivers/Watchdog.h>
1032#include <ti/drivers/watchdog/WatchdogCC26XX.h>
1033
1034WatchdogCC26XX_Object watchdogCC26XXObjects[CC1352R1_LAUNCHXL_WATCHDOGCOUNT];
1035
1036const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1352R1_LAUNCHXL_WATCHDOGCOUNT] = {
1037 {
1038 .baseAddr = WDT_BASE,
1039 .reloadValue = 1000 /* Reload value in milliseconds */
1040 },
1041};
1042
1043const Watchdog_Config Watchdog_config[CC1352R1_LAUNCHXL_WATCHDOGCOUNT] = {
1044 {
1045 .fxnTablePtr = &WatchdogCC26XX_fxnTable,
1046 .object = &watchdogCC26XXObjects[CC1352R1_LAUNCHXL_WATCHDOG0],
1047 .hwAttrs = &watchdogCC26XXHWAttrs[CC1352R1_LAUNCHXL_WATCHDOG0]
1048 },
1049};
1050
1051const uint_least8_t Watchdog_count = CC1352R1_LAUNCHXL_WATCHDOGCOUNT;
1052
1053/*
1054 * Board-specific initialization function to disable external flash.
1055 * This function is defined in the file CC1352R1_LAUNCHXL_fxns.c
1056 */
1057extern void Board_initHook(void);
1058
1059/*
1060 * ======== CC1352R1_LAUNCHXL_initGeneral ========
1061 */
1062void CC1352R1_LAUNCHXL_initGeneral(void)
1063{
1064 Power_init();
1065
1066 if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
1067 /* Error with PIN_init */
1068 while (1);
1069 }
1070
1071 /* Perform board-specific initialization */
1072 Board_initHook();
1073}
1074
1075/*
1076 * ======== Board_init ========
1077 */
1078void Board_init(void)
1079{
1080 CC1352R1_LAUNCHXL_initGeneral();
1081}
===========================================================================
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