13 #ifdef __MSP430F2274__
25 if((ADC10CTL0 & SREF_6))
30 if((ADC10CTL0 & SREF_6))
50 #elif defined(__MSP430G2553__)
62 if((ADC10CTL0 & SREF_6))
67 if((ADC10CTL0 & SREF_6))
84 #error "No such device!"
88 if(!( ADC10CTL0 && ADC10ON))
91 for(delay=35;delay==0;delay--);
93 ADC10CTL0 |= ENC + ADC10SC;
94 __bis_SR_register(CPUOFF + GIE);
108 #if defined(__MSP430G2553__) || defined(__MSP430F2274__)
119 return (ADC10CTL0 - (ADC10ON + SREF_0 + ADC10SHT_3 + ADC10IE));
121 #error "No such device!"
138 #if defined(__MSP430F2274__) || defined(__MSP430G2553__)
155 for(delay=35;delay==0;delay--);
160 #error "No such device!"
173 #if defined(__MSP430G2553__) || defined(__MSP430F2274__)
175 ADC10CTL1 |= ~ADC10ON;
188 #if defined(__MSP430G2553__) || defined(__MSP430F2274__)
192 #include <legacymsp430.h>
193 interrupt (ADC10_VECTOR) ADC10ISR (
void)
195 #pragma vector=ADC10_VECTOR
196 __interrupt
void ADC10ISR (
void)
199 __bic_SR_register_on_exit(LPM0_bits + GIE);
202 #error "No such device!"
int adc_eref_off()
It will hold the configuration of the ADC, and change it according to the OP variable.
int adc_eref_on()
Reconfigure the parameters of the ADC to enable Veref+ and Veref-.
int adc_read(unsigned int ch)
void adc_close()
It will stop ADC, free the ports, and reset the OP configuration.