summaryrefslogtreecommitdiff
path: root/msp340/Break/driverlib/MSP430FR5xx_6xx/adc12_b.h
blob: 303a192f810c301652a66f861902c02cea5668fe (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
/* --COPYRIGHT--,BSD
 * Copyright (c) 2014, 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.
 * --/COPYRIGHT--*/
//*****************************************************************************
//
// adc12_b.h - Driver for the ADC12_B Module.
//
//*****************************************************************************

#ifndef __MSP430WARE_ADC12_B_H__
#define __MSP430WARE_ADC12_B_H__

#include "inc/hw_memmap.h"

#ifdef __MSP430_HAS_ADC12_B__

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

#include "inc/hw_regaccess.h"
//*****************************************************************************
//
//! \brief Used in the ADC12_B_init() function as the param parameter.
//
//*****************************************************************************
typedef struct ADC12_B_initParam
{
    //! Is the signal that will trigger a sample-and-hold for an input signal
    //! to be converted.
    //! \n Valid values are:
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_SC [Default]
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_1
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_2
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_3
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_4
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_5
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_6
    //! - \b ADC12_B_SAMPLEHOLDSOURCE_7
    uint16_t sampleHoldSignalSourceSelect;
    //! Selects the clock that will be used by the ADC12B core, and the
    //! sampling timer if a sampling pulse mode is enabled.
    //! \n Valid values are:
    //! - \b ADC12_B_CLOCKSOURCE_ADC12OSC [Default]
    //! - \b ADC12_B_CLOCKSOURCE_ACLK
    //! - \b ADC12_B_CLOCKSOURCE_MCLK
    //! - \b ADC12_B_CLOCKSOURCE_SMCLK
    uint8_t clockSourceSelect;
    //! Selects the amount that the clock will be divided.
    //! \n Valid values are:
    //! - \b ADC12_B_CLOCKDIVIDER_1 [Default]
    //! - \b ADC12_B_CLOCKDIVIDER_2
    //! - \b ADC12_B_CLOCKDIVIDER_3
    //! - \b ADC12_B_CLOCKDIVIDER_4
    //! - \b ADC12_B_CLOCKDIVIDER_5
    //! - \b ADC12_B_CLOCKDIVIDER_6
    //! - \b ADC12_B_CLOCKDIVIDER_7
    //! - \b ADC12_B_CLOCKDIVIDER_8
    uint16_t clockSourceDivider;
    //! Selects the amount that the clock will be predivided.
    //! \n Valid values are:
    //! - \b ADC12_B_CLOCKPREDIVIDER__1 [Default]
    //! - \b ADC12_B_CLOCKPREDIVIDER__4
    //! - \b ADC12_B_CLOCKPREDIVIDER__32
    //! - \b ADC12_B_CLOCKPREDIVIDER__64
    uint16_t clockSourcePredivider;
    //! Selects what internal channel to map for ADC input channels
    //! \n Valid values are:
    //! - \b ADC12_B_MAPINTCH3
    //! - \b ADC12_B_MAPINTCH2
    //! - \b ADC12_B_MAPINTCH1
    //! - \b ADC12_B_MAPINTCH0
    //! - \b ADC12_B_TEMPSENSEMAP
    //! - \b ADC12_B_BATTMAP
    //! - \b ADC12_B_NOINTCH
    uint16_t internalChannelMap;
} ADC12_B_initParam;

//*****************************************************************************
//
//! \brief Used in the ADC12_B_configureMemory() function as the param
//! parameter.
//
//*****************************************************************************
typedef struct ADC12_B_configureMemoryParam
{
    //! Is the selected memory buffer to set the configuration for.
    //! \n Valid values are:
    //! - \b ADC12_B_MEMORY_0
    //! - \b ADC12_B_MEMORY_1
    //! - \b ADC12_B_MEMORY_2
    //! - \b ADC12_B_MEMORY_3
    //! - \b ADC12_B_MEMORY_4
    //! - \b ADC12_B_MEMORY_5
    //! - \b ADC12_B_MEMORY_6
    //! - \b ADC12_B_MEMORY_7
    //! - \b ADC12_B_MEMORY_8
    //! - \b ADC12_B_MEMORY_9
    //! - \b ADC12_B_MEMORY_10
    //! - \b ADC12_B_MEMORY_11
    //! - \b ADC12_B_MEMORY_12
    //! - \b ADC12_B_MEMORY_13
    //! - \b ADC12_B_MEMORY_14
    //! - \b ADC12_B_MEMORY_15
    //! - \b ADC12_B_MEMORY_16
    //! - \b ADC12_B_MEMORY_17
    //! - \b ADC12_B_MEMORY_18
    //! - \b ADC12_B_MEMORY_19
    //! - \b ADC12_B_MEMORY_20
    //! - \b ADC12_B_MEMORY_21
    //! - \b ADC12_B_MEMORY_22
    //! - \b ADC12_B_MEMORY_23
    //! - \b ADC12_B_MEMORY_24
    //! - \b ADC12_B_MEMORY_25
    //! - \b ADC12_B_MEMORY_26
    //! - \b ADC12_B_MEMORY_27
    //! - \b ADC12_B_MEMORY_28
    //! - \b ADC12_B_MEMORY_29
    //! - \b ADC12_B_MEMORY_30
    //! - \b ADC12_B_MEMORY_31
    uint8_t memoryBufferControlIndex;
    //! Is the input that will store the converted data into the specified
    //! memory buffer.
    //! \n Valid values are:
    //! - \b ADC12_B_INPUT_A0 [Default]
    //! - \b ADC12_B_INPUT_A1
    //! - \b ADC12_B_INPUT_A2
    //! - \b ADC12_B_INPUT_A3
    //! - \b ADC12_B_INPUT_A4
    //! - \b ADC12_B_INPUT_A5
    //! - \b ADC12_B_INPUT_A6
    //! - \b ADC12_B_INPUT_A7
    //! - \b ADC12_B_INPUT_A8
    //! - \b ADC12_B_INPUT_A9
    //! - \b ADC12_B_INPUT_A10
    //! - \b ADC12_B_INPUT_A11
    //! - \b ADC12_B_INPUT_A12
    //! - \b ADC12_B_INPUT_A13
    //! - \b ADC12_B_INPUT_A14
    //! - \b ADC12_B_INPUT_A15
    //! - \b ADC12_B_INPUT_A16
    //! - \b ADC12_B_INPUT_A17
    //! - \b ADC12_B_INPUT_A18
    //! - \b ADC12_B_INPUT_A19
    //! - \b ADC12_B_INPUT_A20
    //! - \b ADC12_B_INPUT_A21
    //! - \b ADC12_B_INPUT_A22
    //! - \b ADC12_B_INPUT_A23
    //! - \b ADC12_B_INPUT_A24
    //! - \b ADC12_B_INPUT_A25
    //! - \b ADC12_B_INPUT_A26
    //! - \b ADC12_B_INPUT_A27
    //! - \b ADC12_B_INPUT_A28
    //! - \b ADC12_B_INPUT_A29
    //! - \b ADC12_B_INPUT_TCMAP
    //! - \b ADC12_B_INPUT_BATMAP
    uint8_t inputSourceSelect;
    //! Is the reference voltage source to set as the upper/lower limits for
    //! the conversion stored in the specified memory.
    //! \n Valid values are:
    //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_VSS [Default]
    //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS
    //! - \b ADC12_B_VREFPOS_EXTNEG_VREFNEG_VSS
    //! - \b ADC12_B_VREFPOS_EXTBUF_VREFNEG_VSS
    //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_VSS
    //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTBUF
    //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTPOS
    //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTPOS
    //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_INTBUF
    //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_INTBUF
    //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTNEG
    //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTNEG
    //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_EXTNEG
    //! - \b ADC12_B_VREFPOS_EXTBUF_VREFNEG_EXTNEG
    uint16_t refVoltageSourceSelect;
    //! Indicates that the specified memory buffer will be the end of the
    //! sequence if a sequenced conversion mode is selected
    //! \n Valid values are:
    //! - \b ADC12_B_NOTENDOFSEQUENCE [Default]
    //! - \b ADC12_B_ENDOFSEQUENCE
    uint16_t endOfSequence;
    //! Sets the window comparator mode
    //! \n Valid values are:
    //! - \b ADC12_B_WINDOW_COMPARATOR_DISABLE [Default]
    //! - \b ADC12_B_WINDOW_COMPARATOR_ENABLE
    uint16_t windowComparatorSelect;
    //! Sets the differential mode
    //! \n Valid values are:
    //! - \b ADC12_B_DIFFERENTIAL_MODE_DISABLE [Default]
    //! - \b ADC12_B_DIFFERENTIAL_MODE_ENABLE
    uint16_t differentialModeSelect;
} ADC12_B_configureMemoryParam;

//*****************************************************************************
//
// The following are values that can be passed to the clockSourceDivider
// parameter for functions: ADC12_B_init(); the param parameter for functions:
// ADC12_B_init().
//
//*****************************************************************************
#define ADC12_B_CLOCKDIVIDER_1                                     (ADC12DIV_0)
#define ADC12_B_CLOCKDIVIDER_2                                     (ADC12DIV_1)
#define ADC12_B_CLOCKDIVIDER_3                                     (ADC12DIV_2)
#define ADC12_B_CLOCKDIVIDER_4                                     (ADC12DIV_3)
#define ADC12_B_CLOCKDIVIDER_5                                     (ADC12DIV_4)
#define ADC12_B_CLOCKDIVIDER_6                                     (ADC12DIV_5)
#define ADC12_B_CLOCKDIVIDER_7                                     (ADC12DIV_6)
#define ADC12_B_CLOCKDIVIDER_8                                     (ADC12DIV_7)

//*****************************************************************************
//
// The following are values that can be passed to the clockSourceSelect
// parameter for functions: ADC12_B_init(); the param parameter for functions:
// ADC12_B_init().
//
//*****************************************************************************
#define ADC12_B_CLOCKSOURCE_ADC12OSC                              (ADC12SSEL_0)
#define ADC12_B_CLOCKSOURCE_ACLK                                  (ADC12SSEL_1)
#define ADC12_B_CLOCKSOURCE_MCLK                                  (ADC12SSEL_2)
#define ADC12_B_CLOCKSOURCE_SMCLK                                 (ADC12SSEL_3)

//*****************************************************************************
//
// The following are values that can be passed to the clockSourcePredivider
// parameter for functions: ADC12_B_init(); the param parameter for functions:
// ADC12_B_init().
//
//*****************************************************************************
#define ADC12_B_CLOCKPREDIVIDER__1                               (ADC12PDIV__1)
#define ADC12_B_CLOCKPREDIVIDER__4                               (ADC12PDIV__4)
#define ADC12_B_CLOCKPREDIVIDER__32                             (ADC12PDIV__32)
#define ADC12_B_CLOCKPREDIVIDER__64                             (ADC12PDIV__64)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_init(); the sampleHoldSignalSourceSelect parameter for
// functions: ADC12_B_init().
//
//*****************************************************************************
#define ADC12_B_SAMPLEHOLDSOURCE_SC                                (ADC12SHS_0)
#define ADC12_B_SAMPLEHOLDSOURCE_1                                 (ADC12SHS_1)
#define ADC12_B_SAMPLEHOLDSOURCE_2                                 (ADC12SHS_2)
#define ADC12_B_SAMPLEHOLDSOURCE_3                                 (ADC12SHS_3)
#define ADC12_B_SAMPLEHOLDSOURCE_4                                 (ADC12SHS_4)
#define ADC12_B_SAMPLEHOLDSOURCE_5                                 (ADC12SHS_5)
#define ADC12_B_SAMPLEHOLDSOURCE_6                                 (ADC12SHS_6)
#define ADC12_B_SAMPLEHOLDSOURCE_7                                 (ADC12SHS_7)

//*****************************************************************************
//
// The following are values that can be passed to the internalChannelMap
// parameter for functions: ADC12_B_init(); the param parameter for functions:
// ADC12_B_init().
//
//*****************************************************************************
#define ADC12_B_MAPINTCH3                                        (ADC12ICH3MAP)
#define ADC12_B_MAPINTCH2                                        (ADC12ICH2MAP)
#define ADC12_B_MAPINTCH1                                        (ADC12ICH1MAP)
#define ADC12_B_MAPINTCH0                                        (ADC12ICH0MAP)
#define ADC12_B_TEMPSENSEMAP                                       (ADC12TCMAP)
#define ADC12_B_BATTMAP                                           (ADC12BATMAP)
#define ADC12_B_NOINTCH                                                  (0x00)

//*****************************************************************************
//
// The following are values that can be passed to the clockCycleHoldCountLowMem
// parameter for functions: ADC12_B_setupSamplingTimer(); the
// clockCycleHoldCountHighMem parameter for functions:
// ADC12_B_setupSamplingTimer().
//
//*****************************************************************************
#define ADC12_B_CYCLEHOLD_4_CYCLES                                (ADC12SHT0_0)
#define ADC12_B_CYCLEHOLD_8_CYCLES                                (ADC12SHT0_1)
#define ADC12_B_CYCLEHOLD_16_CYCLES                               (ADC12SHT0_2)
#define ADC12_B_CYCLEHOLD_32_CYCLES                               (ADC12SHT0_3)
#define ADC12_B_CYCLEHOLD_64_CYCLES                               (ADC12SHT0_4)
#define ADC12_B_CYCLEHOLD_96_CYCLES                               (ADC12SHT0_5)
#define ADC12_B_CYCLEHOLD_128_CYCLES                              (ADC12SHT0_6)
#define ADC12_B_CYCLEHOLD_192_CYCLES                              (ADC12SHT0_7)
#define ADC12_B_CYCLEHOLD_256_CYCLES                              (ADC12SHT0_8)
#define ADC12_B_CYCLEHOLD_384_CYCLES                              (ADC12SHT0_9)
#define ADC12_B_CYCLEHOLD_512_CYCLES                             (ADC12SHT0_10)
#define ADC12_B_CYCLEHOLD_768_CYCLES                             (ADC12SHT0_11)
#define ADC12_B_CYCLEHOLD_1024_CYCLES                            (ADC12SHT0_12)

//*****************************************************************************
//
// The following are values that can be passed to the multipleSamplesEnabled
// parameter for functions: ADC12_B_setupSamplingTimer().
//
//*****************************************************************************
#define ADC12_B_MULTIPLESAMPLESDISABLE                            (!(ADC12MSC))
#define ADC12_B_MULTIPLESAMPLESENABLE                                (ADC12MSC)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_DIFFERENTIAL_MODE_DISABLE                                (0x00)
#define ADC12_B_DIFFERENTIAL_MODE_ENABLE                             (ADC12DIF)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_NOTENDOFSEQUENCE                                  (!(ADC12EOS))
#define ADC12_B_ENDOFSEQUENCE                                        (ADC12EOS)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_VREFPOS_AVCC_VREFNEG_VSS                         (ADC12VRSEL_0)
#define ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS                       (ADC12VRSEL_1)
#define ADC12_B_VREFPOS_EXTNEG_VREFNEG_VSS                       (ADC12VRSEL_2)
#define ADC12_B_VREFPOS_EXTBUF_VREFNEG_VSS                       (ADC12VRSEL_3)
#define ADC12_B_VREFPOS_EXTPOS_VREFNEG_VSS                       (ADC12VRSEL_4)
#define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTBUF                      (ADC12VRSEL_5)
#define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTPOS                      (ADC12VRSEL_6)
#define ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTPOS                    (ADC12VRSEL_7)
#define ADC12_B_VREFPOS_AVCC_VREFNEG_INTBUF                      (ADC12VRSEL_9)
#define ADC12_B_VREFPOS_EXTPOS_VREFNEG_INTBUF                   (ADC12VRSEL_11)
#define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTNEG                     (ADC12VRSEL_12)
#define ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTNEG                   (ADC12VRSEL_13)
#define ADC12_B_VREFPOS_EXTPOS_VREFNEG_EXTNEG                   (ADC12VRSEL_14)
#define ADC12_B_VREFPOS_EXTBUF_VREFNEG_EXTNEG                   (ADC12VRSEL_15)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_INPUT_A0                                          (ADC12INCH_0)
#define ADC12_B_INPUT_A1                                          (ADC12INCH_1)
#define ADC12_B_INPUT_A2                                          (ADC12INCH_2)
#define ADC12_B_INPUT_A3                                          (ADC12INCH_3)
#define ADC12_B_INPUT_A4                                          (ADC12INCH_4)
#define ADC12_B_INPUT_A5                                          (ADC12INCH_5)
#define ADC12_B_INPUT_A6                                          (ADC12INCH_6)
#define ADC12_B_INPUT_A7                                          (ADC12INCH_7)
#define ADC12_B_INPUT_A8                                          (ADC12INCH_8)
#define ADC12_B_INPUT_A9                                          (ADC12INCH_9)
#define ADC12_B_INPUT_A10                                        (ADC12INCH_10)
#define ADC12_B_INPUT_A11                                        (ADC12INCH_11)
#define ADC12_B_INPUT_A12                                        (ADC12INCH_12)
#define ADC12_B_INPUT_A13                                        (ADC12INCH_13)
#define ADC12_B_INPUT_A14                                        (ADC12INCH_14)
#define ADC12_B_INPUT_A15                                        (ADC12INCH_15)
#define ADC12_B_INPUT_A16                                        (ADC12INCH_16)
#define ADC12_B_INPUT_A17                                        (ADC12INCH_17)
#define ADC12_B_INPUT_A18                                        (ADC12INCH_18)
#define ADC12_B_INPUT_A19                                        (ADC12INCH_19)
#define ADC12_B_INPUT_A20                                        (ADC12INCH_20)
#define ADC12_B_INPUT_A21                                        (ADC12INCH_21)
#define ADC12_B_INPUT_A22                                        (ADC12INCH_22)
#define ADC12_B_INPUT_A23                                        (ADC12INCH_23)
#define ADC12_B_INPUT_A24                                        (ADC12INCH_24)
#define ADC12_B_INPUT_A25                                        (ADC12INCH_25)
#define ADC12_B_INPUT_A26                                        (ADC12INCH_26)
#define ADC12_B_INPUT_A27                                        (ADC12INCH_27)
#define ADC12_B_INPUT_A28                                        (ADC12INCH_28)
#define ADC12_B_INPUT_A29                                        (ADC12INCH_29)
#define ADC12_B_INPUT_TCMAP                                      (ADC12INCH_30)
#define ADC12_B_INPUT_BATMAP                                     (ADC12INCH_31)

//*****************************************************************************
//
// The following are values that can be passed to the param parameter for
// functions: ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_WINDOW_COMPARATOR_DISABLE                                (0x00)
#define ADC12_B_WINDOW_COMPARATOR_ENABLE                            (ADC12WINC)

//*****************************************************************************
//
// The following are values that can be passed to the memoryIndex parameter for
// functions: ADC12_B_getMemoryAddressForDMA(); the memoryBufferIndex parameter
// for functions: ADC12_B_getResults(); the param parameter for functions:
// ADC12_B_configureMemory().
//
//*****************************************************************************
#define ADC12_B_MEMORY_0                                                 (0x00)
#define ADC12_B_MEMORY_1                                                 (0x02)
#define ADC12_B_MEMORY_2                                                 (0x04)
#define ADC12_B_MEMORY_3                                                 (0x06)
#define ADC12_B_MEMORY_4                                                 (0x08)
#define ADC12_B_MEMORY_5                                                 (0x0A)
#define ADC12_B_MEMORY_6                                                 (0x0C)
#define ADC12_B_MEMORY_7                                                 (0x0E)
#define ADC12_B_MEMORY_8                                                 (0x10)
#define ADC12_B_MEMORY_9                                                 (0x12)
#define ADC12_B_MEMORY_10                                                (0x14)
#define ADC12_B_MEMORY_11                                                (0x16)
#define ADC12_B_MEMORY_12                                                (0x18)
#define ADC12_B_MEMORY_13                                                (0x1A)
#define ADC12_B_MEMORY_14                                                (0x1C)
#define ADC12_B_MEMORY_15                                                (0x1E)
#define ADC12_B_MEMORY_16                                                (0x20)
#define ADC12_B_MEMORY_17                                                (0x22)
#define ADC12_B_MEMORY_18                                                (0x24)
#define ADC12_B_MEMORY_19                                                (0x26)
#define ADC12_B_MEMORY_20                                                (0x28)
#define ADC12_B_MEMORY_21                                                (0x2A)
#define ADC12_B_MEMORY_22                                                (0x2C)
#define ADC12_B_MEMORY_23                                                (0x2E)
#define ADC12_B_MEMORY_24                                                (0x30)
#define ADC12_B_MEMORY_25                                                (0x32)
#define ADC12_B_MEMORY_26                                                (0x34)
#define ADC12_B_MEMORY_27                                                (0x36)
#define ADC12_B_MEMORY_28                                                (0x38)
#define ADC12_B_MEMORY_29                                                (0x3A)
#define ADC12_B_MEMORY_30                                                (0x3C)
#define ADC12_B_MEMORY_31                                                (0x3E)

//*****************************************************************************
//
// The following are values that can be passed to the interruptMask0 parameter
// for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
//
//*****************************************************************************
#define ADC12_B_IE0                                                  (ADC12IE0)
#define ADC12_B_IE1                                                  (ADC12IE1)
#define ADC12_B_IE2                                                  (ADC12IE2)
#define ADC12_B_IE3                                                  (ADC12IE3)
#define ADC12_B_IE4                                                  (ADC12IE4)
#define ADC12_B_IE5                                                  (ADC12IE5)
#define ADC12_B_IE6                                                  (ADC12IE6)
#define ADC12_B_IE7                                                  (ADC12IE7)
#define ADC12_B_IE8                                                  (ADC12IE8)
#define ADC12_B_IE9                                                  (ADC12IE9)
#define ADC12_B_IE10                                                (ADC12IE10)
#define ADC12_B_IE11                                                (ADC12IE11)
#define ADC12_B_IE12                                                (ADC12IE12)
#define ADC12_B_IE13                                                (ADC12IE13)
#define ADC12_B_IE14                                                (ADC12IE14)
#define ADC12_B_IE15                                                (ADC12IE15)

//*****************************************************************************
//
// The following are values that can be passed to the interruptMask1 parameter
// for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
//
//*****************************************************************************
#define ADC12_B_IE16                                                (ADC12IE16)
#define ADC12_B_IE17                                                (ADC12IE17)
#define ADC12_B_IE18                                                (ADC12IE18)
#define ADC12_B_IE19                                                (ADC12IE19)
#define ADC12_B_IE20                                                (ADC12IE20)
#define ADC12_B_IE21                                                (ADC12IE21)
#define ADC12_B_IE22                                                (ADC12IE22)
#define ADC12_B_IE23                                                (ADC12IE23)
#define ADC12_B_IE24                                                (ADC12IE24)
#define ADC12_B_IE25                                                (ADC12IE25)
#define ADC12_B_IE26                                                (ADC12IE26)
#define ADC12_B_IE27                                                (ADC12IE27)
#define ADC12_B_IE28                                                (ADC12IE28)
#define ADC12_B_IE29                                                (ADC12IE29)
#define ADC12_B_IE30                                                (ADC12IE30)
#define ADC12_B_IE31                                                (ADC12IE31)

//*****************************************************************************
//
// The following are values that can be passed to the interruptMask2 parameter
// for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
//
//*****************************************************************************
#define ADC12_B_INIE                                                (ADC12INIE)
#define ADC12_B_LOIE                                                (ADC12LOIE)
#define ADC12_B_HIIE                                                (ADC12HIIE)
#define ADC12_B_OVIE                                                (ADC12OVIE)
#define ADC12_B_TOVIE                                              (ADC12TOVIE)
#define ADC12_B_RDYIE                                              (ADC12RDYIE)

//*****************************************************************************
//
// The following are values that can be passed to the memoryInterruptFlagMask
// parameter for functions: ADC12_B_clearInterrupt(), and
// ADC12_B_getInterruptStatus().
//
//*****************************************************************************
#define ADC12_B_IFG0                                                (ADC12IFG0)
#define ADC12_B_IFG1                                                (ADC12IFG1)
#define ADC12_B_IFG2                                                (ADC12IFG2)
#define ADC12_B_IFG3                                                (ADC12IFG3)
#define ADC12_B_IFG4                                                (ADC12IFG4)
#define ADC12_B_IFG5                                                (ADC12IFG5)
#define ADC12_B_IFG6                                                (ADC12IFG6)
#define ADC12_B_IFG7                                                (ADC12IFG7)
#define ADC12_B_IFG8                                                (ADC12IFG8)
#define ADC12_B_IFG9                                                (ADC12IFG9)
#define ADC12_B_IFG10                                              (ADC12IFG10)
#define ADC12_B_IFG11                                              (ADC12IFG11)
#define ADC12_B_IFG12                                              (ADC12IFG12)
#define ADC12_B_IFG13                                              (ADC12IFG13)
#define ADC12_B_IFG14                                              (ADC12IFG14)
#define ADC12_B_IFG15                                              (ADC12IFG15)
#define ADC12_B_IFG16                                              (ADC12IFG16)
#define ADC12_B_IFG17                                              (ADC12IFG17)
#define ADC12_B_IFG18                                              (ADC12IFG18)
#define ADC12_B_IFG19                                              (ADC12IFG19)
#define ADC12_B_IFG20                                              (ADC12IFG20)
#define ADC12_B_IFG21                                              (ADC12IFG21)
#define ADC12_B_IFG22                                              (ADC12IFG22)
#define ADC12_B_IFG23                                              (ADC12IFG23)
#define ADC12_B_IFG24                                              (ADC12IFG24)
#define ADC12_B_IFG25                                              (ADC12IFG25)
#define ADC12_B_IFG26                                              (ADC12IFG26)
#define ADC12_B_IFG27                                              (ADC12IFG27)
#define ADC12_B_IFG28                                              (ADC12IFG28)
#define ADC12_B_IFG29                                              (ADC12IFG29)
#define ADC12_B_IFG30                                              (ADC12IFG30)
#define ADC12_B_IFG31                                              (ADC12IFG31)
#define ADC12_B_INIFG                                              (ADC12INIFG)
#define ADC12_B_LOIFG                                              (ADC12LOIFG)
#define ADC12_B_HIIFG                                              (ADC12HIIFG)
#define ADC12_B_OVIFG                                              (ADC12OVIFG)
#define ADC12_B_TOVIFG                                            (ADC12TOVIFG)
#define ADC12_B_RDYIFG                                            (ADC12RDYIFG)

//*****************************************************************************
//
// The following are values that can be passed to the startingMemoryBufferIndex
// parameter for functions: ADC12_B_startConversion().
//
//*****************************************************************************
#define ADC12_B_START_AT_ADC12MEM0                           (ADC12CSTARTADD_0)
#define ADC12_B_START_AT_ADC12MEM1                           (ADC12CSTARTADD_1)
#define ADC12_B_START_AT_ADC12MEM2                           (ADC12CSTARTADD_2)
#define ADC12_B_START_AT_ADC12MEM3                           (ADC12CSTARTADD_3)
#define ADC12_B_START_AT_ADC12MEM4                           (ADC12CSTARTADD_4)
#define ADC12_B_START_AT_ADC12MEM5                           (ADC12CSTARTADD_5)
#define ADC12_B_START_AT_ADC12MEM6                           (ADC12CSTARTADD_6)
#define ADC12_B_START_AT_ADC12MEM7                           (ADC12CSTARTADD_7)
#define ADC12_B_START_AT_ADC12MEM8                           (ADC12CSTARTADD_8)
#define ADC12_B_START_AT_ADC12MEM9                           (ADC12CSTARTADD_9)
#define ADC12_B_START_AT_ADC12MEM10                         (ADC12CSTARTADD_10)
#define ADC12_B_START_AT_ADC12MEM11                         (ADC12CSTARTADD_11)
#define ADC12_B_START_AT_ADC12MEM12                         (ADC12CSTARTADD_12)
#define ADC12_B_START_AT_ADC12MEM13                         (ADC12CSTARTADD_13)
#define ADC12_B_START_AT_ADC12MEM14                         (ADC12CSTARTADD_14)
#define ADC12_B_START_AT_ADC12MEM15                         (ADC12CSTARTADD_15)
#define ADC12_B_START_AT_ADC12MEM16                         (ADC12CSTARTADD_16)
#define ADC12_B_START_AT_ADC12MEM17                         (ADC12CSTARTADD_17)
#define ADC12_B_START_AT_ADC12MEM18                         (ADC12CSTARTADD_18)
#define ADC12_B_START_AT_ADC12MEM19                         (ADC12CSTARTADD_19)
#define ADC12_B_START_AT_ADC12MEM20                         (ADC12CSTARTADD_20)
#define ADC12_B_START_AT_ADC12MEM21                         (ADC12CSTARTADD_21)
#define ADC12_B_START_AT_ADC12MEM22                         (ADC12CSTARTADD_22)
#define ADC12_B_START_AT_ADC12MEM23                         (ADC12CSTARTADD_23)
#define ADC12_B_START_AT_ADC12MEM24                         (ADC12CSTARTADD_24)
#define ADC12_B_START_AT_ADC12MEM25                         (ADC12CSTARTADD_25)
#define ADC12_B_START_AT_ADC12MEM26                         (ADC12CSTARTADD_26)
#define ADC12_B_START_AT_ADC12MEM27                         (ADC12CSTARTADD_27)
#define ADC12_B_START_AT_ADC12MEM28                         (ADC12CSTARTADD_28)
#define ADC12_B_START_AT_ADC12MEM29                         (ADC12CSTARTADD_29)
#define ADC12_B_START_AT_ADC12MEM30                         (ADC12CSTARTADD_30)
#define ADC12_B_START_AT_ADC12MEM31                         (ADC12CSTARTADD_31)

//*****************************************************************************
//
// The following are values that can be passed to the
// conversionSequenceModeSelect parameter for functions:
// ADC12_B_startConversion().
//
//*****************************************************************************
#define ADC12_B_SINGLECHANNEL                                   (ADC12CONSEQ_0)
#define ADC12_B_SEQOFCHANNELS                                   (ADC12CONSEQ_1)
#define ADC12_B_REPEATED_SINGLECHANNEL                          (ADC12CONSEQ_2)
#define ADC12_B_REPEATED_SEQOFCHANNELS                          (ADC12CONSEQ_3)

//*****************************************************************************
//
// The following are values that can be passed to the preempt parameter for
// functions: ADC12_B_disableConversions().
//
//*****************************************************************************
#define ADC12_B_COMPLETECONVERSION                                        false
#define ADC12_B_PREEMPTCONVERSION                                          true

//*****************************************************************************
//
// The following are values that can be passed to the resolutionSelect
// parameter for functions: ADC12_B_setResolution().
//
//*****************************************************************************
#define ADC12_B_RESOLUTION_8BIT                                (ADC12RES__8BIT)
#define ADC12_B_RESOLUTION_10BIT                              (ADC12RES__10BIT)
#define ADC12_B_RESOLUTION_12BIT                              (ADC12RES__12BIT)

//*****************************************************************************
//
// The following are values that can be passed to the invertedSignal parameter
// for functions: ADC12_B_setSampleHoldSignalInversion().
//
//*****************************************************************************
#define ADC12_B_NONINVERTEDSIGNAL                                (!(ADC12ISSH))
#define ADC12_B_INVERTEDSIGNAL                                      (ADC12ISSH)

//*****************************************************************************
//
// The following are values that can be passed to the readBackFormat parameter
// for functions: ADC12_B_setDataReadBackFormat().
//
//*****************************************************************************
#define ADC12_B_UNSIGNED_BINARY                                    (!(ADC12DF))
#define ADC12_B_SIGNED_2SCOMPLEMENT                                   (ADC12DF)

//*****************************************************************************
//
// The following are values that can be passed to the powerMode parameter for
// functions: ADC12_B_setAdcPowerMode().
//
//*****************************************************************************
#define ADC12_B_REGULARPOWERMODE                                (!(ADC12PWRMD))
#define ADC12_B_LOWPOWERMODE                                       (ADC12PWRMD)

//*****************************************************************************
//
// The following are values that can be passed toThe following are values that
// can be returned by the ADC12_B_isBusy() function.
//
//*****************************************************************************
#define ADC12_B_NOTBUSY                                                    0x00
#define ADC12_B_BUSY                                                  ADC12BUSY

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************

//*****************************************************************************
//
//! \brief Initializes the ADC12B Module.
//!
//! This function initializes the ADC module to allow for analog-to-digital
//! conversions. Specifically this function sets up the sample-and-hold signal
//! and clock sources for the ADC core to use for conversions. Upon successful
//! completion of the initialization all of the ADC control registers will be
//! reset, excluding the memory controls and reference module bits, the given
//! parameters will be set, and the ADC core will be turned on (Note, that the
//! ADC core only draws power during conversions and remains off when not
//! converting).Note that sample/hold signal sources are device dependent. Note
//! that if re-initializing the ADC after starting a conversion with the
//! startConversion() function, the disableConversion() must be called BEFORE
//! this function can be called.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param param is the pointer to struct for initialization.
//!
//! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
//
//*****************************************************************************
extern bool ADC12_B_init(uint16_t baseAddress,
                         ADC12_B_initParam *param);

//*****************************************************************************
//
//! \brief Enables the ADC12B block.
//!
//! This will enable operation of the ADC12B block.
//!
//! \param baseAddress is the base address of the ADC12B module.
//!
//! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_enable(uint16_t baseAddress);

//*****************************************************************************
//
//! \brief Disables the ADC12B block.
//!
//! This will disable operation of the ADC12B block.
//!
//! \param baseAddress is the base address of the ADC12B module.
//!
//! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_disable(uint16_t baseAddress);

//*****************************************************************************
//
//! \brief Sets up and enables the Sampling Timer Pulse Mode.
//!
//! This function sets up the sampling timer pulse mode which allows the
//! sample/hold signal to trigger a sampling timer to sample-and-hold an input
//! signal for a specified number of clock cycles without having to hold the
//! sample/hold signal for the entire period of sampling. Note that if a
//! conversion has been started with the startConversion() function, then a
//! call to disableConversions() is required before this function may be
//! called.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param clockCycleHoldCountLowMem sets the amount of clock cycles to sample-
//!        and-hold for the higher memory buffers 0-7.
//!        Valid values are:
//!        - \b ADC12_B_CYCLEHOLD_4_CYCLES [Default]
//!        - \b ADC12_B_CYCLEHOLD_8_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_16_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_32_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_64_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_96_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_128_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_192_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_256_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_384_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_512_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_768_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_1024_CYCLES
//!        \n Modified bits are \b ADC12SHT0x of \b ADC12CTL0 register.
//! \param clockCycleHoldCountHighMem sets the amount of clock cycles to
//!        sample-and-hold for the higher memory buffers 8-15.
//!        Valid values are:
//!        - \b ADC12_B_CYCLEHOLD_4_CYCLES [Default]
//!        - \b ADC12_B_CYCLEHOLD_8_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_16_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_32_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_64_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_96_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_128_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_192_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_256_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_384_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_512_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_768_CYCLES
//!        - \b ADC12_B_CYCLEHOLD_1024_CYCLES
//!        \n Modified bits are \b ADC12SHT1x of \b ADC12CTL0 register.
//! \param multipleSamplesEnabled allows multiple conversions to start without
//!        a trigger signal from the sample/hold signal
//!        Valid values are:
//!        - \b ADC12_B_MULTIPLESAMPLESDISABLE [Default] - a timer trigger will
//!           be needed to start every ADC conversion.
//!        - \b ADC12_B_MULTIPLESAMPLESENABLE - during a sequenced and/or
//!           repeated conversion mode, after the first conversion, no
//!           sample/hold signal is necessary to start subsequent sample/hold
//!           and convert processes.
//!        \n Modified bits are \b ADC12MSC of \b ADC12CTL0 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setupSamplingTimer(uint16_t baseAddress,
                                       uint16_t clockCycleHoldCountLowMem,
                                       uint16_t clockCycleHoldCountHighMem,
                                       uint16_t multipleSamplesEnabled);

