Contiki-NG
CC1310_LAUNCHXL.c
1 /*
2  * Copyright (c) 2015-2019, 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  * ====================== CC1310_LAUNCHXL.c ===================================
35  * This file is responsible for setting up the board specific items for the
36  * CC1310_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 "CC1310_LAUNCHXL.h"
50 
51 /*
52  * =============================== ADCBuf ===============================
53  */
54 #include <ti/drivers/ADCBuf.h>
55 #include <ti/drivers/adcbuf/ADCBufCC26XX.h>
56 
57 ADCBufCC26XX_Object adcBufCC26xxObjects[CC1310_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 ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[CC1310_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
67  {CC1310_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
68  {CC1310_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
69  {CC1310_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
70  {CC1310_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
71  {CC1310_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
72  {CC1310_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
73  {CC1310_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
74  {CC1310_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 ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC1310_LAUNCHXL_ADCBUFCOUNT] = {
81  {
82  .intPriority = ~0,
83  .swiPriority = 0,
84  .adcChannelLut = ADCBufCC26XX_adcChannelLut,
85  }
86 };
87 
88 const ADCBuf_Config ADCBuf_config[CC1310_LAUNCHXL_ADCBUFCOUNT] = {
89  {
90  &ADCBufCC26XX_fxnTable,
91  &adcBufCC26xxObjects[CC1310_LAUNCHXL_ADCBUF0],
92  &adcBufCC26xxHWAttrs[CC1310_LAUNCHXL_ADCBUF0]
93  },
94 };
95 
96 const uint_least8_t ADCBuf_count = CC1310_LAUNCHXL_ADCBUFCOUNT;
97 
98 /*
99  * =============================== ADC ===============================
100  */
101 #include <ti/drivers/ADC.h>
102 #include <ti/drivers/adc/ADCCC26XX.h>
103 
104 ADCCC26XX_Object adcCC26xxObjects[CC1310_LAUNCHXL_ADCCOUNT];
105 
106 
107 const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCCOUNT] = {
108  {
109  .adcDIO = CC1310_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 = CC1310_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 = CC1310_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 = CC1310_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 = CC1310_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 = CC1310_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 = CC1310_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 = CC1310_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[CC1310_LAUNCHXL_ADCCOUNT] = {
210  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC0]},
211  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC1]},
212  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC2]},
213  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC3]},
214  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC4]},
215  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC5]},
216  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC6]},
217  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADC7], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADC7]},
218  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCDCOUPL]},
219  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCVSS]},
220  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1310_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC1310_LAUNCHXL_ADCVDDS]},
221 };
222 
223 const uint_least8_t ADC_count = CC1310_LAUNCHXL_ADCCOUNT;
224 
225 /*
226  * =============================== Crypto ===============================
227  */
228 #include <ti/drivers/crypto/CryptoCC26XX.h>
229 
230 CryptoCC26XX_Object cryptoCC26XXObjects[CC1310_LAUNCHXL_CRYPTOCOUNT];
231 
232 const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC1310_LAUNCHXL_CRYPTOCOUNT] = {
233  {
234  .baseAddr = CRYPTO_BASE,
235  .powerMngrId = PowerCC26XX_PERIPH_CRYPTO,
236  .intNum = INT_CRYPTO_RESULT_AVAIL_IRQ,
237  .intPriority = ~0,
238  }
239 };
240 
241 const CryptoCC26XX_Config CryptoCC26XX_config[CC1310_LAUNCHXL_CRYPTOCOUNT] = {
242  {
243  .object = &cryptoCC26XXObjects[CC1310_LAUNCHXL_CRYPTO0],
244  .hwAttrs = &cryptoCC26XXHWAttrs[CC1310_LAUNCHXL_CRYPTO0]
245  }
246 };
247 
248 /*
249  * =============================== AESCCM ===============================
250  */
251 #include <ti/drivers/AESCCM.h>
252 #include <ti/drivers/aesccm/AESCCMCC26XX.h>
253 
254 AESCCMCC26XX_Object aesccmCC26XXObjects[CC1310_LAUNCHXL_AESCCMCOUNT];
255 
256 const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC1310_LAUNCHXL_AESCCMCOUNT] = {
257  {
258  .intPriority = ~0,
259  }
260 };
261 
262 const AESCCM_Config AESCCM_config[CC1310_LAUNCHXL_AESCCMCOUNT] = {
263  {
264  .object = &aesccmCC26XXObjects[CC1310_LAUNCHXL_AESCCM0],
265  .hwAttrs = &aesccmCC26XXHWAttrs[CC1310_LAUNCHXL_AESCCM0]
266  },
267 };
268 
269 const uint_least8_t AESCCM_count = CC1310_LAUNCHXL_AESCCMCOUNT;
270 
271 
272 /*
273  * =============================== AESGCM ===============================
274  */
275 #include <ti/drivers/AESGCM.h>
276 #include <ti/drivers/aesgcm/AESGCMCC26XX.h>
277 
278 AESGCMCC26XX_Object aesgcmCC26XXObjects[CC1310_LAUNCHXL_AESGCMCOUNT];
279 
280 const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC1310_LAUNCHXL_AESGCMCOUNT] = {
281  {
282  .intPriority = ~0,
283  }
284 };
285 
286 const AESGCM_Config AESGCM_config[CC1310_LAUNCHXL_AESGCMCOUNT] = {
287  {
288  .object = &aesgcmCC26XXObjects[CC1310_LAUNCHXL_AESGCM0],
289  .hwAttrs = &aesgcmCC26XXHWAttrs[CC1310_LAUNCHXL_AESGCM0]
290  },
291 };
292 
293 const uint_least8_t AESGCM_count = CC1310_LAUNCHXL_AESGCMCOUNT;
294 
295 /*
296  * =============================== AESCBC ===============================
297  */
298 #include <ti/drivers/AESCBC.h>
299 #include <ti/drivers/aescbc/AESCBCCC26XX.h>
300 
301 AESCBCCC26XX_Object aescbcCC26XXObjects[CC1310_LAUNCHXL_AESCBCCOUNT];
302 
303 const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC1310_LAUNCHXL_AESCBCCOUNT] = {
304  {
305  .intPriority = ~0,
306  }
307 };
308 
309 const AESCBC_Config AESCBC_config[CC1310_LAUNCHXL_AESCBCCOUNT] = {
310  {
311  .object = &aescbcCC26XXObjects[CC1310_LAUNCHXL_AESCBC0],
312  .hwAttrs = &aescbcCC26XXHWAttrs[CC1310_LAUNCHXL_AESCBC0]
313  },
314 };
315 
316 const uint_least8_t AESCBC_count = CC1310_LAUNCHXL_AESCBCCOUNT;
317 
318 /*
319  * =============================== AESCTR ===============================
320  */
321 #include <ti/drivers/AESCTR.h>
322 #include <ti/drivers/aesctr/AESCTRCC26XX.h>
323 
324 AESCTRCC26XX_Object aesctrCC26XXObjects[CC1310_LAUNCHXL_AESCTRCOUNT];
325 
326 const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC1310_LAUNCHXL_AESCTRCOUNT] = {
327  {
328  .intPriority = ~0,
329  }
330 };
331 
332 const AESCTR_Config AESCTR_config[CC1310_LAUNCHXL_AESCTRCOUNT] = {
333  {
334  .object = &aesctrCC26XXObjects[CC1310_LAUNCHXL_AESCTR0],
335  .hwAttrs = &aesctrCC26XXHWAttrs[CC1310_LAUNCHXL_AESCTR0]
336  },
337 };
338 
339 const uint_least8_t AESCTR_count = CC1310_LAUNCHXL_AESCTRCOUNT;
340 
341 /*
342  * =============================== AESECB ===============================
343  */
344 #include <ti/drivers/AESECB.h>
345 #include <ti/drivers/aesecb/AESECBCC26XX.h>
346 
347 AESECBCC26XX_Object aesecbCC26XXObjects[CC1310_LAUNCHXL_AESECBCOUNT];
348 
349 const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC1310_LAUNCHXL_AESECBCOUNT] = {
350  {
351  .intPriority = ~0,
352  }
353 };
354 
355 const AESECB_Config AESECB_config[CC1310_LAUNCHXL_AESECBCOUNT] = {
356  {
357  .object = &aesecbCC26XXObjects[CC1310_LAUNCHXL_AESECB0],
358  .hwAttrs = &aesecbCC26XXHWAttrs[CC1310_LAUNCHXL_AESECB0]
359  },
360 };
361 
362 const uint_least8_t AESECB_count = CC1310_LAUNCHXL_AESECBCOUNT;
363 
364 /*
365  * =============================== AESCTRDRBG ===============================
366  */
367 #include <ti/drivers/AESCTRDRBG.h>
368 #include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
369 
370 AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC1310_LAUNCHXL_AESCTRDRBGCOUNT];
371 
372 const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC1310_LAUNCHXL_AESCTRDRBGCOUNT] = {
373  {
374  .aesctrIndex = CC1310_LAUNCHXL_AESCTR0,
375  }
376 };
377 
378 const AESCTRDRBG_Config AESCTRDRBG_config[CC1310_LAUNCHXL_AESCTRDRBGCOUNT] = {
379  {
380  .object = &aesctrdrbgXXObjects[CC1310_LAUNCHXL_AESCTRDRBG0],
381  .hwAttrs = &aesctrdrbgXXHWAttrs[CC1310_LAUNCHXL_AESCTRDRBG0]
382  },
383 };
384 
385 const uint_least8_t AESCTRDRBG_count = CC1310_LAUNCHXL_AESCTRDRBGCOUNT;
386 
387 /*
388  * =============================== TRNG ===============================
389  */
390 #include <ti/drivers/TRNG.h>
391 #include <ti/drivers/trng/TRNGCC26XX.h>
392 
393 TRNGCC26XX_Object trngCC26XXObjects[CC1310_LAUNCHXL_TRNGCOUNT];
394 
395 const TRNGCC26XX_HWAttrs trngCC26X2HWAttrs[CC1310_LAUNCHXL_TRNGCOUNT] = {
396  {
397  .intPriority = ~0,
398  .swiPriority = 0,
399  .samplesPerCycle = 240000,
400  }
401 };
402 
403 const TRNG_Config TRNG_config[CC1310_LAUNCHXL_TRNGCOUNT] = {
404  {
405  .object = &trngCC26XXObjects[CC1310_LAUNCHXL_TRNG0],
406  .hwAttrs = &trngCC26X2HWAttrs[CC1310_LAUNCHXL_TRNG0]
407  },
408 };
409 
410 const uint_least8_t TRNG_count = CC1310_LAUNCHXL_TRNGCOUNT;
411 
412 /*
413  * =============================== GPIO ===============================
414  */
415 #include <ti/drivers/GPIO.h>
416 #include <ti/drivers/gpio/GPIOCC26XX.h>
417 
418 /*
419  * Array of Pin configurations
420  * NOTE: The order of the pin configurations must coincide with what was
421  * defined in CC1310_LAUNCHXL.h
422  * NOTE: Pins not used for interrupts should be placed at the end of the
423  * array. Callback entries can be omitted from callbacks array to
424  * reduce memory usage.
425  */
426 GPIO_PinConfig gpioPinConfigs[] = {
427  /* Input pins */
428  GPIOCC26XX_DIO_13 | GPIO_DO_NOT_CONFIG, /* Button 0 */
429  GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
430 
431  GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC1310_LAUNCHXL_SPI_MASTER_READY */
432  GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC1310_LAUNCHXL_SPI_SLAVE_READY */
433 
434  /* Output pins */
435  GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
436  GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
437 
438  /* SPI Flash CSN */
439  GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
440 
441  /* SD CS */
442  GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,
443 };
444 
445 /*
446  * Array of callback function pointers
447  * NOTE: The order of the pin configurations must coincide with what was
448  * defined in CC1310_LAUNCH.h
449  * NOTE: Pins not used for interrupts can be omitted from callbacks array to
450  * reduce memory usage (if placed at end of gpioPinConfigs array).
451  */
452 GPIO_CallbackFxn gpioCallbackFunctions[] = {
453  NULL, /* Button 0 */
454  NULL, /* Button 1 */
455  NULL, /* CC1310_LAUNCHXL_SPI_MASTER_READY */
456  NULL, /* CC1310_LAUNCHXL_SPI_SLAVE_READY */
457 };
458 
459 const GPIOCC26XX_Config GPIOCC26XX_config = {
460  .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
461  .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
462  .numberOfPinConfigs = CC1310_LAUNCHXL_GPIOCOUNT,
463  .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
464  .intPriority = (~0)
465 };
466 
467 /*
468  * =============================== GPTimer ===============================
469  * Remove unused entries to reduce flash usage both in Board.c and Board.h
470  */
471 #include <ti/drivers/timer/GPTimerCC26XX.h>
472 
473 GPTimerCC26XX_Object gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMERCOUNT];
474 
475 const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMERPARTSCOUNT] = {
476  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
477  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
478  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
479  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
480  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
481  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
482  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
483  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
484 };
485 
486 const GPTimerCC26XX_Config GPTimerCC26XX_config[CC1310_LAUNCHXL_GPTIMERPARTSCOUNT] = {
487  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER0A], GPT_A },
488  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER0B], GPT_B },
489  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER1A], GPT_A },
490  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER1B], GPT_B },
491  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER2A], GPT_A },
492  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER2B], GPT_B },
493  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER3A], GPT_A },
494  { &gptimerCC26XXObjects[CC1310_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC1310_LAUNCHXL_GPTIMER3B], GPT_B },
495 };
496 
497 /*
498  * =============================== I2C ===============================
499 */
500 #include <ti/drivers/I2C.h>
501 #include <ti/drivers/i2c/I2CCC26XX.h>
502 
503 #if TI_I2C_CONF_ENABLE
504 
505 I2CCC26XX_Object i2cCC26xxObjects[CC1310_LAUNCHXL_I2CCOUNT];
506 
507 const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1310_LAUNCHXL_I2CCOUNT] = {
508 #if TI_I2C_CONF_I2C0_ENABLE
509  {
510  .baseAddr = I2C0_BASE,
511  .powerMngrId = PowerCC26XX_PERIPH_I2C0,
512  .intNum = INT_I2C_IRQ,
513  .intPriority = ~0,
514  .swiPriority = 0,
515  .sdaPin = CC1310_LAUNCHXL_I2C0_SDA0,
516  .sclPin = CC1310_LAUNCHXL_I2C0_SCL0,
517  },
518 #endif
519 };
520 
521 const I2C_Config I2C_config[CC1310_LAUNCHXL_I2CCOUNT] = {
522 #if TI_I2C_CONF_I2C0_ENABLE
523  {
524  .fxnTablePtr = &I2CCC26XX_fxnTable,
525  .object = &i2cCC26xxObjects[CC1310_LAUNCHXL_I2C0],
526  .hwAttrs = &i2cCC26xxHWAttrs[CC1310_LAUNCHXL_I2C0]
527  },
528 #endif
529 };
530 
531 const uint_least8_t I2C_count = CC1310_LAUNCHXL_I2CCOUNT;
532 
533 #endif /* TI_I2C_CONF_ENABLE */
534 
535 /*
536  * =============================== I2S ===============================
537 */
538 #include <ti/drivers/I2S.h>
539 #include <ti/drivers/i2s/I2SCC26XX.h>
540 
541 I2SCC26XX_Object i2sCC26XXObjects[CC1310_LAUNCHXL_I2SCOUNT];
542 
543 const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC1310_LAUNCHXL_I2SCOUNT] = {
544  {
545  .pinSD1 = CC1310_LAUNCHXL_I2S_ADI,
546  .pinSD0 = CC1310_LAUNCHXL_I2S_ADO,
547  .pinSCK = CC1310_LAUNCHXL_I2S_BCLK,
548  .pinMCLK = CC1310_LAUNCHXL_I2S_MCLK,
549  .pinWS = CC1310_LAUNCHXL_I2S_WCLK,
550  .intPriority = ~0,
551  }
552 };
553 
554 const I2S_Config I2S_config[CC1310_LAUNCHXL_I2SCOUNT] = {
555  {
556  .object = &i2sCC26XXObjects[CC1310_LAUNCHXL_I2S0],
557  .hwAttrs = &i2sCC26XXHWAttrs[CC1310_LAUNCHXL_I2S0]
558  },
559 };
560 
561 const uint_least8_t I2S_count = CC1310_LAUNCHXL_I2SCOUNT;
562 
563 /*
564  * =============================== NVS ===============================
565  */
566 #include <ti/drivers/NVS.h>
567 #include <ti/drivers/nvs/NVSSPI25X.h>
568 #include <ti/drivers/nvs/NVSCC26XX.h>
569 
570 #define NVS_REGIONS_BASE 0x1A000
571 #define SECTORSIZE 0x1000
572 #define REGIONSIZE (SECTORSIZE * 4)
573 
574 #if TI_NVS_CONF_ENABLE
575 
576 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
577 
578 /*
579  * Reserve flash sectors for NVS driver use by placing an uninitialized byte
580  * array at the desired flash address.
581  */
582 #if defined(__TI_COMPILER_VERSION__)
583 
584 /*
585  * Place uninitialized array at NVS_REGIONS_BASE
586  */
587 #pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
588 #pragma NOINIT(flashBuf);
589 static char flashBuf[REGIONSIZE];
590 
591 #elif defined(__IAR_SYSTEMS_ICC__)
592 
593 /*
594  * Place uninitialized array at NVS_REGIONS_BASE
595  */
596 static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
597 
598 #elif defined(__GNUC__)
599 
600 /*
601  * Place the flash buffers in the .nvs section created in the gcc linker file.
602  * The .nvs section enforces alignment on a sector boundary but may
603  * be placed anywhere in flash memory. If desired the .nvs section can be set
604  * to a fixed address by changing the following in the gcc linker file:
605  *
606  * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
607  * *(.nvs)
608  * } > REGION_TEXT
609  */
610 __attribute__ ((section (".nvs")))
611 static char flashBuf[REGIONSIZE];
612 
613 #endif
614 
615 /* Allocate objects for NVS Internal Regions */
616 NVSCC26XX_Object nvsCC26xxObjects[1];
617 
618 /* Hardware attributes for NVS Internal Regions */
619 const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
620  {
621  .regionBase = (void *)flashBuf,
622  .regionSize = REGIONSIZE,
623  },
624 };
625 
626 #endif /* TI_NVS_CONF_NVS_INTERNAL_ENABLE */
627 
628 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
629 
630 #define SPISECTORSIZE 0x1000
631 #define SPIREGIONSIZE (SPISECTORSIZE * 32)
632 #define VERIFYBUFSIZE 64
633 
634 static uint8_t verifyBuf[VERIFYBUFSIZE];
635 
636 /* Allocate objects for NVS External Regions */
637 NVSSPI25X_Object nvsSPI25XObjects[1];
638 
639 /* Hardware attributes for NVS External Regions */
640 const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
641  {
642  .regionBaseOffset = 0,
643  .regionSize = SPIREGIONSIZE,
644  .sectorSize = SPISECTORSIZE,
645  .verifyBuf = verifyBuf,
646  .verifyBufSize = VERIFYBUFSIZE,
647  .spiHandle = NULL,
648  .spiIndex = 0,
649  .spiBitRate = 4000000,
650  .spiCsnGpioIndex = CC1310_LAUNCHXL_GPIO_SPI_FLASH_CS,
651  .statusPollDelayUs = 100,
652  },
653 };
654 
655 #endif /* TI_NVS_CONF_NVS_EXTERNAL_ENABLE */
656 
657 /* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
658 const NVS_Config NVS_config[CC1310_LAUNCHXL_NVSCOUNT] = {
659 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
660  {
661  .fxnTablePtr = &NVSCC26XX_fxnTable,
662  .object = &nvsCC26xxObjects[0],
663  .hwAttrs = &nvsCC26xxHWAttrs[0],
664  },
665 #endif
666 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
667  {
668  .fxnTablePtr = &NVSSPI25X_fxnTable,
669  .object = &nvsSPI25XObjects[0],
670  .hwAttrs = &nvsSPI25XHWAttrs[0],
671  },
672 #endif
673 };
674 
675 const uint_least8_t NVS_count = CC1310_LAUNCHXL_NVSCOUNT;
676 
677 #endif /* TI_NVS_CONF_ENABLE */
678 
679 /*
680  * =============================== PIN ===============================
681  */
682 #include <ti/drivers/PIN.h>
683 #include <ti/drivers/pin/PINCC26XX.h>
684 
685 const PIN_Config BoardGpioInitTable[] = {
686 
687  CC1310_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
688  CC1310_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
689  CC1310_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
690  CC1310_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
691  CC1310_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
692  CC1310_LAUNCHXL_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
693  CC1310_LAUNCHXL_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
694  CC1310_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
695  CC1310_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
696  CC1310_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
697 
698  PIN_TERMINATE
699 };
700 
701 const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
702  .intPriority = ~0,
703  .swiPriority = 0
704 };
705 
706 /*
707  * =============================== Power ===============================
708  */
709 #include <ti/drivers/Power.h>
710 #include <ti/drivers/power/PowerCC26XX.h>
711 #include "clock-arch.h"
712 
713 const PowerCC26XX_Config PowerCC26XX_config = {
714  .policyInitFxn = NULL,
715  .policyFxn = &clock_arch_standby_policy,
716  .calibrateFxn = &PowerCC26XX_calibrate,
717  .enablePolicy = true,
718  .calibrateRCOSC_LF = true,
719  .calibrateRCOSC_HF = true,
720 };
721 
722 /*
723  * =============================== PWM ===============================
724  * Remove unused entries to reduce flash usage both in Board.c and Board.h
725  */
726 #include <ti/drivers/PWM.h>
727 #include <ti/drivers/pwm/PWMTimerCC26XX.h>
728 
729 PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWMCOUNT];
730 
731 const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWMCOUNT] = {
732  { .pwmPin = CC1310_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER0A },
733  { .pwmPin = CC1310_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER0B },
734  { .pwmPin = CC1310_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER1A },
735  { .pwmPin = CC1310_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER1B },
736  { .pwmPin = CC1310_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER2A },
737  { .pwmPin = CC1310_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER2B },
738  { .pwmPin = CC1310_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER3A },
739  { .pwmPin = CC1310_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER3B },
740 };
741 
742 const PWM_Config PWM_config[CC1310_LAUNCHXL_PWMCOUNT] = {
743  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM0] },
744  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM1] },
745  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM2] },
746  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM3] },
747  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM4] },
748  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM5] },
749  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM6] },
750  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWM7] },
751 };
752 
753 const uint_least8_t PWM_count = CC1310_LAUNCHXL_PWMCOUNT;
754 
755 /*
756  * =============================== RF Driver ===============================
757  */
758 #include <ti/drivers/rf/RF.h>
759 
760 const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
761  .hwiPriority = ~0, /* Lowest HWI priority */
762  .swiPriority = 0, /* Lowest SWI priority */
763  .xoscHfAlwaysNeeded = true, /* Keep XOSC dependency while in standby */
764  .globalCallback = NULL, /* No board specific callback */
765  .globalEventMask = 0 /* No events subscribed to */
766 };
767 
768 /*
769  * =============================== SD ===============================
770  */
771 #include <ti/drivers/SD.h>
772 #include <ti/drivers/sd/SDSPI.h>
773 
774 #if TI_SD_CONF_ENABLE
775 
776 #if !(TI_SPI_CONF_SPI0_ENABLE)
777 #error "SD driver requires SPI0 enabled"
778 #endif
779 
780 SDSPI_Object sdspiObjects[CC1310_LAUNCHXL_SDCOUNT];
781 
782 const SDSPI_HWAttrs sdspiHWAttrs[CC1310_LAUNCHXL_SDCOUNT] = {
783  {
784  .spiIndex = CC1310_LAUNCHXL_SPI0,
785  .spiCsGpioIndex = CC1310_LAUNCHXL_SDSPI_CS
786  }
787 };
788 
789 const SD_Config SD_config[CC1310_LAUNCHXL_SDCOUNT] = {
790  {
791  .fxnTablePtr = &SDSPI_fxnTable,
792  .object = &sdspiObjects[CC1310_LAUNCHXL_SDSPI0],
793  .hwAttrs = &sdspiHWAttrs[CC1310_LAUNCHXL_SDSPI0]
794  },
795 };
796 
797 const uint_least8_t SD_count = CC1310_LAUNCHXL_SDCOUNT;
798 
799 #endif /* TI_SD_CONF_ENABLE */
800 
801 /*
802  * =============================== SPI DMA ===============================
803  */
804 #include <ti/drivers/SPI.h>
805 #include <ti/drivers/spi/SPICC26XXDMA.h>
806 
807 #if TI_SPI_CONF_ENABLE
808 
809 SPICC26XXDMA_Object spiCC26XXDMAObjects[CC1310_LAUNCHXL_SPICOUNT];
810 
811 /*
812  * NOTE: The SPI instances below can be used by the SD driver to communicate
813  * with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
814  * to satisfy the SDSPI driver requirement.
815  */
816 const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC1310_LAUNCHXL_SPICOUNT] = {
817 #if TI_SPI_CONF_SPI0_ENABLE
818  {
819  .baseAddr = SSI0_BASE,
820  .intNum = INT_SSI0_COMB,
821  .intPriority = ~0,
822  .swiPriority = 0,
823  .powerMngrId = PowerCC26XX_PERIPH_SSI0,
824  .defaultTxBufValue = 0xFF,
825  .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
826  .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
827  .mosiPin = CC1310_LAUNCHXL_SPI0_MOSI,
828  .misoPin = CC1310_LAUNCHXL_SPI0_MISO,
829  .clkPin = CC1310_LAUNCHXL_SPI0_CLK,
830  .csnPin = CC1310_LAUNCHXL_SPI0_CSN,
831  .minDmaTransferSize = 10
832  },
833 #endif
834 #if TI_SPI_CONF_SPI1_ENABLE
835  {
836  .baseAddr = SSI1_BASE,
837  .intNum = INT_SSI1_COMB,
838  .intPriority = ~0,
839  .swiPriority = 0,
840  .powerMngrId = PowerCC26XX_PERIPH_SSI1,
841  .defaultTxBufValue = 0xFF,
842  .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
843  .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
844  .mosiPin = CC1310_LAUNCHXL_SPI1_MOSI,
845  .misoPin = CC1310_LAUNCHXL_SPI1_MISO,
846  .clkPin = CC1310_LAUNCHXL_SPI1_CLK,
847  .csnPin = CC1310_LAUNCHXL_SPI1_CSN,
848  .minDmaTransferSize = 10
849  },
850 #endif
851 };
852 
853 const SPI_Config SPI_config[CC1310_LAUNCHXL_SPICOUNT] = {
854 #if TI_SPI_CONF_SPI0_ENABLE
855  {
856  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
857  .object = &spiCC26XXDMAObjects[CC1310_LAUNCHXL_SPI0],
858  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1310_LAUNCHXL_SPI0]
859  },
860 #endif
861 #if TI_SPI_CONF_SPI1_ENABLE
862  {
863  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
864  .object = &spiCC26XXDMAObjects[CC1310_LAUNCHXL_SPI1],
865  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1310_LAUNCHXL_SPI1]
866  },
867 #endif
868 };
869 
870 const uint_least8_t SPI_count = CC1310_LAUNCHXL_SPICOUNT;
871 
872 #endif /* TI_SPI_CONF_ENABLE */
873 
874 /*
875  * =============================== UART ===============================
876  */
877 #include <ti/drivers/UART.h>
878 #include <ti/drivers/uart/UARTCC26XX.h>
879 
880 #if TI_UART_CONF_ENABLE
881 
882 UARTCC26XX_Object uartCC26XXObjects[CC1310_LAUNCHXL_UARTCOUNT];
883 
884 uint8_t uartCC26XXRingBuffer[CC1310_LAUNCHXL_UARTCOUNT][32];
885 
886 const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1310_LAUNCHXL_UARTCOUNT] = {
887 #if TI_UART_CONF_UART0_ENABLE
888  {
889  .baseAddr = UART0_BASE,
890  .powerMngrId = PowerCC26XX_PERIPH_UART0,
891  .intNum = INT_UART0_COMB,
892  .intPriority = ~0,
893  .swiPriority = 0,
894  .txPin = CC1310_LAUNCHXL_UART_TX,
895  .rxPin = CC1310_LAUNCHXL_UART_RX,
896  .ctsPin = PIN_UNASSIGNED,
897  .rtsPin = PIN_UNASSIGNED,
898  .ringBufPtr = uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0],
899  .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0]),
900  .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
901  .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
902  .errorFxn = NULL
903  },
904 #endif
905 };
906 
907 const UART_Config UART_config[CC1310_LAUNCHXL_UARTCOUNT] = {
908 #if TI_UART_CONF_UART0_ENABLE
909  {
910  .fxnTablePtr = &UARTCC26XX_fxnTable,
911  .object = &uartCC26XXObjects[CC1310_LAUNCHXL_UART0],
912  .hwAttrs = &uartCC26XXHWAttrs[CC1310_LAUNCHXL_UART0]
913  },
914 #endif
915 };
916 
917 const uint_least8_t UART_count = CC1310_LAUNCHXL_UARTCOUNT;
918 
919 #endif /* TI_UART_CONF_ENABLE */
920 
921 /*
922  * =============================== UDMA ===============================
923  */
924 #include <ti/drivers/dma/UDMACC26XX.h>
925 
926 UDMACC26XX_Object udmaObjects[CC1310_LAUNCHXL_UDMACOUNT];
927 
928 const UDMACC26XX_HWAttrs udmaHWAttrs[CC1310_LAUNCHXL_UDMACOUNT] = {
929  {
930  .baseAddr = UDMA0_BASE,
931  .powerMngrId = PowerCC26XX_PERIPH_UDMA,
932  .intNum = INT_DMA_ERR,
933  .intPriority = ~0
934  }
935 };
936 
937 const UDMACC26XX_Config UDMACC26XX_config[CC1310_LAUNCHXL_UDMACOUNT] = {
938  {
939  .object = &udmaObjects[CC1310_LAUNCHXL_UDMA0],
940  .hwAttrs = &udmaHWAttrs[CC1310_LAUNCHXL_UDMA0]
941  },
942 };
943 
944 /*
945  * =============================== Watchdog ===============================
946  */
947 #include <ti/drivers/Watchdog.h>
948 #include <ti/drivers/watchdog/WatchdogCC26XX.h>
949 
950 WatchdogCC26XX_Object watchdogCC26XXObjects[CC1310_LAUNCHXL_WATCHDOGCOUNT];
951 
952 const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1310_LAUNCHXL_WATCHDOGCOUNT] = {
953  {
954  .baseAddr = WDT_BASE,
955  .reloadValue = 1000 /* Reload value in milliseconds */
956  },
957 };
958 
959 const Watchdog_Config Watchdog_config[CC1310_LAUNCHXL_WATCHDOGCOUNT] = {
960  {
961  .fxnTablePtr = &WatchdogCC26XX_fxnTable,
962  .object = &watchdogCC26XXObjects[CC1310_LAUNCHXL_WATCHDOG0],
963  .hwAttrs = &watchdogCC26XXHWAttrs[CC1310_LAUNCHXL_WATCHDOG0]
964  },
965 };
966 
967 const uint_least8_t Watchdog_count = CC1310_LAUNCHXL_WATCHDOGCOUNT;
968 
969 /*
970  * Board-specific initialization function to disable external flash.
971  * This function is defined in the file CC1310_LAUNCHXL_fxns.c
972  */
973 extern void Board_initHook(void);
974 
975 /*
976  * ======== CC1310_LAUNCHXL_initGeneral ========
977  */
979 {
980  Power_init();
981 
982  if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
983  /* Error with PIN_init */
984  while (1);
985  }
986 
987  /* Perform board-specific initialization */
988  Board_initHook();
989 }
990 
991 /*
992  * ======== Board_init ========
993  */
994 void Board_init(void)
995 {
997 }
void CC1310_LAUNCHXL_initGeneral(void)
Initialize the general board specific settings.
#define SSI1_BASE
Base address for SSI1.
Definition: ssi.h:59
#define SSI0_BASE
Base address for SSI0.
Definition: ssi.h:58
============================================================================
Header file for the CC13xx/CC26xx clock implementation.
void clock_arch_standby_policy(void)
Called by the Power driver when dropping to some low-power state.
Definition: clock-arch.c:184