Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Namespaces | Classes | Functions | Variables
lampda::power::charger Namespace Reference

Handles the battery charging processes, and power output control. More...

Namespaces

namespace  drivers
 Hardware driver interactions for the charger component.
 

Classes

struct  BatteryStatus_t
 Raw battery status measurments. More...
 
struct  Charger_t
 Store the charger characteristics. More...
 

Functions

bool should_charge ()
 
void control_OTG (const uint16_t mv, const uint16_t ma)
 Set the OTG control parameters. Set the parameters to zero to disable OTG mode.
 
bool is_status_error ()
 
void update_state_status ()
 
void update_state ()
 
bool setup ()
 call once at program startup
 
void loop ()
 call at every loop runs
 
void shutdown ()
 Call when system goes to sleep.
 
void set_enable_charge (const bool shouldCharge)
 debug feature: enable/disable the charging process
 
bool is_vbus_powered ()
 Return true if voltage is detected on VBUS.
 
bool can_use_vbus_power ()
 Return true if we are allowed to use the VBUS power.
 
bool is_vbus_signal_detected ()
 Return true if the USB VBUS presence signal is active.
 
Charger_t get_state ()
 Return the latest known state of the charger.
 

Variables

static bool isBatteryFullLatched_s = false
 
static bool enableCharge_s = true
 
static BatteryStatus_t batteryStatus
 
static Charger_t charger
 
bool isOtgEnabled_s = false
 
bool isSetup = false
 
const platform::gpio::DigitalPin chargeOkPin (platform::gpio::DigitalPin::GPIO::Input_isChargeOk)
 

Detailed Description

Handles the battery charging processes, and power output control.

Handles the battery charging processes.

Function Documentation

◆ control_OTG()

void lampda::power::charger::control_OTG ( const uint16_t  mv,
const uint16_t  ma 
)

Set the OTG control parameters. Set the parameters to zero to disable OTG mode.

Parameters
[in]mvDesired output voltage in millivolts
[in]maDesired maximum output current in milliamps

Variable Documentation

◆ isSetup

bool lampda::power::charger::isSetup = false

HEADER DEFINITIONS