Zephyr API Documentation  3.7.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
fuel_gauge.h File Reference
#include <errno.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/syscalls/fuel_gauge.h>

Go to the source code of this file.

Data Structures

union  fuel_gauge_prop_val
 Property field to value/type union. More...
 
struct  sbs_gauge_manufacturer_name
 
struct  sbs_gauge_device_name
 
struct  sbs_gauge_device_chemistry
 
struct  fuel_gauge_driver_api
 

Macros

#define SBS_GAUGE_MANUFACTURER_NAME_MAX_SIZE   20
 Data structures for reading SBS buffer properties.
 
#define SBS_GAUGE_DEVICE_NAME_MAX_SIZE   20
 
#define SBS_GAUGE_DEVICE_CHEMISTRY_MAX_SIZE   4
 

Typedefs

typedef uint16_t fuel_gauge_prop_t
 
typedef int(* fuel_gauge_get_property_t) (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val *val)
 Callback API for getting a fuel_gauge property.
 
typedef int(* fuel_gauge_set_property_t) (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val val)
 Callback API for setting a fuel_gauge property.
 
typedef int(* fuel_gauge_get_buffer_property_t) (const struct device *dev, fuel_gauge_prop_t prop_type, void *dst, size_t dst_len)
 Callback API for getting a fuel_gauge buffer property.
 
typedef int(* fuel_gauge_battery_cutoff_t) (const struct device *dev)
 Callback API for doing a battery cutoff.
 

Enumerations

enum  fuel_gauge_prop_type {
  FUEL_GAUGE_AVG_CURRENT = 0 , FUEL_GAUGE_BATTERY_CUTOFF , FUEL_GAUGE_CURRENT , FUEL_GAUGE_CHARGE_CUTOFF ,
  FUEL_GAUGE_CYCLE_COUNT , FUEL_GAUGE_CONNECT_STATE , FUEL_GAUGE_FLAGS , FUEL_GAUGE_FULL_CHARGE_CAPACITY ,
  FUEL_GAUGE_PRESENT_STATE , FUEL_GAUGE_REMAINING_CAPACITY , FUEL_GAUGE_RUNTIME_TO_EMPTY , FUEL_GAUGE_RUNTIME_TO_FULL ,
  FUEL_GAUGE_SBS_MFR_ACCESS , FUEL_GAUGE_ABSOLUTE_STATE_OF_CHARGE , FUEL_GAUGE_RELATIVE_STATE_OF_CHARGE , FUEL_GAUGE_TEMPERATURE ,
  FUEL_GAUGE_VOLTAGE , FUEL_GAUGE_SBS_MODE , FUEL_GAUGE_CHARGE_CURRENT , FUEL_GAUGE_CHARGE_VOLTAGE ,
  FUEL_GAUGE_STATUS , FUEL_GAUGE_DESIGN_CAPACITY , FUEL_GAUGE_DESIGN_VOLTAGE , FUEL_GAUGE_SBS_ATRATE ,
  FUEL_GAUGE_SBS_ATRATE_TIME_TO_FULL , FUEL_GAUGE_SBS_ATRATE_TIME_TO_EMPTY , FUEL_GAUGE_SBS_ATRATE_OK , FUEL_GAUGE_SBS_REMAINING_CAPACITY_ALARM ,
  FUEL_GAUGE_SBS_REMAINING_TIME_ALARM , FUEL_GAUGE_MANUFACTURER_NAME , FUEL_GAUGE_DEVICE_NAME , FUEL_GAUGE_DEVICE_CHEMISTRY ,
  FUEL_GAUGE_COMMON_COUNT , FUEL_GAUGE_CUSTOM_BEGIN , FUEL_GAUGE_PROP_MAX = UINT16_MAX
}
 

Functions

int fuel_gauge_get_prop (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val *val)
 Fetch a battery fuel-gauge property.
 
int fuel_gauge_get_props (const struct device *dev, fuel_gauge_prop_t *props, union fuel_gauge_prop_val *vals, size_t len)
 Fetch multiple battery fuel-gauge properties.
 
int fuel_gauge_set_prop (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val val)
 Set a battery fuel-gauge property.
 
int fuel_gauge_set_props (const struct device *dev, fuel_gauge_prop_t *props, union fuel_gauge_prop_val *vals, size_t len)
 Set a battery fuel-gauge property.
 
int fuel_gauge_get_buffer_prop (const struct device *dev, fuel_gauge_prop_t prop_type, void *dst, size_t dst_len)
 Fetch a battery fuel-gauge buffer property.
 
int fuel_gauge_battery_cutoff (const struct device *dev)
 Have fuel gauge cutoff its associated battery.