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

Handles the battery balancing process. More...

Classes

struct  Status
 Store the balancer component status. More...
 

Typedefs

using balancer_t = bq76905::BQ76905
 

Functions

uint16_t get_battery_voltage_mv (const uint8_t index)
 
uint8_t compute_cell_balancing_max ()
 Compute the maximum number of cells that should be balanced at the same time prevent the breakage of the component at high temperatures.
 
void set_balancing (uint8_t cellIndex, bool shouldBalance)
 
bool is_balancing (uint8_t cellIndex)
 
void balance_batteries ()
 
void disable_battery_balancing ()
 
Status get_status ()
 Return the status of the balancer.
 
bool init ()
 Call once on init.
 
void loop ()
 call often to refresh measurments
 
void enable_balancing (bool enable)
 enable the battery balancing process
 
void go_to_sleep ()
 call before the system goes to sleep
 

Variables

constexpr uint16_t unbalancedMv = 3
 threshold at which point a battery is considered unbalanced with another
 
Status _status
 
balancer_t balancer
 
balancer_t::Regt balancerRegisters
 
bool isBalancingEnabled = false
 
bool isInit = false
 
bool isInitFirstFullScanDone = false
 

Detailed Description

Handles the battery balancing process.

Function Documentation

◆ init()

bool lampda::power::balancer::init ( )

Call once on init.

Returns
false if the component detect an issue