forked from 49577/ble_examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CC26X2R1_LAUNCHXL.c
1098 lines (939 loc) · 39.3 KB
/
CC26X2R1_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
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2016-2017, 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.
*/
/*
* ====================== CC26X2R1_LAUNCHXL.c ===================================
* This file is responsible for setting up the board specific items for the
* CC26X2R1_LAUNCHXL board.
*/
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/devices/cc13x2_cc26x2/driverlib/ioc.h>
#include <ti/devices/cc13x2_cc26x2/driverlib/udma.h>
#include <ti/devices/cc13x2_cc26x2/inc/hw_ints.h>
#include <ti/devices/cc13x2_cc26x2/inc/hw_memmap.h>
#include "CC26X2R1_LAUNCHXL.h"
/*
* =============================== ADCBuf ===============================
*/
#include <ti/drivers/ADCBuf.h>
#include <ti/drivers/adcbuf/ADCBufCC26XX.h>
ADCBufCC26XX_Object adcBufCC26xxObjects[CC26X2R1_LAUNCHXL_ADCBUFCOUNT];
/*
* This table converts a virtual adc channel into a dio and internal analogue
* input signal. This table is necessary for the functioning of the adcBuf
* driver. Comment out unused entries to save flash. Dio and internal signal
* pairs are hardwired. Do not remap them in the table. You may reorder entire
* entries. The mapping of dio and internal signals is package dependent.
*/
const ADCBufCC26XX_AdcChannelLutEntry ADCBufCC26XX_adcChannelLut[CC26X2R1_LAUNCHXL_ADCBUF0CHANNELCOUNT] = {
{CC26X2R1_LAUNCHXL_DIO23_ANALOG, ADC_COMPB_IN_AUXIO7},
{CC26X2R1_LAUNCHXL_DIO24_ANALOG, ADC_COMPB_IN_AUXIO6},
{CC26X2R1_LAUNCHXL_DIO25_ANALOG, ADC_COMPB_IN_AUXIO5},
{CC26X2R1_LAUNCHXL_DIO26_ANALOG, ADC_COMPB_IN_AUXIO4},
{CC26X2R1_LAUNCHXL_DIO27_ANALOG, ADC_COMPB_IN_AUXIO3},
{CC26X2R1_LAUNCHXL_DIO28_ANALOG, ADC_COMPB_IN_AUXIO2},
{CC26X2R1_LAUNCHXL_DIO29_ANALOG, ADC_COMPB_IN_AUXIO1},
{CC26X2R1_LAUNCHXL_DIO30_ANALOG, ADC_COMPB_IN_AUXIO0},
{PIN_UNASSIGNED, ADC_COMPB_IN_VDDS},
{PIN_UNASSIGNED, ADC_COMPB_IN_DCOUPL},
{PIN_UNASSIGNED, ADC_COMPB_IN_VSS},
};
const ADCBufCC26XX_HWAttrs adcBufCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCBUFCOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
.adcChannelLut = ADCBufCC26XX_adcChannelLut,
.gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER0A,
.gptDMAChannelMask = 1 << UDMA_CHAN_TIMER0_A,
}
};
const ADCBuf_Config ADCBuf_config[CC26X2R1_LAUNCHXL_ADCBUFCOUNT] = {
{
&ADCBufCC26XX_fxnTable,
&adcBufCC26xxObjects[CC26X2R1_LAUNCHXL_ADCBUF0],
&adcBufCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCBUF0]
},
};
const uint_least8_t ADCBuf_count = CC26X2R1_LAUNCHXL_ADCBUFCOUNT;
/*
* =============================== ADC ===============================
*/
#include <ti/drivers/ADC.h>
#include <ti/drivers/adc/ADCCC26XX.h>
ADCCC26XX_Object adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADCCOUNT];
const ADCCC26XX_HWAttrs adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCCOUNT] = {
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO23_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO7,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO24_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO6,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO25_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO5,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO26_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO4,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO27_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO3,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO28_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO2,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO29_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO1,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = CC26X2R1_LAUNCHXL_DIO30_ANALOG,
.adcCompBInput = ADC_COMPB_IN_AUXIO0,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_10P9_MS,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_DCOUPL,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VSS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
},
{
.adcDIO = PIN_UNASSIGNED,
.adcCompBInput = ADC_COMPB_IN_VDDS,
.refSource = ADCCC26XX_FIXED_REFERENCE,
.samplingDuration = ADCCC26XX_SAMPLING_DURATION_2P7_US,
.inputScalingEnabled = true,
.triggerSource = ADCCC26XX_TRIGGER_MANUAL,
.returnAdjustedVal = false
}
};
const ADC_Config ADC_config[CC26X2R1_LAUNCHXL_ADCCOUNT] = {
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC0], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC0]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC1], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC1]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC2], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC2]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC3], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC3]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC4], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC4]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC5], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC5]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC6], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC6]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADC7], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADC7]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADCDCOUPL], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCDCOUPL]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADCVSS], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCVSS]},
{&ADCCC26XX_fxnTable, &adcCC26xxObjects[CC26X2R1_LAUNCHXL_ADCVDDS], &adcCC26xxHWAttrs[CC26X2R1_LAUNCHXL_ADCVDDS]},
};
const uint_least8_t ADC_count = CC26X2R1_LAUNCHXL_ADCCOUNT;
/*
* =============================== Crypto ===============================
*/
#include <ti/drivers/crypto/CryptoCC26XX.h>
CryptoCC26XX_Object cryptoCC26XXObjects[CC26X2R1_LAUNCHXL_CRYPTOCOUNT];
const CryptoCC26XX_HWAttrs cryptoCC26XXHWAttrs[CC26X2R1_LAUNCHXL_CRYPTOCOUNT] = {
{
.baseAddr = CRYPTO_BASE,
.powerMngrId = PowerCC26XX_PERIPH_CRYPTO,
.intNum = INT_CRYPTO_RESULT_AVAIL_IRQ,
.intPriority = ~0,
}
};
const CryptoCC26XX_Config CryptoCC26XX_config[CC26X2R1_LAUNCHXL_CRYPTOCOUNT] = {
{
.object = &cryptoCC26XXObjects[CC26X2R1_LAUNCHXL_CRYPTO0],
.hwAttrs = &cryptoCC26XXHWAttrs[CC26X2R1_LAUNCHXL_CRYPTO0]
},
};
/*
* =============================== ECDH ===============================
*/
#include <ti/drivers/ECDH.h>
#include <ti/drivers/ecdh/ECDHCC26X2.h>
ECDHCC26X2_Object ecdhCC26X2Objects[CC26X2R1_LAUNCHXL_ECDHCOUNT];
const ECDHCC26X2_HWAttrs ecdhCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECDHCOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const ECDH_Config ECDH_config[CC26X2R1_LAUNCHXL_ECDHCOUNT] = {
{
.object = &ecdhCC26X2Objects[CC26X2R1_LAUNCHXL_ECDH0],
.hwAttrs = &ecdhCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECDH0]
},
};
const uint_least8_t ECDH_count = CC26X2R1_LAUNCHXL_ECDHCOUNT;
/*
* =============================== ECDSA ===============================
*/
#include <ti/drivers/ECDSA.h>
#include <ti/drivers/ecdsa/ECDSACC26X2.h>
ECDSACC26X2_Object ecdsaCC26X2Objects[CC26X2R1_LAUNCHXL_ECDSACOUNT];
const ECDSACC26X2_HWAttrs ecdsaCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECDSACOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const ECDSA_Config ECDSA_config[CC26X2R1_LAUNCHXL_ECDSACOUNT] = {
{
.object = &ecdsaCC26X2Objects[CC26X2R1_LAUNCHXL_ECDSA0],
.hwAttrs = &ecdsaCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECDSA0]
},
};
const uint_least8_t ECDSA_count = CC26X2R1_LAUNCHXL_ECDSACOUNT;
/*
* =============================== ECJPAKE ===============================
*/
#include <ti/drivers/ECJPAKE.h>
#include <ti/drivers/ecjpake/ECJPAKECC26X2.h>
ECJPAKECC26X2_Object ecjpakeCC26X2Objects[CC26X2R1_LAUNCHXL_ECJPAKECOUNT];
const ECJPAKECC26X2_HWAttrs ecjpakeCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECJPAKECOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const ECJPAKE_Config ECJPAKE_config[CC26X2R1_LAUNCHXL_ECJPAKECOUNT] = {
{
.object = &ecjpakeCC26X2Objects[CC26X2R1_LAUNCHXL_ECJPAKE0],
.hwAttrs = &ecjpakeCC26X2HWAttrs[CC26X2R1_LAUNCHXL_ECJPAKE0]
},
};
const uint_least8_t ECJPAKE_count = CC26X2R1_LAUNCHXL_ECJPAKECOUNT;
/*
* =============================== SHA2 ===============================
*/
#include <ti/drivers/SHA2.h>
#include <ti/drivers/sha2/SHA2CC26X2.h>
SHA2CC26X2_Object sha2CC26X2Objects[CC26X2R1_LAUNCHXL_SHA2COUNT];
const SHA2CC26X2_HWAttrs sha2CC26X2HWAttrs[CC26X2R1_LAUNCHXL_SHA2COUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const SHA2_Config SHA2_config[CC26X2R1_LAUNCHXL_SHA2COUNT] = {
{
.object = &sha2CC26X2Objects[CC26X2R1_LAUNCHXL_SHA20],
.hwAttrs = &sha2CC26X2HWAttrs[CC26X2R1_LAUNCHXL_SHA20]
},
};
const uint_least8_t SHA2_count = CC26X2R1_LAUNCHXL_SHA2COUNT;
/*
* =============================== AESCCM ===============================
*/
#include <ti/drivers/AESCCM.h>
#include <ti/drivers/aesccm/AESCCMCC26XX.h>
AESCCMCC26XX_Object aesccmCC26XXObjects[CC26X2R1_LAUNCHXL_AESCCMCOUNT];
const AESCCMCC26XX_HWAttrs aesccmCC26XXHWAttrs[CC26X2R1_LAUNCHXL_AESCCMCOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const AESCCM_Config AESCCM_config[CC26X2R1_LAUNCHXL_AESCCMCOUNT] = {
{
.object = &aesccmCC26XXObjects[CC26X2R1_LAUNCHXL_AESCCM0],
.hwAttrs = &aesccmCC26XXHWAttrs[CC26X2R1_LAUNCHXL_AESCCM0]
},
};
const uint_least8_t AESCCM_count = CC26X2R1_LAUNCHXL_AESCCMCOUNT;
/*
* =============================== AESECB ===============================
*/
#include <ti/drivers/AESECB.h>
#include <ti/drivers/aesecb/AESECBCC26XX.h>
AESECBCC26XX_Object aesecbCC26XXObjects[CC26X2R1_LAUNCHXL_AESECBCOUNT];
const AESECBCC26XX_HWAttrs aesecbCC26XXHWAttrs[CC26X2R1_LAUNCHXL_AESECBCOUNT] = {
{
.intPriority = ~0,
.swiPriority = 0,
}
};
const AESECB_Config AESECB_config[CC26X2R1_LAUNCHXL_AESECBCOUNT] = {
{
.object = &aesecbCC26XXObjects[CC26X2R1_LAUNCHXL_AESECB0],
.hwAttrs = &aesecbCC26XXHWAttrs[CC26X2R1_LAUNCHXL_AESECB0]
},
};
const uint_least8_t AESECB_count = CC26X2R1_LAUNCHXL_AESECBCOUNT;
/*
* =============================== Display ===============================
*/
#include <ti/display/Display.h>
#include <ti/display/DisplayUart.h>
#include <ti/display/DisplaySharp.h>
#ifndef BOARD_DISPLAY_UART_STRBUF_SIZE
#define BOARD_DISPLAY_UART_STRBUF_SIZE 128
#endif
#ifndef BOARD_DISPLAY_SHARP_SIZE
#define BOARD_DISPLAY_SHARP_SIZE 96
#endif
DisplayUart_Object displayUartObject;
DisplaySharp_Object displaySharpObject;
static char uartStringBuf[BOARD_DISPLAY_UART_STRBUF_SIZE];
static uint_least8_t sharpDisplayBuf[BOARD_DISPLAY_SHARP_SIZE * BOARD_DISPLAY_SHARP_SIZE / 8];
const DisplayUart_HWAttrs displayUartHWAttrs = {
.uartIdx = CC26X2R1_LAUNCHXL_UART0,
.baudRate = 115200,
.mutexTimeout = (unsigned int)(-1),
.strBuf = uartStringBuf,
.strBufLen = BOARD_DISPLAY_UART_STRBUF_SIZE,
};
const DisplaySharp_HWAttrs displaySharpHWattrs = {
.spiIndex = CC26X2R1_LAUNCHXL_SPI0,
.csPin = CC26X2R1_LAUNCHXL_LCD_CS,
.extcominPin = CC26X2R1_LAUNCHXL_LCD_EXTCOMIN,
.powerPin = CC26X2R1_LAUNCHXL_LCD_POWER,
.enablePin = CC26X2R1_LAUNCHXL_LCD_ENABLE,
.pixelWidth = BOARD_DISPLAY_SHARP_SIZE,
.pixelHeight = BOARD_DISPLAY_SHARP_SIZE,
.displayBuf = sharpDisplayBuf,
};
#ifndef BOARD_DISPLAY_USE_UART
#define BOARD_DISPLAY_USE_UART 1
#endif
#ifndef BOARD_DISPLAY_USE_UART_ANSI
#define BOARD_DISPLAY_USE_UART_ANSI 0
#endif
#ifndef BOARD_DISPLAY_USE_LCD
#define BOARD_DISPLAY_USE_LCD 0
#endif
/*
* This #if/#else is needed to workaround a problem with the
* IAR compiler. The IAR compiler doesn't like the empty array
* initialization. (IAR Error[Pe1345])
*/
#if (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD)
const Display_Config Display_config[] = {
#if (BOARD_DISPLAY_USE_UART)
{
# if (BOARD_DISPLAY_USE_UART_ANSI)
.fxnTablePtr = &DisplayUartAnsi_fxnTable,
# else /* Default to minimal UART with no cursor placement */
.fxnTablePtr = &DisplayUartMin_fxnTable,
# endif
.object = &displayUartObject,
.hwAttrs = &displayUartHWAttrs,
},
#endif
#if (BOARD_DISPLAY_USE_LCD)
{
.fxnTablePtr = &DisplaySharp_fxnTable,
.object = &displaySharpObject,
.hwAttrs = &displaySharpHWattrs
},
#endif
};
const uint_least8_t Display_count = sizeof(Display_config) / sizeof(Display_Config);
#else
const Display_Config *Display_config = NULL;
const uint_least8_t Display_count = 0;
#endif /* (BOARD_DISPLAY_USE_UART || BOARD_DISPLAY_USE_LCD) */
/*
* =============================== GPIO ===============================
*/
#include <ti/drivers/GPIO.h>
#include <ti/drivers/gpio/GPIOCC26XX.h>
/*
* Array of Pin configurations
* NOTE: The order of the pin configurations must coincide with what was
* defined in CC26X2R1_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 */
GPIOCC26XX_DIO_13 | GPIO_DO_NOT_CONFIG, /* Button 0 */
GPIOCC26XX_DIO_14 | GPIO_DO_NOT_CONFIG, /* Button 1 */
/* Output pins */
GPIOCC26XX_DIO_07 | GPIO_DO_NOT_CONFIG, /* Green LED */
GPIOCC26XX_DIO_06 | GPIO_DO_NOT_CONFIG, /* Red LED */
/* SPI Flash CSN */
GPIOCC26XX_DIO_20 | GPIO_DO_NOT_CONFIG,
/* SD CS */
GPIOCC26XX_DIO_21 | GPIO_DO_NOT_CONFIG
};
/*
* Array of callback function pointers
* NOTE: The order of the pin configurations must coincide with what was
* defined in CC26X2R1_LAUNCH.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, /* Button 0 */
NULL, /* Button 1 */
};
const GPIOCC26XX_Config GPIOCC26XX_config = {
.pinConfigs = (GPIO_PinConfig *)gpioPinConfigs,
.callbacks = (GPIO_CallbackFxn *)gpioCallbackFunctions,
.numberOfPinConfigs = CC26X2R1_LAUNCHXL_GPIOCOUNT,
.numberOfCallbacks = sizeof(gpioCallbackFunctions)/sizeof(GPIO_CallbackFxn),
.intPriority = (~0)
};
/*
* =============================== GPTimer ===============================
* Remove unused entries to reduce flash usage both in Board.c and Board.h
*/
#include <ti/drivers/timer/GPTimerCC26XX.h>
GPTimerCC26XX_Object gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMERCOUNT];
const GPTimerCC26XX_HWAttrs gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
{ .baseAddr = GPT0_BASE, .intNum = INT_GPT0A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0A, },
{ .baseAddr = GPT0_BASE, .intNum = INT_GPT0B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT0, .pinMux = GPT_PIN_0B, },
{ .baseAddr = GPT1_BASE, .intNum = INT_GPT1A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1A, },
{ .baseAddr = GPT1_BASE, .intNum = INT_GPT1B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT1, .pinMux = GPT_PIN_1B, },
{ .baseAddr = GPT2_BASE, .intNum = INT_GPT2A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2A, },
{ .baseAddr = GPT2_BASE, .intNum = INT_GPT2B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT2, .pinMux = GPT_PIN_2B, },
{ .baseAddr = GPT3_BASE, .intNum = INT_GPT3A, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3A, },
{ .baseAddr = GPT3_BASE, .intNum = INT_GPT3B, .intPriority = (~0), .powerMngrId = PowerCC26XX_PERIPH_GPT3, .pinMux = GPT_PIN_3B, },
};
const GPTimerCC26XX_Config GPTimerCC26XX_config[CC26X2R1_LAUNCHXL_GPTIMERPARTSCOUNT] = {
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER0A], GPT_A },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER0], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER0B], GPT_B },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER1A], GPT_A },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER1], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER1B], GPT_B },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER2A], GPT_A },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER2], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER2B], GPT_B },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER3A], GPT_A },
{ &gptimerCC26XXObjects[CC26X2R1_LAUNCHXL_GPTIMER3], &gptimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_GPTIMER3B], GPT_B },
};
/*
* =============================== I2C ===============================
*/
#include <ti/drivers/I2C.h>
#include <ti/drivers/i2c/I2CCC26XX.h>
I2CCC26XX_Object i2cCC26xxObjects[CC26X2R1_LAUNCHXL_I2CCOUNT];
const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC26X2R1_LAUNCHXL_I2CCOUNT] = {
{
.baseAddr = I2C0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_I2C0,
.intNum = INT_I2C_IRQ,
.intPriority = ~0,
.swiPriority = 0,
.sdaPin = CC26X2R1_LAUNCHXL_I2C0_SDA0,
.sclPin = CC26X2R1_LAUNCHXL_I2C0_SCL0,
}
};
const I2C_Config I2C_config[CC26X2R1_LAUNCHXL_I2CCOUNT] = {
{
.fxnTablePtr = &I2CCC26XX_fxnTable,
.object = &i2cCC26xxObjects[CC26X2R1_LAUNCHXL_I2C0],
.hwAttrs = &i2cCC26xxHWAttrs[CC26X2R1_LAUNCHXL_I2C0]
},
};
const uint_least8_t I2C_count = CC26X2R1_LAUNCHXL_I2CCOUNT;
/*
*============================= I2S =====================================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(I2SCC26XX_config, ".const:I2SCC26XX_config")
#pragma DATA_SECTION(i2sCC26XXHWAttrs, ".const:i2sCC26XXHWAttrs")
#endif
#include <ti/drivers/i2s/I2SCC26XX.h>
I2SCC26XX_Object i2sCC26XXObject;
const I2SCC26XX_HWAttrs i2sCC26XXHWAttrs = {
.baseAddr = I2S0_BASE,
.intNum = INT_I2S_IRQ,
.intPriority = ~0,
.powerMngrId = PowerCC26XX_PERIPH_I2S,
.mclkPin = CC26X2R1_LAUNCHXL_I2S_MCLK,
.bclkPin = CC26X2R1_LAUNCHXL_I2S_BCLK,
.wclkPin = CC26X2R1_LAUNCHXL_I2S_WCLK,
.ad0Pin = CC26X2R1_LAUNCHXL_I2S_ADO,
.ad1Pin = CC26X2R1_LAUNCHXL_I2S_ADI,
};
/* I2S configuration structure */
const I2SCC26XX_Config I2SCC26XX_config[] = {
{
.object = &i2sCC26XXObject,
.hwAttrs = &i2sCC26XXHWAttrs
},
{NULL, NULL}
};
/*
* =============================== NVS ===============================
*/
#include <ti/drivers/NVS.h>
#include <ti/drivers/nvs/NVSSPI25X.h>
#include <ti/drivers/nvs/NVSCC26XX.h>
#define NVS_REGIONS_BASE 0x52000
#define SECTORSIZE 0x2000
#define REGIONSIZE (SECTORSIZE * 2)
#define VERIFYBUFSIZE 64
static uint8_t verifyBuf[VERIFYBUFSIZE];
/*
* Reserve flash sectors for NVS driver use by placing an uninitialized byte
* array at the desired flash address.
*/
#if defined(__TI_COMPILER_VERSION__)
/*
* Place uninitialized array at NVS_REGIONS_BASE
*/
#pragma LOCATION(flashBuf, NVS_REGIONS_BASE);
#pragma NOINIT(flashBuf);
static char flashBuf[REGIONSIZE];
#elif defined(__IAR_SYSTEMS_ICC__)
/*
* Place uninitialized array at NVS_REGIONS_BASE
*/
__no_init static char flashBuf[REGIONSIZE] @ NVS_REGIONS_BASE;
#elif defined(__GNUC__)
/*
* Place the flash buffers in the .nvs section created in the gcc linker file.
* The .nvs section enforces alignment on a sector boundary but may
* be placed anywhere in flash memory. If desired the .nvs section can be set
* to a fixed address by changing the following in the gcc linker file:
*
* .nvs (FIXED_FLASH_ADDR) (NOLOAD) : AT (FIXED_FLASH_ADDR) {
* *(.nvs)
* } > REGION_TEXT
*/
__attribute__ ((section (".nvs")))
static char flashBuf[REGIONSIZE];
#endif
/* Allocate objects for NVS and NVS SPI */
NVSCC26XX_Object nvsCC26xxObjects[1];
NVSSPI25X_Object nvsSPI25XObjects[1];
/* Hardware attributes for NVS */
const NVSCC26XX_HWAttrs nvsCC26xxHWAttrs[1] = {
{
.regionBase = (void *)flashBuf,
.regionSize = REGIONSIZE,
},
};
/* Hardware attributes for NVS SPI */
const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {
{
.regionBaseOffset = 0,
.regionSize = REGIONSIZE,
.sectorSize = SECTORSIZE,
.verifyBuf = verifyBuf,
.verifyBufSize = VERIFYBUFSIZE,
.spiHandle = NULL,
.spiIndex = 0,
.spiBitRate = 4000000,
.spiCsnGpioIndex = CC26X2R1_LAUNCHXL_GPIO_SPI_FLASH_CS,
},
};
/* NVS Region index 0 and 1 refer to NVS and NVS SPI respectively */
const NVS_Config NVS_config[CC26X2R1_LAUNCHXL_NVSCOUNT] = {
{
.fxnTablePtr = &NVSCC26XX_fxnTable,
.object = &nvsCC26xxObjects[0],
.hwAttrs = &nvsCC26xxHWAttrs[0],
},
{
.fxnTablePtr = &NVSSPI25X_fxnTable,
.object = &nvsSPI25XObjects[0],
.hwAttrs = &nvsSPI25XHWAttrs[0],
},
};
const uint_least8_t NVS_count = CC26X2R1_LAUNCHXL_NVSCOUNT;
/*
* =============================== PIN ===============================
*/
#include <ti/drivers/PIN.h>
#include <ti/drivers/pin/PINCC26XX.h>
const PIN_Config BoardGpioInitTable[] = {
CC26X2R1_LAUNCHXL_PIN_RLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC26X2R1_LAUNCHXL_PIN_GLED | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* LED initially off */
CC26X2R1_LAUNCHXL_PIN_BTN1 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC26X2R1_LAUNCHXL_PIN_BTN2 | PIN_INPUT_EN | PIN_PULLUP | PIN_IRQ_BOTHEDGES | PIN_HYSTERESIS, /* Button is active low */
CC26X2R1_LAUNCHXL_SPI_FLASH_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MIN, /* External flash chip select */
CC26X2R1_LAUNCHXL_UART0_RX | PIN_INPUT_EN | PIN_PULLDOWN, /* UART RX via debugger back channel */
CC26X2R1_LAUNCHXL_UART0_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX via debugger back channel */
CC26X2R1_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
CC26X2R1_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
CC26X2R1_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */
PIN_TERMINATE
};
const PINCC26XX_HWAttrs PINCC26XX_hwAttrs = {
.intPriority = ~0,
.swiPriority = 0
};
/*
* =============================== Power ===============================
*/
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26X2.h>
const PowerCC26X2_Config PowerCC26X2_config = {
.policyInitFxn = NULL,
.policyFxn = &PowerCC26XX_standbyPolicy,
.calibrateFxn = &PowerCC26XX_calibrate,
.enablePolicy = true,
.calibrateRCOSC_LF = true,
.calibrateRCOSC_HF = true,
};
/*
* =============================== PWM ===============================
* Remove unused entries to reduce flash usage both in Board.c and Board.h
*/
#include <ti/drivers/PWM.h>
#include <ti/drivers/pwm/PWMTimerCC26XX.h>
PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWMCOUNT];
const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWMCOUNT] = {
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN0, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER0A },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN1, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER0B },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN2, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER1A },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN3, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER1B },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN4, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER2A },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN5, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER2B },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN6, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER3A },
{ .pwmPin = CC26X2R1_LAUNCHXL_PWMPIN7, .gpTimerUnit = CC26X2R1_LAUNCHXL_GPTIMER3B },
};
const PWM_Config PWM_config[CC26X2R1_LAUNCHXL_PWMCOUNT] = {
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM0], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM0] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM1], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM1] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM2], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM2] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM3], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM3] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM4], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM4] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM5], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM5] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM6], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM6] },
{ &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[CC26X2R1_LAUNCHXL_PWM7], &pwmtimerCC26xxHWAttrs[CC26X2R1_LAUNCHXL_PWM7] },
};
const uint_least8_t PWM_count = CC26X2R1_LAUNCHXL_PWMCOUNT;
/*
* =============================== RF Driver ===============================
*/
#include <ti/drivers/rf/RF.h>
const RFCC26XX_HWAttrs RFCC26XX_hwAttrs = {
.hwiCpe0Priority = ~0,
.hwiHwPriority = ~0,
.swiCpe0Priority = 0,
.swiHwPriority = 0,
};
/*
* =============================== SD ===============================
*/
#include <ti/drivers/SD.h>
#include <ti/drivers/sd/SDSPI.h>
SDSPI_Object sdspiObjects[CC26X2R1_LAUNCHXL_SDCOUNT];
const SDSPI_HWAttrs sdspiHWAttrs[CC26X2R1_LAUNCHXL_SDCOUNT] = {
{
.spiIndex = CC26X2R1_LAUNCHXL_SPI0,
.spiCsGpioIndex = CC26X2R1_LAUNCHXL_SDSPI_CS
}
};
const SD_Config SD_config[CC26X2R1_LAUNCHXL_SDCOUNT] = {
{
.fxnTablePtr = &SDSPI_fxnTable,
.object = &sdspiObjects[CC26X2R1_LAUNCHXL_SDSPI0],
.hwAttrs = &sdspiHWAttrs[CC26X2R1_LAUNCHXL_SDSPI0]
},
};
const uint_least8_t SD_count = CC26X2R1_LAUNCHXL_SDCOUNT;
/*
* =============================== SPI DMA ===============================
*/
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPICC26XXDMA.h>
SPICC26XXDMA_Object spiCC26XXDMAObjects[CC26X2R1_LAUNCHXL_SPICOUNT];
/*
* NOTE: The SPI instances below can be used by the SD driver to communicate
* with a SD card via SPI. The 'defaultTxBufValue' fields below are set to 0xFF
* to satisfy the SDSPI driver requirement.
*/
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[CC26X2R1_LAUNCHXL_SPICOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0xFF,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = CC26X2R1_LAUNCHXL_SPI0_MOSI,
.misoPin = CC26X2R1_LAUNCHXL_SPI0_MISO,
.clkPin = CC26X2R1_LAUNCHXL_SPI0_CLK,
.csnPin = CC26X2R1_LAUNCHXL_SPI0_CSN,
.minDmaTransferSize = 10
},
{
.baseAddr = SSI1_BASE,
.intNum = INT_SSI1_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI1,
.defaultTxBufValue = 0xFF,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
.mosiPin = CC26X2R1_LAUNCHXL_SPI1_MOSI,
.misoPin = CC26X2R1_LAUNCHXL_SPI1_MISO,
.clkPin = CC26X2R1_LAUNCHXL_SPI1_CLK,
.csnPin = CC26X2R1_LAUNCHXL_SPI1_CSN,
.minDmaTransferSize = 10
}
};
const SPI_Config SPI_config[CC26X2R1_LAUNCHXL_SPICOUNT] = {
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[CC26X2R1_LAUNCHXL_SPI0],
.hwAttrs = &spiCC26XXDMAHWAttrs[CC26X2R1_LAUNCHXL_SPI0]
},
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[CC26X2R1_LAUNCHXL_SPI1],
.hwAttrs = &spiCC26XXDMAHWAttrs[CC26X2R1_LAUNCHXL_SPI1]
},
};
const uint_least8_t SPI_count = CC26X2R1_LAUNCHXL_SPICOUNT;
/*
* =============================== UART ===============================
*/
#include <ti/drivers/UART.h>
#include <ti/drivers/uart/UARTCC26XX.h>
UARTCC26XX_Object uartCC26XXObjects[CC26X2R1_LAUNCHXL_UARTCOUNT];
uint8_t uartCC26XXRingBuffer[CC26X2R1_LAUNCHXL_UARTCOUNT][32];
const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC26X2R1_LAUNCHXL_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UART0,
.intNum = INT_UART0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = CC26X2R1_LAUNCHXL_UART0_TX,
.rxPin = CC26X2R1_LAUNCHXL_UART0_RX,
.ctsPin = PIN_UNASSIGNED,
.rtsPin = PIN_UNASSIGNED,
.ringBufPtr = uartCC26XXRingBuffer[CC26X2R1_LAUNCHXL_UART0],
.ringBufSize = sizeof(uartCC26XXRingBuffer[CC26X2R1_LAUNCHXL_UART0]),
.txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
.rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8
},
{
.baseAddr = UART1_BASE,
.powerMngrId = PowerCC26X2_PERIPH_UART1,
.intNum = INT_UART1_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = CC26X2R1_LAUNCHXL_UART1_TX,
.rxPin = CC26X2R1_LAUNCHXL_UART1_RX,
.ctsPin = PIN_UNASSIGNED,
.rtsPin = PIN_UNASSIGNED,
.ringBufPtr = uartCC26XXRingBuffer[CC26X2R1_LAUNCHXL_UART1],
.ringBufSize = sizeof(uartCC26XXRingBuffer[CC26X2R1_LAUNCHXL_UART1]),
.txIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_1_8,
.rxIntFifoThr = UARTCC26XX_FIFO_THRESHOLD_4_8
}
};
const UART_Config UART_config[CC26X2R1_LAUNCHXL_UARTCOUNT] = {
{
.fxnTablePtr = &UARTCC26XX_fxnTable,
.object = &uartCC26XXObjects[CC26X2R1_LAUNCHXL_UART0],
.hwAttrs = &uartCC26XXHWAttrs[CC26X2R1_LAUNCHXL_UART0]
},
{
.fxnTablePtr = &UARTCC26XX_fxnTable,
.object = &uartCC26XXObjects[CC26X2R1_LAUNCHXL_UART1],
.hwAttrs = &uartCC26XXHWAttrs[CC26X2R1_LAUNCHXL_UART1]
},
};
const uint_least8_t UART_count = CC26X2R1_LAUNCHXL_UARTCOUNT;
/*
* =============================== UDMA ===============================
*/
#include <ti/drivers/dma/UDMACC26XX.h>
UDMACC26XX_Object udmaObjects[CC26X2R1_LAUNCHXL_UDMACOUNT];
const UDMACC26XX_HWAttrs udmaHWAttrs[CC26X2R1_LAUNCHXL_UDMACOUNT] = {
{
.baseAddr = UDMA0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UDMA,
.intNum = INT_DMA_ERR,
.intPriority = ~0
}
};
const UDMACC26XX_Config UDMACC26XX_config[CC26X2R1_LAUNCHXL_UDMACOUNT] = {
{
.object = &udmaObjects[CC26X2R1_LAUNCHXL_UDMA0],
.hwAttrs = &udmaHWAttrs[CC26X2R1_LAUNCHXL_UDMA0]
},
};
/*
* =============================== Watchdog ===============================
*/
#include <ti/drivers/Watchdog.h>
#include <ti/drivers/watchdog/WatchdogCC26XX.h>
WatchdogCC26XX_Object watchdogCC26XXObjects[CC26X2R1_LAUNCHXL_WATCHDOGCOUNT];
const WatchdogCC26XX_HWAttrs watchdogCC26XXHWAttrs[CC26X2R1_LAUNCHXL_WATCHDOGCOUNT] = {
{
.baseAddr = WDT_BASE,
.reloadValue = 1000 /* Reload value in milliseconds */
},
};
const Watchdog_Config Watchdog_config[CC26X2R1_LAUNCHXL_WATCHDOGCOUNT] = {
{
.fxnTablePtr = &WatchdogCC26XX_fxnTable,
.object = &watchdogCC26XXObjects[CC26X2R1_LAUNCHXL_WATCHDOG0],
.hwAttrs = &watchdogCC26XXHWAttrs[CC26X2R1_LAUNCHXL_WATCHDOG0]
},
};
const uint_least8_t Watchdog_count = CC26X2R1_LAUNCHXL_WATCHDOGCOUNT;
/*
* ======== CC26X2R1_LAUNCHXL_wakeUpExtFlash ========