Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
Charger Interface. More...
Data Structures | |
struct | charger_current_notifier |
The input current thresholds for the charger to notify the system. More... | |
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 void(* | charger_status_notifier_t) (enum charger_status status) |
The charger status change callback to notify the system. | |
typedef void(* | charger_online_notifier_t) (enum charger_online online) |
The charger online change callback to notify the system. | |
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. | |
typedef int(* | charger_charge_enable_t) (const struct device *dev, const bool enable) |
Callback API enabling or disabling a charge cycle. | |
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. | |
int | charger_charge_enable (const struct device *dev, const bool enable) |
Enable or disable a charge cycle. | |
Charger Interface.
charger_charge_enable_t |
#include <zephyr/drivers/charger.h>
Callback API enabling or disabling a charge cycle.
See charger_charge_enable() for argument description
charger_get_property_t |
#include <zephyr/drivers/charger.h>
Callback API for getting a charger property.
See charger_get_property() for argument description
typedef void(* charger_online_notifier_t) (enum charger_online online) |
#include <zephyr/drivers/charger.h>
The charger online change callback to notify the system.
online | Current external supply state |
#include <zephyr/drivers/charger.h>
A charger property's identifier.
See charger_property for a list of identifiers
charger_set_property_t |
#include <zephyr/drivers/charger.h>
Callback API for setting a charger property.
See charger_set_property() for argument description
typedef void(* charger_status_notifier_t) (enum charger_status status) |
#include <zephyr/drivers/charger.h>
The charger status change callback to notify the system.
status | Current charging state |
enum charger_charge_type |
#include <zephyr/drivers/charger.h>
Charge algorithm types.
enum charger_health |
#include <zephyr/drivers/charger.h>
Charger health conditions.
These conditions determine the ability to, or the rate of, charge
#include <zephyr/drivers/charger.h>
Charger severity levels for system notifications.
enum charger_online |
#include <zephyr/drivers/charger.h>
External supply states.
enum charger_property |
#include <zephyr/drivers/charger.h>
Runtime Dynamic Battery Parameters.
Enumerator | |
---|---|
CHARGER_PROP_ONLINE | Indicates if external supply is present for the charger. Value should be of type enum charger_online |
CHARGER_PROP_PRESENT | Reports whether or not a battery is present. Value should be of type bool |
CHARGER_PROP_STATUS | Represents the charging status of the charger. Value should be of type enum charger_status |
CHARGER_PROP_CHARGE_TYPE | Represents the charging algo type of the charger. Value should be of type enum charger_charge_type |
CHARGER_PROP_HEALTH | Represents the health of the charger. Value should be of type enum charger_health |
CHARGER_PROP_CONSTANT_CHARGE_CURRENT_UA | Configuration of current sink used for charging in µA. |
CHARGER_PROP_PRECHARGE_CURRENT_UA | Configuration of current sink used for conditioning in µA. |
CHARGER_PROP_CHARGE_TERM_CURRENT_UA | Configuration of charge termination target in µA. |
CHARGER_PROP_CONSTANT_CHARGE_VOLTAGE_UV | Configuration of charge voltage regulation target in µV. |
CHARGER_PROP_INPUT_REGULATION_CURRENT_UA | Configuration of the input current regulation target in µA. This value is a rising current threshold that is regulated by reducing the charge current output |
CHARGER_PROP_INPUT_REGULATION_VOLTAGE_UV | Configuration of the input voltage regulation target in µV. This value is a falling voltage threshold that is regulated by reducing the charge current output |
CHARGER_PROP_INPUT_CURRENT_NOTIFICATION | Configuration to issue a notification to the system based on the input current level and timing. Value should be of type struct charger_current_notifier |
CHARGER_PROP_DISCHARGE_CURRENT_NOTIFICATION | Configuration to issue a notification to the system based on the battery discharge current level and timing. Value should be of type struct charger_current_notifier |
CHARGER_PROP_SYSTEM_VOLTAGE_NOTIFICATION_UV | Configuration of the falling system voltage threshold where a notification is issued to the system, measured in µV. |
CHARGER_PROP_STATUS_NOTIFICATION | Configuration to issue a notification to the system based on the charger status change. Value should be of type charger_status_notifier_t |
CHARGER_PROP_ONLINE_NOTIFICATION | Configuration to issue a notification to the system based on the charger online change. Value should be of type charger_online_notifier_t |
CHARGER_PROP_COMMON_COUNT | Reserved to demark end of common charger properties. |
CHARGER_PROP_CUSTOM_BEGIN | Reserved to demark downstream custom properties - use this value as the actual value may change over future versions of this API. |
CHARGER_PROP_MAX | Reserved to demark end of valid enum properties. |
enum charger_status |
#include <zephyr/drivers/charger.h>
Charging states.
#include <zephyr/drivers/charger.h>
Enable or disable a charge cycle.
dev | Pointer to the battery charger device |
enable | true enables a charge cycle, false disables a charge cycle |
0 | if successful |
-EIO | if communication with the charger failed |
-EINVAL | if the conditions for initiating charging are invalid |
int charger_get_prop | ( | const struct device * | dev, |
const charger_prop_t | prop, | ||
union charger_propval * | val | ||
) |
#include <zephyr/drivers/charger.h>
Fetch a battery charger property.
dev | Pointer to the battery charger device |
prop | Charger property to get |
val | Pointer to charger_propval union |
0 | if successful |
< | 0 if getting property failed |
int charger_set_prop | ( | const struct device * | dev, |
const charger_prop_t | prop, | ||
const union charger_propval * | val | ||
) |
#include <zephyr/drivers/charger.h>
Set a battery charger property.
dev | Pointer to the battery charger device |
prop | Charger property to set |
val | Pointer to charger_propval union |
0 | if successful |
< | 0 if setting property failed |