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

Interface for the abstraction layer of the battery charger component. More...

Go to the source code of this file.

Classes

struct  lampda::power::charger::drivers::Measurments
 Store the DAC values mesured by some system sensors, relative to the battery and power. More...
 
struct  lampda::power::charger::drivers::Battery
 Store the battery specific measurments ans status. It is a refined data version of the Measurments class. More...
 

Namespaces

namespace  lampda
 Program scope.
 
namespace  lampda::power::charger
 Handles the battery charging processes, and power output control.
 
namespace  lampda::power::charger::drivers
 Hardware driver interactions for the charger component.
 

Enumerations

enum class  lampda::power::charger::drivers::Status_t {
  lampda::power::charger::drivers::UNINITIALIZED , lampda::power::charger::drivers::NOMINAL , lampda::power::charger::drivers::ERROR , lampda::power::charger::drivers::ERROR_COMPONENT ,
  lampda::power::charger::drivers::ERROR_HAS_FAULTS
}
 Store the status of the charge component. More...
 
enum class  lampda::power::charger::drivers::ChargeStatus_t { lampda::power::charger::drivers::OFF , lampda::power::charger::drivers::PRECHARGE , lampda::power::charger::drivers::FASTCHARGE , lampda::power::charger::drivers::SLOW_CHARGE }
 Status of the charge process. More...
 

Functions

bool lampda::power::charger::drivers::enable (const uint16_t minSystemVoltage_mV, const uint16_t maxBatteryVoltage_mV, const uint16_t maxChargingCurrent_mA, const uint16_t maxDichargingCurrent_mA, const bool forceReset=false)
 Call once on program start.
 
void lampda::power::charger::drivers::loop (const bool isChargeOk)
 Call often during execution.
 
void lampda::power::charger::drivers::shutdown ()
 call on program stop to gracefully shutdown the component.
 
void lampda::power::charger::drivers::enable_charge (const bool enable)
 Enable the charge process. this will start the charge only if the conditions are right.
 
void lampda::power::charger::drivers::set_input_current_limit (const uint16_t maxInputCurrent_mA, const bool shouldUseICO)
 Set the input current limit.
 
uint16_t lampda::power::charger::drivers::get_charge_current ()
 return the actual charge current, in milliamps.
 
bool lampda::power::charger::drivers::is_input_source_present ()
 return true if an input source is present for the charger on the USB port.
 
void lampda::power::charger::drivers::enable_OTG ()
 Enable the OTG and disable the charging process.
 
void lampda::power::charger::drivers::disable_OTG ()
 Disable the OTG.
 
void lampda::power::charger::drivers::set_OTG_targets (const uint16_t voltage_mV, const uint16_t maxCurrent_mA)
 set the desired OTG capabilities
 
bool lampda::power::charger::drivers::is_in_OTG ()
 Return true if the system is in OTG mode.
 
void lampda::power::charger::drivers::try_clear_faults ()
 try to clear the faults that can be cleared. if this succeeds, the status will be to NOMINAL next loop call.
 
Status_t lampda::power::charger::drivers::get_status ()
 return the status of the component
 
std::string lampda::power::charger::drivers::get_status_detail ()
 return a string with details on the error status
 
ChargeStatus_t lampda::power::charger::drivers::get_charge_status ()
 return the charge status object of the battery
 
std::string lampda::power::charger::drivers::get_software_error_message ()
 contains details on software error if any
 
Measurments lampda::power::charger::drivers::get_measurments ()
 
Battery lampda::power::charger::drivers::get_battery ()
 

Detailed Description

Interface for the abstraction layer of the battery charger component.