//*****************************************************************************
//
//! \brief Disables Sampling Timer Pulse Mode.
//!
//! Disables the Sampling Timer Pulse Mode. Note that if a conversion has been
//! started with the startConversion() function, then a call to
//! disableConversions() is required before this function may be called.
//!
//! \param baseAddress is the base address of the ADC12B module.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_disableSamplingTimer(uint16_t baseAddress);

//*****************************************************************************
//
//! \brief Configures the controls of the selected memory buffer.
//!
//! Maps an input signal conversion into the selected memory buffer, as well as
//! the positive and negative reference voltages for each conversion being
//! stored into this memory buffer. If the internal reference is used for the
//! positive reference voltage, the internal REF module must be used to control
//! the voltage level. Note that if a conversion has been started with the
//! startConversion() function, then a call to disableConversions() is required
//! before this function may be called.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param param is the pointer to struct for ADC12B memory configuration.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_configureMemory(uint16_t baseAddress,
                                    ADC12_B_configureMemoryParam *param);

//*****************************************************************************
//
//! \brief Sets the high and low threshold for the window comparator feature.
//!
//! Sets the high and low threshold for the window comparator feature. Use the
//! ADC12HIIE, ADC12INIE, ADC12LOIE interrupts to utilize this feature.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param highThreshold is the upper bound that could trip an interrupt for
//!        the window comparator.
//! \param lowThreshold is the lower bound that could trip on interrupt for the
//!        window comparator.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setWindowCompAdvanced(uint16_t baseAddress,
                                          uint16_t highThreshold,
                                          uint16_t lowThreshold);

