70 uint16_t
read(uint8_t index)
const;
static constexpr uint16_t NO_READING
static constexpr uint8_t SQR1_CHANNEL_COUNT_OFFSET
static constexpr uint16_t RAW_READING_MAX
bool is_initialized() const
Checks if the adc has been initialized, i.e. init has been called.
A driver for the analog-digital converters available on the microcontroller.
static constexpr uint8_t CHANNEL_COUNT
const ADCHardwareStruct * adc_def_
uint8_t get_current_channel_count() const
Checks the number of used channels. If this exceeds CHANNEL_COUNT, stuff will break.
void init(const ADCHardwareStruct *adc_def)
Initializes the ADC according to the definition struct provided.
uint8_t add_channel(uint8_t channel)
Adds a channel to the list that is scanned.
uint16_t read(uint8_t index) const
Reads a single channel.
volatile uint32_t buffer[CHANNEL_COUNT]
static constexpr uint32_t SQR1_CHANNEL_COUNT_MASK
static constexpr double REFERENCE_VOLTAGE