MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.91.13.01
adc12_b.h
1 //*****************************************************************************
2 //
3 // adc12_b.h - Driver for the ADC12_B Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_ADC12_B_H__
8 #define __MSP430WARE_ADC12_B_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_ADC12_B__
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "inc/hw_memmap.h"
26 //*****************************************************************************
27 //
28 //! \brief Used in the ADC12_B_init() function as the param parameter.
29 //
30 //*****************************************************************************
31 typedef struct ADC12_B_initParam {
32  //! Is the signal that will trigger a sample-and-hold for an input signal
33  //! to be converted.
34  //! \n Valid values are:
35  //! - \b ADC12_B_SAMPLEHOLDSOURCE_SC [Default]
36  //! - \b ADC12_B_SAMPLEHOLDSOURCE_1
37  //! - \b ADC12_B_SAMPLEHOLDSOURCE_2
38  //! - \b ADC12_B_SAMPLEHOLDSOURCE_3
39  //! - \b ADC12_B_SAMPLEHOLDSOURCE_4
40  //! - \b ADC12_B_SAMPLEHOLDSOURCE_5
41  //! - \b ADC12_B_SAMPLEHOLDSOURCE_6
42  //! - \b ADC12_B_SAMPLEHOLDSOURCE_7 - This parameter is device specific and
43  //! sources should be found in the device's datasheet.
45  //! Selects the clock that will be used by the ADC12B core, and the
46  //! sampling timer if a sampling pulse mode is enabled.
47  //! \n Valid values are:
48  //! - \b ADC12_B_CLOCKSOURCE_ADC12OSC [Default] - MODOSC 5 MHz oscillator
49  //! from the UCS
50  //! - \b ADC12_B_CLOCKSOURCE_ACLK - The Auxiliary Clock
51  //! - \b ADC12_B_CLOCKSOURCE_MCLK - The Master Clock
52  //! - \b ADC12_B_CLOCKSOURCE_SMCLK - The Sub-Master Clock
54  //! Selects the amount that the clock will be divided.
55  //! \n Valid values are:
56  //! - \b ADC12_B_CLOCKDIVIDER_1 [Default]
57  //! - \b ADC12_B_CLOCKDIVIDER_2
58  //! - \b ADC12_B_CLOCKDIVIDER_3
59  //! - \b ADC12_B_CLOCKDIVIDER_4
60  //! - \b ADC12_B_CLOCKDIVIDER_5
61  //! - \b ADC12_B_CLOCKDIVIDER_6
62  //! - \b ADC12_B_CLOCKDIVIDER_7
63  //! - \b ADC12_B_CLOCKDIVIDER_8
65  //! Selects the amount that the clock will be predivided.
66  //! \n Valid values are:
67  //! - \b ADC12_B_CLOCKPREDIVIDER__1 [Default]
68  //! - \b ADC12_B_CLOCKPREDIVIDER__4
69  //! - \b ADC12_B_CLOCKPREDIVIDER__32
70  //! - \b ADC12_B_CLOCKPREDIVIDER__64
72  //! Selects what internal channel to map for ADC input channels
73  //! \n Valid values are:
74  //! - \b ADC12_B_MAPINTCH3
75  //! - \b ADC12_B_MAPINTCH2
76  //! - \b ADC12_B_MAPINTCH1
77  //! - \b ADC12_B_MAPINTCH0
78  //! - \b ADC12_B_TEMPSENSEMAP
79  //! - \b ADC12_B_BATTMAP
80  //! - \b ADC12_B_NOINTCH
83 
84 //*****************************************************************************
85 //
86 //! \brief Used in the ADC12_B_configureMemory() function as the param
87 //! parameter.
88 //
89 //*****************************************************************************
91  //! Is the selected memory buffer to set the configuration for.
92  //! \n Valid values are:
93  //! - \b ADC12_B_MEMORY_0
94  //! - \b ADC12_B_MEMORY_1
95  //! - \b ADC12_B_MEMORY_2
96  //! - \b ADC12_B_MEMORY_3
97  //! - \b ADC12_B_MEMORY_4
98  //! - \b ADC12_B_MEMORY_5
99  //! - \b ADC12_B_MEMORY_6
100  //! - \b ADC12_B_MEMORY_7
101  //! - \b ADC12_B_MEMORY_8
102  //! - \b ADC12_B_MEMORY_9
103  //! - \b ADC12_B_MEMORY_10
104  //! - \b ADC12_B_MEMORY_11
105  //! - \b ADC12_B_MEMORY_12
106  //! - \b ADC12_B_MEMORY_13
107  //! - \b ADC12_B_MEMORY_14
108  //! - \b ADC12_B_MEMORY_15
109  //! - \b ADC12_B_MEMORY_16
110  //! - \b ADC12_B_MEMORY_17
111  //! - \b ADC12_B_MEMORY_18
112  //! - \b ADC12_B_MEMORY_19
113  //! - \b ADC12_B_MEMORY_20
114  //! - \b ADC12_B_MEMORY_21
115  //! - \b ADC12_B_MEMORY_22
116  //! - \b ADC12_B_MEMORY_23
117  //! - \b ADC12_B_MEMORY_24
118  //! - \b ADC12_B_MEMORY_25
119  //! - \b ADC12_B_MEMORY_26
120  //! - \b ADC12_B_MEMORY_27
121  //! - \b ADC12_B_MEMORY_28
122  //! - \b ADC12_B_MEMORY_29
123  //! - \b ADC12_B_MEMORY_30
124  //! - \b ADC12_B_MEMORY_31
126  //! Is the input that will store the converted data into the specified
127  //! memory buffer.
128  //! \n Valid values are:
129  //! - \b ADC12_B_INPUT_A0 [Default]
130  //! - \b ADC12_B_INPUT_A1
131  //! - \b ADC12_B_INPUT_A2
132  //! - \b ADC12_B_INPUT_A3
133  //! - \b ADC12_B_INPUT_A4
134  //! - \b ADC12_B_INPUT_A5
135  //! - \b ADC12_B_INPUT_A6
136  //! - \b ADC12_B_INPUT_A7
137  //! - \b ADC12_B_INPUT_A8
138  //! - \b ADC12_B_INPUT_A9
139  //! - \b ADC12_B_INPUT_A10
140  //! - \b ADC12_B_INPUT_A11
141  //! - \b ADC12_B_INPUT_A12
142  //! - \b ADC12_B_INPUT_A13
143  //! - \b ADC12_B_INPUT_A14
144  //! - \b ADC12_B_INPUT_A15
145  //! - \b ADC12_B_INPUT_A16
146  //! - \b ADC12_B_INPUT_A17
147  //! - \b ADC12_B_INPUT_A18
148  //! - \b ADC12_B_INPUT_A19
149  //! - \b ADC12_B_INPUT_A20
150  //! - \b ADC12_B_INPUT_A21
151  //! - \b ADC12_B_INPUT_A22
152  //! - \b ADC12_B_INPUT_A23
153  //! - \b ADC12_B_INPUT_A24
154  //! - \b ADC12_B_INPUT_A25
155  //! - \b ADC12_B_INPUT_A26
156  //! - \b ADC12_B_INPUT_A27
157  //! - \b ADC12_B_INPUT_A28
158  //! - \b ADC12_B_INPUT_A29
159  //! - \b ADC12_B_INPUT_TCMAP
160  //! - \b ADC12_B_INPUT_BATMAP
162  //! Is the reference voltage source to set as the upper/lower limits for
163  //! the conversion stored in the specified memory.
164  //! \n Valid values are:
165  //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_VSS [Default]
166  //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS
167  //! - \b ADC12_B_VREFPOS_EXTNEG_VREFNEG_VSS
168  //! - \b ADC12_B_VREFPOS_EXTBUF_VREFNEG_VSS
169  //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_VSS
170  //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTBUF
171  //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTPOS
172  //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTPOS
173  //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_INTBUF
174  //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_INTBUF
175  //! - \b ADC12_B_VREFPOS_AVCC_VREFNEG_EXTNEG
176  //! - \b ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTNEG
177  //! - \b ADC12_B_VREFPOS_EXTPOS_VREFNEG_EXTNEG
178  //! - \b ADC12_B_VREFPOS_EXTBUF_VREFNEG_EXTNEG
180  //! Indicates that the specified memory buffer will be the end of the
181  //! sequence if a sequenced conversion mode is selected
182  //! \n Valid values are:
183  //! - \b ADC12_B_NOTENDOFSEQUENCE [Default] - The specified memory buffer
184  //! will NOT be the end of the sequence OR a sequenced conversion mode
185  //! is not selected.
186  //! - \b ADC12_B_ENDOFSEQUENCE - The specified memory buffer will be the
187  //! end of the sequence.
188  uint16_t endOfSequence;
189  //! Sets the window comparator mode
190  //! \n Valid values are:
191  //! - \b ADC12_B_WINDOW_COMPARATOR_DISABLE [Default]
192  //! - \b ADC12_B_WINDOW_COMPARATOR_ENABLE
194  //! Sets the differential mode
195  //! \n Valid values are:
196  //! - \b ADC12_B_DIFFERENTIAL_MODE_DISABLE [Default]
197  //! - \b ADC12_B_DIFFERENTIAL_MODE_ENABLE
200 
201 
202 //*****************************************************************************
203 //
204 // The following are values that can be passed to the clockSourceDivider
205 // parameter for functions: ADC12_B_init(); the param parameter for functions:
206 // ADC12_B_init().
207 //
208 //*****************************************************************************
209 #define ADC12_B_CLOCKDIVIDER_1 (ADC12DIV_0)
210 #define ADC12_B_CLOCKDIVIDER_2 (ADC12DIV_1)
211 #define ADC12_B_CLOCKDIVIDER_3 (ADC12DIV_2)
212 #define ADC12_B_CLOCKDIVIDER_4 (ADC12DIV_3)
213 #define ADC12_B_CLOCKDIVIDER_5 (ADC12DIV_4)
214 #define ADC12_B_CLOCKDIVIDER_6 (ADC12DIV_5)
215 #define ADC12_B_CLOCKDIVIDER_7 (ADC12DIV_6)
216 #define ADC12_B_CLOCKDIVIDER_8 (ADC12DIV_7)
217 
218 //*****************************************************************************
219 //
220 // The following are values that can be passed to the clockSourceSelect
221 // parameter for functions: ADC12_B_init(); the param parameter for functions:
222 // ADC12_B_init().
223 //
224 //*****************************************************************************
225 #define ADC12_B_CLOCKSOURCE_ADC12OSC (ADC12SSEL_0)
226 #define ADC12_B_CLOCKSOURCE_ACLK (ADC12SSEL_1)
227 #define ADC12_B_CLOCKSOURCE_MCLK (ADC12SSEL_2)
228 #define ADC12_B_CLOCKSOURCE_SMCLK (ADC12SSEL_3)
229 
230 //*****************************************************************************
231 //
232 // The following are values that can be passed to the clockSourcePredivider
233 // parameter for functions: ADC12_B_init(); the param parameter for functions:
234 // ADC12_B_init().
235 //
236 //*****************************************************************************
237 #define ADC12_B_CLOCKPREDIVIDER__1 (ADC12PDIV__1)
238 #define ADC12_B_CLOCKPREDIVIDER__4 (ADC12PDIV__4)
239 #define ADC12_B_CLOCKPREDIVIDER__32 (ADC12PDIV__32)
240 #define ADC12_B_CLOCKPREDIVIDER__64 (ADC12PDIV__64)
241 
242 //*****************************************************************************
243 //
244 // The following are values that can be passed to the param parameter for
245 // functions: ADC12_B_init(); the sampleHoldSignalSourceSelect parameter for
246 // functions: ADC12_B_init().
247 //
248 //*****************************************************************************
249 #define ADC12_B_SAMPLEHOLDSOURCE_SC (ADC12SHS_0)
250 #define ADC12_B_SAMPLEHOLDSOURCE_1 (ADC12SHS_1)
251 #define ADC12_B_SAMPLEHOLDSOURCE_2 (ADC12SHS_2)
252 #define ADC12_B_SAMPLEHOLDSOURCE_3 (ADC12SHS_3)
253 #define ADC12_B_SAMPLEHOLDSOURCE_4 (ADC12SHS_4)
254 #define ADC12_B_SAMPLEHOLDSOURCE_5 (ADC12SHS_5)
255 #define ADC12_B_SAMPLEHOLDSOURCE_6 (ADC12SHS_6)
256 #define ADC12_B_SAMPLEHOLDSOURCE_7 (ADC12SHS_7)
257 
258 //*****************************************************************************
259 //
260 // The following are values that can be passed to the internalChannelMap
261 // parameter for functions: ADC12_B_init(); the param parameter for functions:
262 // ADC12_B_init().
263 //
264 //*****************************************************************************
265 #define ADC12_B_MAPINTCH3 (ADC12ICH3MAP)
266 #define ADC12_B_MAPINTCH2 (ADC12ICH2MAP)
267 #define ADC12_B_MAPINTCH1 (ADC12ICH1MAP)
268 #define ADC12_B_MAPINTCH0 (ADC12ICH0MAP)
269 #define ADC12_B_TEMPSENSEMAP (ADC12TCMAP)
270 #define ADC12_B_BATTMAP (ADC12BATMAP)
271 #define ADC12_B_NOINTCH (0x00)
272 
273 //*****************************************************************************
274 //
275 // The following are values that can be passed to the clockCycleHoldCountLowMem
276 // parameter for functions: ADC12_B_setupSamplingTimer(); the
277 // clockCycleHoldCountHighMem parameter for functions:
278 // ADC12_B_setupSamplingTimer().
279 //
280 //*****************************************************************************
281 #define ADC12_B_CYCLEHOLD_4_CYCLES (ADC12SHT0_0)
282 #define ADC12_B_CYCLEHOLD_8_CYCLES (ADC12SHT0_1)
283 #define ADC12_B_CYCLEHOLD_16_CYCLES (ADC12SHT0_2)
284 #define ADC12_B_CYCLEHOLD_32_CYCLES (ADC12SHT0_3)
285 #define ADC12_B_CYCLEHOLD_64_CYCLES (ADC12SHT0_4)
286 #define ADC12_B_CYCLEHOLD_96_CYCLES (ADC12SHT0_5)
287 #define ADC12_B_CYCLEHOLD_128_CYCLES (ADC12SHT0_6)
288 #define ADC12_B_CYCLEHOLD_192_CYCLES (ADC12SHT0_7)
289 #define ADC12_B_CYCLEHOLD_256_CYCLES (ADC12SHT0_8)
290 #define ADC12_B_CYCLEHOLD_384_CYCLES (ADC12SHT0_9)
291 #define ADC12_B_CYCLEHOLD_512_CYCLES (ADC12SHT0_10)
292 #define ADC12_B_CYCLEHOLD_768_CYCLES (ADC12SHT0_11)
293 #define ADC12_B_CYCLEHOLD_1024_CYCLES (ADC12SHT0_12)
294 
295 //*****************************************************************************
296 //
297 // The following are values that can be passed to the multipleSamplesEnabled
298 // parameter for functions: ADC12_B_setupSamplingTimer().
299 //
300 //*****************************************************************************
301 #define ADC12_B_MULTIPLESAMPLESDISABLE (!(ADC12MSC))
302 #define ADC12_B_MULTIPLESAMPLESENABLE (ADC12MSC)
303 
304 //*****************************************************************************
305 //
306 // The following are values that can be passed to the param parameter for
307 // functions: ADC12_B_configureMemory().
308 //
309 //*****************************************************************************
310 #define ADC12_B_DIFFERENTIAL_MODE_DISABLE (0x00)
311 #define ADC12_B_DIFFERENTIAL_MODE_ENABLE (ADC12DIF)
312 
313 //*****************************************************************************
314 //
315 // The following are values that can be passed to the param parameter for
316 // functions: ADC12_B_configureMemory().
317 //
318 //*****************************************************************************
319 #define ADC12_B_NOTENDOFSEQUENCE (!(ADC12EOS))
320 #define ADC12_B_ENDOFSEQUENCE (ADC12EOS)
321 
322 //*****************************************************************************
323 //
324 // The following are values that can be passed to the param parameter for
325 // functions: ADC12_B_configureMemory().
326 //
327 //*****************************************************************************
328 #define ADC12_B_VREFPOS_AVCC_VREFNEG_VSS (ADC12VRSEL_0)
329 #define ADC12_B_VREFPOS_INTBUF_VREFNEG_VSS (ADC12VRSEL_1)
330 #define ADC12_B_VREFPOS_EXTNEG_VREFNEG_VSS (ADC12VRSEL_2)
331 #define ADC12_B_VREFPOS_EXTBUF_VREFNEG_VSS (ADC12VRSEL_3)
332 #define ADC12_B_VREFPOS_EXTPOS_VREFNEG_VSS (ADC12VRSEL_4)
333 #define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTBUF (ADC12VRSEL_5)
334 #define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTPOS (ADC12VRSEL_6)
335 #define ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTPOS (ADC12VRSEL_7)
336 #define ADC12_B_VREFPOS_AVCC_VREFNEG_INTBUF (ADC12VRSEL_9)
337 #define ADC12_B_VREFPOS_EXTPOS_VREFNEG_INTBUF (ADC12VRSEL_11)
338 #define ADC12_B_VREFPOS_AVCC_VREFNEG_EXTNEG (ADC12VRSEL_12)
339 #define ADC12_B_VREFPOS_INTBUF_VREFNEG_EXTNEG (ADC12VRSEL_13)
340 #define ADC12_B_VREFPOS_EXTPOS_VREFNEG_EXTNEG (ADC12VRSEL_14)
341 #define ADC12_B_VREFPOS_EXTBUF_VREFNEG_EXTNEG (ADC12VRSEL_15)
342 
343 //*****************************************************************************
344 //
345 // The following are values that can be passed to the param parameter for
346 // functions: ADC12_B_configureMemory().
347 //
348 //*****************************************************************************
349 #define ADC12_B_INPUT_A0 (ADC12INCH_0)
350 #define ADC12_B_INPUT_A1 (ADC12INCH_1)
351 #define ADC12_B_INPUT_A2 (ADC12INCH_2)
352 #define ADC12_B_INPUT_A3 (ADC12INCH_3)
353 #define ADC12_B_INPUT_A4 (ADC12INCH_4)
354 #define ADC12_B_INPUT_A5 (ADC12INCH_5)
355 #define ADC12_B_INPUT_A6 (ADC12INCH_6)
356 #define ADC12_B_INPUT_A7 (ADC12INCH_7)
357 #define ADC12_B_INPUT_A8 (ADC12INCH_8)
358 #define ADC12_B_INPUT_A9 (ADC12INCH_9)
359 #define ADC12_B_INPUT_A10 (ADC12INCH_10)
360 #define ADC12_B_INPUT_A11 (ADC12INCH_11)
361 #define ADC12_B_INPUT_A12 (ADC12INCH_12)
362 #define ADC12_B_INPUT_A13 (ADC12INCH_13)
363 #define ADC12_B_INPUT_A14 (ADC12INCH_14)
364 #define ADC12_B_INPUT_A15 (ADC12INCH_15)
365 #define ADC12_B_INPUT_A16 (ADC12INCH_16)
366 #define ADC12_B_INPUT_A17 (ADC12INCH_17)
367 #define ADC12_B_INPUT_A18 (ADC12INCH_18)
368 #define ADC12_B_INPUT_A19 (ADC12INCH_19)
369 #define ADC12_B_INPUT_A20 (ADC12INCH_20)
370 #define ADC12_B_INPUT_A21 (ADC12INCH_21)
371 #define ADC12_B_INPUT_A22 (ADC12INCH_22)
372 #define ADC12_B_INPUT_A23 (ADC12INCH_23)
373 #define ADC12_B_INPUT_A24 (ADC12INCH_24)
374 #define ADC12_B_INPUT_A25 (ADC12INCH_25)
375 #define ADC12_B_INPUT_A26 (ADC12INCH_26)
376 #define ADC12_B_INPUT_A27 (ADC12INCH_27)
377 #define ADC12_B_INPUT_A28 (ADC12INCH_28)
378 #define ADC12_B_INPUT_A29 (ADC12INCH_29)
379 #define ADC12_B_INPUT_TCMAP (ADC12INCH_30)
380 #define ADC12_B_INPUT_BATMAP (ADC12INCH_31)
381 
382 //*****************************************************************************
383 //
384 // The following are values that can be passed to the param parameter for
385 // functions: ADC12_B_configureMemory().
386 //
387 //*****************************************************************************
388 #define ADC12_B_WINDOW_COMPARATOR_DISABLE (0x00)
389 #define ADC12_B_WINDOW_COMPARATOR_ENABLE (ADC12WINC)
390 
391 //*****************************************************************************
392 //
393 // The following are values that can be passed to the memoryIndex parameter for
394 // functions: ADC12_B_getMemoryAddressForDMA(); the memoryBufferIndex parameter
395 // for functions: ADC12_B_getResults(); the param parameter for functions:
396 // ADC12_B_configureMemory().
397 //
398 //*****************************************************************************
399 #define ADC12_B_MEMORY_0 (0x00)
400 #define ADC12_B_MEMORY_1 (0x02)
401 #define ADC12_B_MEMORY_2 (0x04)
402 #define ADC12_B_MEMORY_3 (0x06)
403 #define ADC12_B_MEMORY_4 (0x08)
404 #define ADC12_B_MEMORY_5 (0x0A)
405 #define ADC12_B_MEMORY_6 (0x0C)
406 #define ADC12_B_MEMORY_7 (0x0E)
407 #define ADC12_B_MEMORY_8 (0x10)
408 #define ADC12_B_MEMORY_9 (0x12)
409 #define ADC12_B_MEMORY_10 (0x14)
410 #define ADC12_B_MEMORY_11 (0x16)
411 #define ADC12_B_MEMORY_12 (0x18)
412 #define ADC12_B_MEMORY_13 (0x1A)
413 #define ADC12_B_MEMORY_14 (0x1C)
414 #define ADC12_B_MEMORY_15 (0x1E)
415 #define ADC12_B_MEMORY_16 (0x20)
416 #define ADC12_B_MEMORY_17 (0x22)
417 #define ADC12_B_MEMORY_18 (0x24)
418 #define ADC12_B_MEMORY_19 (0x26)
419 #define ADC12_B_MEMORY_20 (0x28)
420 #define ADC12_B_MEMORY_21 (0x2A)
421 #define ADC12_B_MEMORY_22 (0x2C)
422 #define ADC12_B_MEMORY_23 (0x2E)
423 #define ADC12_B_MEMORY_24 (0x30)
424 #define ADC12_B_MEMORY_25 (0x32)
425 #define ADC12_B_MEMORY_26 (0x34)
426 #define ADC12_B_MEMORY_27 (0x36)
427 #define ADC12_B_MEMORY_28 (0x38)
428 #define ADC12_B_MEMORY_29 (0x3A)
429 #define ADC12_B_MEMORY_30 (0x3C)
430 #define ADC12_B_MEMORY_31 (0x3E)
431 
432 //*****************************************************************************
433 //
434 // The following are values that can be passed to the interruptMask0 parameter
435 // for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
436 //
437 //*****************************************************************************
438 #define ADC12_B_IE0 (ADC12IE0)
439 #define ADC12_B_IE1 (ADC12IE1)
440 #define ADC12_B_IE2 (ADC12IE2)
441 #define ADC12_B_IE3 (ADC12IE3)
442 #define ADC12_B_IE4 (ADC12IE4)
443 #define ADC12_B_IE5 (ADC12IE5)
444 #define ADC12_B_IE6 (ADC12IE6)
445 #define ADC12_B_IE7 (ADC12IE7)
446 #define ADC12_B_IE8 (ADC12IE8)
447 #define ADC12_B_IE9 (ADC12IE9)
448 #define ADC12_B_IE10 (ADC12IE10)
449 #define ADC12_B_IE11 (ADC12IE11)
450 #define ADC12_B_IE12 (ADC12IE12)
451 #define ADC12_B_IE13 (ADC12IE13)
452 #define ADC12_B_IE14 (ADC12IE14)
453 #define ADC12_B_IE15 (ADC12IE15)
454 
455 //*****************************************************************************
456 //
457 // The following are values that can be passed to the interruptMask1 parameter
458 // for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
459 //
460 //*****************************************************************************
461 #define ADC12_B_IE16 (ADC12IE16)
462 #define ADC12_B_IE17 (ADC12IE17)
463 #define ADC12_B_IE18 (ADC12IE18)
464 #define ADC12_B_IE19 (ADC12IE19)
465 #define ADC12_B_IE20 (ADC12IE20)
466 #define ADC12_B_IE21 (ADC12IE21)
467 #define ADC12_B_IE22 (ADC12IE22)
468 #define ADC12_B_IE23 (ADC12IE23)
469 #define ADC12_B_IE24 (ADC12IE24)
470 #define ADC12_B_IE25 (ADC12IE25)
471 #define ADC12_B_IE26 (ADC12IE26)
472 #define ADC12_B_IE27 (ADC12IE27)
473 #define ADC12_B_IE28 (ADC12IE28)
474 #define ADC12_B_IE29 (ADC12IE29)
475 #define ADC12_B_IE30 (ADC12IE30)
476 #define ADC12_B_IE31 (ADC12IE31)
477 
478 //*****************************************************************************
479 //
480 // The following are values that can be passed to the interruptMask2 parameter
481 // for functions: ADC12_B_enableInterrupt(), and ADC12_B_disableInterrupt().
482 //
483 //*****************************************************************************
484 #define ADC12_B_INIE (ADC12INIE)
485 #define ADC12_B_LOIE (ADC12LOIE)
486 #define ADC12_B_HIIE (ADC12HIIE)
487 #define ADC12_B_OVIE (ADC12OVIE)
488 #define ADC12_B_TOVIE (ADC12TOVIE)
489 #define ADC12_B_RDYIE (ADC12RDYIE)
490 
491 //*****************************************************************************
492 //
493 // The following are values that can be passed to the memoryInterruptFlagMask
494 // parameter for functions: ADC12_B_clearInterrupt(), and
495 // ADC12_B_getInterruptStatus().
496 //
497 //*****************************************************************************
498 #define ADC12_B_IFG0 (ADC12IFG0)
499 #define ADC12_B_IFG1 (ADC12IFG1)
500 #define ADC12_B_IFG2 (ADC12IFG2)
501 #define ADC12_B_IFG3 (ADC12IFG3)
502 #define ADC12_B_IFG4 (ADC12IFG4)
503 #define ADC12_B_IFG5 (ADC12IFG5)
504 #define ADC12_B_IFG6 (ADC12IFG6)
505 #define ADC12_B_IFG7 (ADC12IFG7)
506 #define ADC12_B_IFG8 (ADC12IFG8)
507 #define ADC12_B_IFG9 (ADC12IFG9)
508 #define ADC12_B_IFG10 (ADC12IFG10)
509 #define ADC12_B_IFG11 (ADC12IFG11)
510 #define ADC12_B_IFG12 (ADC12IFG12)
511 #define ADC12_B_IFG13 (ADC12IFG13)
512 #define ADC12_B_IFG14 (ADC12IFG14)
513 #define ADC12_B_IFG15 (ADC12IFG15)
514 #define ADC12_B_IFG16 (ADC12IFG16)
515 #define ADC12_B_IFG17 (ADC12IFG17)
516 #define ADC12_B_IFG18 (ADC12IFG18)
517 #define ADC12_B_IFG19 (ADC12IFG19)
518 #define ADC12_B_IFG20 (ADC12IFG20)
519 #define ADC12_B_IFG21 (ADC12IFG21)
520 #define ADC12_B_IFG22 (ADC12IFG22)
521 #define ADC12_B_IFG23 (ADC12IFG23)
522 #define ADC12_B_IFG24 (ADC12IFG24)
523 #define ADC12_B_IFG25 (ADC12IFG25)
524 #define ADC12_B_IFG26 (ADC12IFG26)
525 #define ADC12_B_IFG27 (ADC12IFG27)
526 #define ADC12_B_IFG28 (ADC12IFG28)
527 #define ADC12_B_IFG29 (ADC12IFG29)
528 #define ADC12_B_IFG30 (ADC12IFG30)
529 #define ADC12_B_IFG31 (ADC12IFG31)
530 #define ADC12_B_INIFG (ADC12INIFG)
531 #define ADC12_B_LOIFG (ADC12LOIFG)
532 #define ADC12_B_HIIFG (ADC12HIIFG)
533 #define ADC12_B_OVIFG (ADC12OVIFG)
534 #define ADC12_B_TOVIFG (ADC12TOVIFG)
535 #define ADC12_B_RDYIFG (ADC12RDYIFG)
536 
537 //*****************************************************************************
538 //
539 // The following are values that can be passed to the startingMemoryBufferIndex
540 // parameter for functions: ADC12_B_startConversion().
541 //
542 //*****************************************************************************
543 #define ADC12_B_START_AT_ADC12MEM0 (ADC12CSTARTADD_0)
544 #define ADC12_B_START_AT_ADC12MEM1 (ADC12CSTARTADD_1)
545 #define ADC12_B_START_AT_ADC12MEM2 (ADC12CSTARTADD_2)
546 #define ADC12_B_START_AT_ADC12MEM3 (ADC12CSTARTADD_3)
547 #define ADC12_B_START_AT_ADC12MEM4 (ADC12CSTARTADD_4)
548 #define ADC12_B_START_AT_ADC12MEM5 (ADC12CSTARTADD_5)
549 #define ADC12_B_START_AT_ADC12MEM6 (ADC12CSTARTADD_6)
550 #define ADC12_B_START_AT_ADC12MEM7 (ADC12CSTARTADD_7)
551 #define ADC12_B_START_AT_ADC12MEM8 (ADC12CSTARTADD_8)
552 #define ADC12_B_START_AT_ADC12MEM9 (ADC12CSTARTADD_9)
553 #define ADC12_B_START_AT_ADC12MEM10 (ADC12CSTARTADD_10)
554 #define ADC12_B_START_AT_ADC12MEM11 (ADC12CSTARTADD_11)
555 #define ADC12_B_START_AT_ADC12MEM12 (ADC12CSTARTADD_12)
556 #define ADC12_B_START_AT_ADC12MEM13 (ADC12CSTARTADD_13)
557 #define ADC12_B_START_AT_ADC12MEM14 (ADC12CSTARTADD_14)
558 #define ADC12_B_START_AT_ADC12MEM15 (ADC12CSTARTADD_15)
559 #define ADC12_B_START_AT_ADC12MEM16 (ADC12CSTARTADD_16)
560 #define ADC12_B_START_AT_ADC12MEM17 (ADC12CSTARTADD_17)
561 #define ADC12_B_START_AT_ADC12MEM18 (ADC12CSTARTADD_18)
562 #define ADC12_B_START_AT_ADC12MEM19 (ADC12CSTARTADD_19)
563 #define ADC12_B_START_AT_ADC12MEM20 (ADC12CSTARTADD_20)
564 #define ADC12_B_START_AT_ADC12MEM21 (ADC12CSTARTADD_21)
565 #define ADC12_B_START_AT_ADC12MEM22 (ADC12CSTARTADD_22)
566 #define ADC12_B_START_AT_ADC12MEM23 (ADC12CSTARTADD_23)
567 #define ADC12_B_START_AT_ADC12MEM24 (ADC12CSTARTADD_24)
568 #define ADC12_B_START_AT_ADC12MEM25 (ADC12CSTARTADD_25)
569 #define ADC12_B_START_AT_ADC12MEM26 (ADC12CSTARTADD_26)
570 #define ADC12_B_START_AT_ADC12MEM27 (ADC12CSTARTADD_27)
571 #define ADC12_B_START_AT_ADC12MEM28 (ADC12CSTARTADD_28)
572 #define ADC12_B_START_AT_ADC12MEM29 (ADC12CSTARTADD_29)
573 #define ADC12_B_START_AT_ADC12MEM30 (ADC12CSTARTADD_30)
574 #define ADC12_B_START_AT_ADC12MEM31 (ADC12CSTARTADD_31)
575 
576 //*****************************************************************************
577 //
578 // The following are values that can be passed to the
579 // conversionSequenceModeSelect parameter for functions:
580 // ADC12_B_startConversion().
581 //
582 //*****************************************************************************
583 #define ADC12_B_SINGLECHANNEL (ADC12CONSEQ_0)
584 #define ADC12_B_SEQOFCHANNELS (ADC12CONSEQ_1)
585 #define ADC12_B_REPEATED_SINGLECHANNEL (ADC12CONSEQ_2)
586 #define ADC12_B_REPEATED_SEQOFCHANNELS (ADC12CONSEQ_3)
587 
588 //*****************************************************************************
589 //
590 // The following are values that can be passed to the preempt parameter for
591 // functions: ADC12_B_disableConversions().
592 //
593 //*****************************************************************************
594 #define ADC12_B_COMPLETECONVERSION false
595 #define ADC12_B_PREEMPTCONVERSION true
596 
597 //*****************************************************************************
598 //
599 // The following are values that can be passed to the resolutionSelect
600 // parameter for functions: ADC12_B_setResolution().
601 //
602 //*****************************************************************************
603 #define ADC12_B_RESOLUTION_8BIT (ADC12RES__8BIT)
604 #define ADC12_B_RESOLUTION_10BIT (ADC12RES__10BIT)
605 #define ADC12_B_RESOLUTION_12BIT (ADC12RES__12BIT)
606 
607 //*****************************************************************************
608 //
609 // The following are values that can be passed to the invertedSignal parameter
610 // for functions: ADC12_B_setSampleHoldSignalInversion().
611 //
612 //*****************************************************************************
613 #define ADC12_B_NONINVERTEDSIGNAL (!(ADC12ISSH))
614 #define ADC12_B_INVERTEDSIGNAL (ADC12ISSH)
615 
616 //*****************************************************************************
617 //
618 // The following are values that can be passed to the readBackFormat parameter
619 // for functions: ADC12_B_setDataReadBackFormat().
620 //
621 //*****************************************************************************
622 #define ADC12_B_UNSIGNED_BINARY (!(ADC12DF))
623 #define ADC12_B_SIGNED_2SCOMPLEMENT (ADC12DF)
624 
625 //*****************************************************************************
626 //
627 // The following are values that can be passed to the powerMode parameter for
628 // functions: ADC12_B_setAdcPowerMode().
629 //
630 //*****************************************************************************
631 #define ADC12_B_REGULARPOWERMODE (!(ADC12PWRMD))
632 #define ADC12_B_LOWPOWERMODE (ADC12PWRMD)
633 
634 //*****************************************************************************
635 //
636 // The following are values that can be passed toThe following are values that
637 // can be returned by the ADC12_B_isBusy() function.
638 //
639 //*****************************************************************************
640 #define ADC12_B_NOTBUSY 0x00
641 #define ADC12_B_BUSY ADC12BUSY
642 
643 //*****************************************************************************
644 //
645 // Prototypes for the APIs.
646 //
647 //*****************************************************************************
648 
649 //*****************************************************************************
650 //
651 //! \brief Initializes the ADC12B Module.
652 //!
653 //! This function initializes the ADC module to allow for analog-to-digital
654 //! conversions. Specifically this function sets up the sample-and-hold signal
655 //! and clock sources for the ADC core to use for conversions. Upon successful
656 //! completion of the initialization all of the ADC control registers will be
657 //! reset, excluding the memory controls and reference module bits, the given
658 //! parameters will be set, and the ADC core will be turned on (Note, that the
659 //! ADC core only draws power during conversions and remains off when not
660 //! converting).Note that sample/hold signal sources are device dependent. Note
661 //! that if re-initializing the ADC after starting a conversion with the
662 //! startConversion() function, the disableConversion() must be called BEFORE
663 //! this function can be called.
664 //!
665 //! \param baseAddress is the base address of the ADC12B module.
666 //! \param param is the pointer to struct for initialization.
667 //!
668 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
669 //
670 //*****************************************************************************
671 extern bool ADC12_B_init(uint16_t baseAddress,
672  ADC12_B_initParam *param);
673 
674 //*****************************************************************************
675 //
676 //! \brief Enables the ADC12B block.
677 //!
678 //! This will enable operation of the ADC12B block.
679 //!
680 //! \param baseAddress is the base address of the ADC12B module.
681 //!
682 //! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
683 //!
684 //! \return None
685 //
686 //*****************************************************************************
687 extern void ADC12_B_enable(uint16_t baseAddress);
688 
689 //*****************************************************************************
690 //
691 //! \brief Disables the ADC12B block.
692 //!
693 //! This will disable operation of the ADC12B block.
694 //!
695 //! \param baseAddress is the base address of the ADC12B module.
696 //!
697 //! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
698 //!
699 //! \return None
700 //
701 //*****************************************************************************
702 extern void ADC12_B_disable(uint16_t baseAddress);
703 
704 //*****************************************************************************
705 //
706 //! \brief Sets up and enables the Sampling Timer Pulse Mode.
707 //!
708 //! This function sets up the sampling timer pulse mode which allows the
709 //! sample/hold signal to trigger a sampling timer to sample-and-hold an input
710 //! signal for a specified number of clock cycles without having to hold the
711 //! sample/hold signal for the entire period of sampling. Note that if a
712 //! conversion has been started with the startConversion() function, then a
713 //! call to disableConversions() is required before this function may be
714 //! called.
715 //!
716 //! \param baseAddress is the base address of the ADC12B module.
717 //! \param clockCycleHoldCountLowMem sets the amount of clock cycles to sample-
718 //! and-hold for the higher memory buffers 0-7.
719 //! Valid values are:
720 //! - \b ADC12_B_CYCLEHOLD_4_CYCLES [Default]
721 //! - \b ADC12_B_CYCLEHOLD_8_CYCLES
722 //! - \b ADC12_B_CYCLEHOLD_16_CYCLES
723 //! - \b ADC12_B_CYCLEHOLD_32_CYCLES
724 //! - \b ADC12_B_CYCLEHOLD_64_CYCLES
725 //! - \b ADC12_B_CYCLEHOLD_96_CYCLES
726 //! - \b ADC12_B_CYCLEHOLD_128_CYCLES
727 //! - \b ADC12_B_CYCLEHOLD_192_CYCLES
728 //! - \b ADC12_B_CYCLEHOLD_256_CYCLES
729 //! - \b ADC12_B_CYCLEHOLD_384_CYCLES
730 //! - \b ADC12_B_CYCLEHOLD_512_CYCLES
731 //! - \b ADC12_B_CYCLEHOLD_768_CYCLES
732 //! - \b ADC12_B_CYCLEHOLD_1024_CYCLES
733 //! \n Modified bits are \b ADC12SHT0x of \b ADC12CTL0 register.
734 //! \param clockCycleHoldCountHighMem sets the amount of clock cycles to
735 //! sample-and-hold for the higher memory buffers 8-15.
736 //! Valid values are:
737 //! - \b ADC12_B_CYCLEHOLD_4_CYCLES [Default]
738 //! - \b ADC12_B_CYCLEHOLD_8_CYCLES
739 //! - \b ADC12_B_CYCLEHOLD_16_CYCLES
740 //! - \b ADC12_B_CYCLEHOLD_32_CYCLES
741 //! - \b ADC12_B_CYCLEHOLD_64_CYCLES
742 //! - \b ADC12_B_CYCLEHOLD_96_CYCLES
743 //! - \b ADC12_B_CYCLEHOLD_128_CYCLES
744 //! - \b ADC12_B_CYCLEHOLD_192_CYCLES
745 //! - \b ADC12_B_CYCLEHOLD_256_CYCLES
746 //! - \b ADC12_B_CYCLEHOLD_384_CYCLES
747 //! - \b ADC12_B_CYCLEHOLD_512_CYCLES
748 //! - \b ADC12_B_CYCLEHOLD_768_CYCLES
749 //! - \b ADC12_B_CYCLEHOLD_1024_CYCLES
750 //! \n Modified bits are \b ADC12SHT1x of \b ADC12CTL0 register.
751 //! \param multipleSamplesEnabled allows multiple conversions to start without
752 //! a trigger signal from the sample/hold signal
753 //! Valid values are:
754 //! - \b ADC12_B_MULTIPLESAMPLESDISABLE [Default] - a timer trigger will
755 //! be needed to start every ADC conversion.
756 //! - \b ADC12_B_MULTIPLESAMPLESENABLE - during a sequenced and/or
757 //! repeated conversion mode, after the first conversion, no
758 //! sample/hold signal is necessary to start subsequent sample/hold
759 //! and convert processes.
760 //! \n Modified bits are \b ADC12MSC of \b ADC12CTL0 register.
761 //!
762 //! \return None
763 //
764 //*****************************************************************************
765 extern void ADC12_B_setupSamplingTimer(uint16_t baseAddress,
766  uint16_t clockCycleHoldCountLowMem,
767  uint16_t clockCycleHoldCountHighMem,
768  uint16_t multipleSamplesEnabled);
769 
770 //*****************************************************************************
771 //
772 //! \brief Disables Sampling Timer Pulse Mode.
773 //!
774 //! Disables the Sampling Timer Pulse Mode. Note that if a conversion has been
775 //! started with the startConversion() function, then a call to
776 //! disableConversions() is required before this function may be called.
777 //!
778 //! \param baseAddress is the base address of the ADC12B module.
779 //!
780 //! \return None
781 //
782 //*****************************************************************************
783 extern void ADC12_B_disableSamplingTimer(uint16_t baseAddress);
784 
785 //*****************************************************************************
786 //
787 //! \brief Configures the controls of the selected memory buffer.
788 //!
789 //! Maps an input signal conversion into the selected memory buffer, as well as
790 //! the positive and negative reference voltages for each conversion being
791 //! stored into this memory buffer. If the internal reference is used for the
792 //! positive reference voltage, the internal REF module must be used to control
793 //! the voltage level. Note that if a conversion has been started with the
794 //! startConversion() function, then a call to disableConversions() is required
795 //! before this function may be called. If conversion is not disabled, this
796 //! function does nothing.
797 //!
798 //! \param baseAddress is the base address of the ADC12B module.
799 //! \param param is the pointer to struct for ADC12B memory configuration.
800 //!
801 //! \return None
802 //
803 //*****************************************************************************
804 extern void ADC12_B_configureMemory(uint16_t baseAddress,
806 
807 //*****************************************************************************
808 //
809 //! \brief Sets the high and low threshold for the window comparator feature.
810 //!
811 //! Sets the high and low threshold for the window comparator feature. Use the
812 //! ADC12HIIE, ADC12INIE, ADC12LOIE interrupts to utilize this feature.
813 //!
814 //! \param baseAddress is the base address of the ADC12B module.
815 //! \param highThreshold is the upper bound that could trip an interrupt for
816 //! the window comparator.
817 //! \param lowThreshold is the lower bound that could trip on interrupt for the
818 //! window comparator.
819 //!
820 //! \return None
821 //
822 //*****************************************************************************
823 extern void ADC12_B_setWindowCompAdvanced(uint16_t baseAddress,
824  uint16_t highThreshold,
825  uint16_t lowThreshold);
826 
827 //*****************************************************************************
828 //
829 //! \brief Enables selected ADC12B interrupt sources.
830 //!
831 //! Enables the indicated ADC12B interrupt sources. Only the sources that are
832 //! enabled can be reflected to the processor interrupt; disabled sources have
833 //! no effect on the processor. <b>Does not clear interrupt flags.
834 //!
835 //! \param baseAddress is the base address of the ADC12B module.
836 //! \param interruptMask0 is the bit mask of the memory buffer and overflow
837 //! interrupt sources to be enabled. If the desired interrupt is not
838 //! available in the selection for interruptMask0, then simply pass in a
839 //! '0' for this value.
840 //! Valid values are:
841 //! - \b ADC12_B_IE0
842 //! - \b ADC12_B_IE1
843 //! - \b ADC12_B_IE2
844 //! - \b ADC12_B_IE3
845 //! - \b ADC12_B_IE4
846 //! - \b ADC12_B_IE5
847 //! - \b ADC12_B_IE6
848 //! - \b ADC12_B_IE7
849 //! - \b ADC12_B_IE8
850 //! - \b ADC12_B_IE9
851 //! - \b ADC12_B_IE10
852 //! - \b ADC12_B_IE11
853 //! - \b ADC12_B_IE12
854 //! - \b ADC12_B_IE13
855 //! - \b ADC12_B_IE14
856 //! - \b ADC12_B_IE15
857 //! \param interruptMask1 is the bit mask of the memory buffer and overflow
858 //! interrupt sources to be enabled. If the desired interrupt is not
859 //! available in the selection for interruptMask1, then simply pass in a
860 //! '0' for this value.
861 //! Valid values are:
862 //! - \b ADC12_B_IE16
863 //! - \b ADC12_B_IE17
864 //! - \b ADC12_B_IE18
865 //! - \b ADC12_B_IE19
866 //! - \b ADC12_B_IE20
867 //! - \b ADC12_B_IE21
868 //! - \b ADC12_B_IE22
869 //! - \b ADC12_B_IE23
870 //! - \b ADC12_B_IE24
871 //! - \b ADC12_B_IE25
872 //! - \b ADC12_B_IE26
873 //! - \b ADC12_B_IE27
874 //! - \b ADC12_B_IE28
875 //! - \b ADC12_B_IE29
876 //! - \b ADC12_B_IE30
877 //! - \b ADC12_B_IE31
878 //! \param interruptMask2 is the bit mask of the memory buffer and overflow
879 //! interrupt sources to be enabled. If the desired interrupt is not
880 //! available in the selection for interruptMask2, then simply pass in a
881 //! '0' for this value.
882 //! Valid values are:
883 //! - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
884 //! register is either greater than the ADC12LO or lower than the
885 //! ADC12HI threshold. GIE bit must be set to enable the interrupt.
886 //! - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
887 //! lower limit interrupt of the window comparator for the result
888 //! register. GIE bit must be set to enable the interrupt.
889 //! - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
890 //! limit of the window comparator for the result register. GIE bit
891 //! must be set to enable the interrupt.
892 //! - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
893 //! to save to a memory buffer that has not been read out yet. GIE
894 //! bit must be set to enable the interrupt.
895 //! - \b ADC12_B_TOVIE - enable for a conversion that is about to start
896 //! before the previous conversion has been completed. GIE bit must
897 //! be set to enable the interrupt.
898 //! - \b ADC12_B_RDYIE - enable for the local buffered reference ready
899 //! signal. GIE bit must be set to enable the interrupt.
900 //!
901 //! Modified bits of \b ADC12IERx register.
902 //!
903 //! \return None
904 //
905 //*****************************************************************************
906 extern void ADC12_B_enableInterrupt(uint16_t baseAddress,
907  uint16_t interruptMask0,
908  uint16_t interruptMask1,
909  uint16_t interruptMask2);
910 
911 //*****************************************************************************
912 //
913 //! \brief Disables selected ADC12B interrupt sources.
914 //!
915 //! Disables the indicated ADC12B interrupt sources. Only the sources that are
916 //! enabled can be reflected to the processor interrupt; disabled sources have
917 //! no effect on the processor.
918 //!
919 //! \param baseAddress is the base address of the ADC12B module.
920 //! \param interruptMask0 is the bit mask of the memory buffer and overflow
921 //! interrupt sources to be disabled. If the desired interrupt is not
922 //! available in the selection for interruptMask0, then simply pass in a
923 //! '0' for this value.
924 //! Valid values are:
925 //! - \b ADC12_B_IE0
926 //! - \b ADC12_B_IE1
927 //! - \b ADC12_B_IE2
928 //! - \b ADC12_B_IE3
929 //! - \b ADC12_B_IE4
930 //! - \b ADC12_B_IE5
931 //! - \b ADC12_B_IE6
932 //! - \b ADC12_B_IE7
933 //! - \b ADC12_B_IE8
934 //! - \b ADC12_B_IE9
935 //! - \b ADC12_B_IE10
936 //! - \b ADC12_B_IE11
937 //! - \b ADC12_B_IE12
938 //! - \b ADC12_B_IE13
939 //! - \b ADC12_B_IE14
940 //! - \b ADC12_B_IE15
941 //! \param interruptMask1 is the bit mask of the memory buffer and overflow
942 //! interrupt sources to be disabled. If the desired interrupt is not
943 //! available in the selection for interruptMask1, then simply pass in a
944 //! '0' for this value.
945 //! Valid values are:
946 //! - \b ADC12_B_IE16
947 //! - \b ADC12_B_IE17
948 //! - \b ADC12_B_IE18
949 //! - \b ADC12_B_IE19
950 //! - \b ADC12_B_IE20
951 //! - \b ADC12_B_IE21
952 //! - \b ADC12_B_IE22
953 //! - \b ADC12_B_IE23
954 //! - \b ADC12_B_IE24
955 //! - \b ADC12_B_IE25
956 //! - \b ADC12_B_IE26
957 //! - \b ADC12_B_IE27
958 //! - \b ADC12_B_IE28
959 //! - \b ADC12_B_IE29
960 //! - \b ADC12_B_IE30
961 //! - \b ADC12_B_IE31
962 //! \param interruptMask2 is the bit mask of the memory buffer and overflow
963 //! interrupt sources to be disabled. If the desired interrupt is not
964 //! available in the selection for interruptMask2, then simply pass in a
965 //! '0' for this value.
966 //! Valid values are:
967 //! - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
968 //! register is either greater than the ADC12LO or lower than the
969 //! ADC12HI threshold. GIE bit must be set to enable the interrupt.
970 //! - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
971 //! lower limit interrupt of the window comparator for the result
972 //! register. GIE bit must be set to enable the interrupt.
973 //! - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
974 //! limit of the window comparator for the result register. GIE bit
975 //! must be set to enable the interrupt.
976 //! - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
977 //! to save to a memory buffer that has not been read out yet. GIE
978 //! bit must be set to enable the interrupt.
979 //! - \b ADC12_B_TOVIE - enable for a conversion that is about to start
980 //! before the previous conversion has been completed. GIE bit must
981 //! be set to enable the interrupt.
982 //! - \b ADC12_B_RDYIE - enable for the local buffered reference ready
983 //! signal. GIE bit must be set to enable the interrupt.
984 //!
985 //! Modified bits of \b ADC12IERx register.
986 //!
987 //! \return None
988 //
989 //*****************************************************************************
990 extern void ADC12_B_disableInterrupt(uint16_t baseAddress,
991  uint16_t interruptMask0,
992  uint16_t interruptMask1,
993  uint16_t interruptMask2);
994 
995 //*****************************************************************************
996 //
997 //! \brief Clears ADC12B selected interrupt flags.
998 //!
999 //! Modified registers are ADC12IFG .
1000 //!
1001 //! \param baseAddress is the base address of the ADC12B module.
1002 //! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
1003 //! interrupt register to update
1004 //! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
1005 //! overflow interrupt flags to be cleared.
1006 //! Valid values are:
1007 //! - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
1008 //! - \b ADC12_B_IFG1
1009 //! - \b ADC12_B_IFG2
1010 //! - \b ADC12_B_IFG3
1011 //! - \b ADC12_B_IFG4
1012 //! - \b ADC12_B_IFG5
1013 //! - \b ADC12_B_IFG6
1014 //! - \b ADC12_B_IFG7
1015 //! - \b ADC12_B_IFG8
1016 //! - \b ADC12_B_IFG9
1017 //! - \b ADC12_B_IFG10
1018 //! - \b ADC12_B_IFG11
1019 //! - \b ADC12_B_IFG12
1020 //! - \b ADC12_B_IFG13
1021 //! - \b ADC12_B_IFG14
1022 //! - \b ADC12_B_IFG15
1023 //! - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
1024 //! - \b ADC12_B_IFG17
1025 //! - \b ADC12_B_IFG18
1026 //! - \b ADC12_B_IFG19
1027 //! - \b ADC12_B_IFG20
1028 //! - \b ADC12_B_IFG21
1029 //! - \b ADC12_B_IFG22
1030 //! - \b ADC12_B_IFG23
1031 //! - \b ADC12_B_IFG24
1032 //! - \b ADC12_B_IFG25
1033 //! - \b ADC12_B_IFG26
1034 //! - \b ADC12_B_IFG27
1035 //! - \b ADC12_B_IFG28
1036 //! - \b ADC12_B_IFG29
1037 //! - \b ADC12_B_IFG30
1038 //! - \b ADC12_B_IFG31
1039 //! - \b ADC12_B_INIFG - interruptRegisterChoice = 2
1040 //! - \b ADC12_B_LOIFG
1041 //! - \b ADC12_B_HIIFG
1042 //! - \b ADC12_B_OVIFG
1043 //! - \b ADC12_B_TOVIFG
1044 //! - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
1045 //! cleared, so that it no longer asserts. The memory buffer
1046 //! interrupt flags are only cleared when the memory buffer is
1047 //! accessed. Note that the overflow interrupts do not have an
1048 //! interrupt flag to clear; they must be accessed directly from the
1049 //! interrupt vector.
1050 //!
1051 //! \return None
1052 //
1053 //*****************************************************************************
1054 extern void ADC12_B_clearInterrupt(uint16_t baseAddress,
1055  uint8_t interruptRegisterChoice,
1056  uint16_t memoryInterruptFlagMask);
1057 
1058 //*****************************************************************************
1059 //
1060 //! \brief Returns the status of the selected memory interrupt flags.
1061 //!
1062 //! Returns the status of the selected memory interrupt flags. Note that the
1063 //! overflow interrupts do not have an interrupt flag to clear; they must be
1064 //! accessed directly from the interrupt vector.
1065 //!
1066 //! \param baseAddress is the base address of the ADC12B module.
1067 //! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
1068 //! interrupt register to update
1069 //! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
1070 //! overflow interrupt flags to be cleared.
1071 //! Valid values are:
1072 //! - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
1073 //! - \b ADC12_B_IFG1
1074 //! - \b ADC12_B_IFG2
1075 //! - \b ADC12_B_IFG3
1076 //! - \b ADC12_B_IFG4
1077 //! - \b ADC12_B_IFG5
1078 //! - \b ADC12_B_IFG6
1079 //! - \b ADC12_B_IFG7
1080 //! - \b ADC12_B_IFG8
1081 //! - \b ADC12_B_IFG9
1082 //! - \b ADC12_B_IFG10
1083 //! - \b ADC12_B_IFG11
1084 //! - \b ADC12_B_IFG12
1085 //! - \b ADC12_B_IFG13
1086 //! - \b ADC12_B_IFG14
1087 //! - \b ADC12_B_IFG15
1088 //! - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
1089 //! - \b ADC12_B_IFG17
1090 //! - \b ADC12_B_IFG18
1091 //! - \b ADC12_B_IFG19
1092 //! - \b ADC12_B_IFG20
1093 //! - \b ADC12_B_IFG21
1094 //! - \b ADC12_B_IFG22
1095 //! - \b ADC12_B_IFG23
1096 //! - \b ADC12_B_IFG24
1097 //! - \b ADC12_B_IFG25
1098 //! - \b ADC12_B_IFG26
1099 //! - \b ADC12_B_IFG27
1100 //! - \b ADC12_B_IFG28
1101 //! - \b ADC12_B_IFG29
1102 //! - \b ADC12_B_IFG30
1103 //! - \b ADC12_B_IFG31
1104 //! - \b ADC12_B_INIFG - interruptRegisterChoice = 2
1105 //! - \b ADC12_B_LOIFG
1106 //! - \b ADC12_B_HIIFG
1107 //! - \b ADC12_B_OVIFG
1108 //! - \b ADC12_B_TOVIFG
1109 //! - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
1110 //! cleared, so that it no longer asserts. The memory buffer
1111 //! interrupt flags are only cleared when the memory buffer is
1112 //! accessed. Note that the overflow interrupts do not have an
1113 //! interrupt flag to clear; they must be accessed directly from the
1114 //! interrupt vector.
1115 //!
1116 //! \return The current interrupt flag status for the corresponding mask.
1117 //
1118 //*****************************************************************************
1119 extern uint16_t ADC12_B_getInterruptStatus(uint16_t baseAddress,
1120  uint8_t interruptRegisterChoice,
1121  uint16_t memoryInterruptFlagMask);
1122 
1123 //*****************************************************************************
1124 //
1125 //! \brief Enables/Starts an Analog-to-Digital Conversion.
1126 //!
1127 //! Enables/starts the conversion process of the ADC. If the sample/hold signal
1128 //! source chosen during initialization was ADC12OSC, then the conversion is
1129 //! started immediately, otherwise the chosen sample/hold signal source starts
1130 //! the conversion by a rising edge of the signal. Keep in mind when selecting
1131 //! conversion modes, that for sequenced and/or repeated modes, to keep the
1132 //! sample/hold-and-convert process continuing without a trigger from the
1133 //! sample/hold signal source, the multiple samples must be enabled using the
1134 //! ADC12_B_setupSamplingTimer() function. Note that after this function is
1135 //! called, the ADC12_B_stopConversions() has to be called to re-initialize the
1136 //! ADC, reconfigure a memory buffer control, enable/disable the sampling
1137 //! timer, or to change the internal reference voltage.
1138 //!
1139 //! \param baseAddress is the base address of the ADC12B module.
1140 //! \param startingMemoryBufferIndex is the memory buffer that will hold the
1141 //! first or only conversion.
1142 //! Valid values are:
1143 //! - \b ADC12_B_START_AT_ADC12MEM0 [Default]
1144 //! - \b ADC12_B_START_AT_ADC12MEM1
1145 //! - \b ADC12_B_START_AT_ADC12MEM2
1146 //! - \b ADC12_B_START_AT_ADC12MEM3
1147 //! - \b ADC12_B_START_AT_ADC12MEM4
1148 //! - \b ADC12_B_START_AT_ADC12MEM5
1149 //! - \b ADC12_B_START_AT_ADC12MEM6
1150 //! - \b ADC12_B_START_AT_ADC12MEM7
1151 //! - \b ADC12_B_START_AT_ADC12MEM8
1152 //! - \b ADC12_B_START_AT_ADC12MEM9
1153 //! - \b ADC12_B_START_AT_ADC12MEM10
1154 //! - \b ADC12_B_START_AT_ADC12MEM11
1155 //! - \b ADC12_B_START_AT_ADC12MEM12
1156 //! - \b ADC12_B_START_AT_ADC12MEM13
1157 //! - \b ADC12_B_START_AT_ADC12MEM14
1158 //! - \b ADC12_B_START_AT_ADC12MEM15
1159 //! - \b ADC12_B_START_AT_ADC12MEM16
1160 //! - \b ADC12_B_START_AT_ADC12MEM17
1161 //! - \b ADC12_B_START_AT_ADC12MEM18
1162 //! - \b ADC12_B_START_AT_ADC12MEM19
1163 //! - \b ADC12_B_START_AT_ADC12MEM20
1164 //! - \b ADC12_B_START_AT_ADC12MEM21
1165 //! - \b ADC12_B_START_AT_ADC12MEM22
1166 //! - \b ADC12_B_START_AT_ADC12MEM23
1167 //! - \b ADC12_B_START_AT_ADC12MEM24
1168 //! - \b ADC12_B_START_AT_ADC12MEM25
1169 //! - \b ADC12_B_START_AT_ADC12MEM26
1170 //! - \b ADC12_B_START_AT_ADC12MEM27
1171 //! - \b ADC12_B_START_AT_ADC12MEM28
1172 //! - \b ADC12_B_START_AT_ADC12MEM29
1173 //! - \b ADC12_B_START_AT_ADC12MEM30
1174 //! - \b ADC12_B_START_AT_ADC12MEM31
1175 //! \n Modified bits are \b ADC12CSTARTADDx of \b ADC12CTL1 register.
1176 //! \param conversionSequenceModeSelect determines the ADC operating mode.
1177 //! Valid values are:
1178 //! - \b ADC12_B_SINGLECHANNEL [Default] - one-time conversion of a
1179 //! single channel into a single memory buffer.
1180 //! - \b ADC12_B_SEQOFCHANNELS - one time conversion of multiple
1181 //! channels into the specified starting memory buffer and each
1182 //! subsequent memory buffer up until the conversion is stored in a
1183 //! memory buffer dedicated as the end-of-sequence by the memory's
1184 //! control register.
1185 //! - \b ADC12_B_REPEATED_SINGLECHANNEL - repeated conversions of one
1186 //! channel into a single memory buffer.
1187 //! - \b ADC12_B_REPEATED_SEQOFCHANNELS - repeated conversions of
1188 //! multiple channels into the specified starting memory buffer and
1189 //! each subsequent memory buffer up until the conversion is stored
1190 //! in a memory buffer dedicated as the end-of-sequence by the
1191 //! memory's control register.
1192 //! \n Modified bits are \b ADC12CONSEQx of \b ADC12CTL1 register.
1193 //!
1194 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
1195 //!
1196 //! \return None
1197 //
1198 //*****************************************************************************
1199 extern void ADC12_B_startConversion(uint16_t baseAddress,
1200  uint16_t startingMemoryBufferIndex,
1201  uint8_t conversionSequenceModeSelect);
1202 
1203 //*****************************************************************************
1204 //
1205 //! \brief Disables the ADC from converting any more signals.
1206 //!
1207 //! Disables the ADC from converting any more signals. If there is a conversion
1208 //! in progress, this function can stop it immediately if the preempt parameter
1209 //! is set as ADC12_B_PREEMPTCONVERSION, by changing the conversion mode to
1210 //! single-channel, single-conversion and disabling conversions. If the
1211 //! conversion mode is set as single-channel, single-conversion and this
1212 //! function is called without preemption, then the ADC core conversion status
1213 //! is polled until the conversion is complete before disabling conversions to
1214 //! prevent unpredictable data. If the ADC12_B_startConversion() has been
1215 //! called, then this function has to be called to re-initialize the ADC,
1216 //! reconfigure a memory buffer control, enable/disable the sampling pulse
1217 //! mode, or change the internal reference voltage.
1218 //!
1219 //! \param baseAddress is the base address of the ADC12B module.
1220 //! \param preempt specifies if the current conversion should be preemptively
1221 //! stopped before the end of the conversion.
1222 //! Valid values are:
1223 //! - \b ADC12_B_COMPLETECONVERSION - Allows the ADC12B to end the
1224 //! current conversion before disabling conversions.
1225 //! - \b ADC12_B_PREEMPTCONVERSION - Stops the ADC12B immediately, with
1226 //! unpredictable results of the current conversion.
1227 //!
1228 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
1229 //!
1230 //! \return None
1231 //
1232 //*****************************************************************************
1233 extern void ADC12_B_disableConversions(uint16_t baseAddress,
1234  bool preempt);
1235 
1236 //*****************************************************************************
1237 //
1238 //! \brief Returns the raw contents of the specified memory buffer.
1239 //!
1240 //! Returns the raw contents of the specified memory buffer. The format of the
1241 //! content depends on the read-back format of the data: if the data is in
1242 //! signed 2's complement format then the contents in the memory buffer will be
1243 //! left-justified with the least-significant bits as 0's, whereas if the data
1244 //! is in unsigned format then the contents in the memory buffer will be right-
1245 //! justified with the most-significant bits as 0's.
1246 //!
1247 //! \param baseAddress is the base address of the ADC12B module.
1248 //! \param memoryBufferIndex is the specified memory buffer to read.
1249 //! Valid values are:
1250 //! - \b ADC12_B_MEMORY_0
1251 //! - \b ADC12_B_MEMORY_1
1252 //! - \b ADC12_B_MEMORY_2
1253 //! - \b ADC12_B_MEMORY_3
1254 //! - \b ADC12_B_MEMORY_4
1255 //! - \b ADC12_B_MEMORY_5
1256 //! - \b ADC12_B_MEMORY_6
1257 //! - \b ADC12_B_MEMORY_7
1258 //! - \b ADC12_B_MEMORY_8
1259 //! - \b ADC12_B_MEMORY_9
1260 //! - \b ADC12_B_MEMORY_10
1261 //! - \b ADC12_B_MEMORY_11
1262 //! - \b ADC12_B_MEMORY_12
1263 //! - \b ADC12_B_MEMORY_13
1264 //! - \b ADC12_B_MEMORY_14
1265 //! - \b ADC12_B_MEMORY_15
1266 //! - \b ADC12_B_MEMORY_16
1267 //! - \b ADC12_B_MEMORY_17
1268 //! - \b ADC12_B_MEMORY_18
1269 //! - \b ADC12_B_MEMORY_19
1270 //! - \b ADC12_B_MEMORY_20
1271 //! - \b ADC12_B_MEMORY_21
1272 //! - \b ADC12_B_MEMORY_22
1273 //! - \b ADC12_B_MEMORY_23
1274 //! - \b ADC12_B_MEMORY_24
1275 //! - \b ADC12_B_MEMORY_25
1276 //! - \b ADC12_B_MEMORY_26
1277 //! - \b ADC12_B_MEMORY_27
1278 //! - \b ADC12_B_MEMORY_28
1279 //! - \b ADC12_B_MEMORY_29
1280 //! - \b ADC12_B_MEMORY_30
1281 //! - \b ADC12_B_MEMORY_31
1282 //!
1283 //! \return A signed integer of the contents of the specified memory buffer.
1284 //
1285 //*****************************************************************************
1286 extern uint16_t ADC12_B_getResults(uint16_t baseAddress,
1287  uint8_t memoryBufferIndex);
1288 
1289 //*****************************************************************************
1290 //
1291 //! \brief Use to change the resolution of the converted data.
1292 //!
1293 //! This function can be used to change the resolution of the converted data
1294 //! from the default of 12-bits.
1295 //!
1296 //! \param baseAddress is the base address of the ADC12B module.
1297 //! \param resolutionSelect determines the resolution of the converted data.
1298 //! Valid values are:
1299 //! - \b ADC12_B_RESOLUTION_8BIT
1300 //! - \b ADC12_B_RESOLUTION_10BIT
1301 //! - \b ADC12_B_RESOLUTION_12BIT [Default]
1302 //! \n Modified bits are \b ADC12RESx of \b ADC12CTL2 register.
1303 //!
1304 //! \return None
1305 //
1306 //*****************************************************************************
1307 extern void ADC12_B_setResolution(uint16_t baseAddress,
1308  uint8_t resolutionSelect);
1309 
1310 //*****************************************************************************
1311 //
1312 //! \brief Use to invert or un-invert the sample/hold signal.
1313 //!
1314 //! This function can be used to invert or un-invert the sample/hold signal.
1315 //! Note that if a conversion has been started with the startConversion()
1316 //! function, then a call to disableConversions() is required before this
1317 //! function may be called.
1318 //!
1319 //! \param baseAddress is the base address of the ADC12B module.
1320 //! \param invertedSignal set if the sample/hold signal should be inverted
1321 //! Valid values are:
1322 //! - \b ADC12_B_NONINVERTEDSIGNAL [Default] - a sample-and-hold of an
1323 //! input signal for conversion will be started on a rising edge of
1324 //! the sample/hold signal.
1325 //! - \b ADC12_B_INVERTEDSIGNAL - a sample-and-hold of an input signal
1326 //! for conversion will be started on a falling edge of the
1327 //! sample/hold signal.
1328 //! \n Modified bits are \b ADC12ISSH of \b ADC12CTL1 register.
1329 //!
1330 //! \return None
1331 //
1332 //*****************************************************************************
1333 extern void ADC12_B_setSampleHoldSignalInversion(uint16_t baseAddress,
1334  uint16_t invertedSignal);
1335 
1336 //*****************************************************************************
1337 //
1338 //! \brief Use to set the read-back format of the converted data.
1339 //!
1340 //! Sets the format of the converted data: how it will be stored into the
1341 //! memory buffer, and how it should be read back. The format can be set as
1342 //! right-justified (default), which indicates that the number will be
1343 //! unsigned, or left-justified, which indicates that the number will be signed
1344 //! in 2's complement format. This change affects all memory buffers for
1345 //! subsequent conversions.
1346 //!
1347 //! \param baseAddress is the base address of the ADC12B module.
1348 //! \param readBackFormat is the specified format to store the conversions in
1349 //! the memory buffer.
1350 //! Valid values are:
1351 //! - \b ADC12_B_UNSIGNED_BINARY [Default]
1352 //! - \b ADC12_B_SIGNED_2SCOMPLEMENT
1353 //! \n Modified bits are \b ADC12DF of \b ADC12CTL2 register.
1354 //!
1355 //! \return None
1356 //
1357 //*****************************************************************************
1358 extern void ADC12_B_setDataReadBackFormat(uint16_t baseAddress,
1359  uint8_t readBackFormat);
1360 
1361 //*****************************************************************************
1362 //
1363 //! \brief Use to set the ADC's power conservation mode if the sampling rate is
1364 //! at 50-ksps or less.
1365 //!
1366 //! Sets ADC's power mode. If the user has a sampling rate greater than
1367 //! 50-ksps, then he/she can only enable ADC12_B_REGULARPOWERMODE. If the
1368 //! sampling rate is 50-ksps or less, the user can enable ADC12_B_LOWPOWERMODE
1369 //! granting additional power savings.
1370 //!
1371 //! \param baseAddress is the base address of the ADC12B module.
1372 //! \param powerMode is the specified maximum sampling rate.
1373 //! Valid values are:
1374 //! - \b ADC12_B_REGULARPOWERMODE [Default] - If sampling rate is
1375 //! greater than 50-ksps, there is no power saving feature available.
1376 //! - \b ADC12_B_LOWPOWERMODE - If sampling rate is less than or equal
1377 //! to 50-ksps, select this value to save power
1378 //! \n Modified bits are \b ADC12SR of \b ADC12CTL2 register.
1379 //!
1380 //! \return None
1381 //
1382 //*****************************************************************************
1383 extern void ADC12_B_setAdcPowerMode(uint16_t baseAddress,
1384  uint8_t powerMode);
1385 
1386 //*****************************************************************************
1387 //
1388 //! \brief Returns the address of the specified memory buffer for the DMA
1389 //! module.
1390 //!
1391 //! Returns the address of the specified memory buffer. This can be used in
1392 //! conjunction with the DMA to store the converted data directly to memory.
1393 //!
1394 //! \param baseAddress is the base address of the ADC12B module.
1395 //! \param memoryIndex is the memory buffer to return the address of.
1396 //! Valid values are:
1397 //! - \b ADC12_B_MEMORY_0
1398 //! - \b ADC12_B_MEMORY_1
1399 //! - \b ADC12_B_MEMORY_2
1400 //! - \b ADC12_B_MEMORY_3
1401 //! - \b ADC12_B_MEMORY_4
1402 //! - \b ADC12_B_MEMORY_5
1403 //! - \b ADC12_B_MEMORY_6
1404 //! - \b ADC12_B_MEMORY_7
1405 //! - \b ADC12_B_MEMORY_8
1406 //! - \b ADC12_B_MEMORY_9
1407 //! - \b ADC12_B_MEMORY_10
1408 //! - \b ADC12_B_MEMORY_11
1409 //! - \b ADC12_B_MEMORY_12
1410 //! - \b ADC12_B_MEMORY_13
1411 //! - \b ADC12_B_MEMORY_14
1412 //! - \b ADC12_B_MEMORY_15
1413 //! - \b ADC12_B_MEMORY_16
1414 //! - \b ADC12_B_MEMORY_17
1415 //! - \b ADC12_B_MEMORY_18
1416 //! - \b ADC12_B_MEMORY_19
1417 //! - \b ADC12_B_MEMORY_20
1418 //! - \b ADC12_B_MEMORY_21
1419 //! - \b ADC12_B_MEMORY_22
1420 //! - \b ADC12_B_MEMORY_23
1421 //! - \b ADC12_B_MEMORY_24
1422 //! - \b ADC12_B_MEMORY_25
1423 //! - \b ADC12_B_MEMORY_26
1424 //! - \b ADC12_B_MEMORY_27
1425 //! - \b ADC12_B_MEMORY_28
1426 //! - \b ADC12_B_MEMORY_29
1427 //! - \b ADC12_B_MEMORY_30
1428 //! - \b ADC12_B_MEMORY_31
1429 //!
1430 //! \return address of the specified memory buffer
1431 //
1432 //*****************************************************************************
1433 extern uint32_t ADC12_B_getMemoryAddressForDMA(uint16_t baseAddress,
1434  uint8_t memoryIndex);
1435 
1436 //*****************************************************************************
1437 //
1438 //! \brief Returns the busy status of the ADC12B core.
1439 //!
1440 //! Returns the status of the ADC core if there is a conversion currently
1441 //! taking place.
1442 //!
1443 //! \param baseAddress is the base address of the ADC12B module.
1444 //!
1445 //! \return ADC12_B_BUSY or ADC12_B_NOTBUSY dependent if there is a conversion
1446 //! currently taking place.
1447 //! Return one of the following:
1448 //! - \b ADC12_B_NOTBUSY
1449 //! - \b ADC12_B_BUSY
1450 //! \n indicating if a conversion is taking place
1451 //
1452 //*****************************************************************************
1453 extern uint8_t ADC12_B_isBusy(uint16_t baseAddress);
1454 
1455 //*****************************************************************************
1456 //
1457 // Mark the end of the C bindings section for C++ compilers.
1458 //
1459 //*****************************************************************************
1460 #ifdef __cplusplus
1461 }
1462 #endif
1463 
1464 #endif
1465 #endif // __MSP430WARE_ADC12_B_H__
uint16_t sampleHoldSignalSourceSelect
Definition: adc12_b.h:44
void ADC12_B_clearInterrupt(uint16_t baseAddress, uint8_t interruptRegisterChoice, uint16_t memoryInterruptFlagMask)
Clears ADC12B selected interrupt flags.
Definition: adc12_b.c:160
uint32_t ADC12_B_getMemoryAddressForDMA(uint16_t baseAddress, uint8_t memoryIndex)
Returns the address of the specified memory buffer for the DMA module.
Definition: adc12_b.c:241
void ADC12_B_disableInterrupt(uint16_t baseAddress, uint16_t interruptMask0, uint16_t interruptMask1, uint16_t interruptMask2)
Disables selected ADC12B interrupt sources.
Definition: adc12_b.c:150
void ADC12_B_setWindowCompAdvanced(uint16_t baseAddress, uint16_t highThreshold, uint16_t lowThreshold)
Sets the high and low threshold for the window comparator feature.
Definition: adc12_b.c:132
uint16_t endOfSequence
Definition: adc12_b.h:188
void ADC12_B_setupSamplingTimer(uint16_t baseAddress, uint16_t clockCycleHoldCountLowMem, uint16_t clockCycleHoldCountHighMem, uint16_t multipleSamplesEnabled)
Sets up and enables the Sampling Timer Pulse Mode.
Definition: adc12_b.c:77
void ADC12_B_disable(uint16_t baseAddress)
Disables the ADC12B block.
Definition: adc12_b.c:64
void ADC12_B_configureMemory(uint16_t baseAddress, ADC12_B_configureMemoryParam *param)
Configures the controls of the selected memory buffer.
Definition: adc12_b.c:99
void ADC12_B_setResolution(uint16_t baseAddress, uint8_t resolutionSelect)
Use to change the resolution of the converted data.
Definition: adc12_b.c:213
uint16_t refVoltageSourceSelect
Definition: adc12_b.h:179
uint16_t differentialModeSelect
Definition: adc12_b.h:198
Used in the ADC12_B_init() function as the param parameter.
Definition: adc12_b.h:31
void ADC12_B_setSampleHoldSignalInversion(uint16_t baseAddress, uint16_t invertedSignal)
Use to invert or un-invert the sample/hold signal.
Definition: adc12_b.c:220
uint16_t windowComparatorSelect
Definition: adc12_b.h:193
uint16_t ADC12_B_getInterruptStatus(uint16_t baseAddress, uint8_t interruptRegisterChoice, uint16_t memoryInterruptFlagMask)
Returns the status of the selected memory interrupt flags.
Definition: adc12_b.c:169
void ADC12_B_enableInterrupt(uint16_t baseAddress, uint16_t interruptMask0, uint16_t interruptMask1, uint16_t interruptMask2)
Enables selected ADC12B interrupt sources.
Definition: adc12_b.c:140
uint8_t memoryBufferControlIndex
Definition: adc12_b.h:125
void ADC12_B_setDataReadBackFormat(uint16_t baseAddress, uint8_t readBackFormat)
Use to set the read-back format of the converted data.
Definition: adc12_b.c:227
uint8_t ADC12_B_isBusy(uint16_t baseAddress)
Returns the busy status of the ADC12B core.
Definition: adc12_b.c:248
bool ADC12_B_init(uint16_t baseAddress, ADC12_B_initParam *param)
Initializes the ADC12B Module.
Definition: adc12_b.c:21
Used in the ADC12_B_configureMemory() function as the param parameter.
Definition: adc12_b.h:90
uint8_t inputSourceSelect
Definition: adc12_b.h:161
void ADC12_B_disableSamplingTimer(uint16_t baseAddress)
Disables Sampling Timer Pulse Mode.
Definition: adc12_b.c:94
uint16_t ADC12_B_getResults(uint16_t baseAddress, uint8_t memoryBufferIndex)
Returns the raw contents of the specified memory buffer.
Definition: adc12_b.c:207
void ADC12_B_startConversion(uint16_t baseAddress, uint16_t startingMemoryBufferIndex, uint8_t conversionSequenceModeSelect)
Enables/Starts an Analog-to-Digital Conversion.
Definition: adc12_b.c:177
uint16_t clockSourcePredivider
Definition: adc12_b.h:71
uint16_t clockSourceDivider
Definition: adc12_b.h:64
uint16_t internalChannelMap
Definition: adc12_b.h:81
void ADC12_B_disableConversions(uint16_t baseAddress, bool preempt)
Disables the ADC from converting any more signals.
Definition: adc12_b.c:193
void ADC12_B_setAdcPowerMode(uint16_t baseAddress, uint8_t powerMode)
Use to set the ADC&#39;s power conservation mode if the sampling rate is at 50-ksps or less...
Definition: adc12_b.c:234
void ADC12_B_enable(uint16_t baseAddress)
Enables the ADC12B block.
Definition: adc12_b.c:55
uint8_t clockSourceSelect
Definition: adc12_b.h:53

Copyright 2020, Texas Instruments Incorporated