//*****************************************************************************
//
//! \brief Enables selected ADC12B interrupt sources.
//!
//! Enables the indicated ADC12B interrupt sources.  Only the sources that are
//! enabled can be reflected to the processor interrupt; disabled sources have
//! no effect on the processor. <b>Does not clear interrupt flags.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param interruptMask0 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be enabled. If the desired interrupt is not
//!        available in the selection for interruptMask0, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_IE0
//!        - \b ADC12_B_IE1
//!        - \b ADC12_B_IE2
//!        - \b ADC12_B_IE3
//!        - \b ADC12_B_IE4
//!        - \b ADC12_B_IE5
//!        - \b ADC12_B_IE6
//!        - \b ADC12_B_IE7
//!        - \b ADC12_B_IE8
//!        - \b ADC12_B_IE9
//!        - \b ADC12_B_IE10
//!        - \b ADC12_B_IE11
//!        - \b ADC12_B_IE12
//!        - \b ADC12_B_IE13
//!        - \b ADC12_B_IE14
//!        - \b ADC12_B_IE15
//! \param interruptMask1 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be enabled. If the desired interrupt is not
//!        available in the selection for interruptMask1, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_IE16
//!        - \b ADC12_B_IE17
//!        - \b ADC12_B_IE18
//!        - \b ADC12_B_IE19
//!        - \b ADC12_B_IE20
//!        - \b ADC12_B_IE21
//!        - \b ADC12_B_IE22
//!        - \b ADC12_B_IE23
//!        - \b ADC12_B_IE24
//!        - \b ADC12_B_IE25
//!        - \b ADC12_B_IE26
//!        - \b ADC12_B_IE27
//!        - \b ADC12_B_IE28
//!        - \b ADC12_B_IE29
//!        - \b ADC12_B_IE30
//!        - \b ADC12_B_IE31
//! \param interruptMask2 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be enabled. If the desired interrupt is not
//!        available in the selection for interruptMask2, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
//!           register is either greater than the ADC12LO or lower than the
//!           ADC12HI threshold. GIE bit must be set to enable the interrupt.
//!        - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
//!           lower limit interrupt of the window comparator for the result
//!           register. GIE bit must be set to enable the interrupt.
//!        - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
//!           limit of the window comparator for the result register. GIE bit
//!           must be set to enable the interrupt.
//!        - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
//!           to save to a memory buffer that has not been read out yet. GIE
//!           bit must be set to enable the interrupt.
//!        - \b ADC12_B_TOVIE - enable for a conversion that is about to start
//!           before the previous conversion has been completed. GIE bit must
//!           be set to enable the interrupt.
//!        - \b ADC12_B_RDYIE - enable for the local buffered reference ready
//!           signal. GIE bit must be set to enable the interrupt.
//!
//! Modified bits of \b ADC12IERx register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_enableInterrupt(uint16_t baseAddress,
                                    uint16_t interruptMask0,
                                    uint16_t interruptMask1,
                                    uint16_t interruptMask2);

