Zephyr API 3.6.99
|
Fuel Gauge Interface . More...
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. | |
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. | |
Fuel Gauge Interface .
#define SBS_GAUGE_DEVICE_CHEMISTRY_MAX_SIZE 4 |
#include <zephyr/drivers/fuel_gauge.h>
#define SBS_GAUGE_DEVICE_NAME_MAX_SIZE 20 |
#include <zephyr/drivers/fuel_gauge.h>
#define SBS_GAUGE_MANUFACTURER_NAME_MAX_SIZE 20 |
#include <zephyr/drivers/fuel_gauge.h>
Data structures for reading SBS buffer properties.
typedef int(* fuel_gauge_battery_cutoff_t) (const struct device *dev) |
#include <zephyr/drivers/fuel_gauge.h>
Callback API for doing a battery cutoff.
See fuel_gauge_battery_cutoff() for argument description
typedef int(* fuel_gauge_get_buffer_property_t) (const struct device *dev, fuel_gauge_prop_t prop_type, void *dst, size_t dst_len) |
#include <zephyr/drivers/fuel_gauge.h>
Callback API for getting a fuel_gauge buffer property.
See fuel_gauge_get_buffer_property() for argument description
typedef int(* fuel_gauge_get_property_t) (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val *val) |
#include <zephyr/drivers/fuel_gauge.h>
Callback API for getting a fuel_gauge property.
See fuel_gauge_get_property() for argument description
typedef uint16_t fuel_gauge_prop_t |
#include <zephyr/drivers/fuel_gauge.h>
typedef int(* fuel_gauge_set_property_t) (const struct device *dev, fuel_gauge_prop_t prop, union fuel_gauge_prop_val val) |
#include <zephyr/drivers/fuel_gauge.h>
Callback API for setting a fuel_gauge property.
See fuel_gauge_set_property() for argument description
enum fuel_gauge_prop_type |
#include <zephyr/drivers/fuel_gauge.h>
int fuel_gauge_battery_cutoff | ( | const struct device * | dev | ) |
#include <zephyr/drivers/fuel_gauge.h>
Have fuel gauge cutoff its associated battery.
dev | Pointer to the battery fuel-gauge device |
int fuel_gauge_get_buffer_prop | ( | const struct device * | dev, |
fuel_gauge_prop_t | prop_type, | ||
void * | dst, | ||
size_t | dst_len ) |
#include <zephyr/drivers/fuel_gauge.h>
Fetch a battery fuel-gauge buffer property.
dev | Pointer to the battery fuel-gauge device |
prop_type | Type of property to be fetched from device |
dst | byte array or struct that will hold the buffer data that is read from the fuel gauge |
dst_len | the length of the destination array in bytes |
int fuel_gauge_get_prop | ( | const struct device * | dev, |
fuel_gauge_prop_t | prop, | ||
union fuel_gauge_prop_val * | val ) |
#include <zephyr/drivers/fuel_gauge.h>
Fetch a battery fuel-gauge property.
dev | Pointer to the battery fuel-gauge device |
prop | Type of property to be fetched from device |
val | pointer to a union fuel_gauge_prop_val where the property is read into from the fuel gauge device. |
int fuel_gauge_get_props | ( | const struct device * | dev, |
fuel_gauge_prop_t * | props, | ||
union fuel_gauge_prop_val * | vals, | ||
size_t | len ) |
#include <zephyr/drivers/fuel_gauge.h>
Fetch multiple battery fuel-gauge properties.
The default implementation is the same as calling fuel_gauge_get_prop() multiple times. A driver may implement the get_properties
field of the fuel gauge driver APIs struct to override this implementation.
dev | Pointer to the battery fuel-gauge device |
props | Array of the type of property to be fetched from device, each index corresponds to the same index of the vals input array. |
vals | Pointer to array of union fuel_gauge_prop_val where the property is read into from the fuel gauge device. The vals array is not permuted. |
len | number of properties in props & vals array |
int fuel_gauge_set_prop | ( | const struct device * | dev, |
fuel_gauge_prop_t | prop, | ||
union fuel_gauge_prop_val | val ) |
#include <zephyr/drivers/fuel_gauge.h>
Set a battery fuel-gauge property.
dev | Pointer to the battery fuel-gauge device |
prop | Type of property that's being set |
val | Value to set associated prop property. |
int fuel_gauge_set_props | ( | const struct device * | dev, |
fuel_gauge_prop_t * | props, | ||
union fuel_gauge_prop_val * | vals, | ||
size_t | len ) |
#include <zephyr/drivers/fuel_gauge.h>
Set a battery fuel-gauge property.
dev | Pointer to the battery fuel-gauge device |
props | Array of the type of property to be set, each index corresponds to the same index of the vals input array. |
vals | Pointer to array of union fuel_gauge_prop_val where the property is written the fuel gauge device. The vals array is not permuted. |
len | number of properties in props array |