21 #ifndef COSA_ANALOG_PIN_HH 22 #define COSA_ANALOG_PIN_HH 90 static void prescale(uint8_t factor);
108 static uint16_t
bandgap(uint16_t vref = 1100);
114 __attribute__((always_inline))
124 __attribute__((always_inline))
136 __attribute__((always_inline))
148 __attribute__((always_inline))
160 __attribute__((always_inline))
Board::AnalogPin pin() const
static void prescale(uint8_t factor)
uint8_t m_event
Event to push on completion.
friend void ADC_vect(void)
AnalogPin & operator>>(uint16_t &var)
const Board::AnalogPin m_pin
Analog channel number.
virtual void on_change(uint16_t value)
virtual void on_interrupt(uint16_t arg)
static void adc_disable()
static uint16_t bandgap(uint16_t vref=1100)
AnalogPin(Board::AnalogPin pin, Board::Reference ref=Board::AVCC_REFERENCE)
Board::Reference reference() const
virtual void on_event(uint8_t type, uint16_t value)
static AnalogPin * sampling_pin
Current sampling pin if any.
void reference(Board::Reference ref)
Board::Reference m_reference
ADC reference voltage type.
bool sample_request(uint8_t event=Event::NULL_TYPE)
uint16_t m_value
Latest sample value.