//*****************************************************************************
//
//! \brief Disables selected ADC12B interrupt sources.
//!
//! Disables the indicated ADC12B interrupt sources. Only the sources that are
//! enabled can be reflected to the processor interrupt; disabled sources have
//! no effect on the processor.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param interruptMask0 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be disabled. If the desired interrupt is not
//!        available in the selection for interruptMask0, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_IE0
//!        - \b ADC12_B_IE1
//!        - \b ADC12_B_IE2
//!        - \b ADC12_B_IE3
//!        - \b ADC12_B_IE4
//!        - \b ADC12_B_IE5
//!        - \b ADC12_B_IE6
//!        - \b ADC12_B_IE7
//!        - \b ADC12_B_IE8
//!        - \b ADC12_B_IE9
//!        - \b ADC12_B_IE10
//!        - \b ADC12_B_IE11
//!        - \b ADC12_B_IE12
//!        - \b ADC12_B_IE13
//!        - \b ADC12_B_IE14
//!        - \b ADC12_B_IE15
//! \param interruptMask1 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be disabled. If the desired interrupt is not
//!        available in the selection for interruptMask1, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_IE16
//!        - \b ADC12_B_IE17
//!        - \b ADC12_B_IE18
//!        - \b ADC12_B_IE19
//!        - \b ADC12_B_IE20
//!        - \b ADC12_B_IE21
//!        - \b ADC12_B_IE22
//!        - \b ADC12_B_IE23
//!        - \b ADC12_B_IE24
//!        - \b ADC12_B_IE25
//!        - \b ADC12_B_IE26
//!        - \b ADC12_B_IE27
//!        - \b ADC12_B_IE28
//!        - \b ADC12_B_IE29
//!        - \b ADC12_B_IE30
//!        - \b ADC12_B_IE31
//! \param interruptMask2 is the bit mask of the memory buffer and overflow
//!        interrupt sources to be disabled. If the desired interrupt is not
//!        available in the selection for interruptMask2, then simply pass in a
//!        '0' for this value.
//!        Valid values are:
//!        - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
//!           register is either greater than the ADC12LO or lower than the
//!           ADC12HI threshold. GIE bit must be set to enable the interrupt.
//!        - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
//!           lower limit interrupt of the window comparator for the result
//!           register. GIE bit must be set to enable the interrupt.
//!        - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
//!           limit of the window comparator for the result register. GIE bit
//!           must be set to enable the interrupt.
//!        - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
//!           to save to a memory buffer that has not been read out yet. GIE
//!           bit must be set to enable the interrupt.
//!        - \b ADC12_B_TOVIE - enable for a conversion that is about to start
//!           before the previous conversion has been completed. GIE bit must
//!           be set to enable the interrupt.
//!        - \b ADC12_B_RDYIE - enable for the local buffered reference ready
//!           signal. GIE bit must be set to enable the interrupt.
//!
//! Modified bits of \b ADC12IERx register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_disableInterrupt(uint16_t baseAddress,
                                     uint16_t interruptMask0,
                                     uint16_t interruptMask1,
                                     uint16_t interruptMask2);

