MAX1704x chips for battery monitoring.
More...
#include <BatteryMonitorHardware.hpp>
|
| | MAX1704x (I2CBus bus=I2CBus::PRIMARY, uint8_t i2c_address=0xFF) |
| | Construct a new MAX1704x object.
|
| |
|
virtual | ~MAX1704x () |
| | Destroy the MAX1704x object.
|
| |
| virtual void | onStart () override |
| | Called once when the battery monitor daemon is started.
|
| |
| virtual void | getStatus (BatteryStatus ¤tStatus) |
| | Get the battery status.
|
| |
|
| bool | read (uint8_t regAddress, uint16_t &value) |
| | Read from a register.
|
| |
| bool | write (uint8_t regAddress, uint16_t value) |
| | Write to a register.
|
| |
| bool | quickStart () |
| | Send a quick start command.
|
| |
| virtual bool | read_soc (uint8_t ¤tSoC) override |
| | Retrieve the current state of charge.
|
| |
|
| void * | device = nullptr |
| | I2C slave device (must be type-casted)
|
| |
MAX1704x chips for battery monitoring.
Definition at line 156 of file BatteryMonitorHardware.hpp.
◆ MAX1704x()
| MAX1704x::MAX1704x |
( |
I2CBus | bus = I2CBus::PRIMARY, |
|
|
uint8_t | i2c_address = 0xFF ) |
Construct a new MAX1704x object.
- Parameters
-
| bus | I2C bus where the chip is attached |
| i2c_address | 7-bit full I2C address. Set to 0xFF to use a default address. |
◆ onStart()
| virtual void MAX1704x::onStart |
( |
| ) |
|
|
inlineoverridevirtual |
◆ quickStart()
| bool MAX1704x::quickStart |
( |
| ) |
|
|
protected |
Send a quick start command.
- Returns
- true On success
-
false On failure
◆ read()
| bool MAX1704x::read |
( |
uint8_t | regAddress, |
|
|
uint16_t & | value ) |
|
protected |
Read from a register.
- Parameters
-
| regAddress | Register address |
| value | Register value |
- Returns
- true On success
-
false On failure
◆ read_soc()
| virtual bool MAX1704x::read_soc |
( |
uint8_t & | soc | ) |
|
|
overrideprotectedvirtual |
Retrieve the current state of charge.
- Parameters
-
| [out] | soc | State of charge. Higher than 101 if the battery is charging at constant voltage. |
- Returns
- true If
soc was retrieved with success
-
false If there is no battery or
soc is unknown
Implements BatteryMonitorInterface.
◆ write()
| bool MAX1704x::write |
( |
uint8_t | regAddress, |
|
|
uint16_t | value ) |
|
protected |
Write to a register.
- Parameters
-
| regAddress | Register address |
| value | Value to write |
- Returns
- true On success
-
false On failure
◆ device
| void* MAX1704x::device = nullptr |
|
protected |
The documentation for this class was generated from the following file: