36 float voltage_multiplier,
37 float current_multiplier)
GPIO_TypeDef * current_gpio
uint8_t current_adc_channel
double read() const
Get the last reading of the pin, in volts.
A driver for the analog-digital converters available on the microcontroller.
bool has_current_sense() const
Checks if current sense is available. As there isn't hardware to detect this, this simply checks if t...
void set_voltage_multiplier(double multiplier)
Sets the voltage multiplier for the battery monitor.
bool has_voltage_sense() const
Checks if voltage sense is available. As there isn't hardware to detect this, this simply checks if t...
float read_current() const
Read the current battery current.
float read_voltage() const
Read the current battery voltage.
float voltage_multiplier_
GPIO_TypeDef * voltage_gpio
void init(AnalogDigitalConverter *adc, GPIO_TypeDef *basePort, uint16_t pin, uint8_t adc_channel)
Initializes a pin to read analog values.
void set_current_multiplier(double multiplier)
Sets the current multiplier for the battery monitor.
uint8_t voltage_adc_channel
void init(const BatteryMonitorHardwareStruct &def, AnalogDigitalConverter *adc, float voltage_multiplier=0, float current_multiplier=0)
Initialize the battery monitor.
float current_multiplier_