//*****************************************************************************
//
//! \brief Clears ADC12B selected interrupt flags.
//!
//! Modified registers are ADC12IFG .
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
//!        interrupt register to update
//! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
//!        overflow interrupt flags to be cleared.
//!        Valid values are:
//!        - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
//!        - \b ADC12_B_IFG1
//!        - \b ADC12_B_IFG2
//!        - \b ADC12_B_IFG3
//!        - \b ADC12_B_IFG4
//!        - \b ADC12_B_IFG5
//!        - \b ADC12_B_IFG6
//!        - \b ADC12_B_IFG7
//!        - \b ADC12_B_IFG8
//!        - \b ADC12_B_IFG9
//!        - \b ADC12_B_IFG10
//!        - \b ADC12_B_IFG11
//!        - \b ADC12_B_IFG12
//!        - \b ADC12_B_IFG13
//!        - \b ADC12_B_IFG14
//!        - \b ADC12_B_IFG15
//!        - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
//!        - \b ADC12_B_IFG17
//!        - \b ADC12_B_IFG18
//!        - \b ADC12_B_IFG19
//!        - \b ADC12_B_IFG20
//!        - \b ADC12_B_IFG21
//!        - \b ADC12_B_IFG22
//!        - \b ADC12_B_IFG23
//!        - \b ADC12_B_IFG24
//!        - \b ADC12_B_IFG25
//!        - \b ADC12_B_IFG26
//!        - \b ADC12_B_IFG27
//!        - \b ADC12_B_IFG28
//!        - \b ADC12_B_IFG29
//!        - \b ADC12_B_IFG30
//!        - \b ADC12_B_IFG31
//!        - \b ADC12_B_INIFG - interruptRegisterChoice = 2
//!        - \b ADC12_B_LOIFG
//!        - \b ADC12_B_HIIFG
//!        - \b ADC12_B_OVIFG
//!        - \b ADC12_B_TOVIFG
//!        - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
//!           cleared, so that it no longer asserts. The memory buffer
//!           interrupt flags are only cleared when the memory buffer is
//!           accessed. Note that the overflow interrupts do not have an
//!           interrupt flag to clear; they must be accessed directly from the
//!           interrupt vector.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_clearInterrupt(uint16_t baseAddress,
                                   uint8_t interruptRegisterChoice,
                                   uint16_t memoryInterruptFlagMask);

