MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
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.
796 //!
797 //! \param baseAddress is the base address of the ADC12B module.
798 //! \param param is the pointer to struct for ADC12B memory configuration.
799 //!
800 //! \return None
801 //
802 //*****************************************************************************
803 extern void ADC12_B_configureMemory(uint16_t baseAddress,
805 
806 //*****************************************************************************
807 //
808 //! \brief Sets the high and low threshold for the window comparator feature.
809 //!
810 //! Sets the high and low threshold for the window comparator feature. Use the
811 //! ADC12HIIE, ADC12INIE, ADC12LOIE interrupts to utilize this feature.
812 //!
813 //! \param baseAddress is the base address of the ADC12B module.
814 //! \param highThreshold is the upper bound that could trip an interrupt for
815 //! the window comparator.
816 //! \param lowThreshold is the lower bound that could trip on interrupt for the
817 //! window comparator.
818 //!
819 //! \return None
820 //
821 //*****************************************************************************
822 extern void ADC12_B_setWindowCompAdvanced(uint16_t baseAddress,
823  uint16_t highThreshold,
824  uint16_t lowThreshold);
825 
826 //*****************************************************************************
827 //
828 //! \brief Enables selected ADC12B interrupt sources.
829 //!
830 //! Enables the indicated ADC12B interrupt sources. Only the sources that are
831 //! enabled can be reflected to the processor interrupt; disabled sources have
832 //! no effect on the processor. <b>Does not clear interrupt flags.
833 //!
834 //! \param baseAddress is the base address of the ADC12B module.
835 //! \param interruptMask0 is the bit mask of the memory buffer and overflow
836 //! interrupt sources to be enabled. If the desired interrupt is not
837 //! available in the selection for interruptMask0, then simply pass in a
838 //! '0' for this value.
839 //! Valid values are:
840 //! - \b ADC12_B_IE0
841 //! - \b ADC12_B_IE1
842 //! - \b ADC12_B_IE2
843 //! - \b ADC12_B_IE3
844 //! - \b ADC12_B_IE4
845 //! - \b ADC12_B_IE5
846 //! - \b ADC12_B_IE6
847 //! - \b ADC12_B_IE7
848 //! - \b ADC12_B_IE8
849 //! - \b ADC12_B_IE9
850 //! - \b ADC12_B_IE10
851 //! - \b ADC12_B_IE11
852 //! - \b ADC12_B_IE12
853 //! - \b ADC12_B_IE13
854 //! - \b ADC12_B_IE14
855 //! - \b ADC12_B_IE15
856 //! \param interruptMask1 is the bit mask of the memory buffer and overflow
857 //! interrupt sources to be enabled. If the desired interrupt is not
858 //! available in the selection for interruptMask1, then simply pass in a
859 //! '0' for this value.
860 //! Valid values are:
861 //! - \b ADC12_B_IE16
862 //! - \b ADC12_B_IE17
863 //! - \b ADC12_B_IE18
864 //! - \b ADC12_B_IE19
865 //! - \b ADC12_B_IE20
866 //! - \b ADC12_B_IE21
867 //! - \b ADC12_B_IE22
868 //! - \b ADC12_B_IE23
869 //! - \b ADC12_B_IE24
870 //! - \b ADC12_B_IE25
871 //! - \b ADC12_B_IE26
872 //! - \b ADC12_B_IE27
873 //! - \b ADC12_B_IE28
874 //! - \b ADC12_B_IE29
875 //! - \b ADC12_B_IE30
876 //! - \b ADC12_B_IE31
877 //! \param interruptMask2 is the bit mask of the memory buffer and overflow
878 //! interrupt sources to be enabled. If the desired interrupt is not
879 //! available in the selection for interruptMask2, then simply pass in a
880 //! '0' for this value.
881 //! Valid values are:
882 //! - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
883 //! register is either greater than the ADC12LO or lower than the
884 //! ADC12HI threshold. GIE bit must be set to enable the interrupt.
885 //! - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
886 //! lower limit interrupt of the window comparator for the result
887 //! register. GIE bit must be set to enable the interrupt.
888 //! - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
889 //! limit of the window comparator for the result register. GIE bit
890 //! must be set to enable the interrupt.
891 //! - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
892 //! to save to a memory buffer that has not been read out yet. GIE
893 //! bit must be set to enable the interrupt.
894 //! - \b ADC12_B_TOVIE - enable for a conversion that is about to start
895 //! before the previous conversion has been completed. GIE bit must
896 //! be set to enable the interrupt.
897 //! - \b ADC12_B_RDYIE - enable for the local buffered reference ready
898 //! signal. GIE bit must be set to enable the interrupt.
899 //!
900 //! Modified bits of \b ADC12IERx register.
901 //!
902 //! \return None
903 //
904 //*****************************************************************************
905 extern void ADC12_B_enableInterrupt(uint16_t baseAddress,
906  uint16_t interruptMask0,
907  uint16_t interruptMask1,
908  uint16_t interruptMask2);
909 
910 //*****************************************************************************
911 //
912 //! \brief Disables selected ADC12B interrupt sources.
913 //!
914 //! Disables the indicated ADC12B interrupt sources. Only the sources that are
915 //! enabled can be reflected to the processor interrupt; disabled sources have
916 //! no effect on the processor.
917 //!
918 //! \param baseAddress is the base address of the ADC12B module.
919 //! \param interruptMask0 is the bit mask of the memory buffer and overflow
920 //! interrupt sources to be disabled. If the desired interrupt is not
921 //! available in the selection for interruptMask0, then simply pass in a
922 //! '0' for this value.
923 //! Valid values are:
924 //! - \b ADC12_B_IE0
925 //! - \b ADC12_B_IE1
926 //! - \b ADC12_B_IE2
927 //! - \b ADC12_B_IE3
928 //! - \b ADC12_B_IE4
929 //! - \b ADC12_B_IE5
930 //! - \b ADC12_B_IE6
931 //! - \b ADC12_B_IE7
932 //! - \b ADC12_B_IE8
933 //! - \b ADC12_B_IE9
934 //! - \b ADC12_B_IE10
935 //! - \b ADC12_B_IE11
936 //! - \b ADC12_B_IE12
937 //! - \b ADC12_B_IE13
938 //! - \b ADC12_B_IE14
939 //! - \b ADC12_B_IE15
940 //! \param interruptMask1 is the bit mask of the memory buffer and overflow
941 //! interrupt sources to be disabled. If the desired interrupt is not
942 //! available in the selection for interruptMask1, then simply pass in a
943 //! '0' for this value.
944 //! Valid values are:
945 //! - \b ADC12_B_IE16
946 //! - \b ADC12_B_IE17
947 //! - \b ADC12_B_IE18
948 //! - \b ADC12_B_IE19
949 //! - \b ADC12_B_IE20
950 //! - \b ADC12_B_IE21
951 //! - \b ADC12_B_IE22
952 //! - \b ADC12_B_IE23
953 //! - \b ADC12_B_IE24
954 //! - \b ADC12_B_IE25
955 //! - \b ADC12_B_IE26
956 //! - \b ADC12_B_IE27
957 //! - \b ADC12_B_IE28
958 //! - \b ADC12_B_IE29
959 //! - \b ADC12_B_IE30
960 //! - \b ADC12_B_IE31
961 //! \param interruptMask2 is the bit mask of the memory buffer and overflow
962 //! interrupt sources to be disabled. If the desired interrupt is not
963 //! available in the selection for interruptMask2, then simply pass in a
964 //! '0' for this value.
965 //! Valid values are:
966 //! - \b ADC12_B_INIE - Interrupt enable for a conversion in the result
967 //! register is either greater than the ADC12LO or lower than the
968 //! ADC12HI threshold. GIE bit must be set to enable the interrupt.
969 //! - \b ADC12_B_LOIE - Interrupt enable for the falling short of the
970 //! lower limit interrupt of the window comparator for the result
971 //! register. GIE bit must be set to enable the interrupt.
972 //! - \b ADC12_B_HIIE - Interrupt enable for the exceeding the upper
973 //! limit of the window comparator for the result register. GIE bit
974 //! must be set to enable the interrupt.
975 //! - \b ADC12_B_OVIE - Interrupt enable for a conversion that is about
976 //! to save to a memory buffer that has not been read out yet. GIE
977 //! bit must be set to enable the interrupt.
978 //! - \b ADC12_B_TOVIE - enable for a conversion that is about to start
979 //! before the previous conversion has been completed. GIE bit must
980 //! be set to enable the interrupt.
981 //! - \b ADC12_B_RDYIE - enable for the local buffered reference ready
982 //! signal. GIE bit must be set to enable the interrupt.
983 //!
984 //! Modified bits of \b ADC12IERx register.
985 //!
986 //! \return None
987 //
988 //*****************************************************************************
989 extern void ADC12_B_disableInterrupt(uint16_t baseAddress,
990  uint16_t interruptMask0,
991  uint16_t interruptMask1,
992  uint16_t interruptMask2);
993 
994 //*****************************************************************************
995 //
996 //! \brief Clears ADC12B selected interrupt flags.
997 //!
998 //! Modified registers are ADC12IFG .
999 //!
1000 //! \param baseAddress is the base address of the ADC12B module.
1001 //! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
1002 //! interrupt register to update
1003 //! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
1004 //! overflow interrupt flags to be cleared.
1005 //! Valid values are:
1006 //! - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
1007 //! - \b ADC12_B_IFG1
1008 //! - \b ADC12_B_IFG2
1009 //! - \b ADC12_B_IFG3
1010 //! - \b ADC12_B_IFG4
1011 //! - \b ADC12_B_IFG5
1012 //! - \b ADC12_B_IFG6
1013 //! - \b ADC12_B_IFG7
1014 //! - \b ADC12_B_IFG8
1015 //! - \b ADC12_B_IFG9
1016 //! - \b ADC12_B_IFG10
1017 //! - \b ADC12_B_IFG11
1018 //! - \b ADC12_B_IFG12
1019 //! - \b ADC12_B_IFG13
1020 //! - \b ADC12_B_IFG14
1021 //! - \b ADC12_B_IFG15
1022 //! - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
1023 //! - \b ADC12_B_IFG17
1024 //! - \b ADC12_B_IFG18
1025 //! - \b ADC12_B_IFG19
1026 //! - \b ADC12_B_IFG20
1027 //! - \b ADC12_B_IFG21
1028 //! - \b ADC12_B_IFG22
1029 //! - \b ADC12_B_IFG23
1030 //! - \b ADC12_B_IFG24
1031 //! - \b ADC12_B_IFG25
1032 //! - \b ADC12_B_IFG26
1033 //! - \b ADC12_B_IFG27
1034 //! - \b ADC12_B_IFG28
1035 //! - \b ADC12_B_IFG29
1036 //! - \b ADC12_B_IFG30
1037 //! - \b ADC12_B_IFG31
1038 //! - \b ADC12_B_INIFG - interruptRegisterChoice = 2
1039 //! - \b ADC12_B_LOIFG
1040 //! - \b ADC12_B_HIIFG
1041 //! - \b ADC12_B_OVIFG
1042 //! - \b ADC12_B_TOVIFG
1043 //! - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
1044 //! cleared, so that it no longer asserts. The memory buffer
1045 //! interrupt flags are only cleared when the memory buffer is
1046 //! accessed. Note that the overflow interrupts do not have an
1047 //! interrupt flag to clear; they must be accessed directly from the
1048 //! interrupt vector.
1049 //!
1050 //! \return None
1051 //
1052 //*****************************************************************************
1053 extern void ADC12_B_clearInterrupt(uint16_t baseAddress,
1054  uint8_t interruptRegisterChoice,
1055  uint16_t memoryInterruptFlagMask);
1056 
1057 //*****************************************************************************
1058 //
1059 //! \brief Returns the status of the selected memory interrupt flags.
1060 //!
1061 //! Returns the status of the selected memory interrupt flags. Note that the
1062 //! overflow interrupts do not have an interrupt flag to clear; they must be
1063 //! accessed directly from the interrupt vector.
1064 //!
1065 //! \param baseAddress is the base address of the ADC12B module.
1066 //! \param interruptRegisterChoice is either 0, 1, or 2, to choose the correct
1067 //! interrupt register to update
1068 //! \param memoryInterruptFlagMask is the bit mask of the memory buffer and
1069 //! overflow interrupt flags to be cleared.
1070 //! Valid values are:
1071 //! - \b ADC12_B_IFG0 - interruptRegisterChoice = 0
1072 //! - \b ADC12_B_IFG1
1073 //! - \b ADC12_B_IFG2
1074 //! - \b ADC12_B_IFG3
1075 //! - \b ADC12_B_IFG4
1076 //! - \b ADC12_B_IFG5
1077 //! - \b ADC12_B_IFG6
1078 //! - \b ADC12_B_IFG7
1079 //! - \b ADC12_B_IFG8
1080 //! - \b ADC12_B_IFG9
1081 //! - \b ADC12_B_IFG10
1082 //! - \b ADC12_B_IFG11
1083 //! - \b ADC12_B_IFG12
1084 //! - \b ADC12_B_IFG13
1085 //! - \b ADC12_B_IFG14
1086 //! - \b ADC12_B_IFG15
1087 //! - \b ADC12_B_IFG16 - interruptRegisterChoice = 1
1088 //! - \b ADC12_B_IFG17
1089 //! - \b ADC12_B_IFG18
1090 //! - \b ADC12_B_IFG19
1091 //! - \b ADC12_B_IFG20
1092 //! - \b ADC12_B_IFG21
1093 //! - \b ADC12_B_IFG22
1094 //! - \b ADC12_B_IFG23
1095 //! - \b ADC12_B_IFG24
1096 //! - \b ADC12_B_IFG25
1097 //! - \b ADC12_B_IFG26
1098 //! - \b ADC12_B_IFG27
1099 //! - \b ADC12_B_IFG28
1100 //! - \b ADC12_B_IFG29
1101 //! - \b ADC12_B_IFG30
1102 //! - \b ADC12_B_IFG31
1103 //! - \b ADC12_B_INIFG - interruptRegisterChoice = 2
1104 //! - \b ADC12_B_LOIFG
1105 //! - \b ADC12_B_HIIFG
1106 //! - \b ADC12_B_OVIFG
1107 //! - \b ADC12_B_TOVIFG
1108 //! - \b ADC12_B_RDYIFG - The selected ADC12B interrupt flags are
1109 //! cleared, so that it no longer asserts. The memory buffer
1110 //! interrupt flags are only cleared when the memory buffer is
1111 //! accessed. Note that the overflow interrupts do not have an
1112 //! interrupt flag to clear; they must be accessed directly from the
1113 //! interrupt vector.
1114 //!
1115 //! \return The current interrupt flag status for the corresponding mask.
1116 //
1117 //*****************************************************************************
1118 extern uint16_t ADC12_B_getInterruptStatus(uint16_t baseAddress,
1119  uint8_t interruptRegisterChoice,
1120  uint16_t memoryInterruptFlagMask);
1121 
1122 //*****************************************************************************
1123 //
1124 //! \brief Enables/Starts an Analog-to-Digital Conversion.
1125 //!
1126 //! Enables/starts the conversion process of the ADC. If the sample/hold signal
1127 //! source chosen during initialization was ADC12OSC, then the conversion is
1128 //! started immediately, otherwise the chosen sample/hold signal source starts
1129 //! the conversion by a rising edge of the signal. Keep in mind when selecting
1130 //! conversion modes, that for sequenced and/or repeated modes, to keep the
1131 //! sample/hold-and-convert process continuing without a trigger from the
1132 //! sample/hold signal source, the multiple samples must be enabled using the
1133 //! ADC12_B_setupSamplingTimer() function. Note that after this function is
1134 //! called, the ADC12_B_stopConversions() has to be called to re-initialize the
1135 //! ADC, reconfigure a memory buffer control, enable/disable the sampling
1136 //! timer, or to change the internal reference voltage.
1137 //!
1138 //! \param baseAddress is the base address of the ADC12B module.
1139 //! \param startingMemoryBufferIndex is the memory buffer that will hold the
1140 //! first or only conversion.
1141 //! Valid values are:
1142 //! - \b ADC12_B_START_AT_ADC12MEM0 [Default]
1143 //! - \b ADC12_B_START_AT_ADC12MEM1
1144 //! - \b ADC12_B_START_AT_ADC12MEM2
1145 //! - \b ADC12_B_START_AT_ADC12MEM3
1146 //! - \b ADC12_B_START_AT_ADC12MEM4
1147 //! - \b ADC12_B_START_AT_ADC12MEM5
1148 //! - \b ADC12_B_START_AT_ADC12MEM6
1149 //! - \b ADC12_B_START_AT_ADC12MEM7
1150 //! - \b ADC12_B_START_AT_ADC12MEM8
1151 //! - \b ADC12_B_START_AT_ADC12MEM9
1152 //! - \b ADC12_B_START_AT_ADC12MEM10
1153 //! - \b ADC12_B_START_AT_ADC12MEM11
1154 //! - \b ADC12_B_START_AT_ADC12MEM12
1155 //! - \b ADC12_B_START_AT_ADC12MEM13
1156 //! - \b ADC12_B_START_AT_ADC12MEM14
1157 //! - \b ADC12_B_START_AT_ADC12MEM15
1158 //! - \b ADC12_B_START_AT_ADC12MEM16
1159 //! - \b ADC12_B_START_AT_ADC12MEM17
1160 //! - \b ADC12_B_START_AT_ADC12MEM18
1161 //! - \b ADC12_B_START_AT_ADC12MEM19
1162 //! - \b ADC12_B_START_AT_ADC12MEM20
1163 //! - \b ADC12_B_START_AT_ADC12MEM21
1164 //! - \b ADC12_B_START_AT_ADC12MEM22
1165 //! - \b ADC12_B_START_AT_ADC12MEM23
1166 //! - \b ADC12_B_START_AT_ADC12MEM24
1167 //! - \b ADC12_B_START_AT_ADC12MEM25
1168 //! - \b ADC12_B_START_AT_ADC12MEM26
1169 //! - \b ADC12_B_START_AT_ADC12MEM27
1170 //! - \b ADC12_B_START_AT_ADC12MEM28
1171 //! - \b ADC12_B_START_AT_ADC12MEM29
1172 //! - \b ADC12_B_START_AT_ADC12MEM30
1173 //! - \b ADC12_B_START_AT_ADC12MEM31
1174 //! \n Modified bits are \b ADC12CSTARTADDx of \b ADC12CTL1 register.
1175 //! \param conversionSequenceModeSelect determines the ADC operating mode.
1176 //! Valid values are:
1177 //! - \b ADC12_B_SINGLECHANNEL [Default] - one-time conversion of a
1178 //! single channel into a single memory buffer.
1179 //! - \b ADC12_B_SEQOFCHANNELS - one time conversion of multiple
1180 //! channels into the specified starting memory buffer and each
1181 //! subsequent memory buffer up until the conversion is stored in a
1182 //! memory buffer dedicated as the end-of-sequence by the memory's
1183 //! control register.
1184 //! - \b ADC12_B_REPEATED_SINGLECHANNEL - repeated conversions of one
1185 //! channel into a single memory buffer.
1186 //! - \b ADC12_B_REPEATED_SEQOFCHANNELS - repeated conversions of
1187 //! multiple channels into the specified starting memory buffer and
1188 //! each subsequent memory buffer up until the conversion is stored
1189 //! in a memory buffer dedicated as the end-of-sequence by the
1190 //! memory's control register.
1191 //! \n Modified bits are \b ADC12CONSEQx of \b ADC12CTL1 register.
1192 //!
1193 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
1194 //!
1195 //! \return None
1196 //
1197 //*****************************************************************************
1198 extern void ADC12_B_startConversion(uint16_t baseAddress,
1199  uint16_t startingMemoryBufferIndex,
1200  uint8_t conversionSequenceModeSelect);
1201 
1202 //*****************************************************************************
1203 //
1204 //! \brief Disables the ADC from converting any more signals.
1205 //!
1206 //! Disables the ADC from converting any more signals. If there is a conversion
1207 //! in progress, this function can stop it immediately if the preempt parameter
1208 //! is set as ADC12_B_PREEMPTCONVERSION, by changing the conversion mode to
1209 //! single-channel, single-conversion and disabling conversions. If the
1210 //! conversion mode is set as single-channel, single-conversion and this
1211 //! function is called without preemption, then the ADC core conversion status
1212 //! is polled until the conversion is complete before disabling conversions to
1213 //! prevent unpredictable data. If the ADC12_B_startConversion() has been
1214 //! called, then this function has to be called to re-initialize the ADC,
1215 //! reconfigure a memory buffer control, enable/disable the sampling pulse
1216 //! mode, or change the internal reference voltage.
1217 //!
1218 //! \param baseAddress is the base address of the ADC12B module.
1219 //! \param preempt specifies if the current conversion should be preemptively
1220 //! stopped before the end of the conversion.
1221 //! Valid values are:
1222 //! - \b ADC12_B_COMPLETECONVERSION - Allows the ADC12B to end the
1223 //! current conversion before disabling conversions.
1224 //! - \b ADC12_B_PREEMPTCONVERSION - Stops the ADC12B immediately, with
1225 //! unpredictable results of the current conversion.
1226 //!
1227 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
1228 //!
1229 //! \return None
1230 //
1231 //*****************************************************************************
1232 extern void ADC12_B_disableConversions(uint16_t baseAddress,
1233  bool preempt);
1234 
1235 //*****************************************************************************
1236 //
1237 //! \brief Returns the raw contents of the specified memory buffer.
1238 //!
1239 //! Returns the raw contents of the specified memory buffer. The format of the
1240 //! content depends on the read-back format of the data: if the data is in
1241 //! signed 2's complement format then the contents in the memory buffer will be
1242 //! left-justified with the least-significant bits as 0's, whereas if the data
1243 //! is in unsigned format then the contents in the memory buffer will be right-
1244 //! justified with the most-significant bits as 0's.
1245 //!
1246 //! \param baseAddress is the base address of the ADC12B module.
1247 //! \param memoryBufferIndex is the specified memory buffer to read.
1248 //! Valid values are:
1249 //! - \b ADC12_B_MEMORY_0
1250 //! - \b ADC12_B_MEMORY_1
1251 //! - \b ADC12_B_MEMORY_2
1252 //! - \b ADC12_B_MEMORY_3
1253 //! - \b ADC12_B_MEMORY_4
1254 //! - \b ADC12_B_MEMORY_5
1255 //! - \b ADC12_B_MEMORY_6
1256 //! - \b ADC12_B_MEMORY_7
1257 //! - \b ADC12_B_MEMORY_8
1258 //! - \b ADC12_B_MEMORY_9
1259 //! - \b ADC12_B_MEMORY_10
1260 //! - \b ADC12_B_MEMORY_11
1261 //! - \b ADC12_B_MEMORY_12
1262 //! - \b ADC12_B_MEMORY_13
1263 //! - \b ADC12_B_MEMORY_14
1264 //! - \b ADC12_B_MEMORY_15
1265 //! - \b ADC12_B_MEMORY_16
1266 //! - \b ADC12_B_MEMORY_17
1267 //! - \b ADC12_B_MEMORY_18
1268 //! - \b ADC12_B_MEMORY_19
1269 //! - \b ADC12_B_MEMORY_20
1270 //! - \b ADC12_B_MEMORY_21
1271 //! - \b ADC12_B_MEMORY_22
1272 //! - \b ADC12_B_MEMORY_23
1273 //! - \b ADC12_B_MEMORY_24
1274 //! - \b ADC12_B_MEMORY_25
1275 //! - \b ADC12_B_MEMORY_26
1276 //! - \b ADC12_B_MEMORY_27
1277 //! - \b ADC12_B_MEMORY_28
1278 //! - \b ADC12_B_MEMORY_29
1279 //! - \b ADC12_B_MEMORY_30
1280 //! - \b ADC12_B_MEMORY_31
1281 //!
1282 //! \return A signed integer of the contents of the specified memory buffer.
1283 //
1284 //*****************************************************************************
1285 extern uint16_t ADC12_B_getResults(uint16_t baseAddress,
1286  uint8_t memoryBufferIndex);
1287 
1288 //*****************************************************************************
1289 //
1290 //! \brief Use to change the resolution of the converted data.
1291 //!
1292 //! This function can be used to change the resolution of the converted data
1293 //! from the default of 12-bits.
1294 //!
1295 //! \param baseAddress is the base address of the ADC12B module.
1296 //! \param resolutionSelect determines the resolution of the converted data.
1297 //! Valid values are:
1298 //! - \b ADC12_B_RESOLUTION_8BIT
1299 //! - \b ADC12_B_RESOLUTION_10BIT
1300 //! - \b ADC12_B_RESOLUTION_12BIT [Default]
1301 //! \n Modified bits are \b ADC12RESx of \b ADC12CTL2 register.
1302 //!
1303 //! \return None
1304 //
1305 //*****************************************************************************
1306 extern void ADC12_B_setResolution(uint16_t baseAddress,
1307  uint8_t resolutionSelect);
1308 
1309 //*****************************************************************************
1310 //
1311 //! \brief Use to invert or un-invert the sample/hold signal.
1312 //!
1313 //! This function can be used to invert or un-invert the sample/hold signal.
1314 //! Note that if a conversion has been started with the startConversion()
1315 //! function, then a call to disableConversions() is required before this
1316 //! function may be called.
1317 //!
1318 //! \param baseAddress is the base address of the ADC12B module.
1319 //! \param invertedSignal set if the sample/hold signal should be inverted
1320 //! Valid values are:
1321 //! - \b ADC12_B_NONINVERTEDSIGNAL [Default] - a sample-and-hold of an
1322 //! input signal for conversion will be started on a rising edge of
1323 //! the sample/hold signal.
1324 //! - \b ADC12_B_INVERTEDSIGNAL - a sample-and-hold of an input signal
1325 //! for conversion will be started on a falling edge of the
1326 //! sample/hold signal.
1327 //! \n Modified bits are \b ADC12ISSH of \b ADC12CTL1 register.
1328 //!
1329 //! \return None
1330 //
1331 //*****************************************************************************
1332 extern void ADC12_B_setSampleHoldSignalInversion(uint16_t baseAddress,
1333  uint16_t invertedSignal);
1334 
1335 //*****************************************************************************
1336 //
1337 //! \brief Use to set the read-back format of the converted data.
1338 //!
1339 //! Sets the format of the converted data: how it will be stored into the
1340 //! memory buffer, and how it should be read back. The format can be set as
1341 //! right-justified (default), which indicates that the number will be
1342 //! unsigned, or left-justified, which indicates that the number will be signed
1343 //! in 2's complement format. This change affects all memory buffers for
1344 //! subsequent conversions.
1345 //!
1346 //! \param baseAddress is the base address of the ADC12B module.
1347 //! \param readBackFormat is the specified format to store the conversions in
1348 //! the memory buffer.
1349 //! Valid values are:
1350 //! - \b ADC12_B_UNSIGNED_BINARY [Default]
1351 //! - \b ADC12_B_SIGNED_2SCOMPLEMENT
1352 //! \n Modified bits are \b ADC12DF of \b ADC12CTL2 register.
1353 //!
1354 //! \return None
1355 //
1356 //*****************************************************************************
1357 extern void ADC12_B_setDataReadBackFormat(uint16_t baseAddress,
1358  uint8_t readBackFormat);
1359 
1360 //*****************************************************************************
1361 //
1362 //! \brief Use to set the ADC's power conservation mode if the sampling rate is
1363 //! at 50-ksps or less.
1364 //!
1365 //! Sets ADC's power mode. If the user has a sampling rate greater than
1366 //! 50-ksps, then he/she can only enable ADC12_B_REGULARPOWERMODE. If the
1367 //! sampling rate is 50-ksps or less, the user can enable ADC12_B_LOWPOWERMODE
1368 //! granting additional power savings.
1369 //!
1370 //! \param baseAddress is the base address of the ADC12B module.
1371 //! \param powerMode is the specified maximum sampling rate.
1372 //! Valid values are:
1373 //! - \b ADC12_B_REGULARPOWERMODE [Default] - If sampling rate is
1374 //! greater than 50-ksps, there is no power saving feature available.
1375 //! - \b ADC12_B_LOWPOWERMODE - If sampling rate is less than or equal
1376 //! to 50-ksps, select this value to save power
1377 //! \n Modified bits are \b ADC12SR of \b ADC12CTL2 register.
1378 //!
1379 //! \return None
1380 //
1381 //*****************************************************************************
1382 extern void ADC12_B_setAdcPowerMode(uint16_t baseAddress,
1383  uint8_t powerMode);
1384 
1385 //*****************************************************************************
1386 //
1387 //! \brief Returns the address of the specified memory buffer for the DMA
1388 //! module.
1389 //!
1390 //! Returns the address of the specified memory buffer. This can be used in
1391 //! conjunction with the DMA to store the converted data directly to memory.
1392 //!
1393 //! \param baseAddress is the base address of the ADC12B module.
1394 //! \param memoryIndex is the memory buffer to return the address of.
1395 //! Valid values are:
1396 //! - \b ADC12_B_MEMORY_0
1397 //! - \b ADC12_B_MEMORY_1
1398 //! - \b ADC12_B_MEMORY_2
1399 //! - \b ADC12_B_MEMORY_3
1400 //! - \b ADC12_B_MEMORY_4
1401 //! - \b ADC12_B_MEMORY_5
1402 //! - \b ADC12_B_MEMORY_6
1403 //! - \b ADC12_B_MEMORY_7
1404 //! - \b ADC12_B_MEMORY_8
1405 //! - \b ADC12_B_MEMORY_9
1406 //! - \b ADC12_B_MEMORY_10
1407 //! - \b ADC12_B_MEMORY_11
1408 //! - \b ADC12_B_MEMORY_12
1409 //! - \b ADC12_B_MEMORY_13
1410 //! - \b ADC12_B_MEMORY_14
1411 //! - \b ADC12_B_MEMORY_15
1412 //! - \b ADC12_B_MEMORY_16
1413 //! - \b ADC12_B_MEMORY_17
1414 //! - \b ADC12_B_MEMORY_18
1415 //! - \b ADC12_B_MEMORY_19
1416 //! - \b ADC12_B_MEMORY_20
1417 //! - \b ADC12_B_MEMORY_21
1418 //! - \b ADC12_B_MEMORY_22
1419 //! - \b ADC12_B_MEMORY_23
1420 //! - \b ADC12_B_MEMORY_24
1421 //! - \b ADC12_B_MEMORY_25
1422 //! - \b ADC12_B_MEMORY_26
1423 //! - \b ADC12_B_MEMORY_27
1424 //! - \b ADC12_B_MEMORY_28
1425 //! - \b ADC12_B_MEMORY_29
1426 //! - \b ADC12_B_MEMORY_30
1427 //! - \b ADC12_B_MEMORY_31
1428 //!
1429 //! \return address of the specified memory buffer
1430 //
1431 //*****************************************************************************
1432 extern uint32_t ADC12_B_getMemoryAddressForDMA(uint16_t baseAddress,
1433  uint8_t memoryIndex);
1434 
1435 //*****************************************************************************
1436 //
1437 //! \brief Returns the busy status of the ADC12B core.
1438 //!
1439 //! Returns the status of the ADC core if there is a conversion currently
1440 //! taking place.
1441 //!
1442 //! \param baseAddress is the base address of the ADC12B module.
1443 //!
1444 //! \return ADC12_B_BUSY or ADC12_B_NOTBUSY dependent if there is a conversion
1445 //! currently taking place.
1446 //! Return one of the following:
1447 //! - \b ADC12_B_NOTBUSY
1448 //! - \b ADC12_B_BUSY
1449 //! \n indicating if a conversion is taking place
1450 //
1451 //*****************************************************************************
1452 extern uint8_t ADC12_B_isBusy(uint16_t baseAddress);
1453 
1454 //*****************************************************************************
1455 //
1456 // Mark the end of the C bindings section for C++ compilers.
1457 //
1458 //*****************************************************************************
1459 #ifdef __cplusplus
1460 }
1461 #endif
1462 
1463 #endif
1464 #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:150
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:231
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:140
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:122
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:73
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:95
void ADC12_B_setResolution(uint16_t baseAddress, uint8_t resolutionSelect)
Use to change the resolution of the converted data.
Definition: adc12_b.c:203
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:210
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:159
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:130
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:217
uint8_t ADC12_B_isBusy(uint16_t baseAddress)
Returns the busy status of the ADC12B core.
Definition: adc12_b.c:238
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:90
uint16_t ADC12_B_getResults(uint16_t baseAddress, uint8_t memoryBufferIndex)
Returns the raw contents of the specified memory buffer.
Definition: adc12_b.c:197
void ADC12_B_startConversion(uint16_t baseAddress, uint16_t startingMemoryBufferIndex, uint8_t conversionSequenceModeSelect)
Enables/Starts an Analog-to-Digital Conversion.
Definition: adc12_b.c:167
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:183
void ADC12_B_setAdcPowerMode(uint16_t baseAddress, uint8_t powerMode)
Use to set the ADC's power conservation mode if the sampling rate is at 50-ksps or less...
Definition: adc12_b.c:224
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 2015, Texas Instruments Incorporated