Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
charger.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <syscalls/charger.h>

Go to the source code of this file.

Data Structures

union  charger_propval
 container for a charger_property value More...
 
struct  charger_driver_api
 Charging device API. More...
 

Typedefs

typedef uint16_t charger_prop_t
 A charger property's identifier.
 
typedef int(* charger_get_property_t) (const struct device *dev, const charger_prop_t prop, union charger_propval *val)
 Callback API for getting a charger property.
 
typedef int(* charger_set_property_t) (const struct device *dev, const charger_prop_t prop, const union charger_propval *val)
 Callback API for setting a charger property.
 

Enumerations

enum  charger_property {
  CHARGER_PROP_ONLINE = 0 , CHARGER_PROP_PRESENT , CHARGER_PROP_STATUS , CHARGER_PROP_COMMON_COUNT ,
  CHARGER_PROP_CUSTOM_BEGIN = CHARGER_PROP_COMMON_COUNT + 1 , CHARGER_PROP_MAX = UINT16_MAX
}
 Runtime Dynamic Battery Parameters. More...
 
enum  charger_online { CHARGER_ONLINE_OFFLINE = 0 , CHARGER_ONLINE_FIXED , CHARGER_ONLINE_PROGRAMMABLE }
 External supply states. More...
 
enum  charger_status {
  CHARGER_STATUS_UNKNOWN = 0 , CHARGER_STATUS_CHARGING , CHARGER_STATUS_DISCHARGING , CHARGER_STATUS_NOT_CHARGING ,
  CHARGER_STATUS_FULL
}
 Charging states. More...
 

Functions

int charger_get_prop (const struct device *dev, const charger_prop_t prop, union charger_propval *val)
 Fetch a battery charger property.
 
int charger_set_prop (const struct device *dev, const charger_prop_t prop, const union charger_propval *val)
 Set a battery charger property.