//*****************************************************************************
//
//! \brief Returns the status of the selected memory interrupt flags.
//!
//! Returns the status of the selected memory interrupt flags. Note that the
//! overflow interrupts do not have an interrupt flag to clear; they must be
//! accessed directly from the interrupt vector.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
//!        interrupt register to update
//! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
//!        overflow interrupt flags to be cleared.
//!        Valid values are:
//!        - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
//!        - \b ADC12_B_IFG1
//!        - \b ADC12_B_IFG2
//!        - \b ADC12_B_IFG3
//!        - \b ADC12_B_IFG4
//!        - \b ADC12_B_IFG5
//!        - \b ADC12_B_IFG6
//!        - \b ADC12_B_IFG7
//!        - \b ADC12_B_IFG8
//!        - \b ADC12_B_IFG9
//!        - \b ADC12_B_IFG10
//!        - \b ADC12_B_IFG11
//!        - \b ADC12_B_IFG12
//!        - \b ADC12_B_IFG13
//!        - \b ADC12_B_IFG14
//!        - \b ADC12_B_IFG15
//!        - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
//!        - \b ADC12_B_IFG17
//!        - \b ADC12_B_IFG18
//!        - \b ADC12_B_IFG19
//!        - \b ADC12_B_IFG20
//!        - \b ADC12_B_IFG21
//!        - \b ADC12_B_IFG22
//!        - \b ADC12_B_IFG23
//!        - \b ADC12_B_IFG24
//!        - \b ADC12_B_IFG25
//!        - \b ADC12_B_IFG26
//!        - \b ADC12_B_IFG27
//!        - \b ADC12_B_IFG28
//!        - \b ADC12_B_IFG29
//!        - \b ADC12_B_IFG30
//!        - \b ADC12_B_IFG31
//!        - \b ADC12_B_INIFG - interruptRegisterChoice = 2
//!        - \b ADC12_B_LOIFG
//!        - \b ADC12_B_HIIFG
//!        - \b ADC12_B_OVIFG
//!        - \b ADC12_B_TOVIFG
//!        - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
//!           cleared, so that it no longer asserts. The memory buffer
//!           interrupt flags are only cleared when the memory buffer is
//!           accessed. Note that the overflow interrupts do not have an
//!           interrupt flag to clear; they must be accessed directly from the
//!           interrupt vector.
//!
//! \return The current interrupt flag status for the corresponding mask.
//
//*****************************************************************************
extern uint16_t ADC12_B_getInterruptStatus(uint16_t baseAddress,
                                           uint8_t interruptRegisterChoice,
                                           uint16_t memoryInterruptFlagMask);

