OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
BatteryCharger Class Reference

Hardware witnesses regarding battery chargers. More...

#include <BatteryMonitorHardware.hpp>

Static Public Member Functions

static void setExternalPowerWitness (InputGPIO sensePin, bool negativeLogic, bool enableInternalPullResistor)
 Set a GPIO pin to sense the power wire.
 
static void setChargingWitness (InputGPIO sensePin, bool negativeLogic, bool enableInternalPullResistor)
 Set a GPIO pin to sense if the battery is being charged.
 
static void update (BatteryStatus &status)
 Update the battery status according to the witnesses.
 

Detailed Description

Hardware witnesses regarding battery chargers.

Definition at line 63 of file BatteryMonitorHardware.hpp.

Member Function Documentation

◆ setChargingWitness()

static void BatteryCharger::setChargingWitness ( InputGPIO sensePin,
bool negativeLogic,
bool enableInternalPullResistor )
static

Set a GPIO pin to sense if the battery is being charged.

Parameters
sensePinGPIO pin attached to the battery charger chip
negativeLogicIf true, LOW voltage means the battery is charging. If false, HIGH voltage means the battery is charging.
enableInternalPullResistorIf true, the corresponding internal pullup/pulldown resistor is enabled. Set to true if the witness signal works in open drain.

◆ setExternalPowerWitness()

static void BatteryCharger::setExternalPowerWitness ( InputGPIO sensePin,
bool negativeLogic,
bool enableInternalPullResistor )
static

Set a GPIO pin to sense the power wire.

Parameters
sensePinGPIO pin to sense the power wire
negativeLogicIf true, LOW voltage means there is external power If false, HIGH voltage means there is external power
enableInternalPullResistorIf true, the corresponding internal pullup/pulldown resistor is enabled. Set to true if the wire sensing signal works in open drain.

◆ update()

static void BatteryCharger::update ( BatteryStatus & status)
static

Update the battery status according to the witnesses.

Parameters
[in,out]statusBattery status

The documentation for this class was generated from the following file: