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