PropWare
2.1.2
C++ objects and CMake build system for Parallax Propeller
|
Click here for docs on the
develop
branch.
#include <max8819.h>
Public Types | |
enum | { HIGH, MEDIUM, LOW, OFF } |
Public Member Functions | |
void | Start (int CENpin, int CHGpin, int ENpin, int DLIM1pin, int DLIM2pin) |
void | On () |
void | Off () |
bool | GetCharge () |
void | SetCharge (int rate) |
bool | GetPluggedIn (void) |
Max8819.h - Max8819 class to allow access to single pins
The low level interface code is based on Pins.h from David Michael Betz.
Requires a 10k resistor from MAX8819A::CEN to 5V USB.
bool libpropeller::Max8819::GetCharge | ( | ) |
void libpropeller::Max8819::Off | ( | void | ) |
void libpropeller::Max8819::On | ( | ) |
void libpropeller::Max8819::SetCharge | ( | int | rate | ) |
Sets the charge rate. Valid constants are: -OFF -LOW -MEDIUM -HIGH Note: The rate is set even if there is currently no external power, and stays in effect until next called (possibly during the connection of external power).
With a 3kOhm CISET resistor, we have the following charge rates: -LOW == 95 mA -MEDIUM == 475 mA -HIGH == 1000 mA
From the datasheet: It is not necessary to limit the charge current based on the capabilities of the expected AC-toDC adapter or USB/DC input current limit, the system load, or thermal limitations of the PCB. The IC automatically lowers the charging current as necessary to accommodate for these factors.
rate | a constant specifying the rate of charge. |
Definition at line 153 of file max8819.h.
void libpropeller::Max8819::Start | ( | int | CENpin, |
int | CHGpin, | ||
int | ENpin, | ||
int | DLIM1pin, | ||
int | DLIM2pin | ||
) |
Create the MAX8819 object, turn the power on, and turn off charging.
The pins from the Propeller to the MAX8819 can be connected directly: no need for current limiting resistors.
CENpin | The pin connected to Charge Enable on the MAX8819 |
CHGpin | The pin connected to (is) Charge(ing?) pin on the MAX8819 |
ENpin | The pin connected to Enable123 pin on the MAX8819 |
DLIM1pin | The pin connected to DLIM1 pin on the MAX8819 |
DLIM2pin | The pin connected to DLIM2 pin on the MAX8819 |
Definition at line 111 of file max8819.h.