libpropeller
Making PropellerGCC Easier
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
MAX17048 Class Reference

Interface to the MAX17048 Fuel Chip. More...

#include <max17048.h>

Public Member Functions

 MAX17048 ()
 Create a new MAX17048 instance. More...
 
bool Init (I2C *bus)
 Initialize a MAX17048 object. More...
 
bool GetStatus (void)
 Test the presence of the MAX17048 chip by pinging the bus. More...
 
int GetStateOfCharge (void)
 Get the state of charge from the chip. More...
 
int GetVoltage (void)
 Use the MAX17048 internal ADC, and get the voltage. More...
 
int GetChargeRate (void)
 Fetches the rate of charge (positive or negative) More...
 
int GetVersion (void)
 Fetches the hardware version of the MAX17048. More...
 

Detailed Description

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

Author
SRLM

Constructor & Destructor Documentation

MAX17048::MAX17048 ( )
inline

Create a new MAX17048 instance.

Member Function Documentation

int MAX17048::GetChargeRate ( void  )
inline

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).

Todo:
(SRLM): Figure out the sign issues with this.
Returns
the charge rate in units of 0.1%/hr. Note: Positive or negative for
int MAX17048::GetStateOfCharge ( void  )
inline

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.

Todo:
Figure out what voltage the 0% SOC is at, and if we can change it (since we can only run down to about 3.45v with MAX8819 for 3.3v systems.
Returns
the current state of charge in units of 1%/LSb
bool MAX17048::GetStatus ( void  )
inline

Test the presence of the MAX17048 chip by pinging the bus.

Returns
true if the MAX17048 is found, false otherwise.

Here is the call graph for this function:

int MAX17048::GetVersion ( void  )
inline

Fetches the hardware version of the MAX17048.

Returns
the version
int MAX17048::GetVoltage ( void  )
inline

Use the MAX17048 internal ADC, and get the voltage.

Returns
the current voltage in units of 1mv/LSb (0.001v)
bool MAX17048::Init ( I2C bus)
inline

Initialize a MAX17048 object.

Parameters
busThe I2C bus that the MAX17048 is on.
Returns
true if successfully initiated, false otherwise.

Here is the call graph for this function:


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