mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-30 10:28:14 +00:00
feat(core): Add SoC settter to fuel gauge library [no changelog]
This commit is contained in:
parent
90468a2220
commit
763d95dd4f
@ -40,6 +40,12 @@ void fuel_gauge_reset(fuel_gauge_state_t* state) {
|
||||
state->soc_latched = 0.0f;
|
||||
}
|
||||
|
||||
void fuel_gauge_set_soc(fuel_gauge_state_t* state, float soc) {
|
||||
// Set SOC directly
|
||||
state->soc = soc;
|
||||
state->soc_latched = soc;
|
||||
}
|
||||
|
||||
void fuel_gauge_initial_guess(fuel_gauge_state_t* state, float voltage_V,
|
||||
float current_mA, float temperature) {
|
||||
// Determine if we're in discharge mode
|
||||
|
@ -54,6 +54,13 @@ void fuel_gauge_init(fuel_gauge_state_t* state, float R, float Q,
|
||||
*/
|
||||
void fuel_gauge_reset(fuel_gauge_state_t* state);
|
||||
|
||||
/**
|
||||
* Set SOC directly
|
||||
* @param state Pointer to EKF state structure
|
||||
* @param soc State of charge (0.0 to 1.0)
|
||||
*/
|
||||
void fuel_gauge_set_soc(fuel_gauge_state_t* state, float soc);
|
||||
|
||||
/**
|
||||
* Make initial SOC guess based on OCV
|
||||
* @param state Pointer to EKF state structure
|
||||
|
Loading…
Reference in New Issue
Block a user