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