50 #define adc_conversion_ongoing (ADCSRA |= (1<<ADSC))
51 #define adc_conversion_done (!(ADCSRA |= (1<<ADSC)))
55 ADC_TRIG_FREE_RUN = ((0<<ADTS2)|(0<<ADTS1)|(0<<ADTS0)),
56 ADC_TRIG_ANACOMP = ((0<<ADTS2)|(0<<ADTS1)|(1<<ADTS0)),
57 ADC_TRIG_EXTINT0 = ((0<<ADTS2)|(1<<ADTS1)|(0<<ADTS0)),
58 ADC_TRIG_TIM0_COMPA = ((0<<ADTS2)|(1<<ADTS1)|(1<<ADTS0)),
59 ADC_TRIG_TIM0_OVF = ((1<<ADTS2)|(0<<ADTS1)|(0<<ADTS0)),
60 ADC_TRIG_TIM1_COMPB = ((1<<ADTS2)|(0<<ADTS1)|(1<<ADTS0)),
61 ADC_TRIG_TIM1_OVF = ((1<<ADTS2)|(1<<ADTS1)|(0<<ADTS0)),
62 ADC_TRIG_TIM1_CAPT = ((1<<ADTS2)|(1<<ADTS1)|(1<<ADTS0))
67 ADC_PS_2 = ((0<<ADPS2)|(0<<ADPS1)|(1<<ADPS0)),
68 ADC_PS_4 = ((0<<ADPS2)|(1<<ADPS1)|(0<<ADPS0)),
69 ADC_PS_8 = ((0<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)),
70 ADC_PS_16 = ((1<<ADPS2)|(0<<ADPS1)|(0<<ADPS0)),
71 ADC_PS_32 = ((1<<ADPS2)|(0<<ADPS1)|(1<<ADPS0)),
72 ADC_PS_64 = ((1<<ADPS2)|(1<<ADPS1)|(0<<ADPS0)),
73 ADC_PS_128 = ((1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0))
81 ADC_REF_AREF = ((0<<REFS1)|(0<<REFS0)),
82 ADC_REF_AVCC = ((0<<REFS1)|(1<<REFS0)),
83 ADC_REF_INT = ((1<<REFS1)|(1<<REFS0))
88 ADC_CHAN_ADC0 = ((0<<MUX4)|(0<<MUX3)|(0<<MUX2)|(0<<MUX1)|(0<<MUX0)),
89 ADC_CHAN_ADC1 = ((0<<MUX4)|(0<<MUX3)|(0<<MUX2)|(0<<MUX1)|(1<<MUX0)),
90 ADC_CHAN_ADC2 = ((0<<MUX4)|(0<<MUX3)|(0<<MUX2)|(1<<MUX1)|(0<<MUX0)),
91 ADC_CHAN_ADC3 = ((0<<MUX4)|(0<<MUX3)|(0<<MUX2)|(1<<MUX1)|(1<<MUX0)),
92 ADC_CHAN_ADC4 = ((0<<MUX4)|(0<<MUX3)|(1<<MUX2)|(0<<MUX1)|(0<<MUX0)),
93 ADC_CHAN_ADC5 = ((0<<MUX4)|(0<<MUX3)|(1<<MUX2)|(0<<MUX1)|(1<<MUX0)),
94 ADC_CHAN_ADC6 = ((0<<MUX4)|(0<<MUX3)|(1<<MUX2)|(1<<MUX1)|(0<<MUX0)),
95 ADC_CHAN_ADC7 = ((0<<MUX4)|(0<<MUX3)|(1<<MUX2)|(1<<MUX1)|(1<<MUX0))
adc_adj_t
Lists the two ADC adjustment values.
adc_ref_t
Lists the ways in which the voltage reference can be configured for use with the ADC.
adc_chan_t
Lists each channel's mask value for the ADC MUX.
adc_ps_t
Lists a variety of prescalers used with the ADC.
int16_t adc_result_get(adc_adj_t adjust)
This will read the ADC result during the ADC conversion and return the raw ADC conversion result...
int adc_conversion_start(void)
This will start an ADC conversion.
adc_trig_t
Lists the different ways in which the ADC can be triggered.
void adc_init(void)
Initializes the ADC controller.
void adc_deinit(void)
This will disable the adc.