Contiki-NG
CC1352P1_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  * ====================== CC1352P1_LAUNCHXL.c ===================================
35  * This file is responsible for setting up the board specific items for the
36  * CC1352P1_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 "CC1352P1_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[CC1352P1_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[CC1352P1_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
67  {CC1352P1_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
68  {CC1352P1_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
69  {CC1352P1_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
70  {CC1352P1_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
71  {CC1352P1_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
72  {PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
73  {PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
74  {PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
75 };
76 
77 const ADCBufCC26X2_HWAttrs adcBufCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCBUFCOUNT] = {
78  {
79  .intPriority = ~0,
80  .swiPriority = 0,
81  .adcChannelLut = ADCBufCC26X2_adcChannelLut,
82  .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER0A,
83  }
84 };
85 
86 const ADCBuf_Config ADCBuf_config[CC1352P1_LAUNCHXL_ADCBUFCOUNT] = {
87  {
88  &ADCBufCC26X2_fxnTable,
89  &adcBufCC26xxObjects[CC1352P1_LAUNCHXL_ADCBUF0],
90  &adcBufCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCBUF0]
91  },
92 };
93 
94 const uint_least8_t ADCBuf_count = CC1352P1_LAUNCHXL_ADCBUFCOUNT;
95 
96 /*
97  * =============================== ADC ===============================
98  */
99 #include <ti/drivers/ADC.h>
100 #include <ti/drivers/adc/ADCCC26XX.h>
101 
102 ADCCC26XX_Object adcCC26xxObjects[CC1352P1_LAUNCHXL_ADCCOUNT];
103 
104 const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCCOUNT] = {
105  {
106  .adcDIO = CC1352P1_LAUNCHXL_DIO23_ANALOG,
107  .adcCompBInput = ADC_COMPB_IN_AUXIO7,
108  .refSource = ADCCC26XX_FIXED_REFERENCE,
109  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
110  .inputScalingEnabled = true,
111  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
112  .returnAdjustedVal = false
113  },
114  {
115  .adcDIO = CC1352P1_LAUNCHXL_DIO24_ANALOG,
116  .adcCompBInput = ADC_COMPB_IN_AUXIO6,
117  .refSource = ADCCC26XX_FIXED_REFERENCE,
118  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
119  .inputScalingEnabled = true,
120  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
121  .returnAdjustedVal = false
122  },
123  {
124  .adcDIO = CC1352P1_LAUNCHXL_DIO25_ANALOG,
125  .adcCompBInput = ADC_COMPB_IN_AUXIO5,
126  .refSource = ADCCC26XX_FIXED_REFERENCE,
127  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
128  .inputScalingEnabled = true,
129  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
130  .returnAdjustedVal = false
131  },
132  {
133  .adcDIO = CC1352P1_LAUNCHXL_DIO26_ANALOG,
134  .adcCompBInput = ADC_COMPB_IN_AUXIO4,
135  .refSource = ADCCC26XX_FIXED_REFERENCE,
136  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
137  .inputScalingEnabled = true,
138  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
139  .returnAdjustedVal = false
140  },
141  {
142  .adcDIO = CC1352P1_LAUNCHXL_DIO27_ANALOG,
143  .adcCompBInput = ADC_COMPB_IN_AUXIO3,
144  .refSource = ADCCC26XX_FIXED_REFERENCE,
145  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
146  .inputScalingEnabled = true,
147  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
148  .returnAdjustedVal = false
149  },
150  {
151  .adcDIO = PIN_UNASSIGNED,
152  .adcCompBInput = ADC_COMPB_IN_DCOUPL,
153  .refSource = ADCCC26XX_FIXED_REFERENCE,
154  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
155  .inputScalingEnabled = true,
156  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
157  .returnAdjustedVal = false
158  },
159  {
160  .adcDIO = PIN_UNASSIGNED,
161  .adcCompBInput = ADC_COMPB_IN_VSS,
162  .refSource = ADCCC26XX_FIXED_REFERENCE,
163  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
164  .inputScalingEnabled = true,
165  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
166  .returnAdjustedVal = false
167  },
168  {
169  .adcDIO = PIN_UNASSIGNED,
170  .adcCompBInput = ADC_COMPB_IN_VDDS,
171  .refSource = ADCCC26XX_FIXED_REFERENCE,
172  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
173  .inputScalingEnabled = true,
174  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
175  .returnAdjustedVal = false
176  }
177 };
178 
179 const ADC_Config ADC_config[CC1352P1_LAUNCHXL_ADCCOUNT] = {
180  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADC0]},
181  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADC1]},
182  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADC2]},
183  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADC3]},
184  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADC4]},
185  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCDCOUPL]},
186  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCVSS]},
187  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1352P1_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC1352P1_LAUNCHXL_ADCVDDS]},
188 };
189 
190 const uint_least8_t ADC_count = CC1352P1_LAUNCHXL_ADCCOUNT;
191 
192 /*
193  * =============================== ECDH ===============================
194  */
195 #include <ti/drivers/ECDH.h>
196 #include <ti/drivers/ecdh/ECDHCC26X2.h>
197 
198 ECDHCC26X2_Object ecdhCC26X2Objects[CC1352P1_LAUNCHXL_ECDHCOUNT];
199 
200 const ECDHCC26X2_HWAttrs ecdhCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECDHCOUNT] = {
201  {
202  .intPriority = ~0,
203  .swiPriority = 0,
204  }
205 };
206 
207 const ECDH_Config ECDH_config[CC1352P1_LAUNCHXL_ECDHCOUNT] = {
208  {
209  .object = &ecdhCC26X2Objects[CC1352P1_LAUNCHXL_ECDH0],
210  .hwAttrs = &ecdhCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECDH0]
211  },
212 };
213 
214 const uint_least8_t ECDH_count = CC1352P1_LAUNCHXL_ECDHCOUNT;
215 
216 /*
217  * =============================== ECDSA ===============================
218  */
219 #include <ti/drivers/ECDSA.h>
220 #include <ti/drivers/ecdsa/ECDSACC26X2.h>
221 
222 ECDSACC26X2_Object ecdsaCC26X2Objects[CC1352P1_LAUNCHXL_ECDSACOUNT];
223 
224 const ECDSACC26X2_HWAttrs ecdsaCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECDSACOUNT] = {
225  {
226  .intPriority = ~0,
227  .swiPriority = 0,
228  }
229 };
230 
231 const ECDSA_Config ECDSA_config[CC1352P1_LAUNCHXL_ECDSACOUNT] = {
232  {
233  .object = &ecdsaCC26X2Objects[CC1352P1_LAUNCHXL_ECDSA0],
234  .hwAttrs = &ecdsaCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECDSA0]
235  },
236 };
237 
238 const uint_least8_t ECDSA_count = CC1352P1_LAUNCHXL_ECDSACOUNT;
239 
240 /*
241  * =============================== ECJPAKE ===============================
242  */
243 #include <ti/drivers/ECJPAKE.h>
244 #include <ti/drivers/ecjpake/ECJPAKECC26X2.h>
245 
246 ECJPAKECC26X2_Object ecjpakeCC26X2Objects[CC1352P1_LAUNCHXL_ECJPAKECOUNT];
247 
248 const ECJPAKECC26X2_HWAttrs ecjpakeCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECJPAKECOUNT] = {
249  {
250  .intPriority = ~0,
251  .swiPriority = 0,
252  }
253 };
254 
255 const ECJPAKE_Config ECJPAKE_config[CC1352P1_LAUNCHXL_ECJPAKECOUNT] = {
256  {
257  .object = &ecjpakeCC26X2Objects[CC1352P1_LAUNCHXL_ECJPAKE0],
258  .hwAttrs = &ecjpakeCC26X2HWAttrs[CC1352P1_LAUNCHXL_ECJPAKE0]
259  },
260 };
261 
262 const uint_least8_t ECJPAKE_count = CC1352P1_LAUNCHXL_ECJPAKECOUNT;
263 
264 
265 /*
266  * =============================== SHA2 ===============================
267  */
268 #include <ti/drivers/SHA2.h>
269 #include <ti/drivers/sha2/SHA2CC26X2.h>
270 
271 SHA2CC26X2_Object sha2CC26X2Objects[CC1352P1_LAUNCHXL_SHA2COUNT];
272 
273 const SHA2CC26X2_HWAttrs sha2CC26X2HWAttrs[CC1352P1_LAUNCHXL_SHA2COUNT] = {
274  {
275  .intPriority = ~0,
276  .swiPriority = 0,
277  }
278 };
279 
280 const SHA2_Config SHA2_config[CC1352P1_LAUNCHXL_SHA2COUNT] = {
281  {
282  .object = &sha2CC26X2Objects[CC1352P1_LAUNCHXL_SHA20],
283  .hwAttrs = &sha2CC26X2HWAttrs[CC1352P1_LAUNCHXL_SHA20]
284  },
285 };
286 
287 const uint_least8_t SHA2_count = CC1352P1_LAUNCHXL_SHA2COUNT;
288 
289 /*
290  * =============================== AESCCM ===============================
291  */
292 #include <ti/drivers/AESCCM.h>
293 #include <ti/drivers/aesccm/AESCCMCC26XX.h>
294 
295 AESCCMCC26XX_Object aesccmCC26XXObjects[CC1352P1_LAUNCHXL_AESCCMCOUNT];
296 
297 const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC1352P1_LAUNCHXL_AESCCMCOUNT] = {
298  {
299  .intPriority = ~0,
300  .swiPriority = 0,
301  }
302 };
303 
304 const AESCCM_Config AESCCM_config[CC1352P1_LAUNCHXL_AESCCMCOUNT] = {
305  {
306  .object = &aesccmCC26XXObjects[CC1352P1_LAUNCHXL_AESCCM0],
307  .hwAttrs = &aesccmCC26XXHWAttrs[CC1352P1_LAUNCHXL_AESCCM0]
308  },
309 };
310 
311 const uint_least8_t AESCCM_count = CC1352P1_LAUNCHXL_AESCCMCOUNT;
312 
313 /*
314  * =============================== AESECB ===============================
315  */
316 #include <ti/drivers/AESECB.h>
317 #include <ti/drivers/aesecb/AESECBCC26XX.h>
318 
319 AESECBCC26XX_Object aesecbCC26XXObjects[CC1352P1_LAUNCHXL_AESECBCOUNT];
320 
321 const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC1352P1_LAUNCHXL_AESECBCOUNT] = {
322  {
323  .intPriority = ~0,
324  .swiPriority = 0,
325  }
326 };
327 
328 const AESECB_Config AESECB_config[CC1352P1_LAUNCHXL_AESECBCOUNT] = {
329  {
330  .object = &aesecbCC26XXObjects[CC1352P1_LAUNCHXL_AESECB0],
331  .hwAttrs = &aesecbCC26XXHWAttrs[CC1352P1_LAUNCHXL_AESECB0]
332  },
333 };
334 
335 const uint_least8_t AESECB_count = CC1352P1_LAUNCHXL_AESECBCOUNT;
336 
337 /*
338  * =============================== GPIO ===============================
339  */
340 #include <ti/drivers/GPIO.h>
341 #include <ti/drivers/gpio/GPIOCC26XX.h>
342 
343 /*
344  * Array of Pin configurations
345  * NOTE: The order of the pin configurations must coincide with what was
346  * defined in CC1352P1_LAUNCHXL.h
347  * NOTE: Pins not used for interrupts should be placed at the end of the
348  * array. Callback entries can be omitted from callbacks array to
349  * reduce memory usage.
350  */
351 GPIO_PinConfig gpioPinConfigs[] = {
352  /* Input pins */
353  GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* Button 0 */
354  GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
355 
356  GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC1352P1_LAUNCHXL_SPI_MASTER_READY */
357  GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC1352P1_LAUNCHXL_SPI_SLAVE_READY */
358 
359  /* Output pins */
360  GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
361  GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
362 
363  /* SPI Flash CSN */
364  GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
365 
366  /* SD CS */
367  GPIOCC26XX_DIO_19 | GPIO_DO_NOT_CONFIG,
368 };
369 
370 /*
371  * Array of callback function pointers
372  * NOTE: The order of the pin configurations must coincide with what was
373  * defined in CC1352P_LAUNCH.h
374  * NOTE: Pins not used for interrupts can be omitted from callbacks array to
375  * reduce memory usage (if placed at end of gpioPinConfigs array).
376  */
377 GPIO_CallbackFxn gpioCallbackFunctions[] = {
378  NULL, /* Button 0 */
379  NULL, /* Button 1 */
380  NULL, /* CC1352P1_LAUNCHXL_SPI_MASTER_READY */
381  NULL, /* CC1352P1_LAUNCHXL_SPI_SLAVE_READY */
382 };
383 
384 const GPIOCC26XX_Config GPIOCC26XX_config = {
385  .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
386  .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
387  .numberOfPinConfigs = CC1352P1_LAUNCHXL_GPIOCOUNT,
388  .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
389  .intPriority = (~0)
390 };
391 
392 /*
393  * =============================== GPTimer ===============================
394  * Remove unused entries to reduce flash usage both in Board.c and Board.h
395  */
396 #include <ti/drivers/timer/GPTimerCC26XX.h>
397 
398 GPTimerCC26XX_Object gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMERCOUNT];
399 
400 const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
401  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
402  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
403  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
404  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
405  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
406  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
407  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
408  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
409 };
410 
411 const GPTimerCC26XX_Config GPTimerCC26XX_config[CC1352P1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
412  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER0A], GPT_A },
413  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER0B], GPT_B },
414  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER1A], GPT_A },
415  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER1B], GPT_B },
416  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER2A], GPT_A },
417  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER2B], GPT_B },
418  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER3A], GPT_A },
419  { &gptimerCC26XXObjects[CC1352P1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_GPTIMER3B], GPT_B },
420 };
421 
422 /*
423  * =============================== I2C ===============================
424 */
425 #include <ti/drivers/I2C.h>
426 #include <ti/drivers/i2c/I2CCC26XX.h>
427 
428 #if TI_I2C_CONF_ENABLE
429 
430 I2CCC26XX_Object i2cCC26xxObjects[CC1352P1_LAUNCHXL_I2CCOUNT];
431 
432 const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1352P1_LAUNCHXL_I2CCOUNT] = {
433 #if TI_I2C_CONF_I2C0_ENABLE
434  {
435  .baseAddr = I2C0_BASE,
436  .powerMngrId = PowerCC26XX_PERIPH_I2C0,
437  .intNum = INT_I2C_IRQ,
438  .intPriority = ~0,
439  .swiPriority = 0,
440  .sdaPin = CC1352P1_LAUNCHXL_I2C0_SDA0,
441  .sclPin = CC1352P1_LAUNCHXL_I2C0_SCL0,
442  },
443 #endif
444 };
445 
446 const I2C_Config I2C_config[CC1352P1_LAUNCHXL_I2CCOUNT] = {
447 #if TI_I2C_CONF_I2C0_ENABLE
448  {
449  .fxnTablePtr = &I2CCC26XX_fxnTable,
450  .object = &i2cCC26xxObjects[CC1352P1_LAUNCHXL_I2C0],
451  .hwAttrs = &i2cCC26xxHWAttrs[CC1352P1_LAUNCHXL_I2C0]
452  },
453 #endif
454 };
455 
456 const uint_least8_t I2C_count = CC1352P1_LAUNCHXL_I2CCOUNT;
457 
458 #endif /* TI_I2C_CONF_ENABLE */
459 
460 /*
461  * =============================== NVS ===============================
462  */
463 #include <ti/drivers/NVS.h>
464 #include <ti/drivers/nvs/NVSSPI25X.h>
465 #include <ti/drivers/nvs/NVSCC26XX.h>
466 
467 #define NVS_REGIONS_BASE 0x48000
468 #define SECTORSIZE 0x2000
469 #define REGIONSIZE (SECTORSIZE * 4)
470 
471 #if TI_NVS_CONF_ENABLE
472 
473 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
474 
475 /*
476  * Reserve flash sectors for NVS driver use by placing an uninitialized byte
477  * array at the desired flash address.
478  */
479 #if defined(__TI_COMPILER_VERSION__)
480 
481 /*
482  * Place uninitialized array at NVS_REGIONS_BASE
483  */
484 #pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
485 #pragma NOINIT(flashBuf);
486 static char flashBuf[REGIONSIZE];
487 
488 #elif defined(__IAR_SYSTEMS_ICC__)
489 
490 /*
491  * Place uninitialized array at NVS_REGIONS_BASE
492  */
493 static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
494 
495 #elif defined(__GNUC__)
496 
497 /*
498  * Place the flash buffers in the .nvs section created in the gcc linker file.
499  * The .nvs section enforces alignment on a sector boundary but may
500  * be placed anywhere in flash memory. If desired the .nvs section can be set
501  * to a fixed address by changing the following in the gcc linker file:
502  *
503  * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
504  * *(.nvs)
505  * } > REGION_TEXT
506  */
507 __attribute__ ((section (".nvs")))
508 static char flashBuf[REGIONSIZE];
509 
510 #endif
511 
512 /* Allocate objects for NVS Internal Regions */
513 NVSCC26XX_Object nvsCC26xxObjects[1];
514 
515 /* Hardware attributes for NVS Internal Regions */
516 const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
517  {
518  .regionBase = (void *)flashBuf,
519  .regionSize = REGIONSIZE,
520  },
521 };
522 
523 #endif /* TI_NVS_CONF_NVS_INTERNAL_ENABLE */
524 
525 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
526 
527 #define SPISECTORSIZE 0x1000
528 #define SPIREGIONSIZE (SPISECTORSIZE * 32)
529 #define VERIFYBUFSIZE 64
530 
531 static uint8_t verifyBuf[VERIFYBUFSIZE];
532 
533 /* Allocate objects for NVS External Regions */
534 NVSSPI25X_Object nvsSPI25XObjects[1];
535 
536 /* Hardware attributes for NVS External Regions */
537 const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
538  {
539  .regionBaseOffset = 0,
540  .regionSize = SPIREGIONSIZE,
541  .sectorSize = SPISECTORSIZE,
542  .verifyBuf = verifyBuf,
543  .verifyBufSize = VERIFYBUFSIZE,
544  .spiHandle = NULL,
545  .spiIndex = 0,
546  .spiBitRate = 4000000,
547  .spiCsnGpioIndex = CC1352P1_LAUNCHXL_GPIO_SPI_FLASH_CS,
548  },
549 };
550 
551 #endif /* TI_NVS_CONF_NVS_EXTERNAL_ENABLE */
552 
553 /* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
554 const NVS_Config NVS_config[CC1352P1_LAUNCHXL_NVSCOUNT] = {
555 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
556  {
557  .fxnTablePtr = &NVSCC26XX_fxnTable,
558  .object = &nvsCC26xxObjects[0],
559  .hwAttrs = &nvsCC26xxHWAttrs[0],
560  },
561 #endif
562 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
563  {
564  .fxnTablePtr = &NVSSPI25X_fxnTable,
565  .object = &nvsSPI25XObjects[0],
566  .hwAttrs = &nvsSPI25XHWAttrs[0],
567  },
568 #endif
569 };
570 
571 const uint_least8_t NVS_count = CC1352P1_LAUNCHXL_NVSCOUNT;
572 
573 #endif /* TI_NVS_CONF_ENABLE */
574 
575 /*
576  * =============================== PIN ===============================
577  */
578 #include <ti/drivers/PIN.h>
579 #include <ti/drivers/pin/PINCC26XX.h>
580 
581 const PIN_Config BoardGpioInitTable[] = {
582 
583  CC1352P1_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
584  CC1352P1_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
585  CC1352P1_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
586  CC1352P1_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
587  CC1352P1_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
588  CC1352P1_LAUNCHXL_UART0_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
589  CC1352P1_LAUNCHXL_UART0_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
590  CC1352P1_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
591  CC1352P1_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
592  CC1352P1_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
593  CC1352P1_LAUNCHXL_DIO28_RF_24GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
594  CC1352P1_LAUNCHXL_DIO29_RF_HIGH_PA | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
595  CC1352P1_LAUNCHXL_DIO30_RF_SUB1GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Path disabled */
596  PIN_TERMINATE
597 };
598 
599 const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
600  .intPriority = ~0,
601  .swiPriority = 0
602 };
603 
604 /*
605  * =============================== Power ===============================
606  */
607 #include <ti/drivers/Power.h>
608 #include <ti/drivers/power/PowerCC26X2.h>
609 
610 const PowerCC26X2_Config PowerCC26X2_config = {
611  .policyInitFxn = NULL,
612  .policyFxn = &PowerCC26XX_standbyPolicy,
613  .calibrateFxn = &PowerCC26XX_calibrate,
614  .enablePolicy = true,
615  .calibrateRCOSC_LF = true,
616  .calibrateRCOSC_HF = true,
617 };
618 
619 /*
620  * =============================== PWM ===============================
621  * Remove unused entries to reduce flash usage both in Board.c and Board.h
622  */
623 #include <ti/drivers/PWM.h>
624 #include <ti/drivers/pwm/PWMTimerCC26XX.h>
625 
626 PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWMCOUNT];
627 
628 const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWMCOUNT] = {
629  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER0A },
630  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER0B },
631  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER1A },
632  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER1B },
633  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER2A },
634  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER2B },
635  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER3A },
636  { .pwmPin = CC1352P1_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC1352P1_LAUNCHXL_GPTIMER3B },
637 };
638 
639 const PWM_Config PWM_config[CC1352P1_LAUNCHXL_PWMCOUNT] = {
640  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM0] },
641  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM1] },
642  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM2] },
643  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM3] },
644  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM4] },
645  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM5] },
646  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM6] },
647  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1352P1_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC1352P1_LAUNCHXL_PWM7] },
648 };
649 
650 const uint_least8_t PWM_count = CC1352P1_LAUNCHXL_PWMCOUNT;
651 
652 /*
653  * =============================== RF Driver ===============================
654  */
655 #include <ti/drivers/rf/RF.h>
656 
657 /*
658  * Board-specific callback function to set the correct antenna path.
659  *
660  * This function is called by the RF driver on global driver events.
661  * It contains a default implementation to set the correct antenna path.
662  * This function is defined in the file CC1352P1_LAUNCHXL_fxns.c
663  */
664 extern void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void* arg);
665 
666 const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
667  .hwiPriority = ~0, /* Lowest HWI priority */
668  .swiPriority = 0, /* Lowest SWI priority */
669  .xoscHfAlwaysNeeded = true, /* Keep XOSC dependency while in stanby */
670 
671  /* Register the board specific callback */
672  .globalCallback = &rfDriverCallback,
673 
674  /* Subscribe the callback to both events */
675  .globalEventMask = RF_GlobalEventRadioSetup | RF_GlobalEventRadioPowerDown
676 };
677 
678 /*
679  * =============================== SD ===============================
680  */
681 #include <ti/drivers/SD.h>
682 #include <ti/drivers/sd/SDSPI.h>
683 
684 #if TI_SD_CONF_ENABLE
685 
686 #if !(TI_SPI_CONF_SPI0_ENABLE)
687 #error "SD driver requires SPI0 enabled"
688 #endif
689 
690 SDSPI_Object sdspiObjects[CC1352P1_LAUNCHXL_SDCOUNT];
691 
692 const SDSPI_HWAttrs sdspiHWAttrs[CC1352P1_LAUNCHXL_SDCOUNT] = {
693  {
694  .spiIndex = CC1352P1_LAUNCHXL_SPI0,
695  .spiCsGpioIndex = CC1352P1_LAUNCHXL_GPIO_DIO_19
696  }
697 };
698 
699 const SD_Config SD_config[CC1352P1_LAUNCHXL_SDCOUNT] = {
700  {
701  .fxnTablePtr = &SDSPI_fxnTable,
702  .object = &sdspiObjects[CC1352P1_LAUNCHXL_SDSPI0],
703  .hwAttrs = &sdspiHWAttrs[CC1352P1_LAUNCHXL_SDSPI0]
704  },
705 };
706 
707 const uint_least8_t SD_count = CC1352P1_LAUNCHXL_SDCOUNT;
708 
709 #endif /* TI_SD_CONF_ENABLE */
710 
711 /*
712  * =============================== SPI DMA ===============================
713  */
714 #include <ti/drivers/SPI.h>
715 #include <ti/drivers/spi/SPICC26XXDMA.h>
716 
717 #if TI_SPI_CONF_ENABLE
718 
719 SPICC26XXDMA_Object spiCC26XXDMAObjects[CC1352P1_LAUNCHXL_SPICOUNT];
720 
721 /*
722  * NOTE: The SPI instances below can be used by the SD driver to communicate
723  * with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
724  * to satisfy the SDSPI driver requirement.
725  */
726 const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC1352P1_LAUNCHXL_SPICOUNT] = {
727 #if TI_SPI_CONF_SPI0_ENABLE
728  {
729  .baseAddr = SSI0_BASE,
730  .intNum = INT_SSI0_COMB,
731  .intPriority = ~0,
732  .swiPriority = 0,
733  .powerMngrId = PowerCC26XX_PERIPH_SSI0,
734  .defaultTxBufValue = 0xFF,
735  .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
736  .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
737  .mosiPin = CC1352P1_LAUNCHXL_SPI0_MOSI,
738  .misoPin = CC1352P1_LAUNCHXL_SPI0_MISO,
739  .clkPin = CC1352P1_LAUNCHXL_SPI0_CLK,
740  .csnPin = CC1352P1_LAUNCHXL_SPI0_CSN,
741  .minDmaTransferSize = 10
742  },
743 #endif
744 #if TI_SPI_CONF_SPI1_ENABLE
745  {
746  .baseAddr = SSI1_BASE,
747  .intNum = INT_SSI1_COMB,
748  .intPriority = ~0,
749  .swiPriority = 0,
750  .powerMngrId = PowerCC26XX_PERIPH_SSI1,
751  .defaultTxBufValue = 0xFF,
752  .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
753  .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
754  .mosiPin = CC1352P1_LAUNCHXL_SPI1_MOSI,
755  .misoPin = CC1352P1_LAUNCHXL_SPI1_MISO,
756  .clkPin = CC1352P1_LAUNCHXL_SPI1_CLK,
757  .csnPin = CC1352P1_LAUNCHXL_SPI1_CSN,
758  .minDmaTransferSize = 10
759  },
760 #endif
761 };
762 
763 const SPI_Config SPI_config[CC1352P1_LAUNCHXL_SPICOUNT] = {
764 #if TI_SPI_CONF_SPI0_ENABLE
765  {
766  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
767  .object = &spiCC26XXDMAObjects[CC1352P1_LAUNCHXL_SPI0],
768  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1352P1_LAUNCHXL_SPI0]
769  },
770 #endif
771 #if TI_SPI_CONF_SPI1_ENABLE
772  {
773  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
774  .object = &spiCC26XXDMAObjects[CC1352P1_LAUNCHXL_SPI1],
775  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1352P1_LAUNCHXL_SPI1]
776  },
777 #endif
778 };
779 
780 const uint_least8_t SPI_count = CC1352P1_LAUNCHXL_SPICOUNT;
781 
782 #endif /* TI_SPI_CONF_ENABLE */
783 
784 
785 /*
786  * =============================== TRNG ===============================
787  */
788 #include <ti/drivers/TRNG.h>
789 #include <ti/drivers/trng/TRNGCC26X2.h>
790 
791 TRNGCC26X2_Object trngCC26X2Object[CC1352P1_LAUNCHXL_TRNGCOUNT];
792 
793 const TRNGCC26X2_HWAttrs trngCC26X2HWAttrs[CC1352P1_LAUNCHXL_TRNGCOUNT] = {
794  {
795  .swiPriority = 0,
796  .intPriority = ~0,
797  }
798 };
799 
800 const TRNG_Config TRNG_config[] = {
801  { &trngCC26X2Object[0], &trngCC26X2HWAttrs[0] },
802 };
803 
804 const uint8_t TRNG_count = CC1352P1_LAUNCHXL_TRNGCOUNT;
805 
806 
807 /*
808  * =============================== UART ===============================
809  */
810 #include <ti/drivers/UART.h>
811 #include <ti/drivers/uart/UARTCC26XX.h>
812 
813 #if TI_UART_CONF_ENABLE
814 
815 UARTCC26XX_Object uartCC26XXObjects[CC1352P1_LAUNCHXL_UARTCOUNT];
816 
817 uint8_t uartCC26XXRingBuffer[CC1352P1_LAUNCHXL_UARTCOUNT][32];
818 
819 const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1352P1_LAUNCHXL_UARTCOUNT] = {
820 #if TI_UART_CONF_UART0_ENABLE
821  {
822  .baseAddr = UART0_BASE,
823  .powerMngrId = PowerCC26XX_PERIPH_UART0,
824  .intNum = INT_UART0_COMB,
825  .intPriority = ~0,
826  .swiPriority = 0,
827  .txPin = CC1352P1_LAUNCHXL_UART0_TX,
828  .rxPin = CC1352P1_LAUNCHXL_UART0_RX,
829  .ctsPin = PIN_UNASSIGNED,
830  .rtsPin = PIN_UNASSIGNED,
831  .ringBufPtr = uartCC26XXRingBuffer[CC1352P1_LAUNCHXL_UART0],
832  .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1352P1_LAUNCHXL_UART0]),
833  .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
834  .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
835  .errorFxn = NULL
836  },
837 #endif
839  {
840  .baseAddr = UART1_BASE,
841  .powerMngrId = PowerCC26X2_PERIPH_UART1,
842  .intNum = INT_UART1_COMB,
843  .intPriority = ~0,
844  .swiPriority = 0,
845  .txPin = CC1352P1_LAUNCHXL_UART1_TX,
846  .rxPin = CC1352P1_LAUNCHXL_UART1_RX,
847  .ctsPin = PIN_UNASSIGNED,
848  .rtsPin = PIN_UNASSIGNED,
849  .ringBufPtr = uartCC26XXRingBuffer[CC1352P1_LAUNCHXL_UART1],
850  .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1352P1_LAUNCHXL_UART1]),
851  .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
852  .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
853  .errorFxn = NULL
854  },
855 #endif
856 };
857 
858 const UART_Config UART_config[CC1352P1_LAUNCHXL_UARTCOUNT] = {
859 #if TI_UART_CONF_UART0_ENABLE
860  {
861  .fxnTablePtr = &UARTCC26XX_fxnTable,
862  .object = &uartCC26XXObjects[CC1352P1_LAUNCHXL_UART0],
863  .hwAttrs = &uartCC26XXHWAttrs[CC1352P1_LAUNCHXL_UART0]
864  },
865 #endif
866 #if TI_UART_CONF_UART1_ENABLE
867  {
868  .fxnTablePtr = &UARTCC26XX_fxnTable,
869  .object = &uartCC26XXObjects[CC1352P1_LAUNCHXL_UART1],
870  .hwAttrs = &uartCC26XXHWAttrs[CC1352P1_LAUNCHXL_UART1]
871  },
872 #endif
873 };
874 
875 const uint_least8_t UART_count = CC1352P1_LAUNCHXL_UARTCOUNT;
876 
877 #endif /* TI_UART_CONF_ENABLE */
878 
879 /*
880  * =============================== UDMA ===============================
881  */
882 #include <ti/drivers/dma/UDMACC26XX.h>
883 
884 UDMACC26XX_Object udmaObjects[CC1352P1_LAUNCHXL_UDMACOUNT];
885 
886 const UDMACC26XX_HWAttrs udmaHWAttrs[CC1352P1_LAUNCHXL_UDMACOUNT] = {
887  {
888  .baseAddr = UDMA0_BASE,
889  .powerMngrId = PowerCC26XX_PERIPH_UDMA,
890  .intNum = INT_DMA_ERR,
891  .intPriority = ~0
892  }
893 };
894 
895 const UDMACC26XX_Config UDMACC26XX_config[CC1352P1_LAUNCHXL_UDMACOUNT] = {
896  {
897  .object = &udmaObjects[CC1352P1_LAUNCHXL_UDMA0],
898  .hwAttrs = &udmaHWAttrs[CC1352P1_LAUNCHXL_UDMA0]
899  },
900 };
901 
902 
903 
904 /*
905  * =============================== Watchdog ===============================
906  */
907 #include <ti/drivers/Watchdog.h>
908 #include <ti/drivers/watchdog/WatchdogCC26XX.h>
909 
910 WatchdogCC26XX_Object watchdogCC26XXObjects[CC1352P1_LAUNCHXL_WATCHDOGCOUNT];
911 
912 const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1352P1_LAUNCHXL_WATCHDOGCOUNT] = {
913  {
914  .baseAddr = WDT_BASE,
915  .reloadValue = 1000 /* Reload value in milliseconds */
916  },
917 };
918 
919 const Watchdog_Config Watchdog_config[CC1352P1_LAUNCHXL_WATCHDOGCOUNT] = {
920  {
921  .fxnTablePtr = &WatchdogCC26XX_fxnTable,
922  .object = &watchdogCC26XXObjects[CC1352P1_LAUNCHXL_WATCHDOG0],
923  .hwAttrs = &watchdogCC26XXHWAttrs[CC1352P1_LAUNCHXL_WATCHDOG0]
924  },
925 };
926 
927 const uint_least8_t Watchdog_count = CC1352P1_LAUNCHXL_WATCHDOGCOUNT;
928 
929 /*
930  * Board-specific initialization function to disable external flash.
931  * This function is defined in the file CC1352P1_LAUNCHXL_fxns.c
932  */
933 extern void Board_initHook(void);
934 
935 /*
936  * ======== CC1352P1_LAUNCHXL_initGeneral ========
937  */
939 {
940  Power_init();
941 
942  if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
943  /* Error with PIN_init */
944  while (1);
945  }
946 
947  /* Perform board-specific initialization */
948  Board_initHook();
949 }
#define SSI1_BASE
Base address for SSI1.
Definition: ssi.h:59
#define SSI0_BASE
Base address for SSI0.
Definition: ssi.h:58
void CC1352P1_LAUNCHXL_initGeneral(void)
Initialize the general board specific settings.
#define TI_UART_CONF_UART1_ENABLE
Enable or disable UART1 peripheral.
===========================================================================