MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
adc12_a.h
1 //*****************************************************************************
2 //
3 // adc12_a.h - Driver for the ADC12_A Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_ADC12_A_H__
8 #define __MSP430WARE_ADC12_A_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #ifdef __MSP430_HAS_ADC12_PLUS__
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_A_configureMemory() function as the param
29 //! parameter.
30 //
31 //*****************************************************************************
33  //! Is the selected memory buffer to set the configuration for.
34  //! \n Valid values are:
35  //! - \b ADC12_A_MEMORY_0 [Default]
36  //! - \b ADC12_A_MEMORY_1
37  //! - \b ADC12_A_MEMORY_2
38  //! - \b ADC12_A_MEMORY_3
39  //! - \b ADC12_A_MEMORY_4
40  //! - \b ADC12_A_MEMORY_5
41  //! - \b ADC12_A_MEMORY_6
42  //! - \b ADC12_A_MEMORY_7
43  //! - \b ADC12_A_MEMORY_8
44  //! - \b ADC12_A_MEMORY_9
45  //! - \b ADC12_A_MEMORY_10
46  //! - \b ADC12_A_MEMORY_11
47  //! - \b ADC12_A_MEMORY_12
48  //! - \b ADC12_A_MEMORY_13
49  //! - \b ADC12_A_MEMORY_14
50  //! - \b ADC12_A_MEMORY_15
52  //! Is the input that will store the converted data into the specified
53  //! memory buffer.
54  //! \n Valid values are:
55  //! - \b ADC12_A_INPUT_A0 [Default]
56  //! - \b ADC12_A_INPUT_A1
57  //! - \b ADC12_A_INPUT_A2
58  //! - \b ADC12_A_INPUT_A3
59  //! - \b ADC12_A_INPUT_A4
60  //! - \b ADC12_A_INPUT_A5
61  //! - \b ADC12_A_INPUT_A6
62  //! - \b ADC12_A_INPUT_A7
63  //! - \b ADC12_A_INPUT_A8
64  //! - \b ADC12_A_INPUT_A9
65  //! - \b ADC12_A_INPUT_TEMPSENSOR
66  //! - \b ADC12_A_INPUT_BATTERYMONITOR
67  //! - \b ADC12_A_INPUT_A12
68  //! - \b ADC12_A_INPUT_A13
69  //! - \b ADC12_A_INPUT_A14
70  //! - \b ADC12_A_INPUT_A15
72  //! Is the reference voltage source to set as the upper limit for the
73  //! conversion stored in the specified memory.
74  //! \n Valid values are:
75  //! - \b ADC12_A_VREFPOS_AVCC [Default]
76  //! - \b ADC12_A_VREFPOS_EXT
77  //! - \b ADC12_A_VREFPOS_INT
79  //! Is the reference voltage source to set as the lower limit for the
80  //! conversion stored in the specified memory.
81  //! \n Valid values are:
82  //! - \b ADC12_A_VREFNEG_AVSS [Default]
83  //! - \b ADC12_A_VREFNEG_EXT
85  //! Indicates that the specified memory buffer will be the end of the
86  //! sequence if a sequenced conversion mode is selected
87  //! \n Valid values are:
88  //! - \b ADC12_A_NOTENDOFSEQUENCE [Default] - The specified memory buffer
89  //! will NOT be the end of the sequence OR a sequenced conversion mode
90  //! is not selected.
91  //! - \b ADC12_A_ENDOFSEQUENCE - The specified memory buffer will be the
92  //! end of the sequence.
93  uint8_t endOfSequence;
95 
96 
97 //*****************************************************************************
98 //
99 // The following are values that can be passed to the clockSourceSelect
100 // parameter for functions: ADC12_A_init().
101 //
102 //*****************************************************************************
103 #define ADC12_A_CLOCKSOURCE_ADC12OSC (ADC12SSEL_0)
104 #define ADC12_A_CLOCKSOURCE_ACLK (ADC12SSEL_1)
105 #define ADC12_A_CLOCKSOURCE_MCLK (ADC12SSEL_2)
106 #define ADC12_A_CLOCKSOURCE_SMCLK (ADC12SSEL_3)
107 
108 //*****************************************************************************
109 //
110 // The following are values that can be passed to the clockSourceDivider
111 // parameter for functions: ADC12_A_init().
112 //
113 //*****************************************************************************
114 #define ADC12_A_CLOCKDIVIDER_1 (ADC12DIV_0)
115 #define ADC12_A_CLOCKDIVIDER_2 (ADC12DIV_1)
116 #define ADC12_A_CLOCKDIVIDER_3 (ADC12DIV_2)
117 #define ADC12_A_CLOCKDIVIDER_4 (ADC12DIV_3)
118 #define ADC12_A_CLOCKDIVIDER_5 (ADC12DIV_4)
119 #define ADC12_A_CLOCKDIVIDER_6 (ADC12DIV_5)
120 #define ADC12_A_CLOCKDIVIDER_7 (ADC12DIV_6)
121 #define ADC12_A_CLOCKDIVIDER_8 (ADC12DIV_7)
122 #define ADC12_A_CLOCKDIVIDER_12 (ADC12DIV_2 + ADC12PDIV)
123 #define ADC12_A_CLOCKDIVIDER_16 (ADC12DIV_3 + ADC12PDIV)
124 #define ADC12_A_CLOCKDIVIDER_20 (ADC12DIV_4 + ADC12PDIV)
125 #define ADC12_A_CLOCKDIVIDER_24 (ADC12DIV_5 + ADC12PDIV)
126 #define ADC12_A_CLOCKDIVIDER_28 (ADC12DIV_6 + ADC12PDIV)
127 #define ADC12_A_CLOCKDIVIDER_32 (ADC12DIV_7 + ADC12PDIV)
128 
129 //*****************************************************************************
130 //
131 // The following are values that can be passed to the
132 // sampleHoldSignalSourceSelect parameter for functions: ADC12_A_init().
133 //
134 //*****************************************************************************
135 #define ADC12_A_SAMPLEHOLDSOURCE_SC (ADC12SHS_0)
136 #define ADC12_A_SAMPLEHOLDSOURCE_1 (ADC12SHS_1)
137 #define ADC12_A_SAMPLEHOLDSOURCE_2 (ADC12SHS_2)
138 #define ADC12_A_SAMPLEHOLDSOURCE_3 (ADC12SHS_3)
139 
140 //*****************************************************************************
141 //
142 // The following are values that can be passed to the clockCycleHoldCountLowMem
143 // parameter for functions: ADC12_A_setupSamplingTimer(); the
144 // clockCycleHoldCountHighMem parameter for functions:
145 // ADC12_A_setupSamplingTimer().
146 //
147 //*****************************************************************************
148 #define ADC12_A_CYCLEHOLD_4_CYCLES (ADC12SHT0_0)
149 #define ADC12_A_CYCLEHOLD_8_CYCLES (ADC12SHT0_1)
150 #define ADC12_A_CYCLEHOLD_16_CYCLES (ADC12SHT0_2)
151 #define ADC12_A_CYCLEHOLD_32_CYCLES (ADC12SHT0_3)
152 #define ADC12_A_CYCLEHOLD_64_CYCLES (ADC12SHT0_4)
153 #define ADC12_A_CYCLEHOLD_96_CYCLES (ADC12SHT0_5)
154 #define ADC12_A_CYCLEHOLD_128_CYCLES (ADC12SHT0_6)
155 #define ADC12_A_CYCLEHOLD_192_CYCLES (ADC12SHT0_7)
156 #define ADC12_A_CYCLEHOLD_256_CYCLES (ADC12SHT0_8)
157 #define ADC12_A_CYCLEHOLD_384_CYCLES (ADC12SHT0_9)
158 #define ADC12_A_CYCLEHOLD_512_CYCLES (ADC12SHT0_10)
159 #define ADC12_A_CYCLEHOLD_768_CYCLES (ADC12SHT0_11)
160 #define ADC12_A_CYCLEHOLD_1024_CYCLES (ADC12SHT0_12)
161 
162 //*****************************************************************************
163 //
164 // The following are values that can be passed to the multipleSamplesEnabled
165 // parameter for functions: ADC12_A_setupSamplingTimer().
166 //
167 //*****************************************************************************
168 #define ADC12_A_MULTIPLESAMPLESDISABLE (!(ADC12MSC))
169 #define ADC12_A_MULTIPLESAMPLESENABLE (ADC12MSC)
170 
171 //*****************************************************************************
172 //
173 // The following are values that can be passed to the param parameter for
174 // functions: ADC12_A_configureMemory().
175 //
176 //*****************************************************************************
177 #define ADC12_A_VREFPOS_AVCC (!(ADC12SREF0 + ADC12SREF1))
178 #define ADC12_A_VREFPOS_EXT (ADC12SREF1)
179 #define ADC12_A_VREFPOS_INT (ADC12SREF0)
180 
181 //*****************************************************************************
182 //
183 // The following are values that can be passed to the param parameter for
184 // functions: ADC12_A_configureMemory().
185 //
186 //*****************************************************************************
187 #define ADC12_A_VREFNEG_AVSS (!(ADC12SREF2))
188 #define ADC12_A_VREFNEG_EXT (ADC12SREF2)
189 
190 //*****************************************************************************
191 //
192 // The following are values that can be passed to the param parameter for
193 // functions: ADC12_A_configureMemory().
194 //
195 //*****************************************************************************
196 #define ADC12_A_NOTENDOFSEQUENCE (!(ADC12EOS))
197 #define ADC12_A_ENDOFSEQUENCE (ADC12EOS)
198 
199 //*****************************************************************************
200 //
201 // The following are values that can be passed to the param parameter for
202 // functions: ADC12_A_configureMemory().
203 //
204 //*****************************************************************************
205 #define ADC12_A_INPUT_A0 (ADC12INCH_0)
206 #define ADC12_A_INPUT_A1 (ADC12INCH_1)
207 #define ADC12_A_INPUT_A2 (ADC12INCH_2)
208 #define ADC12_A_INPUT_A3 (ADC12INCH_3)
209 #define ADC12_A_INPUT_A4 (ADC12INCH_4)
210 #define ADC12_A_INPUT_A5 (ADC12INCH_5)
211 #define ADC12_A_INPUT_A6 (ADC12INCH_6)
212 #define ADC12_A_INPUT_A7 (ADC12INCH_7)
213 #define ADC12_A_INPUT_A8 (ADC12INCH_8)
214 #define ADC12_A_INPUT_A9 (ADC12INCH_9)
215 #define ADC12_A_INPUT_TEMPSENSOR (ADC12INCH_10)
216 #define ADC12_A_INPUT_BATTERYMONITOR (ADC12INCH_11)
217 #define ADC12_A_INPUT_A12 (ADC12INCH_12)
218 #define ADC12_A_INPUT_A13 (ADC12INCH_13)
219 #define ADC12_A_INPUT_A14 (ADC12INCH_14)
220 #define ADC12_A_INPUT_A15 (ADC12INCH_15)
221 
222 //*****************************************************************************
223 //
224 // The following are values that can be passed to the startingMemoryBufferIndex
225 // parameter for functions: ADC12_A_startConversion(); the memoryIndex
226 // parameter for functions: ADC12_A_getMemoryAddressForDMA(); the
227 // memoryBufferIndex parameter for functions: ADC12_A_getResults(); the param
228 // parameter for functions: ADC12_A_configureMemory().
229 //
230 //*****************************************************************************
231 #define ADC12_A_MEMORY_0 (0x0)
232 #define ADC12_A_MEMORY_1 (0x1)
233 #define ADC12_A_MEMORY_2 (0x2)
234 #define ADC12_A_MEMORY_3 (0x3)
235 #define ADC12_A_MEMORY_4 (0x4)
236 #define ADC12_A_MEMORY_5 (0x5)
237 #define ADC12_A_MEMORY_6 (0x6)
238 #define ADC12_A_MEMORY_7 (0x7)
239 #define ADC12_A_MEMORY_8 (0x8)
240 #define ADC12_A_MEMORY_9 (0x9)
241 #define ADC12_A_MEMORY_10 (0xA)
242 #define ADC12_A_MEMORY_11 (0xB)
243 #define ADC12_A_MEMORY_12 (0xC)
244 #define ADC12_A_MEMORY_13 (0xD)
245 #define ADC12_A_MEMORY_14 (0xE)
246 #define ADC12_A_MEMORY_15 (0xF)
247 
248 //*****************************************************************************
249 //
250 // The following are values that can be passed to the memoryInterruptFlagMask
251 // parameter for functions: ADC12_A_clearInterrupt(), and
252 // ADC12_A_getInterruptStatus().
253 //
254 //*****************************************************************************
255 #define ADC12_A_IFG0 (ADC12IFG0)
256 #define ADC12_A_IFG1 (ADC12IFG1)
257 #define ADC12_A_IFG2 (ADC12IFG2)
258 #define ADC12_A_IFG3 (ADC12IFG3)
259 #define ADC12_A_IFG4 (ADC12IFG4)
260 #define ADC12_A_IFG5 (ADC12IFG5)
261 #define ADC12_A_IFG6 (ADC12IFG6)
262 #define ADC12_A_IFG7 (ADC12IFG7)
263 #define ADC12_A_IFG8 (ADC12IFG8)
264 #define ADC12_A_IFG9 (ADC12IFG9)
265 #define ADC12_A_IFG10 (ADC12IFG10)
266 #define ADC12_A_IFG11 (ADC12IFG11)
267 #define ADC12_A_IFG12 (ADC12IFG12)
268 #define ADC12_A_IFG13 (ADC12IFG13)
269 #define ADC12_A_IFG14 (ADC12IFG14)
270 #define ADC12_A_IFG15 (ADC12IFG15)
271 
272 //*****************************************************************************
273 //
274 // The following are values that can be passed to the
275 // conversionSequenceModeSelect parameter for functions:
276 // ADC12_A_startConversion().
277 //
278 //*****************************************************************************
279 #define ADC12_A_SINGLECHANNEL (ADC12CONSEQ_0)
280 #define ADC12_A_SEQOFCHANNELS (ADC12CONSEQ_1)
281 #define ADC12_A_REPEATED_SINGLECHANNEL (ADC12CONSEQ_2)
282 #define ADC12_A_REPEATED_SEQOFCHANNELS (ADC12CONSEQ_3)
283 
284 //*****************************************************************************
285 //
286 // The following are values that can be passed to the preempt parameter for
287 // functions: ADC12_A_disableConversions().
288 //
289 //*****************************************************************************
290 #define ADC12_A_COMPLETECONVERSION false
291 #define ADC12_A_PREEMPTCONVERSION true
292 
293 //*****************************************************************************
294 //
295 // The following are values that can be passed to the resolutionSelect
296 // parameter for functions: ADC12_A_setResolution().
297 //
298 //*****************************************************************************
299 #define ADC12_A_RESOLUTION_8BIT (ADC12RES_0)
300 #define ADC12_A_RESOLUTION_10BIT (ADC12RES_1)
301 #define ADC12_A_RESOLUTION_12BIT (ADC12RES_2)
302 
303 //*****************************************************************************
304 //
305 // The following are values that can be passed to the invertedSignal parameter
306 // for functions: ADC12_A_setSampleHoldSignalInversion().
307 //
308 //*****************************************************************************
309 #define ADC12_A_NONINVERTEDSIGNAL (!(ADC12ISSH))
310 #define ADC12_A_INVERTEDSIGNAL (ADC12ISSH)
311 
312 //*****************************************************************************
313 //
314 // The following are values that can be passed to the readBackFormat parameter
315 // for functions: ADC12_A_setDataReadBackFormat().
316 //
317 //*****************************************************************************
318 #define ADC12_A_UNSIGNED_BINARY (!(ADC12DF))
319 #define ADC12_A_SIGNED_2SCOMPLEMENT (ADC12DF)
320 
321 //*****************************************************************************
322 //
323 // The following are values that can be passed to the samplingRateSelect
324 // parameter for functions: ADC12_A_setReferenceBufferSamplingRate().
325 //
326 //*****************************************************************************
327 #define ADC12_A_MAXSAMPLINGRATE_200KSPS (!(ADC12SR))
328 #define ADC12_A_MAXSAMPLINGRATE_50KSPS (ADC12SR)
329 
330 //*****************************************************************************
331 //
332 // The following are values that can be passed toThe following are values that
333 // can be returned by the ADC12_A_isBusy() function.
334 //
335 //*****************************************************************************
336 #define ADC12_A_NOTBUSY 0x00
337 #define ADC12_A_BUSY ADC12BUSY
338 
339 //*****************************************************************************
340 //
341 // The following are values that can be passed to the interruptMask parameter
342 // for functions: ADC12_A_enableInterrupt(), and ADC12_A_disableInterrupt().
343 //
344 //*****************************************************************************
345 #define ADC12_A_IE0 (ADC12IE0)
346 #define ADC12_A_IE1 (ADC12IE1)
347 #define ADC12_A_IE2 (ADC12IE2)
348 #define ADC12_A_IE3 (ADC12IE3)
349 #define ADC12_A_IE4 (ADC12IE4)
350 #define ADC12_A_IE5 (ADC12IE5)
351 #define ADC12_A_IE6 (ADC12IE6)
352 #define ADC12_A_IE7 (ADC12IE7)
353 #define ADC12_A_IE8 (ADC12IE8)
354 #define ADC12_A_IE9 (ADC12IE9)
355 #define ADC12_A_IE10 (ADC12IE10)
356 #define ADC12_A_IE11 (ADC12IE11)
357 #define ADC12_A_IE12 (ADC12IE12)
358 #define ADC12_A_IE13 (ADC12IE13)
359 #define ADC12_A_IE14 (ADC12IE14)
360 #define ADC12_A_IE15 (ADC12IE15)
361 #define ADC12_A_OVERFLOW_IE ((uint32_t)ADC12OVIE << 16)
362 #define ADC12_A_CONVERSION_TIME_OVERFLOW_IE ((uint32_t)ADC12TOVIE << 16)
363 
364 //*****************************************************************************
365 //
366 // Prototypes for the APIs.
367 //
368 //*****************************************************************************
369 
370 //*****************************************************************************
371 //
372 //! \brief Initializes the ADC12_A Module.
373 //!
374 //! This function initializes the ADC module to allow for analog-to-digital
375 //! conversions. Specifically this function sets up the sample-and-hold signal
376 //! and clock sources for the ADC core to use for conversions. Upon successful
377 //! completion of the initialization all of the ADC control registers will be
378 //! reset, excluding the memory controls and reference module bits, the given
379 //! parameters will be set, and the ADC core will be turned on (Note, that the
380 //! ADC core only draws power during conversions and remains off when not
381 //! converting).Note that sample/hold signal sources are device dependent. Note
382 //! that if re-initializing the ADC after starting a conversion with the
383 //! startConversion() function, the disableConversion() must be called BEFORE
384 //! this function can be called.
385 //!
386 //! \param baseAddress is the base address of the ADC12_A module.
387 //! \param sampleHoldSignalSourceSelect is the signal that will trigger a
388 //! sample-and-hold for an input signal to be converted. This parameter
389 //! is device specific and sources should be found in the device's
390 //! datasheet.
391 //! Valid values are:
392 //! - \b ADC12_A_SAMPLEHOLDSOURCE_SC [Default]
393 //! - \b ADC12_A_SAMPLEHOLDSOURCE_1
394 //! - \b ADC12_A_SAMPLEHOLDSOURCE_2
395 //! - \b ADC12_A_SAMPLEHOLDSOURCE_3 - This parameter is device specific
396 //! and sources should be found in the device's datasheet.
397 //! \n Modified bits are \b ADC12SHSx of \b ADC12CTL1 register.
398 //! \param clockSourceSelect selects the clock that will be used by the ADC12_A
399 //! core, and the sampling timer if a sampling pulse mode is enabled.
400 //! Valid values are:
401 //! - \b ADC12_A_CLOCKSOURCE_ADC12OSC [Default] - MODOSC 5 MHz
402 //! oscillator from the UCS
403 //! - \b ADC12_A_CLOCKSOURCE_ACLK - The Auxiliary Clock
404 //! - \b ADC12_A_CLOCKSOURCE_MCLK - The Master Clock
405 //! - \b ADC12_A_CLOCKSOURCE_SMCLK - The Sub-Master Clock
406 //! \n Modified bits are \b ADC12SSELx of \b ADC12CTL1 register.
407 //! \param clockSourceDivider selects the amount that the clock will be
408 //! divided.
409 //! Valid values are:
410 //! - \b ADC12_A_CLOCKDIVIDER_1 [Default]
411 //! - \b ADC12_A_CLOCKDIVIDER_2
412 //! - \b ADC12_A_CLOCKDIVIDER_3
413 //! - \b ADC12_A_CLOCKDIVIDER_4
414 //! - \b ADC12_A_CLOCKDIVIDER_5
415 //! - \b ADC12_A_CLOCKDIVIDER_6
416 //! - \b ADC12_A_CLOCKDIVIDER_7
417 //! - \b ADC12_A_CLOCKDIVIDER_8
418 //! - \b ADC12_A_CLOCKDIVIDER_12
419 //! - \b ADC12_A_CLOCKDIVIDER_16
420 //! - \b ADC12_A_CLOCKDIVIDER_20
421 //! - \b ADC12_A_CLOCKDIVIDER_24
422 //! - \b ADC12_A_CLOCKDIVIDER_28
423 //! - \b ADC12_A_CLOCKDIVIDER_32
424 //! \n Modified bits are \b ADC12PDIV of \b ADC12CTL2 register; bits \b
425 //! ADC12DIVx of \b ADC12CTL1 register.
426 //!
427 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
428 //
429 //*****************************************************************************
430 extern bool ADC12_A_init(uint16_t baseAddress,
431  uint16_t sampleHoldSignalSourceSelect,
432  uint8_t clockSourceSelect,
433  uint16_t clockSourceDivider);
434 
435 //*****************************************************************************
436 //
437 //! \brief Enables the ADC12_A block.
438 //!
439 //! This will enable operation of the ADC12_A block.
440 //!
441 //! \param baseAddress is the base address of the ADC12_A module.
442 //!
443 //! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
444 //!
445 //! \return None
446 //
447 //*****************************************************************************
448 extern void ADC12_A_enable(uint16_t baseAddress);
449 
450 //*****************************************************************************
451 //
452 //! \brief Disables the ADC12_A block.
453 //!
454 //! This will disable operation of the ADC12_A block.
455 //!
456 //! \param baseAddress is the base address of the ADC12_A module.
457 //!
458 //! Modified bits are \b ADC12ON of \b ADC12CTL0 register.
459 //!
460 //! \return None
461 //
462 //*****************************************************************************
463 extern void ADC12_A_disable(uint16_t baseAddress);
464 
465 //*****************************************************************************
466 //
467 //! \brief Sets up and enables the Sampling Timer Pulse Mode.
468 //!
469 //! This function sets up the sampling timer pulse mode which allows the
470 //! sample/hold signal to trigger a sampling timer to sample-and-hold an input
471 //! signal for a specified number of clock cycles without having to hold the
472 //! sample/hold signal for the entire period of sampling. Note that if a
473 //! conversion has been started with the startConversion() function, then a
474 //! call to disableConversions() is required before this function may be
475 //! called.
476 //!
477 //! \param baseAddress is the base address of the ADC12_A module.
478 //! \param clockCycleHoldCountLowMem sets the amount of clock cycles to sample-
479 //! and-hold for the higher memory buffers 0-7.
480 //! Valid values are:
481 //! - \b ADC12_A_CYCLEHOLD_4_CYCLES [Default]
482 //! - \b ADC12_A_CYCLEHOLD_8_CYCLES
483 //! - \b ADC12_A_CYCLEHOLD_16_CYCLES
484 //! - \b ADC12_A_CYCLEHOLD_32_CYCLES
485 //! - \b ADC12_A_CYCLEHOLD_64_CYCLES
486 //! - \b ADC12_A_CYCLEHOLD_96_CYCLES
487 //! - \b ADC12_A_CYCLEHOLD_128_CYCLES
488 //! - \b ADC12_A_CYCLEHOLD_192_CYCLES
489 //! - \b ADC12_A_CYCLEHOLD_256_CYCLES
490 //! - \b ADC12_A_CYCLEHOLD_384_CYCLES
491 //! - \b ADC12_A_CYCLEHOLD_512_CYCLES
492 //! - \b ADC12_A_CYCLEHOLD_768_CYCLES
493 //! - \b ADC12_A_CYCLEHOLD_1024_CYCLES
494 //! \n Modified bits are \b ADC12SHT0x of \b ADC12CTL0 register.
495 //! \param clockCycleHoldCountHighMem sets the amount of clock cycles to
496 //! sample-and-hold for the higher memory buffers 8-15.
497 //! Valid values are:
498 //! - \b ADC12_A_CYCLEHOLD_4_CYCLES [Default]
499 //! - \b ADC12_A_CYCLEHOLD_8_CYCLES
500 //! - \b ADC12_A_CYCLEHOLD_16_CYCLES
501 //! - \b ADC12_A_CYCLEHOLD_32_CYCLES
502 //! - \b ADC12_A_CYCLEHOLD_64_CYCLES
503 //! - \b ADC12_A_CYCLEHOLD_96_CYCLES
504 //! - \b ADC12_A_CYCLEHOLD_128_CYCLES
505 //! - \b ADC12_A_CYCLEHOLD_192_CYCLES
506 //! - \b ADC12_A_CYCLEHOLD_256_CYCLES
507 //! - \b ADC12_A_CYCLEHOLD_384_CYCLES
508 //! - \b ADC12_A_CYCLEHOLD_512_CYCLES
509 //! - \b ADC12_A_CYCLEHOLD_768_CYCLES
510 //! - \b ADC12_A_CYCLEHOLD_1024_CYCLES
511 //! \n Modified bits are \b ADC12SHT1x of \b ADC12CTL0 register.
512 //! \param multipleSamplesEnabled allows multiple conversions to start without
513 //! a trigger signal from the sample/hold signal
514 //! Valid values are:
515 //! - \b ADC12_A_MULTIPLESAMPLESDISABLE [Default] - a timer trigger will
516 //! be needed to start every ADC conversion.
517 //! - \b ADC12_A_MULTIPLESAMPLESENABLE - during a sequenced and/or
518 //! repeated conversion mode, after the first conversion, no
519 //! sample/hold signal is necessary to start subsequent sample/hold
520 //! and convert processes.
521 //! \n Modified bits are \b ADC12MSC of \b ADC12CTL0 register.
522 //!
523 //! \return None
524 //
525 //*****************************************************************************
526 extern void ADC12_A_setupSamplingTimer(uint16_t baseAddress,
527  uint16_t clockCycleHoldCountLowMem,
528  uint16_t clockCycleHoldCountHighMem,
529  uint16_t multipleSamplesEnabled);
530 
531 //*****************************************************************************
532 //
533 //! \brief Disables Sampling Timer Pulse Mode.
534 //!
535 //! Disables the Sampling Timer Pulse Mode. Note that if a conversion has been
536 //! started with the startConversion() function, then a call to
537 //! disableConversions() is required before this function may be called.
538 //!
539 //! \param baseAddress is the base address of the ADC12_A module.
540 //!
541 //! Modified bits are \b ADC12SHP of \b ADC12CTL0 register.
542 //!
543 //! \return None
544 //
545 //*****************************************************************************
546 extern void ADC12_A_disableSamplingTimer(uint16_t baseAddress);
547 
548 //*****************************************************************************
549 //
550 //! \brief Configures the controls of the selected memory buffer.
551 //!
552 //! Maps an input signal conversion into the selected memory buffer, as well as
553 //! the positive and negative reference voltages for each conversion being
554 //! stored into this memory buffer. If the internal reference is used for the
555 //! positive reference voltage, the internal REF module must be used to control
556 //! the voltage level. Note that if a conversion has been started with the
557 //! startConversion() function, then a call to disableConversions() is required
558 //! before this function may be called. If conversion is not disabled, this
559 //! function does nothing.
560 //!
561 //! \param baseAddress is the base address of the ADC12_A module.
562 //! \param param is the pointer to struct for memory configuration.
563 //!
564 //! \return None
565 //
566 //*****************************************************************************
567 extern void ADC12_A_configureMemory(uint16_t baseAddress,
569 
570 //*****************************************************************************
571 //
572 //! \brief Enables selected ADC12_A interrupt sources.
573 //!
574 //! Enables the indicated ADC12_A interrupt sources. Only the sources that are
575 //! enabled can be reflected to the processor interrupt, disabled sources have
576 //! no effect on the processor. Does not clear interrupt flags.
577 //!
578 //! \param baseAddress is the base address of the ADC12_A module.
579 //! \param interruptMask
580 //! Mask value is the logical OR of any of the following:
581 //! - \b ADC12_A_IE0
582 //! - \b ADC12_A_IE1
583 //! - \b ADC12_A_IE2
584 //! - \b ADC12_A_IE3
585 //! - \b ADC12_A_IE4
586 //! - \b ADC12_A_IE5
587 //! - \b ADC12_A_IE6
588 //! - \b ADC12_A_IE7
589 //! - \b ADC12_A_IE8
590 //! - \b ADC12_A_IE9
591 //! - \b ADC12_A_IE10
592 //! - \b ADC12_A_IE11
593 //! - \b ADC12_A_IE12
594 //! - \b ADC12_A_IE13
595 //! - \b ADC12_A_IE14
596 //! - \b ADC12_A_IE15
597 //! - \b ADC12_A_OVERFLOW_IE
598 //! - \b ADC12_A_CONVERSION_TIME_OVERFLOW_IE
599 //!
600 //! Modified bits of \b ADC12IE register and bits of \b ADC12CTL0 register.
601 //!
602 //! \return None
603 //
604 //*****************************************************************************
605 extern void ADC12_A_enableInterrupt(uint16_t baseAddress,
606  uint32_t interruptMask);
607 
608 //*****************************************************************************
609 //
610 //! \brief Disables selected ADC12_A interrupt sources.
611 //!
612 //! Disables the indicated ADC12_A interrupt sources. Only the sources that
613 //! are enabled can be reflected to the processor interrupt, disabled sources
614 //! have no effect on the processor.
615 //!
616 //! \param baseAddress is the base address of the ADC12_A module.
617 //! \param interruptMask
618 //! Mask value is the logical OR of any of the following:
619 //! - \b ADC12_A_IE0
620 //! - \b ADC12_A_IE1
621 //! - \b ADC12_A_IE2
622 //! - \b ADC12_A_IE3
623 //! - \b ADC12_A_IE4
624 //! - \b ADC12_A_IE5
625 //! - \b ADC12_A_IE6
626 //! - \b ADC12_A_IE7
627 //! - \b ADC12_A_IE8
628 //! - \b ADC12_A_IE9
629 //! - \b ADC12_A_IE10
630 //! - \b ADC12_A_IE11
631 //! - \b ADC12_A_IE12
632 //! - \b ADC12_A_IE13
633 //! - \b ADC12_A_IE14
634 //! - \b ADC12_A_IE15
635 //! - \b ADC12_A_OVERFLOW_IE
636 //! - \b ADC12_A_CONVERSION_TIME_OVERFLOW_IE
637 //!
638 //! Modified bits of \b ADC12IE register and bits of \b ADC12CTL0 register.
639 //!
640 //! \return None
641 //
642 //*****************************************************************************
643 extern void ADC12_A_disableInterrupt(uint16_t baseAddress,
644  uint32_t interruptMask);
645 
646 //*****************************************************************************
647 //
648 //! \brief Clears ADC12_A selected interrupt flags.
649 //!
650 //! The selected ADC12_A interrupt flags are cleared, so that it no longer
651 //! asserts. The memory buffer interrupt flags are only cleared when the memory
652 //! buffer is accessed. Note that the overflow interrupts do not have an
653 //! interrupt flag to clear; they must be accessed directly from the interrupt
654 //! vector.
655 //!
656 //! \param baseAddress is the base address of the ADC12_A module.
657 //! \param memoryInterruptFlagMask is a bit mask of the interrupt flags to be
658 //! cleared.
659 //! Mask value is the logical OR of any of the following:
660 //! - \b ADC12_A_IFG0
661 //! - \b ADC12_A_IFG1
662 //! - \b ADC12_A_IFG2
663 //! - \b ADC12_A_IFG3
664 //! - \b ADC12_A_IFG4
665 //! - \b ADC12_A_IFG5
666 //! - \b ADC12_A_IFG6
667 //! - \b ADC12_A_IFG7
668 //! - \b ADC12_A_IFG8
669 //! - \b ADC12_A_IFG9
670 //! - \b ADC12_A_IFG10
671 //! - \b ADC12_A_IFG11
672 //! - \b ADC12_A_IFG12
673 //! - \b ADC12_A_IFG13
674 //! - \b ADC12_A_IFG14
675 //! - \b ADC12_A_IFG15
676 //!
677 //! Modified bits of \b ADC12IFG register.
678 //!
679 //! \return None
680 //
681 //*****************************************************************************
682 extern void ADC12_A_clearInterrupt(uint16_t baseAddress,
683  uint16_t memoryInterruptFlagMask);
684 
685 //*****************************************************************************
686 //
687 //! \brief Returns the status of the selected memory interrupt flags.
688 //!
689 //! Returns the status of the selected memory interrupt flags. Note that the
690 //! overflow interrupts do not have an interrupt flag to clear; they must be
691 //! accessed directly from the interrupt vector.
692 //!
693 //! \param baseAddress is the base address of the ADC12_A module.
694 //! \param memoryInterruptFlagMask is a bit mask of the interrupt flags status
695 //! to be returned.
696 //! Mask value is the logical OR of any of the following:
697 //! - \b ADC12_A_IFG0
698 //! - \b ADC12_A_IFG1
699 //! - \b ADC12_A_IFG2
700 //! - \b ADC12_A_IFG3
701 //! - \b ADC12_A_IFG4
702 //! - \b ADC12_A_IFG5
703 //! - \b ADC12_A_IFG6
704 //! - \b ADC12_A_IFG7
705 //! - \b ADC12_A_IFG8
706 //! - \b ADC12_A_IFG9
707 //! - \b ADC12_A_IFG10
708 //! - \b ADC12_A_IFG11
709 //! - \b ADC12_A_IFG12
710 //! - \b ADC12_A_IFG13
711 //! - \b ADC12_A_IFG14
712 //! - \b ADC12_A_IFG15
713 //!
714 //! \return The current interrupt flag status for the corresponding mask.
715 //
716 //*****************************************************************************
717 extern uint16_t ADC12_A_getInterruptStatus(uint16_t baseAddress,
718  uint16_t memoryInterruptFlagMask);
719 
720 //*****************************************************************************
721 //
722 //! \brief Enables/Starts an Analog-to-Digital Conversion.
723 //!
724 //! This function enables/starts the conversion process of the ADC. If the
725 //! sample/hold signal source chosen during initialization was ADC12OSC, then
726 //! the conversion is started immediately, otherwise the chosen sample/hold
727 //! signal source starts the conversion by a rising edge of the signal. Keep in
728 //! mind when selecting conversion modes, that for sequenced and/or repeated
729 //! modes, to keep the sample/hold-and-convert process continuing without a
730 //! trigger from the sample/hold signal source, the multiple samples must be
731 //! enabled using the ADC12_A_setupSamplingTimer() function. Note that after
732 //! this function is called, the ADC12_A_disableConversions() has to be called
733 //! to re-initialize the ADC, reconfigure a memory buffer control,
734 //! enable/disable the sampling timer, or to change the internal reference
735 //! voltage.
736 //!
737 //! \param baseAddress is the base address of the ADC12_A module.
738 //! \param startingMemoryBufferIndex is the memory buffer that will hold the
739 //! first or only conversion.
740 //! Valid values are:
741 //! - \b ADC12_A_MEMORY_0 [Default]
742 //! - \b ADC12_A_MEMORY_1
743 //! - \b ADC12_A_MEMORY_2
744 //! - \b ADC12_A_MEMORY_3
745 //! - \b ADC12_A_MEMORY_4
746 //! - \b ADC12_A_MEMORY_5
747 //! - \b ADC12_A_MEMORY_6
748 //! - \b ADC12_A_MEMORY_7
749 //! - \b ADC12_A_MEMORY_8
750 //! - \b ADC12_A_MEMORY_9
751 //! - \b ADC12_A_MEMORY_10
752 //! - \b ADC12_A_MEMORY_11
753 //! - \b ADC12_A_MEMORY_12
754 //! - \b ADC12_A_MEMORY_13
755 //! - \b ADC12_A_MEMORY_14
756 //! - \b ADC12_A_MEMORY_15
757 //! \n Modified bits are \b ADC12STARTADDx of \b ADC12CTL1 register.
758 //! \param conversionSequenceModeSelect determines the ADC operating mode.
759 //! Valid values are:
760 //! - \b ADC12_A_SINGLECHANNEL [Default] - one-time conversion of a
761 //! single channel into a single memory buffer.
762 //! - \b ADC12_A_SEQOFCHANNELS - one time conversion of multiple
763 //! channels into the specified starting memory buffer and each
764 //! subsequent memory buffer up until the conversion is stored in a
765 //! memory buffer dedicated as the end-of-sequence by the memory's
766 //! control register.
767 //! - \b ADC12_A_REPEATED_SINGLECHANNEL - repeated conversions of one
768 //! channel into a single memory buffer.
769 //! - \b ADC12_A_REPEATED_SEQOFCHANNELS - repeated conversions of
770 //! multiple channels into the specified starting memory buffer and
771 //! each subsequent memory buffer up until the conversion is stored
772 //! in a memory buffer dedicated as the end-of-sequence by the
773 //! memory's control register.
774 //! \n Modified bits are \b ADC12CONSEQx of \b ADC12CTL1 register.
775 //!
776 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
777 //!
778 //! \return None
779 //
780 //*****************************************************************************
781 extern void ADC12_A_startConversion(uint16_t baseAddress,
782  uint16_t startingMemoryBufferIndex,
783  uint8_t conversionSequenceModeSelect);
784 
785 //*****************************************************************************
786 //
787 //! \brief Disables the ADC from converting any more signals.
788 //!
789 //! Disables the ADC from converting any more signals. If there is a conversion
790 //! in progress, this function can stop it immediately if the preempt parameter
791 //! is set as TRUE, by changing the conversion mode to single-channel, single-
792 //! conversion and disabling conversions. If the conversion mode is set as
793 //! single-channel, single-conversion and this function is called without
794 //! preemption, then the ADC core conversion status is polled until the
795 //! conversion is complete before disabling conversions to prevent
796 //! unpredictable data. If the ADC12_A_startConversion() has been called, then
797 //! this function has to be called to re-initialize the ADC, reconfigure a
798 //! memory buffer control, enable/disable the sampling pulse mode, or change
799 //! the internal reference voltage.
800 //!
801 //! \param baseAddress is the base address of the ADC12_A module.
802 //! \param preempt specifies if the current conversion should be pre-empted
803 //! before the end of the conversion.
804 //! Valid values are:
805 //! - \b ADC12_A_COMPLETECONVERSION - Allows the ADC12_A to end the
806 //! current conversion before disabling conversions.
807 //! - \b ADC12_A_PREEMPTCONVERSION - Stops the ADC12_A immediately, with
808 //! unpredictable results of the current conversion.
809 //!
810 //! Modified bits of \b ADC12CTL1 register and bits of \b ADC12CTL0 register.
811 //!
812 //! \return None
813 //
814 //*****************************************************************************
815 extern void ADC12_A_disableConversions(uint16_t baseAddress,
816  bool preempt);
817 
818 //*****************************************************************************
819 //
820 //! \brief A Signed Integer of the contents of the specified memory buffer
821 //!
822 //! Returns the raw contents of the specified memory buffer. The format of the
823 //! content depends on the read-back format of the data: if the data is in
824 //! signed 2's complement format then the contents in the memory buffer will be
825 //! left-justified with the least-significant bits as 0's, whereas if the data
826 //! is in unsigned format then the contents in the memory buffer will be right-
827 //! justified with the most-significant bits as 0's.
828 //!
829 //! \param baseAddress is the base address of the ADC12_A module.
830 //! \param memoryBufferIndex is the specified Memory Buffer to read.
831 //! Valid values are:
832 //! - \b ADC12_A_MEMORY_0 [Default]
833 //! - \b ADC12_A_MEMORY_1
834 //! - \b ADC12_A_MEMORY_2
835 //! - \b ADC12_A_MEMORY_3
836 //! - \b ADC12_A_MEMORY_4
837 //! - \b ADC12_A_MEMORY_5
838 //! - \b ADC12_A_MEMORY_6
839 //! - \b ADC12_A_MEMORY_7
840 //! - \b ADC12_A_MEMORY_8
841 //! - \b ADC12_A_MEMORY_9
842 //! - \b ADC12_A_MEMORY_10
843 //! - \b ADC12_A_MEMORY_11
844 //! - \b ADC12_A_MEMORY_12
845 //! - \b ADC12_A_MEMORY_13
846 //! - \b ADC12_A_MEMORY_14
847 //! - \b ADC12_A_MEMORY_15
848 //!
849 //! \return A signed integer of the contents of the specified memory buffer
850 //
851 //*****************************************************************************
852 extern uint16_t ADC12_A_getResults(uint16_t baseAddress,
853  uint8_t memoryBufferIndex);
854 
855 //*****************************************************************************
856 //
857 //! \brief Use to change the resolution of the converted data.
858 //!
859 //! This function can be used to change the resolution of the converted data
860 //! from the default of 12-bits.
861 //!
862 //! \param baseAddress is the base address of the ADC12_A module.
863 //! \param resolutionSelect determines the resolution of the converted data.
864 //! Valid values are:
865 //! - \b ADC12_A_RESOLUTION_8BIT
866 //! - \b ADC12_A_RESOLUTION_10BIT
867 //! - \b ADC12_A_RESOLUTION_12BIT [Default]
868 //! \n Modified bits are \b ADC12RESx of \b ADC12CTL2 register.
869 //!
870 //! \return None
871 //
872 //*****************************************************************************
873 extern void ADC12_A_setResolution(uint16_t baseAddress,
874  uint8_t resolutionSelect);
875 
876 //*****************************************************************************
877 //
878 //! \brief Use to invert or un-invert the sample/hold signal.
879 //!
880 //! This function can be used to invert or un-invert the sample/hold signal.
881 //! Note that if a conversion has been started with the startConversion()
882 //! function, then a call to disableConversions() is required before this
883 //! function may be called.
884 //!
885 //! \param baseAddress is the base address of the ADC12_A module.
886 //! \param invertedSignal set if the sample/hold signal should be inverted
887 //! Valid values are:
888 //! - \b ADC12_A_NONINVERTEDSIGNAL [Default] - a sample-and-hold of an
889 //! input signal for conversion will be started on a rising edge of
890 //! the sample/hold signal.
891 //! - \b ADC12_A_INVERTEDSIGNAL - a sample-and-hold of an input signal
892 //! for conversion will be started on a falling edge of the
893 //! sample/hold signal.
894 //! \n Modified bits are \b ADC12ISSH of \b ADC12CTL1 register.
895 //!
896 //! \return None
897 //
898 //*****************************************************************************
899 extern void ADC12_A_setSampleHoldSignalInversion(uint16_t baseAddress,
900  uint16_t invertedSignal);
901 
902 //*****************************************************************************
903 //
904 //! \brief Use to set the read-back format of the converted data.
905 //!
906 //! Sets the format of the converted data: how it will be stored into the
907 //! memory buffer, and how it should be read back. The format can be set as
908 //! right-justified (default), which indicates that the number will be
909 //! unsigned, or left-justified, which indicates that the number will be signed
910 //! in 2's complement format. This change affects all memory buffers for
911 //! subsequent conversions.
912 //!
913 //! \param baseAddress is the base address of the ADC12_A module.
914 //! \param readBackFormat is the specified format to store the conversions in
915 //! the memory buffer.
916 //! Valid values are:
917 //! - \b ADC12_A_UNSIGNED_BINARY [Default]
918 //! - \b ADC12_A_SIGNED_2SCOMPLEMENT
919 //! \n Modified bits are \b ADC12DF of \b ADC12CTL2 register.
920 //!
921 //! \return None
922 //
923 //*****************************************************************************
924 extern void ADC12_A_setDataReadBackFormat(uint16_t baseAddress,
925  uint8_t readBackFormat);
926 
927 //*****************************************************************************
928 //
929 //! \brief Enables the reference buffer's burst ability.
930 //!
931 //! Enables the reference buffer's burst ability, allowing the reference buffer
932 //! to turn off while the ADC is not converting, and automatically turning on
933 //! when the ADC needs the generated reference voltage for a conversion.
934 //!
935 //! \param baseAddress is the base address of the ADC12_A module.
936 //!
937 //! \return None
938 //
939 //*****************************************************************************
940 extern void ADC12_A_enableReferenceBurst(uint16_t baseAddress);
941 
942 //*****************************************************************************
943 //
944 //! \brief Disables the reference buffer's burst ability.
945 //!
946 //! Disables the reference buffer's burst ability, forcing the reference buffer
947 //! to remain on continuously.
948 //!
949 //! \param baseAddress is the base address of the ADC12_A module.
950 //!
951 //! \return None
952 //
953 //*****************************************************************************
954 extern void ADC12_A_disableReferenceBurst(uint16_t baseAddress);
955 
956 //*****************************************************************************
957 //
958 //! \brief Use to set the reference buffer's sampling rate.
959 //!
960 //! Sets the reference buffer's sampling rate to the selected sampling rate.
961 //! The default sampling rate is maximum of 200-ksps, and can be reduced to a
962 //! maximum of 50-ksps to conserve power.
963 //!
964 //! \param baseAddress is the base address of the ADC12_A module.
965 //! \param samplingRateSelect is the specified maximum sampling rate.
966 //! Valid values are:
967 //! - \b ADC12_A_MAXSAMPLINGRATE_200KSPS [Default]
968 //! - \b ADC12_A_MAXSAMPLINGRATE_50KSPS
969 //! \n Modified bits are \b ADC12SR of \b ADC12CTL2 register.
970 //!
971 //! \return None
972 //
973 //*****************************************************************************
974 extern void ADC12_A_setReferenceBufferSamplingRate(uint16_t baseAddress,
975  uint8_t samplingRateSelect);
976 
977 //*****************************************************************************
978 //
979 //! \brief Returns the address of the specified memory buffer for the DMA
980 //! module.
981 //!
982 //! Returns the address of the specified memory buffer. This can be used in
983 //! conjunction with the DMA to store the converted data directly to memory.
984 //!
985 //! \param baseAddress is the base address of the ADC12_A module.
986 //! \param memoryIndex is the memory buffer to return the address of.
987 //! Valid values are:
988 //! - \b ADC12_A_MEMORY_0 [Default]
989 //! - \b ADC12_A_MEMORY_1
990 //! - \b ADC12_A_MEMORY_2
991 //! - \b ADC12_A_MEMORY_3
992 //! - \b ADC12_A_MEMORY_4
993 //! - \b ADC12_A_MEMORY_5
994 //! - \b ADC12_A_MEMORY_6
995 //! - \b ADC12_A_MEMORY_7
996 //! - \b ADC12_A_MEMORY_8
997 //! - \b ADC12_A_MEMORY_9
998 //! - \b ADC12_A_MEMORY_10
999 //! - \b ADC12_A_MEMORY_11
1000 //! - \b ADC12_A_MEMORY_12
1001 //! - \b ADC12_A_MEMORY_13
1002 //! - \b ADC12_A_MEMORY_14
1003 //! - \b ADC12_A_MEMORY_15
1004 //!
1005 //! \return address of the specified memory buffer
1006 //
1007 //*****************************************************************************
1008 extern uint32_t ADC12_A_getMemoryAddressForDMA(uint16_t baseAddress,
1009  uint8_t memoryIndex);
1010 
1011 //*****************************************************************************
1012 //
1013 //! \brief Returns the busy status of the ADC12_A core.
1014 //!
1015 //! Returns the status of the ADC core if there is a conversion currently
1016 //! taking place.
1017 //!
1018 //! \param baseAddress is the base address of the ADC12_A module.
1019 //!
1020 //! \return One of the following:
1021 //! - \b ADC12_A_NOTBUSY
1022 //! - \b ADC12_A_BUSY
1023 //! \n indicating if a conversion is taking place
1024 //
1025 //*****************************************************************************
1026 extern uint16_t ADC12_A_isBusy(uint16_t baseAddress);
1027 
1028 //*****************************************************************************
1029 //
1030 // Mark the end of the C bindings section for C++ compilers.
1031 //
1032 //*****************************************************************************
1033 #ifdef __cplusplus
1034 }
1035 #endif
1036 
1037 #endif
1038 #endif // __MSP430WARE_ADC12_A_H__
uint32_t ADC12_A_getMemoryAddressForDMA(uint16_t baseAddress, uint8_t memoryIndex)
Returns the address of the specified memory buffer for the DMA module.
Definition: adc12_a.c:223
void ADC12_A_disableSamplingTimer(uint16_t baseAddress)
Disables Sampling Timer Pulse Mode.
Definition: adc12_a.c:81
void ADC12_A_enableReferenceBurst(uint16_t baseAddress)
Enables the reference buffer&#39;s burst ability.
Definition: adc12_a.c:206
uint8_t inputSourceSelect
Definition: adc12_a.h:71
void ADC12_A_setResolution(uint16_t baseAddress, uint8_t resolutionSelect)
Use to change the resolution of the converted data.
Definition: adc12_a.c:185
void ADC12_A_enableInterrupt(uint16_t baseAddress, uint32_t interruptMask)
Enables selected ADC12_A interrupt sources.
Definition: adc12_a.c:107
void ADC12_A_startConversion(uint16_t baseAddress, uint16_t startingMemoryBufferIndex, uint8_t conversionSequenceModeSelect)
Enables/Starts an Analog-to-Digital Conversion.
Definition: adc12_a.c:149
uint8_t positiveRefVoltageSourceSelect
Definition: adc12_a.h:78
void ADC12_A_enable(uint16_t baseAddress)
Enables the ADC12_A block.
Definition: adc12_a.c:51
void ADC12_A_setSampleHoldSignalInversion(uint16_t baseAddress, uint16_t invertedSignal)
Use to invert or un-invert the sample/hold signal.
Definition: adc12_a.c:192
bool ADC12_A_init(uint16_t baseAddress, uint16_t sampleHoldSignalSourceSelect, uint8_t clockSourceSelect, uint16_t clockSourceDivider)
Initializes the ADC12_A Module.
Definition: adc12_a.c:21
void ADC12_A_clearInterrupt(uint16_t baseAddress, uint16_t memoryInterruptFlagMask)
Clears ADC12_A selected interrupt flags.
Definition: adc12_a.c:137
uint8_t memoryBufferControlIndex
Definition: adc12_a.h:51
void ADC12_A_configureMemory(uint16_t baseAddress, ADC12_A_configureMemoryParam *param)
Configures the controls of the selected memory buffer.
Definition: adc12_a.c:87
void ADC12_A_setDataReadBackFormat(uint16_t baseAddress, uint8_t readBackFormat)
Use to set the read-back format of the converted data.
Definition: adc12_a.c:199
void ADC12_A_disableConversions(uint16_t baseAddress, bool preempt)
Disables the ADC from converting any more signals.
Definition: adc12_a.c:164
uint16_t ADC12_A_isBusy(uint16_t baseAddress)
Returns the busy status of the ADC12_A core.
Definition: adc12_a.c:229
uint16_t ADC12_A_getResults(uint16_t baseAddress, uint8_t memoryBufferIndex)
A Signed Integer of the contents of the specified memory buffer.
Definition: adc12_a.c:179
void ADC12_A_disableInterrupt(uint16_t baseAddress, uint32_t interruptMask)
Disables selected ADC12_A interrupt sources.
Definition: adc12_a.c:122
uint8_t negativeRefVoltageSourceSelect
Definition: adc12_a.h:84
uint8_t endOfSequence
Definition: adc12_a.h:93
void ADC12_A_disable(uint16_t baseAddress)
Disables the ADC12_A block.
Definition: adc12_a.c:57
void ADC12_A_setReferenceBufferSamplingRate(uint16_t baseAddress, uint8_t samplingRateSelect)
Use to set the reference buffer&#39;s sampling rate.
Definition: adc12_a.c:216
uint16_t ADC12_A_getInterruptStatus(uint16_t baseAddress, uint16_t memoryInterruptFlagMask)
Returns the status of the selected memory interrupt flags.
Definition: adc12_a.c:143
void ADC12_A_disableReferenceBurst(uint16_t baseAddress)
Disables the reference buffer&#39;s burst ability.
Definition: adc12_a.c:211
void ADC12_A_setupSamplingTimer(uint16_t baseAddress, uint16_t clockCycleHoldCountLowMem, uint16_t clockCycleHoldCountHighMem, uint16_t multipleSamplesEnabled)
Sets up and enables the Sampling Timer Pulse Mode.
Definition: adc12_a.c:63
Used in the ADC12_A_configureMemory() function as the param parameter.
Definition: adc12_a.h:32

Copyright 2020, Texas Instruments Incorporated