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