MotorWare f2806x Driver API Documentation
adc.c
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
37 
38 
39 // **************************************************************************
40 // the includes
42 
43 
44 // assembly file
45 extern void usDelay(uint32_t Count);
46 
47 
48 // **************************************************************************
49 // the defines
50 
51 
52 // **************************************************************************
53 // the globals
54 
55 
56 // **************************************************************************
57 // the functions
58 
59 void ADC_disable(ADC_Handle adcHandle)
60 {
61  ADC_Obj *adc = (ADC_Obj *)adcHandle;
62 
63 
65 
67 
69 
70  return;
71 } // end of ADC_disable() function
72 
73 
75 {
76  ADC_Obj *adc = (ADC_Obj *)adcHandle;
77 
78 
80 
81  // clear the bits
83 
85 
86  return;
87 } // end of ADC_disableBandGap() function
88 
89 
90 void ADC_disableInt(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber)
91 {
92  ADC_Obj *adc = (ADC_Obj *)adcHandle;
93  uint_least8_t regNumber = intNumber >> 1;
94  uint16_t clearValue = ADC_INTSELxNy_INTE_BITS <<
96 
97 
99 
100  // clear the bits
101  adc->INTSELxNy[regNumber] &= (~clearValue);
102 
104 
105  return;
106 } // end of ADC_disableInt() function
107 
108 
110 {
111  ADC_Obj *adc = (ADC_Obj *)adcHandle;
112 
113 
115 
116  // clear the bits
118 
120 
121  return;
122 } // end of ADC_disableRefBuffers() function
123 
124 
125 void ADC_enable(ADC_Handle adcHandle)
126 {
127  ADC_Obj *adc = (ADC_Obj *)adcHandle;
128 
129 
131 
132  // set the bits
134 
136 
137  return;
138 } // end of ADC_enable() function
139 
140 
142 {
143  ADC_Obj *adc = (ADC_Obj *)adcHandle;
144 
145 
147 
148  // set the bits
150 
152 
153  return;
154 } // end of ADC_enableBandGap() function
155 
156 
157 void ADC_enableInt(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber)
158 {
159  ADC_Obj *adc = (ADC_Obj *)adcHandle;
160  uint_least8_t regNumber = intNumber >> 1;
161  uint_least8_t lShift = ADC_INTSELxNy_NUMBITS_PER_REG - (((intNumber+1) & 0x1) << ADC_INTSELxNy_LOG2_NUMBITS_PER_REG);
162  uint16_t setValue = ADC_INTSELxNy_INTE_BITS << lShift;
163 
164 
166 
167  // set the value
168  adc->INTSELxNy[regNumber] |= setValue;
169 
171 
172  return;
173 } // end of ADC_enableInt() function
174 
175 
177 {
178  ADC_Obj *adc = (ADC_Obj *)adcHandle;
179 
180 
182 
183  // set the bits
185 
187 
188  return;
189 } // end of ADC_enableRefBuffers() function
190 
191 
192 // current sampled last
193 ADC_Handle ADC_init(void *pMemory,const size_t numBytes)
194 {
195  ADC_Handle adcHandle;
196 
197 
198  if(numBytes < sizeof(ADC_Obj))
199  return((ADC_Handle)NULL);
200 
201 
202  // assign the handle
203  adcHandle = (ADC_Handle)pMemory;
204 
205  return(adcHandle);
206 } // end of ADC_init() function
207 
208 
209 void ADC_powerDown(ADC_Handle adcHandle)
210 {
211  ADC_Obj *adc = (ADC_Obj *)adcHandle;
212 
213 
215 
216  // clear the bits
218 
220 
221  return;
222 } // end of ADC_powerDown() function
223 
224 
225 void ADC_powerUp(ADC_Handle adcHandle)
226 {
227  ADC_Obj *adc = (ADC_Obj *)adcHandle;
228 
229 
231 
232  // set the bits
234 
236 
237  return;
238 } // end of ADC_powerUp() function
239 
240 
241 void ADC_reset(ADC_Handle adcHandle)
242 {
243  ADC_Obj *adc = (ADC_Obj *)adcHandle;
244 
245 
247 
248  // set the bits
249  adc->ADCCTL1 |= (uint16_t)ADC_ADCCTL1_RESET_BITS;
250 
252 
253  return;
254 } // end of ADC_reset() function
255 
256 
258 {
259  ADC_Obj *adc = (ADC_Obj *)adcHandle;
260 
261 
263 
264  // set the bits
265  if(OverLap == ADC_ADCCTL2_Overlap)
266  adc->ADCCTL2 &= ~((uint16_t)(ADC_ADCCTL2_ADCNONOVERLAP_BITS));
267  else
268  adc->ADCCTL2 |= (uint16_t)ADC_ADCCTL2_ADCNONOVERLAP_BITS;
269 
271 
272  return;
273 } // end of ADC_setSampleOverlapMode() function
274 
275 
276 void ADC_setIntMode(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber,const ADC_IntMode_e intMode)
277 {
278  ADC_Obj *adc = (ADC_Obj *)adcHandle;
279  uint_least8_t regNumber = intNumber >> 1;
280  uint_least8_t lShift = (ADC_INTSELxNy_NUMBITS_PER_REG - (((intNumber+1) & 0x1) << ADC_INTSELxNy_LOG2_NUMBITS_PER_REG));
281  uint16_t clearValue = ADC_INTSELxNy_INTCONT_BITS << lShift;
282  uint16_t setValue = intMode << lShift;
283 
284 
286 
287  // clear the bits
288  adc->INTSELxNy[regNumber] &= ~(clearValue);
289 
290 
291  // set the bits
292  adc->INTSELxNy[regNumber] |= setValue;
293 
295 
296  return;
297 } // end of ADC_setIntMode() function
298 
299 
301 {
302  ADC_Obj *adc = (ADC_Obj *)adcHandle;
303 
304 
306 
307  // clear the bits
309 
310 
311  // set the bits
312  adc->ADCCTL1 |= pulseMode;
313 
315 
316  return;
317 } // end of ADC_setIntPulseGenMode() function
318 
319 
320 void ADC_setIntSrc(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber,const ADC_IntSrc_e intSrc)
321 {
322  ADC_Obj *adc = (ADC_Obj *)adcHandle;
323  uint_least8_t regNumber = intNumber >> 1;
324  uint_least8_t lShift = (ADC_INTSELxNy_NUMBITS_PER_REG - (((intNumber+1) & 0x1) << ADC_INTSELxNy_LOG2_NUMBITS_PER_REG));
325  uint16_t clearValue = ADC_INTSELxNy_INTSEL_BITS << lShift;
326  uint16_t setValue = intSrc << lShift;
327 
328 
330 
331 
332  // clear the bits
333  adc->INTSELxNy[regNumber] &= ~(clearValue);
334 
335 
336  // set the bits
337  adc->INTSELxNy[regNumber] |= setValue;
338 
339 
341 
342  return;
343 } // end of ADC_setIntSrc() function
344 
345 
346 void ADC_setSampleMode(ADC_Handle adcHandle,const ADC_SampleMode_e sampleMode)
347 {
348  ADC_Obj *adc = (ADC_Obj *)adcHandle;
349 
350 
352 
353  if(sampleMode & ADC_ADCSAMPLEMODE_SEPARATE_FLAG) // separate
354  {
355  adc->ADCSAMPLEMODE &= (~(sampleMode - ADC_ADCSAMPLEMODE_SEPARATE_FLAG));
356  }
357  else
358  {
359  adc->ADCSAMPLEMODE |= sampleMode;
360  }
361 
363 
364  return;
365 } // end of ADC_setSampleMode() function
366 
367 
368 void ADC_setSocChanNumber(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocChanNumber_e chanNumber)
369 {
370  ADC_Obj *adc = (ADC_Obj *)adcHandle;
371 
372 
374 
375  // clear the bits
376  adc->ADCSOCxCTL[socNumber] &= (~ADC_ADCSOCxCTL_CHSEL_BITS);
377 
378 
379  // set the bits
380  adc->ADCSOCxCTL[socNumber] |= chanNumber;
381 
383 
384  return;
385 } // end of ADC_setSocChanNumber() function
386 
387 
388 void ADC_setSocSampleDelay(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocSampleDelay_e sampleDelay)
389 {
390  ADC_Obj *adc = (ADC_Obj *)adcHandle;
391 
392 
394 
395  // clear the bits
396  adc->ADCSOCxCTL[socNumber] &= (~ADC_ADCSOCxCTL_ACQPS_BITS);
397 
398 
399  // set the bits
400  adc->ADCSOCxCTL[socNumber] |= sampleDelay;
401 
403 
404  return;
405 } // end of ADC_setSocSampleDelay() function
406 
407 
408 void ADC_setSocTrigSrc(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocTrigSrc_e trigSrc)
409 {
410  ADC_Obj *adc = (ADC_Obj *)adcHandle;
411 
412 
414 
415  // clear the bits
416  adc->ADCSOCxCTL[socNumber] &= (~ADC_ADCSOCxCTL_TRIGSEL_BITS);
417 
418 
419  // set the bits
420  adc->ADCSOCxCTL[socNumber] |= trigSrc;
421 
423 
424  return;
425 } // end of ADC_setSocTrigSrc() function
426 
427 
428 void ADC_setSocFrc(ADC_Handle adcHandle,const ADC_SocFrc_e socFrc)
429 {
430  ADC_Obj *adc = (ADC_Obj *)adcHandle;
431 
432 
434 
435  // set the bits
436  adc->ADCSOCFRC1 = 1 << socFrc;
437 
439 
440  return;
441 } // end of ADC_setSocFrc() function
442 
443 
444 void ADC_setSocFrcWord(ADC_Handle adcHandle,const uint16_t socFrc)
445 {
446  ADC_Obj *adc = (ADC_Obj *)adcHandle;
447 
448 
450 
451  // write the entire word
452  adc->ADCSOCFRC1 = socFrc;
453 
455 
456  return;
457 } // end of ADC_setSocFrcWord() function
458 
459 
460 void ADC_setTempSensorSrc(ADC_Handle adcHandle,const ADC_TempSensorSrc_e sensorSrc)
461 {
462  ADC_Obj *adc = (ADC_Obj *)adcHandle;
463 
464 
466 
467  // clear the bits
469 
470 
471  // set the bits
472  adc->ADCCTL1 |= sensorSrc;
473 
475 
476  return;
477 } // end of ADC_setTempSensorSrc() function
478 
479 
480 void ADC_setVoltRefSrc(ADC_Handle adcHandle,const ADC_VoltageRefSrc_e voltSrc)
481 {
482  ADC_Obj *adc = (ADC_Obj *)adcHandle;
483 
484 
486 
487  // clear the bits
489 
490 
491  // set the bits
492  adc->ADCCTL1 |= voltSrc;
493 
495 
496  return;
497 } // end of ADC_setVoltRefSrc() function
498 
499 
501 {
502  ADC_Obj *adc = (ADC_Obj *)adcHandle;
503 
504  // get the bits
506 
507  if(divSelect == 4)
508  divSelect = ADC_DivideSelect_ClkIn_by_1;
509 
510  return (divSelect);
511 } // end of ADC_getDivideSelect() function
512 
513 
514 void ADC_setDivideSelect(ADC_Handle adcHandle,const ADC_DivideSelect_e divSelect)
515 {
516  ADC_Obj *adc = (ADC_Obj *)adcHandle;
517 
518 
520 
521  // clear the bits
523 
524 
525  // set the bits
526  adc->ADCCTL2 |= divSelect;
527 
529 
530  return;
531 } // end of ADC_setDivideSelect() function
532 
533 
535 {
536  ADC_Obj *adc = (ADC_Obj *)adcHandle;
537 
538 
540 
541  // set the bits
543 
545 
546  return;
547 } // end of ADC_enableNoOverlapMode() function
548 
549 
551 {
552  ADC_Obj *adc = (ADC_Obj *)adcHandle;
553 
554 
556 
557  // clear the bits
559 
561 
562  return;
563 } // end of ADC_enableNoOverlapMode() function
564 
565 
566 void ADC_setupSocTrigSrc(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_IntTriggerSOC_e intTrigSrc)
567 {
568  ADC_Obj *adc = (ADC_Obj *)adcHandle;
569  uint16_t clearValue;
570  uint16_t setValue;
571  uint16_t lShift_socsel1 = socNumber << 1;
572  uint16_t lShift_socsel2 = (socNumber - ADC_SocNumber_8) << 1;
573 
574 
576 
577  if(socNumber < ADC_SocNumber_8)
578  {
579  clearValue = ADC_ADCINTSOCSELx_SOCx_BITS << lShift_socsel1;
580  setValue = intTrigSrc << lShift_socsel1;
581 
582  // clear the bits
583  adc->ADCINTSOCSEL1 &= (~(clearValue));
584 
585  // set the bits
586  adc->ADCINTSOCSEL1 |= setValue;
587  }
588  else
589  {
590  clearValue = ADC_ADCINTSOCSELx_SOCx_BITS << lShift_socsel2;
591  setValue = intTrigSrc << lShift_socsel2;
592 
593  // clear the bits
594  adc->ADCINTSOCSEL2 &= (~(clearValue));
595 
596  // set the bits
597  adc->ADCINTSOCSEL2 |= setValue;
598  }
599 
601 
602  return;
603 } // end of ADC_setupSocTrigSrc() function
604 
605 void ADC_setOffTrim(ADC_Handle adcHandle, const uint16_t offtrim)
606 {
607  ADC_Obj *adc = (ADC_Obj *)adcHandle;
608 
609 
611 
612  // set the offtrim bits
613  adc->ADCOFFTRIM = offtrim;
614 
616 
617  return;
618 } // end of ADC_setOffTrim() function
619 
621 {
622  ADC_Obj *adc = (ADC_Obj *)adcHandle;
623 
624 
626 
627  // set the bits
629 
631 
632  return;
633 } // end of ADC_enableVoltRefLoConv() function
634 
636 {
637  ADC_Obj *adc = (ADC_Obj *)adcHandle;
638 
639 
641 
642  // set the bits
644 
646 
647  return;
648 } // end of ADC_disableVoltRefLoConv() function
649 
650 // end of file
volatile uint16_t ADCINTSOCSEL2
ADC Interrupt Trigger SOC Select 2 Register.
Definition: adc_obj.h:67
ADC_SocTrigSrc_e
Enumeration to define the start of conversion (SOC) trigger source.
Definition: adc.h:456
void ADC_setSocTrigSrc(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_SocTrigSrc_e trigSrc)
Sets the start-of-conversion (SOC) trigger source.
Definition: adc.c:408
ADC_IntPulseGenMode_e
Enumeration to define the analog-to-digital converter (ADC) interrupt pulse generation mode...
Definition: adc.h:279
#define DISABLE_PROTECTED_REGISTER_WRITE_MODE
Define to disable protected register writes.
Definition: cpu.h:101
void ADC_enableBandGap(ADC_Handle adcHandle)
Enables the analog-to-digital converter (ADC) band gap circuit.
Definition: adc.c:141
void ADC_setOffTrim(ADC_Handle adcHandle, const uint16_t offtrim)
Sets the offset trim register.
Definition: adc.c:605
#define ADC_INTSELxNy_INTE_BITS
Defines the location of the INTE bits in the INTSELxNy register.
Definition: adc.h:157
ADC_SampleMode_e
Enumeration to define the analog-to-digital converter (ADC) sample modes.
Definition: adc.h:334
ADC_SocNumber_e
Enumeration to define the start of conversion (SOC) numbers.
Definition: adc.h:388
#define ADC_ADCCTL2_CLKDIV2EN_BITS
Defines the location of the CLKDIV2EN bits in the ADCTL2 register.
Definition: adc.h:133
ADC_IntSrc_e
Enumeration to define the analog-to-digital converter (ADC) interrupt source.
Definition: adc.h:288
#define ADC_ADCCTL1_ADCPWDN_BITS
Defines the location of the ADCPWDN bits in the ADCTL1 register.
Definition: adc.h:113
void ADC_setSocFrcWord(ADC_Handle adcHandle, const uint16_t socFrc)
Sets the entire start of conversion (SOC) force register.
Definition: adc.c:444
void ADC_setupSocTrigSrc(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_IntTriggerSOC_e intTrigSrc)
Sets the start of conversion (SOC) trigger source.
Definition: adc.c:566
ADC_TempSensorSrc_e
Enumeration to define the temperature sensor source.
Definition: adc.h:484
volatile uint16_t ADCSOCFRC1
ADC SOC Force 1 Register.
Definition: adc_obj.h:71
ADC_SocFrc_e
Enumeration to define the soc force values.
Definition: adc.h:502
void ADC_reset(ADC_Handle adcHandle)
Resets the analog-to-digital converter (ADC)
Definition: adc.c:241
void ADC_setIntPulseGenMode(ADC_Handle adcHandle, const ADC_IntPulseGenMode_e pulseMode)
Sets the interrupt pulse generation mode.
Definition: adc.c:300
void ADC_disableVoltRefLoConv(ADC_Handle adcHandle)
Disables conversion of the voltage reference low signal for calibration.
Definition: adc.c:635
#define ADC_ADCSOCxCTL_ACQPS_BITS
Defines the location of the ACQPS bits in the ADCSOCxCTL register.
Definition: adc.h:165
volatile uint16_t ADCSAMPLEMODE
ADC Sample Mode Register.
Definition: adc_obj.h:64
#define ADC_ADCCTL1_ADCENABLE_BITS
Defines the location of the ADCENABLE bits in the ADCTL1 register.
Definition: adc.h:125
void ADC_enableVoltRefLoConv(ADC_Handle adcHandle)
Enables conversion of the voltage reference low signal for calibration.
Definition: adc.c:620
#define ADC_INTSELxNy_INTSEL_BITS
Defines the location of the INTSEL bits in the INTSELxNy register.
Definition: adc.h:153
#define ADC_ADCSOCxCTL_TRIGSEL_BITS
Defines the location of the TRIGSEL bits in the ADCSOCxCTL register.
Definition: adc.h:173
void ADC_enableNoOverlapMode(ADC_Handle adcHandle)
Enables no overlap mode.
Definition: adc.c:534
void ADC_setIntMode(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber, const ADC_IntMode_e intMode)
Sets the interrupt mode.
Definition: adc.c:276
ADC_DivideSelect_e ADC_getDivideSelect(ADC_Handle adcHandle)
Gets the analog-to-digital converter (ADC) divide select value.
Definition: adc.c:500
void ADC_disableRefBuffers(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC) reference buffers circuit.
Definition: adc.c:109
void ADC_enable(ADC_Handle adcHandle)
Enables the analog-to-digital converter (ADC)
Definition: adc.c:125
volatile uint16_t ADCCTL2
ADC Control Register 2.
Definition: adc.h:530
Contains public interface to various functions related to the analog-to-digital converter (ADC) objec...
volatile uint16_t ADCSOCxCTL[16]
ADC SOCx Control Registers.
Definition: adc_obj.h:77
volatile uint16_t ADCCTL1
ADC Control Register 1.
Definition: adc_obj.h:54
ADC_DivideSelect_e
Enumeration to define the start of conversion (SOC) numbers.
Definition: adc.h:223
ADC_IntTriggerSOC_e
Enumeration to define the analog-to-digital converter (ADC) input trigger SOC Select 1 Register group...
Definition: adc.h:269
volatile uint16_t ADCINTSOCSEL1
ADC Interrupt Trigger SOC Select 1 Register.
Definition: adc_obj.h:66
void ADC_setSampleMode(ADC_Handle adcHandle, const ADC_SampleMode_e sampleMode)
Sets the sample mode.
Definition: adc.c:346
void ADC_disableNoOverlapMode(ADC_Handle adcHandle)
Disables no overlap mode.
Definition: adc.c:550
Defines the analog-to-digital converter (ADC) object.
Definition: adc_obj.h:50
#define ENABLE_PROTECTED_REGISTER_WRITE_MODE
Define to allow protected register writes.
Definition: cpu.h:93
struct _ADC_Obj_ * ADC_Handle
Defines the analog-to-digital converter (ADC) handle.
Definition: adc_obj.h:88
ADC_Handle ADC_init(void *pMemory, const size_t numBytes)
Initializes the analog-to-digital converter (ADC) object handle.
Definition: adc.c:193
#define ADC_ADCCTL1_ADCREFPWD_BITS
Defines the location of the ADCREFPWD bits in the ADCTL1 register.
Definition: adc.h:105
void ADC_disableBandGap(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC) band gap circuit.
Definition: adc.c:74
#define ADC_INTSELxNy_NUMBITS_PER_REG
Defines the number of bits per INTSELxNy register.
Definition: adc.h:145
ADC_IntNumber_e
Enumeration to define the analog-to-digital converter (ADC) interrupt number.
Definition: adc.h:232
void ADC_setVoltRefSrc(ADC_Handle adcHandle, const ADC_VoltageRefSrc_e voltSrc)
Sets the voltage reference source.
Definition: adc.c:480
ADC_VoltageRefSrc_e
Enumeration to define the voltage reference source.
Definition: adc.h:493
void ADC_enableInt(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber)
Enables the analog-to-digital converter (ADC) interrupt.
Definition: adc.c:157
void ADC_setSampleOverlapMode(ADC_Handle adcHandle, ADC_ADCCTL2_ADCNONOVERLAP_e OverLap)
Definition: adc.c:257
#define ADC_ADCCTL1_ADCBGPWD_BITS
Defines the location of the ADCBGPWD bits in the ADCTL1 register.
Definition: adc.h:109
#define ADC_INTSELxNy_INTCONT_BITS
Defines the location of the INTCONT bits in the INTSELxNy register.
Definition: adc.h:161
#define ADC_ADCCTL1_RESET_BITS
Defines the location of the RESET bits in the ADCTL1 register.
Definition: adc.h:129
volatile uint16_t INTSELxNy[5]
ADC Interrupt Select x and y Register.
Definition: adc_obj.h:60
Denotes Main Clock Prescaling of 0.
Definition: adc.h:225
#define ADC_ADCSAMPLEMODE_SEPARATE_FLAG
Define for the channel separate flag.
Definition: adc.h:214
#define ADC_ADCSOCxCTL_CHSEL_BITS
Defines the location of the CHSEL bits in the ADCSOCxCTL register.
Definition: adc.h:169
ADC_SocSampleDelay_e
Enumeration to define the start of conversion (SOC) sample delays.
Definition: adc.h:411
#define ADC_ADCCTL2_ADCNONOVERLAP_BITS
Defines the location of the ADCNONOVERLAP bits in the ADCTL2 register.
Definition: adc.h:141
void ADC_setSocChanNumber(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_SocChanNumber_e chanNumber)
Sets the start-of-conversion (SOC) channel number.
Definition: adc.c:368
void ADC_enableRefBuffers(ADC_Handle adcHandle)
Enables the analog-to-digital converter (ADC) reference buffers circuit.
Definition: adc.c:176
Denotes that sample and conversion overlap is allowed.
Definition: adc.h:262
void ADC_powerDown(ADC_Handle adcHandle)
Powers down the analog-to-digital converter (ADC)
Definition: adc.c:209
void ADC_setIntSrc(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber, const ADC_IntSrc_e intSrc)
Sets the interrupt source.
Definition: adc.c:320
void usDelay(uint32_t Count)
#define ADC_ADCINTSOCSELx_SOCx_BITS
Defines the location of the SOCx bits in the ADCINTSOCSELx register.
Definition: adc.h:177
ADC_IntMode_e
Enumeration to define the analog-to-digital converter (ADC) interrupt mode.
Definition: adc.h:251
ADC_SocChanNumber_e
Enumeration to define the start of conversion (SOC) channel numbers.
Definition: adc.h:357
void ADC_setTempSensorSrc(ADC_Handle adcHandle, const ADC_TempSensorSrc_e sensorSrc)
Sets the temperature sensor source.
Definition: adc.c:460
void ADC_setSocFrc(ADC_Handle adcHandle, const ADC_SocFrc_e socFrc)
Sets the start-of-conversion (SOC) force register.
Definition: adc.c:428
Denotes SOC8.
Definition: adc.h:398
volatile uint16_t ADCOFFTRIM
ADC Offset Trim Register.
Definition: adc_obj.h:80
#define ADC_INTSELxNy_LOG2_NUMBITS_PER_REG
Defines the log2() of the number of bits per INTSELxNy register.
Definition: adc.h:149
ADC_ADCCTL2_ADCNONOVERLAP_e
Enumeration to define the analog-to-digital converter (ADC) sample and conversion overlap setting...
Definition: adc.h:260
void ADC_powerUp(ADC_Handle adcHandle)
Powers up the analog-to-digital converter (ADC)
Definition: adc.c:225
void ADC_disableInt(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber)
Disables the analog-to-digital converter (ADC) interrupt.
Definition: adc.c:90
#define ADC_ADCCTL1_INTPULSEPOS_BITS
Defines the location of the INTPULSEPOS bits in the ADCTL1 register.
Definition: adc.h:97
#define ADC_ADCCTL2_CLKDIV4EN_BITS
Defines the location of the CLKDIV4EN bits in the ADCTL2 register.
Definition: adc.h:137
void ADC_setSocSampleDelay(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_SocSampleDelay_e sampleDelay)
Sets the start-of-conversion (SOC) sample delay.
Definition: adc.c:388
#define ADC_ADCCTL1_TEMPCONV_BITS
Defines the location of the TEMPCONV bits in the ADCTL1 register.
Definition: adc.h:89
#define ADC_ADCCTL1_ADCREFSEL_BITS
Defines the location of the ADCREFSEL bits in the ADCTL1 register.
Definition: adc.h:101
void ADC_disable(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC)
Definition: adc.c:59
#define ADC_ADCCTL1_VREFLOCONV_BITS
Defines the location of the VREFLOCONV bits in the ADCTL1 register.
Definition: adc.h:93
void ADC_setDivideSelect(ADC_Handle adcHandle, const ADC_DivideSelect_e divSelect)
Sets the analog-to-digital converter (ADC) divide select value.
Definition: adc.c:514