MotorWare f2806x Driver API Documentation
adc.h
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--*/
32 #ifndef _ADC_H_
33 #define _ADC_H_
34 
40 
41 
42 // **************************************************************************
43 // the includes
44 
45 // drivers
47 
48 
49 // modules
50 #include "sw/modules/types/src/types.h"
51 
52 
57 
58 
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 
65 // **************************************************************************
66 // the defines
67 
68 
71 #define ADC_BASE_ADDR (0x00000B00)
72 
73 
76 #define ADC_DELAY_usec 10000L
77 
80 #define ADC_numBits 12
81 
84 #define ADC_dataBias (1 << (ADC_numBits - 1))
85 
86 
89 #define ADC_ADCCTL1_TEMPCONV_BITS (1 << 0)
90 
93 #define ADC_ADCCTL1_VREFLOCONV_BITS (1 << 1)
94 
97 #define ADC_ADCCTL1_INTPULSEPOS_BITS (1 << 2)
98 
101 #define ADC_ADCCTL1_ADCREFSEL_BITS (1 << 3)
102 
105 #define ADC_ADCCTL1_ADCREFPWD_BITS (1 << 5)
106 
109 #define ADC_ADCCTL1_ADCBGPWD_BITS (1 << 6)
110 
113 #define ADC_ADCCTL1_ADCPWDN_BITS (1 << 7)
114 
117 #define ADC_ADCCTL1_ADCBSYCHAN_BITS (31 << 8)
118 
121 #define ADC_ADCCTL1_ADCBSY_BITS (1 << 13)
122 
125 #define ADC_ADCCTL1_ADCENABLE_BITS (1 << 14)
126 
129 #define ADC_ADCCTL1_RESET_BITS (1 << 15)
130 
133 #define ADC_ADCCTL2_CLKDIV2EN_BITS (1 << 0)
134 
137 #define ADC_ADCCTL2_CLKDIV4EN_BITS (1 << 2)
138 
141 #define ADC_ADCCTL2_ADCNONOVERLAP_BITS (1 << 1)
142 
145 #define ADC_INTSELxNy_NUMBITS_PER_REG 8
146 
149 #define ADC_INTSELxNy_LOG2_NUMBITS_PER_REG 3
150 
153 #define ADC_INTSELxNy_INTSEL_BITS (31 << 0)
154 
157 #define ADC_INTSELxNy_INTE_BITS (1 << 5)
158 
161 #define ADC_INTSELxNy_INTCONT_BITS (1 << 6)
162 
165 #define ADC_ADCSOCxCTL_ACQPS_BITS (63 << 0)
166 
169 #define ADC_ADCSOCxCTL_CHSEL_BITS (15 << 6)
170 
173 #define ADC_ADCSOCxCTL_TRIGSEL_BITS (31 << 11)
174 
177 #define ADC_ADCINTSOCSELx_SOCx_BITS 3
178 
181 #define ADC_ADCSAMPLEMODE_SIMULEN0_BITS (1 << 0)
182 
185 #define ADC_ADCSAMPLEMODE_SIMULEN2_BITS (1 << 1)
186 
189 #define ADC_ADCSAMPLEMODE_SIMULEN4_BITS (1 << 2)
190 
193 #define ADC_ADCSAMPLEMODE_SIMULEN6_BITS (1 << 3)
194 
197 #define ADC_ADCSAMPLEMODE_SIMULEN8_BITS (1 << 4)
198 
201 #define ADC_ADCSAMPLEMODE_SIMULEN10_BITS (1 << 5)
202 
205 #define ADC_ADCSAMPLEMODE_SIMULEN12_BITS (1 << 6)
206 
209 #define ADC_ADCSAMPLEMODE_SIMULEN14_BITS (1 << 7)
210 
211 
214 #define ADC_ADCSAMPLEMODE_SEPARATE_FLAG 0x100
215 
216 
217 
218 // **************************************************************************
219 // the typedefs
220 
223 typedef enum
224 {
229 
232 typedef enum
233 {
247 
248 
251 typedef enum
252 {
254  ADC_IntMode_EOC=(1 << 6)
255 } ADC_IntMode_e;
256 
257 
260 typedef enum
261 {
265 
266 
269 typedef enum
270 {
275 
276 
279 typedef enum
280 {
284 
285 
288 typedef enum
289 {
290  ADC_IntSrc_EOC0=(0 << 0),
291  ADC_IntSrc_EOC1=(1 << 0),
292  ADC_IntSrc_EOC2=(2 << 0),
293  ADC_IntSrc_EOC3=(3 << 0),
294  ADC_IntSrc_EOC4=(4 << 0),
295  ADC_IntSrc_EOC5=(5 << 0),
296  ADC_IntSrc_EOC6=(6 << 0),
297  ADC_IntSrc_EOC7=(7 << 0),
298  ADC_IntSrc_EOC8=(8 << 0),
299  ADC_IntSrc_EOC9=(9 << 0),
300  ADC_IntSrc_EOC10=(10 << 0),
301  ADC_IntSrc_EOC11=(11 << 0),
302  ADC_IntSrc_EOC12=(12 << 0),
303  ADC_IntSrc_EOC13=(13 << 0),
304  ADC_IntSrc_EOC14=(14 << 0),
305  ADC_IntSrc_EOC15=(15 << 0)
306 } ADC_IntSrc_e;
307 
308 
311 typedef enum
312 {
330 
331 
334 typedef enum
335 {
353 
354 
357 typedef enum
358 {
384 
385 
388 typedef enum
389 {
407 
408 
411 typedef enum
412 {
452 
453 
456 typedef enum
457 {
458  ADC_SocTrigSrc_Sw=(0 << 11),
480 
481 
484 typedef enum
485 {
489 
490 
493 typedef enum
494 {
498 
499 
502 typedef enum
503 {
520 } ADC_SocFrc_e;
521 
522 
525 typedef struct _ADC_Obj_
526 {
527  volatile uint16_t ADCRESULT[16];
528  volatile uint16_t resvd_1[26096];
529  volatile uint16_t ADCCTL1;
530  volatile uint16_t ADCCTL2;
531  volatile uint16_t rsvd_2[2];
532  volatile uint16_t ADCINTFLG;
533  volatile uint16_t ADCINTFLGCLR;
534  volatile uint16_t ADCINTOVF;
535  volatile uint16_t ADCINTOVFCLR;
536  volatile uint16_t INTSELxNy[5];
537  volatile uint16_t rsvd_3[3];
538  volatile uint16_t SOCPRICTRL;
539  volatile uint16_t rsvd_4;
540  volatile uint16_t ADCSAMPLEMODE;
541  volatile uint16_t rsvd_5;
542  volatile uint16_t ADCINTSOCSEL1;
543  volatile uint16_t ADCINTSOCSEL2;
544  volatile uint16_t rsvd_6[2];
545  volatile uint16_t ADCSOCFLG1;
546  volatile uint16_t rsvd_7;
547  volatile uint16_t ADCSOCFRC1;
548  volatile uint16_t rsvd_8;
549  volatile uint16_t ADCSOCOVF1;
550  volatile uint16_t rsvd_9;
551  volatile uint16_t ADCSOCOVFCLR1;
552  volatile uint16_t rsvd_10;
553  volatile uint16_t ADCSOCxCTL[16];
554  volatile uint16_t rsvd_11[16];
555  volatile uint16_t ADCREFTRIM;
556  volatile uint16_t ADCOFFTRIM;
557  volatile uint16_t resvd_12[13];
558  volatile uint16_t ADCREV;
559 } ADC_Obj;
560 
561 
564 typedef struct _ADC_Obj_ *ADC_Handle;
565 
566 
567 // **************************************************************************
568 // the globals
569 
570 
571 // **************************************************************************
572 // the function prototypes
573 
574 
578 static inline void ADC_clearIntFlag(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber)
579 {
580  ADC_Obj *adc = (ADC_Obj *)adcHandle;
581 
582 
583  // clear the bit
584  adc->ADCINTFLGCLR = 1 << intNumber;
585 
586  return;
587 } // end of ADC_clearIntFlag() function
588 
589 
594 static inline bool ADC_getIntFlag(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber)
595 {
596  ADC_Obj *adc = (ADC_Obj *)adcHandle;
597  bool status;
598 
599 
600  // check the status of the bit
601  status = (bool)(adc->ADCINTFLG & (1 << intNumber) >> intNumber);
602 
603  return(status);
604 } // end of ADC_getIntFlag() function
605 
606 
609 extern void ADC_disable(ADC_Handle adcHandle);
610 
611 
614 extern void ADC_disableBandGap(ADC_Handle adcHandle);
615 
616 
620 extern void ADC_disableInt(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber);
621 
622 
625 extern void ADC_disableRefBuffers(ADC_Handle adcHandle);
626 
627 
630 extern void ADC_enable(ADC_Handle adcHandle);
631 
632 
635 extern void ADC_enableBandGap(ADC_Handle adcHandle);
636 
637 
641 extern void ADC_enableInt(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber);
642 
643 
646 extern void ADC_enableRefBuffers(ADC_Handle adcHandle);
647 
648 
652 extern ADC_DivideSelect_e ADC_getDivideSelect(ADC_Handle adcHandle);
653 
654 
659 static inline ADC_SocSampleDelay_e ADC_getSocSampleDelay(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber)
660 {
661  ADC_Obj *adc = (ADC_Obj *)adcHandle;
662  ADC_SocSampleDelay_e sampleDelay;
663 
664 
665  // get the bits
666  sampleDelay = (ADC_SocSampleDelay_e)(adc->ADCSOCxCTL[socNumber] & ADC_ADCSOCxCTL_ACQPS_BITS);
667 
668  return(sampleDelay);
669 } // end of ADC_getSocSampleDelay() function
670 
671 
676 extern ADC_Handle ADC_init(void *pMemory,const size_t numBytes);
677 
678 
681 extern void ADC_powerDown(ADC_Handle adcHandle);
682 
683 
686 extern void ADC_powerUp(ADC_Handle adcHandle);
687 
688 
693 static inline uint_least16_t ADC_readResult(ADC_Handle adcHandle,const ADC_ResultNumber_e resultNumber)
694 {
695  ADC_Obj *adc = (ADC_Obj *)adcHandle;
696 
697  return(adc->ADCRESULT[resultNumber]);
698 } // end of ADC_read() function
699 
700 
703 extern void ADC_reset(ADC_Handle adcHandle);
704 
705 
709 extern void ADC_setDivideSelect(ADC_Handle adcHandle,const ADC_DivideSelect_e divSelect);
710 
711 
716 extern void ADC_setIntMode(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber,const ADC_IntMode_e intMode);
717 
718 
722 extern void ADC_setIntPulseGenMode(ADC_Handle adcHandle,const ADC_IntPulseGenMode_e pulseMode);
723 
724 
729 extern void ADC_setIntSrc(ADC_Handle adcHandle,const ADC_IntNumber_e intNumber,const ADC_IntSrc_e intSrc);
730 
731 
735 extern void ADC_setSampleMode(ADC_Handle adcHandle,const ADC_SampleMode_e sampleMode);
736 
737 
742 extern void ADC_setSocChanNumber(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocChanNumber_e chanNumber);
743 
744 
749 extern void ADC_setSocSampleDelay(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocSampleDelay_e sampleDelay);
750 
751 
756 extern void ADC_setSocTrigSrc(ADC_Handle adcHandle,const ADC_SocNumber_e socNumber,const ADC_SocTrigSrc_e trigSrc);
757 
758 
762 extern void ADC_setSocFrc(ADC_Handle adcHandle,const ADC_SocFrc_e socFrc);
763 
764 
768 extern void ADC_setTempSensorSrc(ADC_Handle adcHandle,const ADC_TempSensorSrc_e sensorSrc);
769 
770 
774 extern void ADC_setVoltRefSrc(ADC_Handle adcHandle,const ADC_VoltageRefSrc_e voltRef);
775 
776 
780 extern void ADC_setOffTrim(ADC_Handle adcHandle, const uint16_t offtrim);
781 
782 
785 extern void ADC_enableVoltRefLoConv(ADC_Handle adcHandle);
786 
787 
790 extern void ADC_disableVoltRefLoConv(ADC_Handle adcHandle);
791 
792 
797 extern void ADC_setupSocTrigSrc(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber, const ADC_IntTriggerSOC_e intTrigSrc);
798 
799 
803 extern void ADC_setSocFrcWord(ADC_Handle adcHandle,const uint16_t socFrc);
804 
805 
808 extern void ADC_enableNoOverlapMode(ADC_Handle adcHandle);
809 
810 
813 extern void ADC_disableNoOverlapMode(ADC_Handle adcHandle);
814 
815 
816 #ifdef __cplusplus
817 }
818 #endif // extern "C"
819 
821 #endif // end of _ADC_H_ definition
822 
struct _ADC_Obj_ * ADC_Handle
Defines the analog-to-digital converter (ADC) handle.
Definition: adc.h:564
Denotes SOC channel number A3.
Definition: adc.h:362
volatile uint16_t ADCSOCOVFCLR1
ADC SOC Overflow Clear 1 Register.
Definition: adc_obj.h:75
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
Denotes SOC channel number B4.
Definition: adc.h:371
volatile uint16_t rsvd_8
Reserved.
Definition: adc_obj.h:72
Denotes SOC channel number A6.
Definition: adc.h:365
Denotes SOC9.
Definition: adc.h:399
Denotes an SOC sample delay of 29 cycles.
Definition: adc.h:430
Denotes an SOC sample delay of 53 cycles.
Definition: adc.h:444
Denotes a EPWM1, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:463
ADC_IntPulseGenMode_e
Enumeration to define the analog-to-digital converter (ADC) interrupt pulse generation mode...
Definition: adc.h:279
Denotes a EPWM4, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:469
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
Denotes SOC8 and SOC9 are sampled separately.
Definition: adc.h:340
Denotes that interrupt source is the end of conversion for SOC11.
Definition: adc.h:301
ADC_SampleMode_e
Enumeration to define the analog-to-digital converter (ADC) sample modes.
Definition: adc.h:334
Denotes soc 12 forced conversion.
Definition: adc.h:516
Denotes an SOC sample delay of 7 cycles.
Definition: adc.h:413
Denotes SOC channel number B6.
Definition: adc.h:373
volatile uint16_t ADCINTFLGCLR
ADC Interrupt Flag Clear Register.
Definition: adc_obj.h:57
ADC_SocNumber_e
Enumeration to define the start of conversion (SOC) numbers.
Definition: adc.h:388
ADC_IntSrc_e
Enumeration to define the analog-to-digital converter (ADC) interrupt source.
Definition: adc.h:288
volatile uint16_t ADCINTFLG
ADC Interrupt Flag Register.
Definition: adc_obj.h:56
void ADC_setSocFrcWord(ADC_Handle adcHandle, const uint16_t socFrc)
Sets the entire start of conversion (SOC) force register.
Definition: adc.c:444
volatile uint16_t ADCINTOVF
ADC Interrupt Overflow Register.
Definition: adc_obj.h:58
Denotes that interrupt source is the end of conversion for SOC4.
Definition: adc.h:294
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
Denotes an SOC sample delay of 15 cycles.
Definition: adc.h:421
Denotes SOC channel number B3.
Definition: adc.h:370
volatile uint16_t ADCSOCFRC1
ADC SOC Force 1 Register.
Definition: adc_obj.h:71
Denotes ADCRESULT12.
Definition: adc.h:325
Denotes SOC14 and SOC15 are sampled together.
Definition: adc.h:351
Denotes a XINT2, XINT2SOC trigger source for the SOC flag.
Definition: adc.h:462
Denotes an SOC sample delay of 26 cycles.
Definition: adc.h:427
ADC_SocFrc_e
Enumeration to define the soc force values.
Definition: adc.h:502
Denotes a EPWM4, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:470
Denotes ADCRESULT1.
Definition: adc.h:314
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
Denotes soc 15 forced conversion.
Definition: adc.h:519
Denotes soc 13 forced conversion.
Definition: adc.h:517
Denotes SOC12 and SOC13 are sampled together.
Definition: adc.h:350
Denotes an SOC sample delay of 61 cycles.
Definition: adc.h:447
Denotes that interrupt source is the end of conversion for SOC14.
Definition: adc.h:304
Denotes SOC4.
Definition: adc.h:394
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
Denotes an SOC sample delay of 27 cycles.
Definition: adc.h:428
Denotes a EPWM8, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:478
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:380
Denotes an SOC sample delay of 9 cycles.
Definition: adc.h:415
volatile uint16_t ADCSAMPLEMODE
ADC Sample Mode Register.
Definition: adc_obj.h:64
static ADC_SocSampleDelay_e ADC_getSocSampleDelay(ADC_Handle adcHandle, const ADC_SocNumber_e socNumber)
Gets the analog-to-digital converter (ADC) start-of-conversion (SOC) sample delay value...
Definition: adc.h:659
Denotes SOC1.
Definition: adc.h:391
Denotes a EPWM8, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:477
void ADC_enableVoltRefLoConv(ADC_Handle adcHandle)
Enables conversion of the voltage reference low signal for calibration.
Definition: adc.c:620
Denotes SOC channel number A1.
Definition: adc.h:360
Denotes soc 8 forced conversion.
Definition: adc.h:512
Denotes SOC5.
Definition: adc.h:395
Denotes SOC channel number A5.
Definition: adc.h:364
Denotes an SOC sample delay of 50 cycles.
Definition: adc.h:441
Denotes ADCINT9 High Priority for use with PIE_enableAdcInt() only.
Definition: adc.h:245
Denotes SOC2 and SOC3 are sampled separately.
Definition: adc.h:337
Denotes Main Clock Prescaling of 4.
Definition: adc.h:227
volatile uint16_t rsvd_10
Reserved.
Definition: adc_obj.h:76
Denotes a EPWM5, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:471
Denotes SOC11.
Definition: adc.h:401
Denotes that interrupt pulse generation occurs when the ADC begins conversion.
Definition: adc.h:281
Denotes a EPWM6, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:473
volatile uint16_t rsvd_2[3]
Reserved.
Definition: adc_obj.h:55
Denotes ADCINT9.
Definition: adc.h:242
Denotes a CPUTIMER1 trigger source for the SOC flag.
Definition: adc.h:460
Denotes SOC channel number A4.
Definition: adc.h:363
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
Denotes an SOC sample delay of 62 cycles.
Definition: adc.h:448
ADC_DivideSelect_e ADC_getDivideSelect(ADC_Handle adcHandle)
Gets the analog-to-digital converter (ADC) divide select value.
Definition: adc.c:500
volatile uint16_t resvd_1[26096]
Reserved.
Definition: adc_obj.h:53
Denotes SOC7.
Definition: adc.h:397
Denotes ADCINT3.
Definition: adc.h:236
Denotes SOC0 and SOC1 are sampled together.
Definition: adc.h:344
volatile uint16_t rsvd_6[2]
Reserved.
Definition: adc_obj.h:68
Denotes SOC2 and SOC3 are sampled together.
Definition: adc.h:345
Denotes ADCRESULT10.
Definition: adc.h:323
Denotes SOC channel number B2.
Definition: adc.h:369
Denotes soc 10 forced conversion.
Definition: adc.h:514
void ADC_disableRefBuffers(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC) reference buffers circuit.
Definition: adc.c:109
Denotes that interrupt source is the end of conversion for SOC15.
Definition: adc.h:305
Denotes ADCRESULT15.
Definition: adc.h:328
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
volatile uint16_t rsvd_3[3]
Reserved.
Definition: adc_obj.h:61
Denotes an SOC sample delay of 38 cycles.
Definition: adc.h:434
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
Denotes a EPWM2, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:466
ADC_DivideSelect_e
Enumeration to define the start of conversion (SOC) numbers.
Definition: adc.h:223
volatile uint16_t ADCINTOVFCLR
ADC Interrupt Overflow Clear Register.
Definition: adc_obj.h:59
ADC_IntTriggerSOC_e
Enumeration to define the analog-to-digital converter (ADC) input trigger SOC Select 1 Register group...
Definition: adc.h:269
Denotes an SOC sample delay of 24 cycles.
Definition: adc.h:425
Denotes an SOC sample delay of 11 cycles.
Definition: adc.h:417
Denotes ADCRESULT2.
Definition: adc.h:315
Denotes an SOC sample delay of 52 cycles.
Definition: adc.h:443
Denotes a EPWM1, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:464
ADC_ResultNumber_e
Enumeration to define the analog-to-digital converter (ADC) result number.
Definition: adc.h:311
Denotes that interrupt source is the end of conversion for SOC0.
Definition: adc.h:290
Denotes an SOC sample delay of 28 cycles.
Definition: adc.h:429
Denotes SOC6 and SOC7 are sampled separately.
Definition: adc.h:339
volatile uint16_t resvd_12[13]
Reserved.
Definition: adc_obj.h:81
Denotes that a new interrupt with not be generated until the interrupt flag is cleared.
Definition: adc.h:253
Denotes an internal voltage reference source.
Definition: adc.h:496
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
Denotes a EPWM5, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:472
Denotes an SOC sample delay of 55 cycles.
Definition: adc.h:446
void ADC_disableNoOverlapMode(ADC_Handle adcHandle)
Disables no overlap mode.
Definition: adc.c:550
Denotes an SOC sample delay of 63 cycles.
Definition: adc.h:449
Denotes SOC6.
Definition: adc.h:396
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:375
Denotes ADCRESULT11.
Definition: adc.h:324
Denotes an SOC sample delay of 39 cycles.
Definition: adc.h:435
Defines the analog-to-digital converter (ADC) object.
Definition: adc_obj.h:50
Denotes SOC10 and SOC11 are sampled together.
Definition: adc.h:349
ADC_Handle ADC_init(void *pMemory, const size_t numBytes)
Initializes the analog-to-digital converter (ADC) object handle.
Definition: adc.c:193
Denotes ADCRESULT14.
Definition: adc.h:327
static bool ADC_getIntFlag(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber)
Gets the analog-to-digital converter (ADC) interrupt flag.
Definition: adc.h:594
Denotes an SOC sample delay of 14 cycles.
Definition: adc.h:420
void ADC_disableBandGap(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC) band gap circuit.
Definition: adc.c:74
Denotes an SOC sample delay of 37 cycles.
Definition: adc.h:433
ADC_IntNumber_e
Enumeration to define the analog-to-digital converter (ADC) interrupt number.
Definition: adc.h:232
Denotes ADCRESULT13.
Definition: adc.h:326
Denotes SOC channel number B7.
Definition: adc.h:374
void ADC_setVoltRefSrc(ADC_Handle adcHandle, const ADC_VoltageRefSrc_e voltRef)
Sets the voltage reference source.
Definition: adc.c:480
Denotes an SOC sample delay of 22 cycles.
Definition: adc.h:423
Denotes that interrupt source is the end of conversion for SOC3.
Definition: adc.h:293
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
Denotes that interrupt source is the end of conversion for SOC13.
Definition: adc.h:303
Denotes a CPUTIMER0 trigger source for the SOC flag.
Definition: adc.h:459
Denotes that sample and conversion overlap is not allowed.
Definition: adc.h:263
Denotes ADCINT1.
Definition: adc.h:234
Denotes SOC0.
Definition: adc.h:390
Denotes ADCINT2.
Definition: adc.h:235
Denotes ADCINT6.
Definition: adc.h:239
Denotes SOC channel number B0.
Definition: adc.h:367
Denotes that interrupt pulse generation occurs 1 cycle prior to the ADC result latching.
Definition: adc.h:282
Denotes an SOC sample delay of 35 cycles.
Definition: adc.h:431
Denotes an SOC sample delay of 48 cycles.
Definition: adc.h:439
volatile uint16_t SOCPRICTRL
ADC Start Of Conversion Priority Control Register.
Definition: adc_obj.h:62
Denotes soc 4 forced conversion.
Definition: adc.h:508
Denotes that interrupt source is the end of conversion for SOC2.
Definition: adc.h:292
Denotes SOC channel number A7.
Definition: adc.h:366
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:377
Denotes an SOC sample delay of 12 cycles.
Definition: adc.h:418
struct _ADC_Obj_ ADC_Obj
Defines the analog-to-digital converter (ADC) object.
Denotes soc 1 forced conversion.
Definition: adc.h:505
Denotes that a new interrupt with be generated on the next end of conversion (EOC) ...
Definition: adc.h:254
Denotes ADCINT1 High Priority for use with PIE_enableAdcInt() only.
Definition: adc.h:243
Denotes an SOC sample delay of 42 cycles.
Definition: adc.h:438
Denotes that interrupt source is the end of conversion for SOC1.
Definition: adc.h:291
Denotes SOC3.
Definition: adc.h:393
Denotes an SOC sample delay of 54 cycles.
Definition: adc.h:445
Denotes SOC4 and SOC5 are sampled separately.
Definition: adc.h:338
Denotes SOC13.
Definition: adc.h:403
Denotes SOC14.
Definition: adc.h:404
Denotes SOC4 and SOC5 are sampled together.
Definition: adc.h:346
volatile uint16_t ADCREFTRIM
ADC Reference/Gain Trim Register.
Definition: adc_obj.h:79
Denotes that interrupt source is the end of conversion for SOC9.
Definition: adc.h:299
Denotes ADCRESULT0.
Definition: adc.h:313
Denotes ADCRESULT3.
Definition: adc.h:316
Denotes soc 9 forced conversion.
Definition: adc.h:513
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
Denotes SOC channel number B5.
Definition: adc.h:372
Denotes an SOC sample delay of 25 cycles.
Definition: adc.h:426
static uint_least16_t ADC_readResult(ADC_Handle adcHandle, const ADC_ResultNumber_e resultNumber)
Reads the specified ADC result (i.e. value)
Definition: adc.h:693
Denotes ADCRESULT4.
Definition: adc.h:317
Denotes SOC10 and SOC11 are sampled separately.
Definition: adc.h:341
Denotes an SOC sample delay of 8 cycles.
Definition: adc.h:414
Denotes SOC14 and SOC15 are sampled separately.
Definition: adc.h:343
Denotes ADCINT5.
Definition: adc.h:238
Denotes soc 7 forced conversion.
Definition: adc.h:511
Denotes SOC0 and SOC1 are sampled separately.
Definition: adc.h:336
Contains public interface to various functions related to the central processing unit (CPU) object...
Denotes SOC15.
Definition: adc.h:405
volatile uint16_t ADCREV
ADC Revision Register.
Definition: adc_obj.h:82
#define ADC_ADCSAMPLEMODE_SEPARATE_FLAG
Define for the channel separate flag.
Definition: adc.h:214
volatile uint16_t rsvd_11[16]
Reserved.
Definition: adc_obj.h:78
volatile uint16_t rsvd_9
Reserved.
Definition: adc_obj.h:74
Denotes SOC12 and SOC13 are sampled separately.
Definition: adc.h:342
Denotes ADCRESULT6.
Definition: adc.h:319
Denotes an SOC sample delay of 51 cycles.
Definition: adc.h:442
Denotes soc 3 forced conversion.
Definition: adc.h:507
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:381
Denotes a EPWM7, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:476
Denotes soc 11 forced conversion.
Definition: adc.h:515
Denotes that interrupt source is the end of conversion for SOC7.
Definition: adc.h:297
Denotes an internal temperature source.
Definition: adc.h:487
static void ADC_clearIntFlag(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber)
Clears the analog-to-digital converter (ADC) interrupt flag.
Definition: adc.h:578
volatile uint16_t ADCSOCFLG1
ADC SOC Flag 1 Register.
Definition: adc_obj.h:69
Denotes that ADCINT2 will trigger SOCx. TRIGSEL field is ignored.
Definition: adc.h:273
Denotes that interrupt source is the end of conversion for SOC12.
Definition: adc.h:302
ADC_SocSampleDelay_e
Enumeration to define the start of conversion (SOC) sample delays.
Definition: adc.h:411
Denotes that interrupt source is the end of conversion for SOC10.
Definition: adc.h:300
Denotes a EPWM3, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:468
Denotes soc 14 forced conversion.
Definition: adc.h:518
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
Denotes ADCRESULT7.
Definition: adc.h:320
Denotes an SOC sample delay of 13 cycles.
Definition: adc.h:419
Denotes ADCRESULT5.
Definition: adc.h:318
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
Denotes SOC6 and SOC7 are sampled together.
Definition: adc.h:347
Denotes an SOC sample delay of 64 cycles.
Definition: adc.h:450
Denotes an SOC sample delay of 40 cycles.
Definition: adc.h:436
Denotes an SOC sample delay of 41 cycles.
Definition: adc.h:437
Denotes a EPWM7, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:475
Denotes soc 6 forced conversion.
Definition: adc.h:510
Denotes soc 2 forced conversion.
Definition: adc.h:506
Denotes SOC12.
Definition: adc.h:402
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:382
Denotes that interrupt source is the end of conversion for SOC5.
Definition: adc.h:295
Denotes an SOC sample delay of 16 cycles.
Definition: adc.h:422
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
Denotes ADCINT7.
Definition: adc.h:240
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:379
ADC_IntMode_e
Enumeration to define the analog-to-digital converter (ADC) interrupt mode.
Definition: adc.h:251
volatile uint16_t rsvd_5
Reserved.
Definition: adc_obj.h:65
ADC_SocChanNumber_e
Enumeration to define the start of conversion (SOC) channel numbers.
Definition: adc.h:357
Denotes an SOC sample delay of 36 cycles.
Definition: adc.h:432
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 ADCRESULT9.
Definition: adc.h:322
Denotes an SOC sample delay of 23 cycles.
Definition: adc.h:424
volatile uint16_t rsvd_4
Reserved.
Definition: adc_obj.h:63
Denotes SOC8.
Definition: adc.h:398
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:376
Denotes soc 5 forced conversion.
Definition: adc.h:509
Denotes SOC8 and SOC9 are sampled together.
Definition: adc.h:348
volatile uint16_t ADCOFFTRIM
ADC Offset Trim Register.
Definition: adc_obj.h:80
Denotes a EPWM7, ADCSOCB trigger source for the SOC flag.
Definition: adc.h:474
Denotes an SOC sample delay of 49 cycles.
Definition: adc.h:440
Denotes that interrupt source is the end of conversion for SOC6.
Definition: adc.h:296
Denotes a EPWM3, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:467
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
Denotes an internal voltage reference source.
Definition: adc.h:495
Denotes SOC2.
Definition: adc.h:392
Denotes a CPUTIMER2 trigger source for the SOC flag.
Definition: adc.h:461
void ADC_disableInt(ADC_Handle adcHandle, const ADC_IntNumber_e intNumber)
Disables the analog-to-digital converter (ADC) interrupt.
Definition: adc.c:90
Denotes an SOC sample delay of 10 cycles.
Definition: adc.h:416
Denotes SOC channel number A2.
Definition: adc.h:361
Denotes soc 0 forced conversion.
Definition: adc.h:504
Denotes that ADCINT1 will trigger SOCx. TRIGSEL field is ignored.
Definition: adc.h:272
Denotes SOC10.
Definition: adc.h:400
volatile uint16_t ADCSOCOVF1
ADC SOC Overflow 1 Register.
Definition: adc_obj.h:73
Denotes an external temperature source.
Definition: adc.h:486
Denotes a software trigger source for the SOC flag.
Definition: adc.h:458
volatile uint16_t rsvd_7
Reserved.
Definition: adc_obj.h:70
Denotes SOC channel number A0 and B0 together.
Definition: adc.h:378
Denotes Main Clock Prescaling of 2.
Definition: adc.h:226
Denotes that no ADCINT will trigger SOCx. TRIGSEL field determines SOCx trigger.
Definition: adc.h:271
Denotes a EPWM2, ADCSOCA trigger source for the SOC flag.
Definition: adc.h:465
Denotes ADCINT8.
Definition: adc.h:241
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
Denotes ADCRESULT8.
Definition: adc.h:321
Denotes ADCINT4.
Definition: adc.h:237
Denotes ADCINT2 High Priority for use with PIE_enableAdcInt() only.
Definition: adc.h:244
Denotes SOC channel number A0.
Definition: adc.h:359
void ADC_disable(ADC_Handle adcHandle)
Disables the analog-to-digital converter (ADC)
Definition: adc.c:59
Denotes SOC channel number B1.
Definition: adc.h:368
Denotes that interrupt source is the end of conversion for SOC8.
Definition: adc.h:298
volatile uint16_t ADCRESULT[16]
ADC result registers.
Definition: adc_obj.h:52
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