static constexpr uint16_t RAW_READING_MAX
A driver for the analog-digital converters available on the microcontroller.
void init(GPIO_TypeDef *BasePort, uint16_t pin, gpio_mode_t mode)
AnalogDigitalConverter * adc_
uint16_t read_raw() const
Get the most recent reading of the pin, directly from the ADC. See AnalogDigitalConverter.read for the details on interpreting this value.
double read() const
Get the last reading of the pin, in volts.
uint8_t add_channel(uint8_t channel)
Adds a channel to the list that is scanned.
void init(AnalogDigitalConverter *adc, GPIO_TypeDef *basePort, uint16_t pin, uint8_t adc_channel)
Initializes a pin to read analog values.
uint16_t read(uint8_t index) const
Reads a single channel.
static constexpr double REFERENCE_VOLTAGE