-
Notifications
You must be signed in to change notification settings - Fork 0
/
CC3200_LAUNCHXL.c
665 lines (585 loc) · 18.7 KB
/
CC3200_LAUNCHXL.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
/*
* Copyright (c) 2015-2016, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* ======== CC3200_LAUNCHXL.c ========
* This file is responsible for setting up the board specific items for the
* CC3200_LAUNCHXL board.
*/
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/ports/DebugP.h>
#include <ti/drivers/ports/HwiP.h>
#include <inc/hw_ints.h>
#include <inc/hw_memmap.h>
#include <inc/hw_types.h>
#include <driverlib/rom.h>
#include <driverlib/rom_map.h>
#include <driverlib/gpio.h>
#include <driverlib/pin.h>
#include <driverlib/prcm.h>
#include <driverlib/spi.h>
#include <driverlib/timer.h>
#include <driverlib/uart.h>
#include <driverlib/udma.h>
#include <driverlib/wdt.h>
#include "CC3200_LAUNCHXL.h"
#include "pin_mux_config.h"
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC3200.h>
/*
* This define determines whether to use the UARTCC3200DMA driver
* or the UARTCC3200 (no DMA) driver. Set to 1 to use the UARTCC3200DMA
* driver.
*/
#ifndef TI_DRIVERS_UART_DMA
#define TI_DRIVERS_UART_DMA 0
#endif
/*
* =============================== DMA ===============================
*/
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_ALIGN(dmaControlTable, 1024)
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=1024
#elif defined(__GNUC__)
__attribute__ ((aligned (1024)))
#endif
static tDMAControlTable dmaControlTable[64];
static bool dmaInitialized = false;
/*
* ======== dmaErrorHwi ========
*/
static void dmaErrorHwi(uintptr_t arg)
{
DebugP_log1("DMA error code: %d\n", MAP_uDMAErrorStatusGet());
MAP_uDMAErrorStatusClear();
DebugP_log0("DMA error!!\n");
while(1);
}
/*
* ======== CC3200_LAUNCHXL_initDMA ========
*/
void CC3200_LAUNCHXL_initDMA(void)
{
HwiP_Params hwiParams;
HwiP_Handle dmaErrorHwiHandle;
if (!dmaInitialized) {
HwiP_Params_init(&hwiParams);
dmaErrorHwiHandle = HwiP_create(INT_UDMAERR, dmaErrorHwi, &hwiParams);
if (dmaErrorHwiHandle == NULL) {
DebugP_log0("Failed to create DMA error Hwi!!\n");
while (1);
}
MAP_PRCMPeripheralClkEnable(PRCM_UDMA, PRCM_RUN_MODE_CLK);
MAP_PRCMPeripheralReset(PRCM_UDMA);
MAP_uDMAEnable();
MAP_uDMAControlBaseSet(dmaControlTable);
dmaInitialized = true;
}
}
/*
* =============================== General ===============================
*/
/*
* ======== CC3200_LAUNCHXL_initGeneral ========
*/
void CC3200_LAUNCHXL_initGeneral(void)
{
PRCMCC3200MCUInit();
PinMuxConfig();
Power_init();
}
/*
* =============================== GPIO ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(GPIOCC3200_config, ".const:GPIOCC3200_config")
#endif
#include <ti/drivers/GPIO.h>
#include <ti/drivers/gpio/GPIOCC3200.h>
/*
* Array of Pin configurations
* NOTE: The order of the pin configurations must coincide with what was
* defined in CC3200_LAUNCHXL.h
* NOTE: Pins not used for interrupts should be placed at the end of the
* array. Callback entries can be omitted from callbacks array to
* reduce memory usage.
*/
GPIO_PinConfig gpioPinConfigs[] = {
/* input pins with callbacks */
/* CC3200_LAUNCHXL_SW2 */
GPIOCC3200_GPIO_22 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_RISING,
/* CC3200_LAUNCHXL_SW3 */
GPIOCC3200_GPIO_13 | GPIO_CFG_INPUT | GPIO_CFG_IN_INT_RISING,
/* output pins */
/* CC3200_LAUNCHXL_LED_D7 */
GPIOCC3200_GPIO_09 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
/*
* CC3200_LAUNCHXL_LED_D5 and CC3200_LAUNCHXL_LED_D6 are shared with the
* I2C and PWM peripherals. In order for those examples to work, these
* LEDs are taken out of gpioPinCOnfig[]
*/
/* CC3200_LAUNCHXL_LED_D6 */
//GPIOCC3200_GPIO_10 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
/* CC3200_LAUNCHXL_LED_D5 */
//GPIOCC3200_GPIO_11 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_LOW,
};
/*
* Array of callback function pointers
* NOTE: The order of the pin configurations must coincide with what was
* defined in CC3200_LAUNCHXL.h
* NOTE: Pins not used for interrupts can be omitted from callbacks array to
* reduce memory usage (if placed at end of gpioPinConfigs array).
*/
GPIO_CallbackFxn gpioCallbackFunctions[] = {
NULL, /* CC3200_LAUNCHXL_SW2 */
NULL /* CC3200_LAUNCHXL_SW3 */
};
/* The device-specific GPIO_config structure */
const GPIOCC3200_Config GPIOCC3200_config = {
.pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
.callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
.numberOfPinConfigs = sizeof(gpioPinConfigs)/sizeof(GPIO_PinConfig),
.numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
.intPriority = (~0)
};
/*
* ======== CC3200_LAUNCHXL_initGPIO ========
*/
void CC3200_LAUNCHXL_initGPIO(void)
{
/* Initialize peripheral and pins */
GPIO_init();
}
/*
* =============================== I2C ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
#pragma DATA_SECTION(i2cCC3200HWAttrs, ".const:i2cCC3200HWAttrs")
#endif
#include <ti/drivers/I2C.h>
#include <ti/drivers/i2c/I2CCC3200.h>
I2CCC3200_Object i2cCC3200Objects[CC3200_LAUNCHXL_I2CCOUNT];
const I2CCC3200_HWAttrs i2cCC3200HWAttrs[CC3200_LAUNCHXL_I2CCOUNT] = {
{
.baseAddr = I2CA0_BASE,
.intNum = INT_I2CA0,
.intPriority = (~0)
}
};
const I2C_Config I2C_config[] = {
{
.fxnTablePtr = &I2CCC3200_fxnTable,
.object = &i2cCC3200Objects[0],
.hwAttrs = &i2cCC3200HWAttrs[0]
},
{NULL, NULL, NULL}
};
/*
* ======== CC3200_initI2C ========
*/
void CC3200_LAUNCHXL_initI2C(void)
{
I2C_init();
}
/*
* =============================== I2S ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(I2S_config, ".const:I2S_config")
#pragma DATA_SECTION(i2sCC3200HWAttrs, ".const:i2sCC3200HWAttrs")
#endif
#include <ti/drivers/I2S.h>
#include <ti/drivers/i2s/I2SCC3200DMA.h>
I2SCC3200DMA_Object i2sCC3200Objects[CC3200_LAUNCHXL_I2SCOUNT];
const I2SCC3200DMA_HWAttrs i2sCC3200HWAttrs[CC3200_LAUNCHXL_I2SCOUNT] = {
{
.baseAddr = I2S_BASE,
.intNum = INT_I2S,
.intPriority = (~0),
.rxChannelIndex = UDMA_CH4_I2S_RX,
.txChannelIndex = UDMA_CH5_I2S_TX
}
};
const I2S_Config I2S_config[] = {
{
.fxnTablePtr = &I2SCC3200DMA_fxnTable,
.object = &i2sCC3200Objects[0],
.hwAttrs = &i2sCC3200HWAttrs[0]
},
{NULL, NULL, NULL}
};
/*
* ======== CC3200_LAUNCHXL_initI2S ========
*/
void CC3200_LAUNCHXL_initI2S(void)
{
CC3200_LAUNCHXL_initDMA();
I2S_init();
}
/*
* =============================== Power ===============================
* In this configuration, Power management is disabled since runPolicy
* is set to 0. Power management can be enabled from main() by calling
* Power_enablePolicy(), or by changing runPolicy to 1 in this structure.
*/
const PowerCC3200_Config PowerCC3200_config = {
.policyInitFxn = &PowerCC3200_initPolicy,
.policyFxn = &PowerCC3200_sleepPolicy,
.enterLPDSHookFxn = NULL,
.resumeLPDSHookFxn = NULL,
.enablePolicy = false,
.enableGPIOWakeupLPDS = true,
.enableGPIOWakeupShutdown = false,
.enableNetworkWakeupLPDS = false,
.wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,
.wakeupGPIOTypeLPDS = PRCM_LPDS_FALL_EDGE,
.wakeupGPIOSourceShutdown = 0,
.wakeupGPIOTypeShutdown = 0,
.ramRetentionMaskLPDS = PRCM_SRAM_COL_1 | PRCM_SRAM_COL_2 |
PRCM_SRAM_COL_3 | PRCM_SRAM_COL_4
};
/*
* =============================== PWM ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(PWM_config, ".const:PWM_config")
#pragma DATA_SECTION(pwmTimerCC3200HWAttrs, ".const:pwmTimerCC3200HWAttrs")
#endif
#include <ti/drivers/PWM.h>
#include <ti/drivers/pwm/PWMTimerCC3200.h>
PWMTimerCC3200_Object pwmTimerCC3200Objects[CC3200_LAUNCHXL_PWMCOUNT];
const PWMTimerCC3200_HWAttrs pwmTimerCC3200HWAttrs[CC3200_LAUNCHXL_PWMCOUNT] = {
{ /* CC3200_LAUNCHXL_PWM6 */
.baseAddr = TIMERA3_BASE,
.timer = TIMER_A
},
{ /* CC3200_LAUNCHXL_PWM7 */
.baseAddr = TIMERA3_BASE,
.timer = TIMER_B
}
};
const PWM_Config PWM_config[] = {
{
.fxnTablePtr = &PWMTimerCC3200_fxnTable,
.object = &pwmTimerCC3200Objects[0],
.hwAttrs = &pwmTimerCC3200HWAttrs[0]
},
{
.fxnTablePtr = &PWMTimerCC3200_fxnTable,
.object = &pwmTimerCC3200Objects[1],
.hwAttrs = &pwmTimerCC3200HWAttrs[1]
},
{NULL, NULL, NULL}
};
/*
* ======== CC3200_LAUNCHXL_initPWM ========
*/
void CC3200_LAUNCHXL_initPWM(void)
{
PWM_init();
}
/*
* =============================== SDSPI ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SDSPI_config, ".const:SDSPI_config")
#pragma DATA_SECTION(sdspiCC3200HWattrs, ".const:sdspiCC3200HWattrs")
#endif
#include <ti/drivers/SDSPI.h>
#include <ti/drivers/sdspi/SDSPICC3200.h>
SDSPICC3200_Object sdspiCC3200Objects[CC3200_LAUNCHXL_SDSPICOUNT];
/* SDSPI configuration structure, describing which pins are to be used */
const SDSPICC3200_HWAttrs sdspiCC3200HWattrs[CC3200_LAUNCHXL_SDSPICOUNT] = {
{
.baseAddr = GSPI_BASE,
.spiPRCM = PRCM_GSPI,
.csGPIOBase = GPIOA0_BASE,
.csGPIOPin = GPIO_PIN_7,
.txGPIOBase = GPIOA2_BASE,
.txGPIOPin = GPIO_PIN_0,
.txGPIOMode = PIN_MODE_0,
.txSPIMode = PIN_MODE_7,
.txPackPin = PIN_07
}
};
const SDSPI_Config SDSPI_config[] = {
{
.fxnTablePtr = &SDSPICC3200_fxnTable,
.object = &sdspiCC3200Objects[0],
.hwAttrs = &sdspiCC3200HWattrs[0]
},
{NULL, NULL, NULL}
};
/*
* ======== CC3200_LAUNCHXL_initSDSPI ========
*/
void CC3200_LAUNCHXL_initSDSPI(void)
{
/* Raise the CS pin to deselect the SD card */
MAP_GPIOPinWrite(GPIOA0_BASE, GPIO_PIN_7, GPIO_PIN_7);
SDSPI_init();
}
/*
* =============================== SPI ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiCC3200DMAHWAttrs, ".const:spiCC3200DMAHWAttrs")
#endif
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPICC3200DMA.h>
SPICC3200DMA_Object SPICC3200DMAObjects[CC3200_LAUNCHXL_SPICOUNT];
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_ALIGN(spiCC3200DMAscratchBuf, 32)
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=32
#elif defined(__GNUC__)
__attribute__ ((aligned (32)))
#endif
uint32_t spiCC3200DMAscratchBuf[CC3200_LAUNCHXL_SPICOUNT];
const SPICC3200DMA_HWAttrs spiCC3200DMAHWAttrs[CC3200_LAUNCHXL_SPICOUNT] = {
{
.baseAddr = GSPI_BASE,
.intNum = INT_GSPI,
.intPriority = (~0),
.spiPRCM = PRCM_GSPI,
.csControl = SPI_HW_CTRL_CS,
.csPolarity = SPI_CS_ACTIVELOW,
.pinMode = SPI_4PIN_MODE,
.turboMode = SPI_TURBO_OFF,
.scratchBufPtr = &spiCC3200DMAscratchBuf[0],
.defaultTxBufValue = 0,
.rxChannelIndex = UDMA_CH6_GSPI_RX,
.txChannelIndex = UDMA_CH7_GSPI_TX,
.minDmaTransferSize = 100
},
{
.baseAddr = LSPI_BASE,
.intNum = INT_LSPI,
.intPriority = (~0),
.spiPRCM = PRCM_LSPI,
.csControl = SPI_SW_CTRL_CS,
.csPolarity = SPI_CS_ACTIVEHIGH,
.pinMode = SPI_4PIN_MODE,
.turboMode = SPI_TURBO_OFF,
.scratchBufPtr = &spiCC3200DMAscratchBuf[1],
.defaultTxBufValue = 0,
.rxChannelIndex = UDMA_CH12_LSPI_RX,
.txChannelIndex = UDMA_CH13_LSPI_TX,
.minDmaTransferSize = 100
}
};
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPICC3200DMA_fxnTable,
.object = &SPICC3200DMAObjects[0],
.hwAttrs = &spiCC3200DMAHWAttrs[0]
},
{
.fxnTablePtr = &SPICC3200DMA_fxnTable,
.object = &SPICC3200DMAObjects[1],
.hwAttrs = &spiCC3200DMAHWAttrs[1]
},
{NULL, NULL, NULL}
};
/*
* ======== CC3200_LAUNCHXL_initSPI ========
*/
void CC3200_LAUNCHXL_initSPI(void)
{
CC3200_LAUNCHXL_initDMA();
SPI_init();
}
/*
* =============================== UART ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(UART_config, ".const:UART_config")
#pragma DATA_SECTION(uartCC3200HWAttrs, ".const:uartCC3200HWAttrs")
#endif
#include <ti/drivers/UART.h>
#if TI_DRIVERS_UART_DMA
#include <ti/drivers/uart/UARTCC3200DMA.h>
UARTCC3200DMA_Object uartCC3200Objects[CC3200_LAUNCHXL_UARTCOUNT];
/* UART configuration structure */
const UARTCC3200DMA_HWAttrs uartCC3200HWAttrs[CC3200_LAUNCHXL_UARTCOUNT] = {
{
.baseAddr = UARTA0_BASE,
.intNum = INT_UARTA0,
.intPriority = (~0),
.rxChannelIndex = UDMA_CH8_UARTA0_RX,
.txChannelIndex = UDMA_CH9_UARTA0_TX
},
{
.baseAddr = UARTA1_BASE,
.intNum = INT_UARTA1,
.intPriority = (~0),
.rxChannelIndex = UDMA_CH10_UARTA1_RX,
.txChannelIndex = UDMA_CH11_UARTA1_TX
},
};
const UART_Config UART_config[] = {
{
.fxnTablePtr = &UARTCC3200DMA_fxnTable,
.object = &uartCC3200Objects[0],
.hwAttrs = &uartCC3200HWAttrs[0]
},
{
.fxnTablePtr = &UARTCC3200DMA_fxnTable,
.object = &uartCC3200Objects[1],
.hwAttrs = &uartCC3200HWAttrs[1]
},
{NULL, NULL, NULL}
};
#else
#include <ti/drivers/uart/UARTCC3200.h>
UARTCC3200_Object uartCC3200Objects[CC3200_LAUNCHXL_UARTCOUNT];
unsigned char uartCC3200RingBuffer[CC3200_LAUNCHXL_UARTCOUNT][32];
/* UART configuration structure */
const UARTCC3200_HWAttrs uartCC3200HWAttrs[CC3200_LAUNCHXL_UARTCOUNT] = {
{
.baseAddr = UARTA0_BASE,
.intNum = INT_UARTA0,
.intPriority = (~0),
.flowControl = UART_FLOWCONTROL_NONE,
.ringBufPtr = uartCC3200RingBuffer[0],
.ringBufSize = sizeof(uartCC3200RingBuffer[0]),
},
{
.baseAddr = UARTA1_BASE,
.intNum = INT_UARTA1,
.intPriority = (~0),
.flowControl = UART_FLOWCONTROL_NONE,
.ringBufPtr = uartCC3200RingBuffer[1],
.ringBufSize = sizeof(uartCC3200RingBuffer[1]),
}
};
const UART_Config UART_config[] = {
{
.fxnTablePtr = &UARTCC3200_fxnTable,
.object = &uartCC3200Objects[0],
.hwAttrs = &uartCC3200HWAttrs[0]
},
{
.fxnTablePtr = &UARTCC3200_fxnTable,
.object = &uartCC3200Objects[1],
.hwAttrs = &uartCC3200HWAttrs[1]
},
{NULL, NULL, NULL}
};
#endif /* TI_DRIVERS_UART_DMA */
/*
* ======== CC3200_LAUNCHXL_initUART ========
*/
void CC3200_LAUNCHXL_initUART(void)
{
#if TI_DRIVERS_UART_DMA
CC3200_LAUNCHXL_initDMA();
#endif
UART_init();
}
/*
* =============================== Watchdog ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(Watchdog_config, ".const:Watchdog_config")
#pragma DATA_SECTION(watchdogCC3200HWAttrs, ".const:watchdogCC3200HWAttrs")
#endif
#include <ti/drivers/Watchdog.h>
#include <ti/drivers/watchdog/WatchdogCC3200.h>
WatchdogCC3200_Object watchdogCC3200Objects[CC3200_LAUNCHXL_WATCHDOGCOUNT];
const WatchdogCC3200_HWAttrs watchdogCC3200HWAttrs[CC3200_LAUNCHXL_WATCHDOGCOUNT] = {
{
.baseAddr = WDT_BASE,
.intNum = INT_WDT,
.intPriority = (~0),
.reloadValue = 80000000 // 1 second period at default CPU clock freq
},
};
const Watchdog_Config Watchdog_config[] = {
{
.fxnTablePtr = &WatchdogCC3200_fxnTable,
.object = &watchdogCC3200Objects[0],
.hwAttrs = &watchdogCC3200HWAttrs[0]
},
{NULL, NULL, NULL},
};
/*
* ======== CC3200_LAUNCHXL_initWatchdog ========
*/
void CC3200_LAUNCHXL_initWatchdog(void)
{
Watchdog_init();
}
/*
* =============================== WiFi ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(WiFi_config, ".const:WiFi_config")
#pragma DATA_SECTION(wiFiCC3200HWAttrs, ".const:wiFiCC3200HWAttrs")
#endif
#include <ti/drivers/WiFi.h>
#include <ti/drivers/wifi/WiFiCC3200.h>
WiFiCC3200_Object wiFiCC3200Objects[CC3200_LAUNCHXL_WIFICOUNT];
const WiFiCC3200_HWAttrs wiFiCC3200HWAttrs[CC3200_LAUNCHXL_WIFICOUNT] = {
{
.wifiIntNum = INT_NWPIC
}
};
const WiFi_Config WiFi_config[] = {
{
.fxnTablePtr = &WiFiCC3200_fxnTable,
.object = &wiFiCC3200Objects[0],
.hwAttrs = &wiFiCC3200HWAttrs[0]
},
{NULL,NULL, NULL},
};
/*
* ======== CC3200_LAUNCHXL_initWiFi ========
*/
void CC3200_LAUNCHXL_initWiFi(void)
{
CC3200_LAUNCHXL_initDMA();
SPI_init();
WiFi_init();
}