Zephyr API 3.6.99
Loading...
Searching...
No Matches
Fuel gauge backend emulator APIs

Fuel gauge backend emulator APIs . More...

Functions

int emul_fuel_gauge_set_battery_charging (const struct emul *target, uint32_t uV, int uA)
 Set charging for fuel gauge associated battery.
 
int emul_fuel_gauge_is_battery_cutoff (const struct emul *target, bool *cutoff)
 Check if the battery has been cut off.
 

Detailed Description

Fuel gauge backend emulator APIs .

Function Documentation

◆ emul_fuel_gauge_is_battery_cutoff()

int emul_fuel_gauge_is_battery_cutoff ( const struct emul * target,
bool * cutoff )

#include <zephyr/drivers/emul_fuel_gauge.h>

Check if the battery has been cut off.

Parameters
targetPointer to the emulator structure for the fuel gauge emulator instance.
cutoffPointer to bool storing variable.
Return values
0If successful.
-ENOTSUPif not supported by emulator.

◆ emul_fuel_gauge_set_battery_charging()

int emul_fuel_gauge_set_battery_charging ( const struct emul * target,
uint32_t uV,
int uA )

#include <zephyr/drivers/emul_fuel_gauge.h>

Set charging for fuel gauge associated battery.

Set how much the battery associated with a fuel gauge IC is charging or discharging. Where voltage is always positive and a positive or negative current denotes charging or discharging, respectively.

Parameters
targetPointer to the emulator structure for the fuel gauge emulator instance.
uVMicrovolts describing the battery voltage.
uAMicroamps describing the battery current where negative is discharging.
Return values
0If successful.
-EINVALif mV or mA are 0.