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