Flying Silicon Sensor
|
Enumerations | |
enum | Supply { PwrUsbOnly = 0 , PwrBattOnly = 1 , PwrConnected = 2 , PwrBattDrained = 3 } |
Functions | |
int | isCharging (void) |
float | getBatPct (void) |
float | getBatVolt (void) |
int | isUsbConnected (void) |
int | isUsbOnly (void) |
int | isBatPowered (void) |
int | isBatDrained (void) |
void | reset (void) |
void | updateState (void) |
Variables | |
static int | pwrStat = PwrUsbOnly |
Power supply status. | |
static float | batVolt = 0.0 |
Battery Voltage. | |
static float | batPct = 0.0 |
Battery charge %. | |
static int | charging = 0 |
Charging state. | |
enum PwrSupply::Supply |
Enumerator | |
---|---|
PwrUsbOnly | Powered by USB only. |
PwrBattOnly | Powered by battery only. |
PwrConnected | Powered by battery and connected to USB. |
PwrBattDrained | Battery drained. |
Definition at line 38 of file pwrSupply.cpp.
float PwrSupply::getBatPct | ( | void | ) |
Check the power status
Definition at line 69 of file pwrSupply.cpp.
References batPct.
Referenced by managePower().
float PwrSupply::getBatVolt | ( | void | ) |
Check the power status
Definition at line 77 of file pwrSupply.cpp.
References batVolt.
Referenced by managePower().
int PwrSupply::isBatDrained | ( | void | ) |
Check the power status
Definition at line 109 of file pwrSupply.cpp.
References PwrBattDrained, and pwrStat.
Referenced by appLoop(), and appSetup().
int PwrSupply::isBatPowered | ( | void | ) |
Check the power status
Definition at line 101 of file pwrSupply.cpp.
References PwrBattOnly, and pwrStat.
Referenced by appLoop(), appSetup(), and managePower().
int PwrSupply::isCharging | ( | void | ) |
Check the power status
Definition at line 62 of file pwrSupply.cpp.
References charging.
Referenced by managePower().
int PwrSupply::isUsbConnected | ( | void | ) |
Check the power status
Definition at line 85 of file pwrSupply.cpp.
References PwrConnected, and pwrStat.
Referenced by enable(), loopConnected(), and managePower().
int PwrSupply::isUsbOnly | ( | void | ) |
Check the power status
Definition at line 93 of file pwrSupply.cpp.
References pwrStat, and PwrUsbOnly.
void PwrSupply::reset | ( | void | ) |
Clear the power status
Definition at line 116 of file pwrSupply.cpp.
References pwrStat, and PwrUsbOnly.
Referenced by resetStatus().
void PwrSupply::updateState | ( | void | ) |
Update the power status
Definition at line 123 of file pwrSupply.cpp.
References batPct, batVolt, charging, DEBUG, FAST_CHARGE, LOG, LOGL, MinBattV, PIN_BATTV, PIN_CHG, PIN_HICHG, PIN_USB, PwrBattDrained, PwrBattOnly, PwrConnected, pwrStat, and PwrUsbOnly.
Referenced by managePower().
|
static |
Battery charge %.
Definition at line 54 of file pwrSupply.cpp.
Referenced by getBatPct(), and updateState().
|
static |
Battery Voltage.
Definition at line 52 of file pwrSupply.cpp.
Referenced by getBatVolt(), and updateState().
|
static |
Charging state.
Definition at line 56 of file pwrSupply.cpp.
Referenced by isCharging(), and updateState().
|
static |
Power supply status.
Definition at line 50 of file pwrSupply.cpp.
Referenced by isBatDrained(), isBatPowered(), isUsbConnected(), isUsbOnly(), reset(), and updateState().