Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
charger.h File Reference

High level layer of the battery charging and balancer algorithms. The charger can be in charge or OTG mode. Charge transfers power from the power rail to the battery, and OTG transfers power from the battery to the power rail. More...

Go to the source code of this file.

Classes

struct  lampda::power::charger::Charger_t
 Store the charger characteristics. More...
 

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::power::charger
 Handles the battery charging processes, and power output control.
 

Functions

bool lampda::power::charger::setup ()
 call once at program startup
 
void lampda::power::charger::loop ()
 call at every loop runs
 
void lampda::power::charger::shutdown ()
 Call when system goes to sleep.
 
void lampda::power::charger::set_enable_charge (const bool shouldCharge)
 debug feature: enable/disable the charging process
 
bool lampda::power::charger::is_vbus_powered ()
 Return true if voltage is detected on VBUS.
 
bool lampda::power::charger::can_use_vbus_power ()
 Return true if we are allowed to use the VBUS power.
 
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.
 
bool lampda::power::charger::is_vbus_signal_detected ()
 Return true if the USB VBUS presence signal is active.
 
Charger_t lampda::power::charger::get_state ()
 Return the latest known state of the charger.
 

Detailed Description

High level layer of the battery charging and balancer algorithms. The charger can be in charge or OTG mode. Charge transfers power from the power rail to the battery, and OTG transfers power from the battery to the power rail.