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