//*****************************************************************************
//
//! \brief Enables/Starts an Analog-to-Digital Conversion.
//!
//! Enables/starts the conversion process of the ADC. If the sample/hold signal
//! source chosen during initialization was ADC12OSC, then the conversion is
//! started immediately, otherwise the chosen sample/hold signal source starts
//! the conversion by a rising edge of the signal. Keep in mind when selecting
//! conversion modes, that for sequenced and/or repeated modes, to keep the
//! sample/hold-and-convert process continuing without a trigger from the
//! sample/hold signal source, the multiple samples must be enabled using the
//! ADC12_B_setupSamplingTimer() function. Note that after this function is
//! called, the ADC12_B_stopConversions() has to be called to re-initialize the
//! ADC, reconfigure a memory buffer control, enable/disable the sampling
//! timer, or to change the internal reference voltage.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param startingMemoryBufferIndex is the memory buffer that will hold the
//!        first or only conversion.
//!        Valid values are:
//!        - \b ADC12_B_START_AT_ADC12MEM0 [Default]
//!        - \b ADC12_B_START_AT_ADC12MEM1
//!        - \b ADC12_B_START_AT_ADC12MEM2
//!        - \b ADC12_B_START_AT_ADC12MEM3
//!        - \b ADC12_B_START_AT_ADC12MEM4
//!        - \b ADC12_B_START_AT_ADC12MEM5
//!        - \b ADC12_B_START_AT_ADC12MEM6
//!        - \b ADC12_B_START_AT_ADC12MEM7
//!        - \b ADC12_B_START_AT_ADC12MEM8
//!        - \b ADC12_B_START_AT_ADC12MEM9
//!        - \b ADC12_B_START_AT_ADC12MEM10
//!        - \b ADC12_B_START_AT_ADC12MEM11
//!        - \b ADC12_B_START_AT_ADC12MEM12
//!        - \b ADC12_B_START_AT_ADC12MEM13
//!        - \b ADC12_B_START_AT_ADC12MEM14
//!        - \b ADC12_B_START_AT_ADC12MEM15
//!        - \b ADC12_B_START_AT_ADC12MEM16
//!        - \b ADC12_B_START_AT_ADC12MEM17
//!        - \b ADC12_B_START_AT_ADC12MEM18
//!        - \b ADC12_B_START_AT_ADC12MEM19
//!        - \b ADC12_B_START_AT_ADC12MEM20
//!        - \b ADC12_B_START_AT_ADC12MEM21
//!        - \b ADC12_B_START_AT_ADC12MEM22
//!        - \b ADC12_B_START_AT_ADC12MEM23
//!        - \b ADC12_B_START_AT_ADC12MEM24
//!        - \b ADC12_B_START_AT_ADC12MEM25
//!        - \b ADC12_B_START_AT_ADC12MEM26
//!        - \b ADC12_B_START_AT_ADC12MEM27
//!        - \b ADC12_B_START_AT_ADC12MEM28
//!        - \b ADC12_B_START_AT_ADC12MEM29
//!        - \b ADC12_B_START_AT_ADC12MEM30
//!        - \b ADC12_B_START_AT_ADC12MEM31
//!        \n Modified bits are \b ADC12CSTARTADDx of \b ADC12CTL1 register.
//! \param conversionSequenceModeSelect determines the ADC operating mode.
//!        Valid values are:
//!        - \b ADC12_B_SINGLECHANNEL [Default] - one-time conversion of a
//!           single channel into a single memory buffer.
//!        - \b ADC12_B_SEQOFCHANNELS - one time conversion of multiple
//!           channels into the specified starting memory buffer and each
//!           subsequent memory buffer up until the conversion is stored in a
//!           memory buffer dedicated as the end-of-sequence by the memory's
//!           control register.
//!        - \b ADC12_B_REPEATED_SINGLECHANNEL - repeated conversions of one
//!           channel into a single memory buffer.
//!        - \b ADC12_B_REPEATED_SEQOFCHANNELS - repeated conversions of
//!           multiple channels into the specified starting memory buffer and
//!           each subsequent memory buffer up until the conversion is stored
//!           in a memory buffer dedicated as the end-of-sequence by the
//!           memory's control register.
//!        \n Modified bits are \b ADC12CONSEQx of \b ADC12CTL1 register.
//!
//! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_startConversion(uint16_t baseAddress,
                                    uint16_t startingMemoryBufferIndex,
                                    uint8_t conversionSequenceModeSelect);

//*****************************************************************************
//
//! \brief Disables the ADC from converting any more signals.
//!
//! Disables the ADC from converting any more signals. If there is a conversion
//! in progress, this function can stop it immediately if the preempt parameter
//! is set as ADC12_B_PREEMPTCONVERSION, by changing the conversion mode to
//! single-channel, single-conversion and disabling conversions. If the
//! conversion mode is set as single-channel, single-conversion and this
//! function is called without preemption, then the ADC core conversion status
//! is polled until the conversion is complete before disabling conversions to
//! prevent unpredictable data. If the ADC12_B_startConversion() has been
//! called, then this function has to be called to re-initialize the ADC,
//! reconfigure a memory buffer control, enable/disable the sampling pulse
//! mode, or change the internal reference voltage.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param preempt specifies if the current conversion should be preemptively
//!        stopped before the end of the conversion.
//!        Valid values are:
//!        - \b ADC12_B_COMPLETECONVERSION - Allows the ADC12B to end the
//!           current conversion before disabling conversions.
//!        - \b ADC12_B_PREEMPTCONVERSION - Stops the ADC12B immediately, with
//!           unpredictable results of the current conversion.
//!
//! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_disableConversions(uint16_t baseAddress,
                                       bool preempt);

