12#ifndef ZEPHYR_INCLUDE_DRIVERS_EMUL_FUEL_GAUGE_H_
13#define ZEPHYR_INCLUDE_DRIVERS_EMUL_FUEL_GAUGE_H_
35__subsystem
struct fuel_gauge_emul_driver_api {
37 int (*is_battery_cutoff)(
const struct emul *
emul,
bool *cutoff);
58static inline int z_impl_emul_fuel_gauge_set_battery_charging(
const struct emul *target,
61 const struct fuel_gauge_emul_driver_api *backend_api =
62 (
const struct fuel_gauge_emul_driver_api *)target->
backend_api;
64 if (backend_api->set_battery_charging == 0) {
68 return backend_api->set_battery_charging(target, uV, uA);
81static inline int z_impl_emul_fuel_gauge_is_battery_cutoff(
const struct emul *target,
bool *cutoff)
83 const struct fuel_gauge_emul_driver_api *backend_api =
84 (
const struct fuel_gauge_emul_driver_api *)target->
backend_api;
86 if (backend_api->is_battery_cutoff == 0) {
89 return backend_api->is_battery_cutoff(target, cutoff);
96#include <zephyr/syscalls/emul_fuel_gauge.h>
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.
#define ENOTSUP
Unsupported value.
Definition errno.h:114
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
An emulator instance - represents the target emulated device/peripheral that is interacted with throu...
Definition emul.h:82
const void * backend_api
Address of the API structure exposed by the emulator instance.
Definition emul.h:103