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