28 const uint8_t MASK = (_BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0));
35 loop_until_bit_is_clear(ADCSRA, ADSC);
43 loop_until_bit_is_clear(ADCSRA, ADSC);
45 synchronized sample =
ADCW;
46 return ((vref * 1024L) / sample);
52 loop_until_bit_is_clear(ADCSRA, ADSC);
54 ADMUX = (ref | (pin & 0x1f));
59 loop_until_bit_is_clear(ADCSRA, ADSC);
Board::AnalogPin pin() const
static void prescale(uint8_t factor)
#define bit_write(c, p, b)
static uint16_t bandgap(uint16_t vref=1100)
#define bit_field_set(p, m, v)
static AnalogPin * sampling_pin
Current sampling pin if any.