PropWare
C++ objects and CMake build system for Parallax Propeller
|
#include <max17048.h>
Public Member Functions | |
MAX17048 () | |
bool | Init (I2C *bus) |
bool | GetStatus (void) |
int | GetStateOfCharge (void) |
int | GetVoltage (void) |
int | GetChargeRate (void) |
int | GetVersion (void) |
Interface to the MAX17048 Fuel Chip
This chip monitors a single cell Lithium battery, and calculates metrics of battery use.
Hardware: The MAX17048 should be connected as described in the datasheet. The only connections required to the Propeller are via the I2C bus.
One MAX17948 can be connected per I2C bus.
(SRLM): Add temperature compensation
Definition at line 21 of file max17048.h.
libpropeller::MAX17048::MAX17048 | ( | ) |
Create a new MAX17048 instance.
Definition at line 26 of file max17048.h.
int libpropeller::MAX17048::GetChargeRate | ( | void | ) |
Fetches the rate of charge (positive or negative)
The charge rate is the change in battery state of charge over time. It should not be used to calculate current consumption (eg milliamps).
Definition at line 86 of file max17048.h.
int libpropeller::MAX17048::GetStateOfCharge | ( | void | ) |
Get the state of charge from the chip.
The state of charge refers to the overall percentage of the battery remaining. The MAX17048 chip automatically adjusts for a number of features, including battery capacity.
Definition at line 59 of file max17048.h.
bool libpropeller::MAX17048::GetStatus | ( | void | ) |
Test the presence of the MAX17048 chip by pinging the bus.
Definition at line 46 of file max17048.h.
int libpropeller::MAX17048::GetVersion | ( | void | ) |
Fetches the hardware version of the MAX17048.
Definition at line 98 of file max17048.h.
int libpropeller::MAX17048::GetVoltage | ( | void | ) |
Use the MAX17048 internal ADC, and get the voltage
Definition at line 68 of file max17048.h.
bool libpropeller::MAX17048::Init | ( | I2C * | bus | ) |
Initialize a MAX17048 object.
Definition at line 36 of file max17048.h.