Contiki-NG
CC1350_LAUNCHXL_433.c
1 /*
2  * Copyright (c) 2017-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  * ============================ CC1350_LAUNCHXL_433.c ============================
35  * This file is responsible for setting up the board specific items for the
36  * CC1350_LAUNCHXL_433 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 "CC1350_LAUNCHXL_433.h"
50 
51 /*
52  * =============================== ADCBuf ===============================
53  */
54 #include <ti/drivers/ADCBuf.h>
55 #include <ti/drivers/adcbuf/ADCBufCC26XX.h>
56 
57 ADCBufCC26XX_Object adcBufCC26XXobjects[CC1350_LAUNCHXL_433_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[CC1350_LAUNCHXL_433_ADCBUF0CHANNELCOUNT] = {
67  {CC1350_LAUNCHXL_433_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
68  {CC1350_LAUNCHXL_433_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
69  {CC1350_LAUNCHXL_433_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
70  {CC1350_LAUNCHXL_433_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
71  {CC1350_LAUNCHXL_433_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
72  {CC1350_LAUNCHXL_433_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
73  {CC1350_LAUNCHXL_433_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
74  {CC1350_LAUNCHXL_433_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[CC1350_LAUNCHXL_433_ADCBUFCOUNT] = {
81  {
82  .intPriority = ~0,
83  .swiPriority = 0,
84  .adcChannelLut = ADCBufCC26XX_adcChannelLut,
85  }
86 };
87 
88 const ADCBuf_Config ADCBuf_config[CC1350_LAUNCHXL_433_ADCBUFCOUNT] = {
89  {
90  &ADCBufCC26XX_fxnTable,
91  &adcBufCC26XXobjects[CC1350_LAUNCHXL_433_ADCBUF0],
92  &adcBufCC26XXHWAttrs[CC1350_LAUNCHXL_433_ADCBUF0]
93  },
94 };
95 
96 const uint_least8_t ADCBuf_count = CC1350_LAUNCHXL_433_ADCBUFCOUNT;
97 
98 /*
99  * =============================== ADC ===============================
100  */
101 #include <ti/drivers/ADC.h>
102 #include <ti/drivers/adc/ADCCC26XX.h>
103 
104 ADCCC26XX_Object adcCC26xxObjects[CC1350_LAUNCHXL_433_ADCCOUNT];
105 
106 const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADCCOUNT] = {
107  {
108  .adcDIO = CC1350_LAUNCHXL_433_DIO23_ANALOG,
109  .adcCompBInput = ADC_COMPB_IN_AUXIO7,
110  .refSource = ADCCC26XX_FIXED_REFERENCE,
111  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
112  .inputScalingEnabled = true,
113  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
114  .returnAdjustedVal = false
115  },
116  {
117  .adcDIO = CC1350_LAUNCHXL_433_DIO24_ANALOG,
118  .adcCompBInput = ADC_COMPB_IN_AUXIO6,
119  .refSource = ADCCC26XX_FIXED_REFERENCE,
120  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
121  .inputScalingEnabled = true,
122  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
123  .returnAdjustedVal = false
124  },
125  {
126  .adcDIO = CC1350_LAUNCHXL_433_DIO25_ANALOG,
127  .adcCompBInput = ADC_COMPB_IN_AUXIO5,
128  .refSource = ADCCC26XX_FIXED_REFERENCE,
129  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
130  .inputScalingEnabled = true,
131  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
132  .returnAdjustedVal = false
133  },
134  {
135  .adcDIO = CC1350_LAUNCHXL_433_DIO26_ANALOG,
136  .adcCompBInput = ADC_COMPB_IN_AUXIO4,
137  .refSource = ADCCC26XX_FIXED_REFERENCE,
138  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
139  .inputScalingEnabled = true,
140  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
141  .returnAdjustedVal = false
142  },
143  {
144  .adcDIO = CC1350_LAUNCHXL_433_DIO27_ANALOG,
145  .adcCompBInput = ADC_COMPB_IN_AUXIO3,
146  .refSource = ADCCC26XX_FIXED_REFERENCE,
147  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
148  .inputScalingEnabled = true,
149  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
150  .returnAdjustedVal = false
151  },
152  {
153  .adcDIO = CC1350_LAUNCHXL_433_DIO28_ANALOG,
154  .adcCompBInput = ADC_COMPB_IN_AUXIO2,
155  .refSource = ADCCC26XX_FIXED_REFERENCE,
156  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
157  .inputScalingEnabled = true,
158  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
159  .returnAdjustedVal = false
160  },
161  {
162  .adcDIO = CC1350_LAUNCHXL_433_DIO29_ANALOG,
163  .adcCompBInput = ADC_COMPB_IN_AUXIO1,
164  .refSource = ADCCC26XX_FIXED_REFERENCE,
165  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
166  .inputScalingEnabled = true,
167  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
168  .returnAdjustedVal = false
169  },
170  {
171  .adcDIO = CC1350_LAUNCHXL_433_DIO30_ANALOG,
172  .adcCompBInput = ADC_COMPB_IN_AUXIO0,
173  .refSource = ADCCC26XX_FIXED_REFERENCE,
174  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
175  .inputScalingEnabled = true,
176  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
177  .returnAdjustedVal = false
178  },
179  {
180  .adcDIO = PIN_UNASSIGNED,
181  .adcCompBInput = ADC_COMPB_IN_DCOUPL,
182  .refSource = ADCCC26XX_FIXED_REFERENCE,
183  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
184  .inputScalingEnabled = true,
185  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
186  .returnAdjustedVal = false
187  },
188  {
189  .adcDIO = PIN_UNASSIGNED,
190  .adcCompBInput = ADC_COMPB_IN_VSS,
191  .refSource = ADCCC26XX_FIXED_REFERENCE,
192  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
193  .inputScalingEnabled = true,
194  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
195  .returnAdjustedVal = false
196  },
197  {
198  .adcDIO = PIN_UNASSIGNED,
199  .adcCompBInput = ADC_COMPB_IN_VDDS,
200  .refSource = ADCCC26XX_FIXED_REFERENCE,
201  .samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
202  .inputScalingEnabled = true,
203  .triggerSource = ADCCC26XX_TRIGGER_MANUAL,
204  .returnAdjustedVal = false
205  }
206 };
207 
208 const ADC_Config ADC_config[CC1350_LAUNCHXL_433_ADCCOUNT] = {
209  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC0], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC0]},
210  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC1], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC1]},
211  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC2], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC2]},
212  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC3], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC3]},
213  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC4], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC4]},
214  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC5], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC5]},
215  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC6], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC6]},
216  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADC7], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADC7]},
217  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADCDCOUPL], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADCDCOUPL]},
218  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADCVSS], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADCVSS]},
219  {&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC1350_LAUNCHXL_433_ADCVDDS], &adcCC26xxHWAttrs[CC1350_LAUNCHXL_433_ADCVDDS]},
220 };
221 
222 const uint_least8_t ADC_count = CC1350_LAUNCHXL_433_ADCCOUNT;
223 
224 /*
225  * =============================== Crypto ===============================
226  */
227 #include <ti/drivers/crypto/CryptoCC26XX.h>
228 
229 CryptoCC26XX_Object cryptoCC26XXObjects[CC1350_LAUNCHXL_433_CRYPTOCOUNT];
230 
231 const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC1350_LAUNCHXL_433_CRYPTOCOUNT] = {
232  {
233  .baseAddr = CRYPTO_BASE,
234  .powerMngrId = PowerCC26XX_PERIPH_CRYPTO,
235  .intNum = INT_CRYPTO_RESULT_AVAIL_IRQ,
236  .intPriority = ~0,
237  }
238 };
239 
240 const CryptoCC26XX_Config CryptoCC26XX_config[CC1350_LAUNCHXL_433_CRYPTOCOUNT] = {
241  {
242  .object = &cryptoCC26XXObjects[CC1350_LAUNCHXL_433_CRYPTO0],
243  .hwAttrs = &cryptoCC26XXHWAttrs[CC1350_LAUNCHXL_433_CRYPTO0]
244  },
245 };
246 
247 /*
248  * =============================== AESCCM ===============================
249  */
250 #include <ti/drivers/AESCCM.h>
251 #include <ti/drivers/aesccm/AESCCMCC26XX.h>
252 
253 AESCCMCC26XX_Object aesccmCC26XXObjects[CC1350_LAUNCHXL_433_AESCCMCOUNT];
254 
255 const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCCMCOUNT] = {
256  {
257  .intPriority = ~0,
258  }
259 };
260 
261 const AESCCM_Config AESCCM_config[CC1350_LAUNCHXL_433_AESCCMCOUNT] = {
262  {
263  .object = &aesccmCC26XXObjects[CC1350_LAUNCHXL_433_AESCCM0],
264  .hwAttrs = &aesccmCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCCM0]
265  },
266 };
267 
268 const uint_least8_t AESCCM_count = CC1350_LAUNCHXL_433_AESCCMCOUNT;
269 
270 
271 /*
272  * =============================== AESGCM ===============================
273  */
274 #include <ti/drivers/AESGCM.h>
275 #include <ti/drivers/aesgcm/AESGCMCC26XX.h>
276 
277 AESGCMCC26XX_Object aesgcmCC26XXObjects[CC1350_LAUNCHXL_433_AESGCMCOUNT];
278 
279 const AESGCMCC26XX_HWAttrs aesgcmCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESGCMCOUNT] = {
280  {
281  .intPriority = ~0,
282  }
283 };
284 
285 const AESGCM_Config AESGCM_config[CC1350_LAUNCHXL_433_AESGCMCOUNT] = {
286  {
287  .object = &aesgcmCC26XXObjects[CC1350_LAUNCHXL_433_AESGCM0],
288  .hwAttrs = &aesgcmCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESGCM0]
289  },
290 };
291 
292 const uint_least8_t AESGCM_count = CC1350_LAUNCHXL_433_AESGCMCOUNT;
293 
294 /*
295  * =============================== AESCBC ===============================
296  */
297 #include <ti/drivers/AESCBC.h>
298 #include <ti/drivers/aescbc/AESCBCCC26XX.h>
299 
300 AESCBCCC26XX_Object aescbcCC26XXObjects[CC1350_LAUNCHXL_433_AESCBCCOUNT];
301 
302 const AESCBCCC26XX_HWAttrs aescbcCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCBCCOUNT] = {
303  {
304  .intPriority = ~0,
305  }
306 };
307 
308 const AESCBC_Config AESCBC_config[CC1350_LAUNCHXL_433_AESCBCCOUNT] = {
309  {
310  .object = &aescbcCC26XXObjects[CC1350_LAUNCHXL_433_AESCBC0],
311  .hwAttrs = &aescbcCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCBC0]
312  },
313 };
314 
315 const uint_least8_t AESCBC_count = CC1350_LAUNCHXL_433_AESCBCCOUNT;
316 
317 /*
318  * =============================== AESCTR ===============================
319  */
320 #include <ti/drivers/AESCTR.h>
321 #include <ti/drivers/aesctr/AESCTRCC26XX.h>
322 
323 AESCTRCC26XX_Object aesctrCC26XXObjects[CC1350_LAUNCHXL_433_AESCTRCOUNT];
324 
325 const AESCTRCC26XX_HWAttrs aesctrCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCTRCOUNT] = {
326  {
327  .intPriority = ~0,
328  }
329 };
330 
331 const AESCTR_Config AESCTR_config[CC1350_LAUNCHXL_433_AESCTRCOUNT] = {
332  {
333  .object = &aesctrCC26XXObjects[CC1350_LAUNCHXL_433_AESCTR0],
334  .hwAttrs = &aesctrCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESCTR0]
335  },
336 };
337 
338 const uint_least8_t AESCTR_count = CC1350_LAUNCHXL_433_AESCTRCOUNT;
339 
340 /*
341  * =============================== AESECB ===============================
342  */
343 #include <ti/drivers/AESECB.h>
344 #include <ti/drivers/aesecb/AESECBCC26XX.h>
345 
346 AESECBCC26XX_Object aesecbCC26XXObjects[CC1350_LAUNCHXL_433_AESECBCOUNT];
347 
348 const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESECBCOUNT] = {
349  {
350  .intPriority = ~0,
351  }
352 };
353 
354 const AESECB_Config AESECB_config[CC1350_LAUNCHXL_433_AESECBCOUNT] = {
355  {
356  .object = &aesecbCC26XXObjects[CC1350_LAUNCHXL_433_AESECB0],
357  .hwAttrs = &aesecbCC26XXHWAttrs[CC1350_LAUNCHXL_433_AESECB0]
358  },
359 };
360 
361 const uint_least8_t AESECB_count = CC1350_LAUNCHXL_433_AESECBCOUNT;
362 
363 /*
364  * =============================== AESCTRDRBG ===============================
365  */
366 #include <ti/drivers/AESCTRDRBG.h>
367 #include <ti/drivers/aesctrdrbg/AESCTRDRBGXX.h>
368 
369 AESCTRDRBGXX_Object aesctrdrbgXXObjects[CC1350_LAUNCHXL_433_AESCTRDRBGCOUNT];
370 
371 const AESCTRDRBGXX_HWAttrs aesctrdrbgXXHWAttrs[CC1350_LAUNCHXL_433_AESCTRDRBGCOUNT] = {
372  {
373  .aesctrIndex = CC1350_LAUNCHXL_433_AESCTR0,
374  }
375 };
376 
377 const AESCTRDRBG_Config AESCTRDRBG_config[CC1350_LAUNCHXL_433_AESCTRDRBGCOUNT] = {
378  {
379  .object = &aesctrdrbgXXObjects[CC1350_LAUNCHXL_433_AESCTRDRBG0],
380  .hwAttrs = &aesctrdrbgXXHWAttrs[CC1350_LAUNCHXL_433_AESCTRDRBG0]
381  },
382 };
383 
384 const uint_least8_t AESCTRDRBG_count = CC1350_LAUNCHXL_433_AESCTRDRBGCOUNT;
385 
386 /*
387  * =============================== TRNG ===============================
388  */
389 #include <ti/drivers/TRNG.h>
390 #include <ti/drivers/trng/TRNGCC26XX.h>
391 
392 TRNGCC26XX_Object trngCC26XXObjects[CC1350_LAUNCHXL_433_TRNGCOUNT];
393 
394 const TRNGCC26XX_HWAttrs trngCC26X2HWAttrs[CC1350_LAUNCHXL_433_TRNGCOUNT] = {
395  {
396  .intPriority = ~0,
397  .swiPriority = 0,
398  .samplesPerCycle = 240000,
399  }
400 };
401 
402 const TRNG_Config TRNG_config[CC1350_LAUNCHXL_433_TRNGCOUNT] = {
403  {
404  .object = &trngCC26XXObjects[CC1350_LAUNCHXL_433_TRNG0],
405  .hwAttrs = &trngCC26X2HWAttrs[CC1350_LAUNCHXL_433_TRNG0]
406  },
407 };
408 
409 const uint_least8_t TRNG_count = CC1350_LAUNCHXL_433_TRNGCOUNT;
410 
411 /*
412  * =============================== GPIO ===============================
413  */
414 #include <ti/drivers/GPIO.h>
415 #include <ti/drivers/gpio/GPIOCC26XX.h>
416 
417 /*
418  * Array of Pin configurations
419  * NOTE: The order of the pin configurations must coincide with what was
420  * defined in CC1350_LAUNCHXL_433.h
421  * NOTE: Pins not used for interrupts should be placed at the end of the
422  * array. Callback entries can be omitted from callbacks array to
423  * reduce memory usage.
424  */
425 GPIO_PinConfig gpioPinConfigs[] = {
426  /* Input pins */
427  GPIOCC26XX_DIO_13 | GPIO_DO_NOT_CONFIG, /* Button 0 */
428  GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
429 
430  GPIOCC26XX_DIO_15 | GPIO_DO_NOT_CONFIG, /* CC1350_LAUNCHXL_433_SPI_MASTER_READY */
431  GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG, /* CC1350_LAUNCHXL_433_SPI_SLAVE_READY */
432 
433  /* Output pins */
434  GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
435  GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
436 
437  /* SPI Flash CSN */
438  GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
439 
440  /* SD CS */
441  GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG,
442 };
443 
444 /*
445  * Array of callback function pointers
446  * NOTE: The order of the pin configurations must coincide with what was
447  * defined in CC1350_LAUNCHXL_433.h
448  * NOTE: Pins not used for interrupts can be omitted from callbacks array to
449  * reduce memory usage (if placed at end of gpioPinConfigs array).
450  */
451 GPIO_CallbackFxn gpioCallbackFunctions[] = {
452  NULL, /* Button 0 */
453  NULL, /* Button 1 */
454  NULL, /* CC1350_LAUNCHXL_433_SPI_MASTER_READY */
455  NULL, /* CC1350_LAUNCHXL_433_SPI_SLAVE_READY */
456 };
457 
458 const GPIOCC26XX_Config GPIOCC26XX_config = {
459  .pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
460  .callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
461  .numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
462  .numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
463  .intPriority = (~0)
464 };
465 
466 /*
467  * =============================== GPTimer ===============================
468  * Remove unused entries to reduce flash usage both in Board.c and Board.h
469  */
470 #include <ti/drivers/timer/GPTimerCC26XX.h>
471 
472 GPTimerCC26XX_Object gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMERCOUNT];
473 
474 const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMERPARTSCOUNT] = {
475  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
476  { .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
477  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
478  { .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
479  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
480  { .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
481  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
482  { .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
483 };
484 
485 const GPTimerCC26XX_Config GPTimerCC26XX_config[CC1350_LAUNCHXL_433_GPTIMERPARTSCOUNT] = {
486  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER0], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER0A], GPT_A },
487  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER0], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER0B], GPT_B },
488  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER1], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER1A], GPT_A },
489  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER1], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER1B], GPT_B },
490  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER2], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER2A], GPT_A },
491  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER2], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER2B], GPT_B },
492  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER3], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER3A], GPT_A },
493  { &gptimerCC26XXObjects[CC1350_LAUNCHXL_433_GPTIMER3], &gptimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_GPTIMER3B], GPT_B },
494 };
495 
496 /*
497  * =============================== I2C ===============================
498 */
499 #include <ti/drivers/I2C.h>
500 #include <ti/drivers/i2c/I2CCC26XX.h>
501 
502 #if TI_I2C_CONF_ENABLE
503 
504 I2CCC26XX_Object i2cCC26xxObjects[CC1350_LAUNCHXL_433_I2CCOUNT];
505 
506 const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC1350_LAUNCHXL_433_I2CCOUNT] = {
507  {
508  .baseAddr = I2C0_BASE,
509  .powerMngrId = PowerCC26XX_PERIPH_I2C0,
510  .intNum = INT_I2C_IRQ,
511  .intPriority = ~0,
512  .swiPriority = 0,
513  .sdaPin = CC1350_LAUNCHXL_433_I2C0_SDA0,
514  .sclPin = CC1350_LAUNCHXL_433_I2C0_SCL0,
515  }
516 };
517 
518 const I2C_Config I2C_config[CC1350_LAUNCHXL_433_I2CCOUNT] = {
519  {
520  .fxnTablePtr = &I2CCC26XX_fxnTable,
521  .object = &i2cCC26xxObjects[CC1350_LAUNCHXL_433_I2C0],
522  .hwAttrs = &i2cCC26xxHWAttrs[CC1350_LAUNCHXL_433_I2C0]
523  },
524 };
525 
526 const uint_least8_t I2C_count = CC1350_LAUNCHXL_433_I2CCOUNT;
527 
528 #endif /* TI_I2C_CONF_ENABLE */
529 
530 /*
531  * =============================== I2S ===============================
532 */
533 #include <ti/drivers/I2S.h>
534 #include <ti/drivers/i2s/I2SCC26XX.h>
535 
536 I2SCC26XX_Object i2sCC26XXObjects[CC1350_LAUNCHXL_433_I2SCOUNT];
537 
538 const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs[CC1350_LAUNCHXL_433_I2SCOUNT] = {
539  {
540  .pinSD1 = CC1350_LAUNCHXL_433_I2S_ADI,
541  .pinSD0 = CC1350_LAUNCHXL_433_I2S_ADO,
542  .pinSCK = CC1350_LAUNCHXL_433_I2S_BCLK,
543  .pinMCLK = CC1350_LAUNCHXL_433_I2S_MCLK,
544  .pinWS = CC1350_LAUNCHXL_433_I2S_WCLK,
545  .intPriority = ~0,
546  }
547 };
548 
549 const I2S_Config I2S_config[CC1350_LAUNCHXL_433_I2SCOUNT] = {
550  {
551  .object = &i2sCC26XXObjects[CC1350_LAUNCHXL_433_I2S0],
552  .hwAttrs = &i2sCC26XXHWAttrs[CC1350_LAUNCHXL_433_I2S0]
553  },
554 };
555 
556 const uint_least8_t I2S_count = CC1350_LAUNCHXL_433_I2SCOUNT;
557 
558 /*
559  * =============================== NVS ===============================
560  */
561 #include <ti/drivers/NVS.h>
562 #include <ti/drivers/nvs/NVSSPI25X.h>
563 #include <ti/drivers/nvs/NVSCC26XX.h>
564 
565 #define NVS_REGIONS_BASE 0x1A000
566 #define SECTORSIZE 0x1000
567 #define REGIONSIZE (SECTORSIZE * 4)
568 
569 #if TI_NVS_CONF_ENABLE
570 
571 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
572 
573 /*
574  * Reserve flash sectors for NVS driver use by placing an uninitialized byte
575  * array at the desired flash address.
576  */
577 #if defined(__TI_COMPILER_VERSION__)
578 
579 /*
580  * Place uninitialized array at NVS_REGIONS_BASE
581  */
582 #pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
583 #pragma NOINIT(flashBuf);
584 static char flashBuf[REGIONSIZE];
585 
586 #elif defined(__IAR_SYSTEMS_ICC__)
587 
588 /*
589  * Place uninitialized array at NVS_REGIONS_BASE
590  */
591 static __no_init char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
592 
593 #elif defined(__GNUC__)
594 
595 /*
596  * Place the flash buffers in the .nvs section created in the gcc linker file.
597  * The .nvs section enforces alignment on a sector boundary but may
598  * be placed anywhere in flash memory. If desired the .nvs section can be set
599  * to a fixed address by changing the following in the gcc linker file:
600  *
601  * .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
602  * *(.nvs)
603  * } > REGION_TEXT
604  */
605 __attribute__ ((section (".nvs")))
606 static char flashBuf[REGIONSIZE];
607 
608 #endif
609 
610 /* Allocate objects for NVS Internal Regions */
611 NVSCC26XX_Object nvsCC26xxObjects[1];
612 
613 /* Hardware attributes for NVS Internal Regions */
614 const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
615  {
616  .regionBase = (void *)flashBuf,
617  .regionSize = REGIONSIZE,
618  },
619 };
620 
621 #endif /* TI_NVS_CONF_NVS_INTERNAL_ENABLE */
622 
623 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
624 
625 #define SPISECTORSIZE 0x1000
626 #define SPIREGIONSIZE (SPISECTORSIZE * 32)
627 #define VERIFYBUFSIZE 64
628 
629 static uint8_t verifyBuf[VERIFYBUFSIZE];
630 
631 /* Allocate objects for NVS External Regions */
632 NVSSPI25X_Object nvsSPI25XObjects[1];
633 
634 /* Hardware attributes for NVS External Regions */
635 const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
636  {
637  .regionBaseOffset = 0,
638  .regionSize = SPIREGIONSIZE,
639  .sectorSize = SPISECTORSIZE,
640  .verifyBuf = verifyBuf,
641  .verifyBufSize = VERIFYBUFSIZE,
642  .spiHandle = NULL,
643  .spiIndex = 0,
644  .spiBitRate = 4000000,
645  .spiCsnGpioIndex = CC1350_LAUNCHXL_433_GPIO_SPI_FLASH_CS,
646  .statusPollDelayUs = 100,
647  },
648 };
649 
650 #endif /* TI_NVS_CONF_NVS_EXTERNAL_ENABLE */
651 
652 /* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
653 const NVS_Config NVS_config[CC1350_LAUNCHXL_433_NVSCOUNT] = {
654 #if TI_NVS_CONF_NVS_INTERNAL_ENABLE
655  {
656  .fxnTablePtr = &NVSCC26XX_fxnTable,
657  .object = &nvsCC26xxObjects[0],
658  .hwAttrs = &nvsCC26xxHWAttrs[0],
659  },
660 #endif
661 #if TI_NVS_CONF_NVS_EXTERNAL_ENABLE
662  {
663  .fxnTablePtr = &NVSSPI25X_fxnTable,
664  .object = &nvsSPI25XObjects[0],
665  .hwAttrs = &nvsSPI25XHWAttrs[0],
666  },
667 #endif
668 };
669 
670 const uint_least8_t NVS_count = CC1350_LAUNCHXL_433_NVSCOUNT;
671 
672 #endif /* TI_NVS_CONF_ENABLE */
673 
674 /*
675  * =============================== PIN ===============================
676  */
677 #include <ti/drivers/PIN.h>
678 #include <ti/drivers/pin/PINCC26XX.h>
679 
680 const PIN_Config BoardGpioInitTable[] = {
681 
682  CC1350_LAUNCHXL_433_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
683  CC1350_LAUNCHXL_433_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
684  CC1350_LAUNCHXL_433_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
685  CC1350_LAUNCHXL_433_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
686  CC1350_LAUNCHXL_433_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
687  CC1350_LAUNCHXL_433_UART_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
688  CC1350_LAUNCHXL_433_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL, /* UART TX via debugger back channel */
689  CC1350_LAUNCHXL_433_DIO1_RF_SUB1GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* RF SW Switch defaults to 2.4 GHz path*/
690  CC1350_LAUNCHXL_433_DIO30_RF_POWER | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* External RF Switch is powered off by default */
691  CC1350_LAUNCHXL_433_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
692  CC1350_LAUNCHXL_433_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
693  CC1350_LAUNCHXL_433_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
694  PIN_TERMINATE
695 };
696 
697 const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
698  .intPriority = ~0,
699  .swiPriority = 0
700 };
701 
702 /*
703  * =============================== Power ===============================
704  */
705 #include <ti/drivers/Power.h>
706 #include <ti/drivers/power/PowerCC26XX.h>
707 #include "clock-arch.h"
708 
709 const PowerCC26XX_Config PowerCC26XX_config = {
710  .policyInitFxn = NULL,
711  .policyFxn = &clock_arch_standby_policy,
712  .calibrateFxn = &PowerCC26XX_calibrate,
713  .enablePolicy = true,
714  .calibrateRCOSC_LF = true,
715  .calibrateRCOSC_HF = true,
716 };
717 
718 /*
719  * =============================== PWM ===============================
720  * Remove unused entries to reduce flash usage both in Board.c and Board.h
721  */
722 #include <ti/drivers/PWM.h>
723 #include <ti/drivers/pwm/PWMTimerCC26XX.h>
724 
725 PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWMCOUNT];
726 
727 const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWMCOUNT] = {
728  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN0, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER0A },
729  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN1, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER0B },
730  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN2, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER1A },
731  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN3, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER1B },
732  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN4, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER2A },
733  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN5, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER2B },
734  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN6, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER3A },
735  { .pwmPin = CC1350_LAUNCHXL_433_PWMPIN7, .gpTimerUnit = CC1350_LAUNCHXL_433_GPTIMER3B },
736 };
737 
738 const PWM_Config PWM_config[CC1350_LAUNCHXL_433_PWMCOUNT] = {
739  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM0], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM0] },
740  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM1], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM1] },
741  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM2], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM2] },
742  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM3], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM3] },
743  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM4], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM4] },
744  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM5], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM5] },
745  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM6], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM6] },
746  { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC1350_LAUNCHXL_433_PWM7], &pwmtimerCC26xxHWAttrs[CC1350_LAUNCHXL_433_PWM7] },
747 };
748 
749 const uint_least8_t PWM_count = CC1350_LAUNCHXL_433_PWMCOUNT;
750 
751 /*
752  * =============================== RF Driver ===============================
753  */
754 #include <ti/drivers/rf/RF.h>
755 
756 /*
757  * Board-specific callback function to set the correct antenna path.
758  *
759  * This function is called by the RF driver on global driver events.
760  * It contains a default implementation to set the correct antenna path.
761  * This function is defined in the file CC1350_LAUNCHXL_433_fxns.c
762  */
763 extern void rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg);
764 
765 const RFCC26XX_HWAttrsV2 RFCC26XX_hwAttrs = {
766  .hwiPriority = ~0, /* Lowest HWI priority */
767  .swiPriority = 0, /* Lowest SWI priority */
768  .xoscHfAlwaysNeeded = true, /* Keep XOSC dependency while in standby */
769 
770  /* Register the board specific callback */
771  .globalCallback = &rfDriverCallback,
772  /* Subscribe the callback to both events */
773  .globalEventMask = RF_GlobalEventRadioSetup | RF_GlobalEventRadioPowerDown
774 };
775 
776 /*
777  * =============================== SD ===============================
778  */
779 #include <ti/drivers/SD.h>
780 #include <ti/drivers/sd/SDSPI.h>
781 
782 #if TI_SD_CONF_ENABLE
783 
784 #if !(TI_SPI_CONF_SPI0_ENABLE)
785 #error "SD driver requires SPI0 enabled"
786 #endif
787 
788 SDSPI_Object sdspiObjects[CC1350_LAUNCHXL_433_SDCOUNT];
789 
790 const SDSPI_HWAttrs sdspiHWAttrs[CC1350_LAUNCHXL_433_SDCOUNT] = {
791  {
792  .spiIndex = CC1350_LAUNCHXL_433_SPI0,
793  .spiCsGpioIndex = CC1350_LAUNCHXL_433_SDSPI_CS
794  }
795 };
796 
797 const SD_Config SD_config[CC1350_LAUNCHXL_433_SDCOUNT] = {
798  {
799  .fxnTablePtr = &SDSPI_fxnTable,
800  .object = &sdspiObjects[CC1350_LAUNCHXL_433_SDSPI0],
801  .hwAttrs = &sdspiHWAttrs[CC1350_LAUNCHXL_433_SDSPI0]
802  },
803 };
804 
805 const uint_least8_t SD_count = CC1350_LAUNCHXL_433_SDCOUNT;
806 
807 #endif /* TI_SD_CONF_ENABLE */
808 
809 /*
810  * =============================== SPI DMA ===============================
811  */
812 #include <ti/drivers/SPI.h>
813 #include <ti/drivers/spi/SPICC26XXDMA.h>
814 
815 #if TI_SPI_CONF_ENABLE
816 
817 SPICC26XXDMA_Object spiCC26XXDMAObjects[CC1350_LAUNCHXL_433_SPICOUNT];
818 
819 /*
820  * NOTE: The SPI instances below can be used by the SD driver to communicate
821  * with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
822  * to satisfy the SDSPI driver requirement.
823  */
824 const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_433_SPICOUNT] = {
825 #if TI_SPI_CONF_SPI0_ENABLE
826  {
827  .baseAddr = SSI0_BASE,
828  .intNum = INT_SSI0_COMB,
829  .intPriority = ~0,
830  .swiPriority = 0,
831  .powerMngrId = PowerCC26XX_PERIPH_SSI0,
832  .defaultTxBufValue = 0xFF,
833  .rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
834  .txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
835  .mosiPin = CC1350_LAUNCHXL_433_SPI0_MOSI,
836  .misoPin = CC1350_LAUNCHXL_433_SPI0_MISO,
837  .clkPin = CC1350_LAUNCHXL_433_SPI0_CLK,
838  .csnPin = CC1350_LAUNCHXL_433_SPI0_CSN,
839  .minDmaTransferSize = 10
840  },
841 #endif
842 #if TI_SPI_CONF_SPI1_ENABLE
843  {
844  .baseAddr = SSI1_BASE,
845  .intNum = INT_SSI1_COMB,
846  .intPriority = ~0,
847  .swiPriority = 0,
848  .powerMngrId = PowerCC26XX_PERIPH_SSI1,
849  .defaultTxBufValue = 0xFF,
850  .rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
851  .txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
852  .mosiPin = CC1350_LAUNCHXL_433_SPI1_MOSI,
853  .misoPin = CC1350_LAUNCHXL_433_SPI1_MISO,
854  .clkPin = CC1350_LAUNCHXL_433_SPI1_CLK,
855  .csnPin = CC1350_LAUNCHXL_433_SPI1_CSN,
856  .minDmaTransferSize = 10
857  },
858 #endif
859 };
860 
861 const SPI_Config SPI_config[CC1350_LAUNCHXL_433_SPICOUNT] = {
862 #if TI_SPI_CONF_SPI0_ENABLE
863  {
864  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
865  .object = &spiCC26XXDMAObjects[CC1350_LAUNCHXL_433_SPI0],
866  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_433_SPI0]
867  },
868 #endif
869 #if TI_SPI_CONF_SPI1_ENABLE
870  {
871  .fxnTablePtr = &SPICC26XXDMA_fxnTable,
872  .object = &spiCC26XXDMAObjects[CC1350_LAUNCHXL_433_SPI1],
873  .hwAttrs = &spiCC26XXDMAHWAttrs[CC1350_LAUNCHXL_433_SPI1]
874  },
875 #endif
876 };
877 
878 const uint_least8_t SPI_count = CC1350_LAUNCHXL_433_SPICOUNT;
879 
880 #endif /* TI_SPI_CONF_ENABLE */
881 
882 /*
883  * =============================== UART ===============================
884  */
885 #include <ti/drivers/UART.h>
886 #include <ti/drivers/uart/UARTCC26XX.h>
887 
888 #if TI_UART_CONF_ENABLE
889 
890 UARTCC26XX_Object uartCC26XXObjects[CC1350_LAUNCHXL_433_UARTCOUNT];
891 
892 uint8_t uartCC26XXRingBuffer[CC1350_LAUNCHXL_433_UARTCOUNT][32];
893 
894 const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1350_LAUNCHXL_433_UARTCOUNT] = {
895 #if TI_UART_CONF_UART0_ENABLE
896  {
897  .baseAddr = UART0_BASE,
898  .powerMngrId = PowerCC26XX_PERIPH_UART0,
899  .intNum = INT_UART0_COMB,
900  .intPriority = ~0,
901  .swiPriority = 0,
902  .txPin = CC1350_LAUNCHXL_433_UART_TX,
903  .rxPin = CC1350_LAUNCHXL_433_UART_RX,
904  .ctsPin = PIN_UNASSIGNED,
905  .rtsPin = PIN_UNASSIGNED,
906  .ringBufPtr = uartCC26XXRingBuffer[CC1350_LAUNCHXL_433_UART0],
907  .ringBufSize = sizeof(uartCC26XXRingBuffer[CC1350_LAUNCHXL_433_UART0]),
908  .txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
909  .rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8,
910  .errorFxn = NULL
911  },
912 #endif
913 };
914 
915 const UART_Config UART_config[CC1350_LAUNCHXL_433_UARTCOUNT] = {
916 #if TI_UART_CONF_UART0_ENABLE
917  {
918  .fxnTablePtr = &UARTCC26XX_fxnTable,
919  .object = &uartCC26XXObjects[CC1350_LAUNCHXL_433_UART0],
920  .hwAttrs = &uartCC26XXHWAttrs[CC1350_LAUNCHXL_433_UART0]
921  },
922 #endif
923 };
924 
925 const uint_least8_t UART_count = CC1350_LAUNCHXL_433_UARTCOUNT;
926 
927 #endif /* TI_UART_CONF_ENABLE */
928 
929 /*
930  * =============================== UDMA ===============================
931  */
932 #include <ti/drivers/dma/UDMACC26XX.h>
933 
934 UDMACC26XX_Object udmaObjects[CC1350_LAUNCHXL_433_UDMACOUNT];
935 
936 const UDMACC26XX_HWAttrs udmaHWAttrs[CC1350_LAUNCHXL_433_UDMACOUNT] = {
937  {
938  .baseAddr = UDMA0_BASE,
939  .powerMngrId = PowerCC26XX_PERIPH_UDMA,
940  .intNum = INT_DMA_ERR,
941  .intPriority = ~0
942  }
943 };
944 
945 const UDMACC26XX_Config UDMACC26XX_config[CC1350_LAUNCHXL_433_UDMACOUNT] = {
946  {
947  .object = &udmaObjects[CC1350_LAUNCHXL_433_UDMA0],
948  .hwAttrs = &udmaHWAttrs[CC1350_LAUNCHXL_433_UDMA0]
949  },
950 };
951 
952 /*
953  * =============================== Watchdog ===============================
954  */
955 #include <ti/drivers/Watchdog.h>
956 #include <ti/drivers/watchdog/WatchdogCC26XX.h>
957 
958 WatchdogCC26XX_Object watchdogCC26XXObjects[CC1350_LAUNCHXL_433_WATCHDOGCOUNT];
959 
960 const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC1350_LAUNCHXL_433_WATCHDOGCOUNT] = {
961  {
962  .baseAddr = WDT_BASE,
963  .reloadValue = 1000 /* Reload value in milliseconds */
964  },
965 };
966 
967 const Watchdog_Config Watchdog_config[CC1350_LAUNCHXL_433_WATCHDOGCOUNT] = {
968  {
969  .fxnTablePtr = &WatchdogCC26XX_fxnTable,
970  .object = &watchdogCC26XXObjects[CC1350_LAUNCHXL_433_WATCHDOG0],
971  .hwAttrs = &watchdogCC26XXHWAttrs[CC1350_LAUNCHXL_433_WATCHDOG0]
972  },
973 };
974 
975 const uint_least8_t Watchdog_count = CC1350_LAUNCHXL_433_WATCHDOGCOUNT;
976 
977 /*
978  * Board-specific initialization function to disable external flash.
979  * This function is defined in the file CC1350_LAUNCHXL_433_fxns.c
980  */
981 extern void Board_initHook(void);
982 
983 /*
984  * ======== CC1350_LAUNCHXL_433_initGeneral ========
985  */
987 {
988  Power_init();
989 
990  if (PIN_init(BoardGpioInitTable) != PIN_SUCCESS) {
991  /* Error with PIN_init */
992  while (1);
993  }
994 
995  /* Perform board-specific initialization */
996  Board_initHook();
997 }
998 
999 /*
1000  * ======== Board_init ========
1001  */
1002 void Board_init(void)
1003 {
1005 }
============================================================================
#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 CC1350_LAUNCHXL_433_initGeneral(void)
Initialize the general board specific settings.
void clock_arch_standby_policy(void)
Called by the Power driver when dropping to some low-power state.
Definition: clock-arch.c:184