//*****************************************************************************
//
//! \brief Returns the raw contents of the specified memory buffer.
//!
//! Returns the raw contents of the specified memory buffer. The format of the
//! content depends on the read-back format of the data: if the data is in
//! signed 2's complement format then the contents in the memory buffer will be
//! left-justified with the least-significant bits as 0's, whereas if the data
//! is in unsigned format then the contents in the memory buffer will be right-
//! justified with the most-significant bits as 0's.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param memoryBufferIndex is the specified memory buffer to read.
//!        Valid values are:
//!        - \b ADC12_B_MEMORY_0
//!        - \b ADC12_B_MEMORY_1
//!        - \b ADC12_B_MEMORY_2
//!        - \b ADC12_B_MEMORY_3
//!        - \b ADC12_B_MEMORY_4
//!        - \b ADC12_B_MEMORY_5
//!        - \b ADC12_B_MEMORY_6
//!        - \b ADC12_B_MEMORY_7
//!        - \b ADC12_B_MEMORY_8
//!        - \b ADC12_B_MEMORY_9
//!        - \b ADC12_B_MEMORY_10
//!        - \b ADC12_B_MEMORY_11
//!        - \b ADC12_B_MEMORY_12
//!        - \b ADC12_B_MEMORY_13
//!        - \b ADC12_B_MEMORY_14
//!        - \b ADC12_B_MEMORY_15
//!        - \b ADC12_B_MEMORY_16
//!        - \b ADC12_B_MEMORY_17
//!        - \b ADC12_B_MEMORY_18
//!        - \b ADC12_B_MEMORY_19
//!        - \b ADC12_B_MEMORY_20
//!        - \b ADC12_B_MEMORY_21
//!        - \b ADC12_B_MEMORY_22
//!        - \b ADC12_B_MEMORY_23
//!        - \b ADC12_B_MEMORY_24
//!        - \b ADC12_B_MEMORY_25
//!        - \b ADC12_B_MEMORY_26
//!        - \b ADC12_B_MEMORY_27
//!        - \b ADC12_B_MEMORY_28
//!        - \b ADC12_B_MEMORY_29
//!        - \b ADC12_B_MEMORY_30
//!        - \b ADC12_B_MEMORY_31
//!
//! \return A signed integer of the contents of the specified memory buffer.
//
//*****************************************************************************
extern uint16_t ADC12_B_getResults(uint16_t baseAddress,
                                   uint8_t memoryBufferIndex);

//*****************************************************************************
//
//! \brief Use to change the resolution of the converted data.
//!
//! This function can be used to change the resolution of the converted data
//! from the default of 12-bits.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param resolutionSelect determines the resolution of the converted data.
//!        Valid values are:
//!        - \b ADC12_B_RESOLUTION_8BIT
//!        - \b ADC12_B_RESOLUTION_10BIT
//!        - \b ADC12_B_RESOLUTION_12BIT [Default]
//!        \n Modified bits are \b ADC12RESx of \b ADC12CTL2 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setResolution(uint16_t baseAddress,
                                  uint8_t resolutionSelect);

//*****************************************************************************
//
//! \brief Use to invert or un-invert the sample/hold signal.
//!
//! This function can be used to invert or un-invert the sample/hold signal.
//! Note that if a conversion has been started with the startConversion()
//! function, then a call to disableConversions() is required before this
//! function may be called.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param invertedSignal set if the sample/hold signal should be inverted
//!        Valid values are:
//!        - \b ADC12_B_NONINVERTEDSIGNAL [Default] - a sample-and-hold of an
//!           input signal for conversion will be started on a rising edge of
//!           the sample/hold signal.
//!        - \b ADC12_B_INVERTEDSIGNAL - a sample-and-hold of an input signal
//!           for conversion will be started on a falling edge of the
//!           sample/hold signal.
//!        \n Modified bits are \b ADC12ISSH of \b ADC12CTL1 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setSampleHoldSignalInversion(uint16_t baseAddress,
                                                 uint16_t invertedSignal);

//*****************************************************************************
//
//! \brief Use to set the read-back format of the converted data.
//!
//! Sets the format of the converted data: how it will be stored into the
//! memory buffer, and how it should be read back. The format can be set as
//! right-justified (default), which indicates that the number will be
//! unsigned, or left-justified, which indicates that the number will be signed
//! in 2's complement format. This change affects all memory buffers for
//! subsequent conversions.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param readBackFormat is the specified format to store the conversions in
//!        the memory buffer.
//!        Valid values are:
//!        - \b ADC12_B_UNSIGNED_BINARY [Default]
//!        - \b ADC12_B_SIGNED_2SCOMPLEMENT
//!        \n Modified bits are \b ADC12DF of \b ADC12CTL2 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setDataReadBackFormat(uint16_t baseAddress,
                                          uint8_t readBackFormat);

//*****************************************************************************
//
//! \brief Use to set the ADC's power conservation mode if the sampling rate is
//! at 50-ksps or less.
//!
//! Sets ADC's power mode. If the user has a sampling rate greater than
//! 50-ksps, then he/she can only enable ADC12_B_REGULARPOWERMODE. If the
//! sampling rate is 50-ksps or less, the user can enable ADC12_B_LOWPOWERMODE
//! granting additional power savings.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param powerMode is the specified maximum sampling rate.
//!        Valid values are:
//!        - \b ADC12_B_REGULARPOWERMODE [Default] - If sampling rate is
//!           greater than 50-ksps, there is no power saving feature available.
//!        - \b ADC12_B_LOWPOWERMODE - If sampling rate is less than or equal
//!           to 50-ksps, select this value to save power
//!        \n Modified bits are \b ADC12SR of \b ADC12CTL2 register.
//!
//! \return None
//
//*****************************************************************************
extern void ADC12_B_setAdcPowerMode(uint16_t baseAddress,
                                    uint8_t powerMode);

//*****************************************************************************
//
//! \brief Returns the address of the specified memory buffer for the DMA
//! module.
//!
//! Returns the address of the specified memory buffer. This can be used in
//! conjunction with the DMA to store the converted data directly to memory.
//!
//! \param baseAddress is the base address of the ADC12B module.
//! \param memoryIndex is the memory buffer to return the address of.
//!        Valid values are:
//!        - \b ADC12_B_MEMORY_0
//!        - \b ADC12_B_MEMORY_1
//!        - \b ADC12_B_MEMORY_2
//!        - \b ADC12_B_MEMORY_3
//!        - \b ADC12_B_MEMORY_4
//!        - \b ADC12_B_MEMORY_5
//!        - \b ADC12_B_MEMORY_6
//!        - \b ADC12_B_MEMORY_7
//!        - \b ADC12_B_MEMORY_8
//!        - \b ADC12_B_MEMORY_9
//!        - \b ADC12_B_MEMORY_10
//!        - \b ADC12_B_MEMORY_11
//!        - \b ADC12_B_MEMORY_12
//!        - \b ADC12_B_MEMORY_13
//!        - \b ADC12_B_MEMORY_14
//!        - \b ADC12_B_MEMORY_15
//!        - \b ADC12_B_MEMORY_16
//!        - \b ADC12_B_MEMORY_17
//!        - \b ADC12_B_MEMORY_18
//!        - \b ADC12_B_MEMORY_19
//!        - \b ADC12_B_MEMORY_20
//!        - \b ADC12_B_MEMORY_21
//!        - \b ADC12_B_MEMORY_22
//!        - \b ADC12_B_MEMORY_23
//!        - \b ADC12_B_MEMORY_24
//!        - \b ADC12_B_MEMORY_25
//!        - \b ADC12_B_MEMORY_26
//!        - \b ADC12_B_MEMORY_27
//!        - \b ADC12_B_MEMORY_28
//!        - \b ADC12_B_MEMORY_29
//!        - \b ADC12_B_MEMORY_30
//!        - \b ADC12_B_MEMORY_31
//!
//! \return address of the specified memory buffer
//
//*****************************************************************************
extern uint32_t ADC12_B_getMemoryAddressForDMA(uint16_t baseAddress,
                                               uint8_t memoryIndex);

//*****************************************************************************
//
//! \brief Returns the busy status of the ADC12B core.
//!
//! Returns the status of the ADC core if there is a conversion currently
//! taking place.
//!
//! \param baseAddress is the base address of the ADC12B module.
//!
//! \return ADC12_B_BUSY or ADC12_B_NOTBUSY dependent if there is a conversion
//!         currently taking place.
//!         Return one of the following:
//!         - \b ADC12_B_NOTBUSY
//!         - \b ADC12_B_BUSY
//!         \n indicating if a conversion is taking place
//
//*****************************************************************************
extern uint8_t ADC12_B_isBusy(uint16_t baseAddress);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif
#endif // __MSP430WARE_ADC12_B_H__