20#include <zephyr/device.h>
23#define ADP536X_VBUS_ILIM_50mA 0x00
24#define ADP536X_VBUS_ILIM_100mA 0x01
25#define ADP536X_VBUS_ILIM_150mA 0x02
26#define ADP536X_VBUS_ILIM_200mA 0x03
27#define ADP536X_VBUS_ILIM_250mA 0x04
28#define ADP536X_VBUS_ILIM_300mA 0x05
29#define ADP536X_VBUS_ILIM_400mA 0x06
30#define ADP536X_VBUS_ILIM_500mA 0x07
33#define ADP536X_CHG_CURRENT_10mA 0x00
34#define ADP536X_CHG_CURRENT_50mA 0x04
35#define ADP536X_CHG_CURRENT_100mA 0x09
36#define ADP536X_CHG_CURRENT_150mA 0x0E
37#define ADP536X_CHG_CURRENT_200mA 0x13
38#define ADP536X_CHG_CURRENT_250mA 0x18
39#define ADP536X_CHG_CURRENT_300mA 0x1D
40#define ADP536X_CHG_CURRENT_320mA 0x1F
43#define ADP536X_OC_CHG_THRESHOLD_25mA 0x00
44#define ADP536X_OC_CHG_THRESHOLD_50mA 0x01
45#define ADP536X_OC_CHG_THRESHOLD_100mA 0x02
46#define ADP536X_OC_CHG_THRESHOLD_150mA 0x03
47#define ADP536X_OC_CHG_THRESHOLD_200mA 0x04
48#define ADP536X_OC_CHG_THRESHOLD_250mA 0x05
49#define ADP536X_OC_CHG_THRESHOLD_300mA 0x06
50#define ADP536X_OC_CHG_THRESHOLD_400mA 0x07
int adp536x_charger_current_set(uint8_t value)
Set the charger current.
int adp536x_charger_termination_voltage_set(uint8_t value)
Set the charger termination voltage.
int adp536x_oc_chg_current_set(uint8_t value)
Set the charge over-current threshold.
int adp536x_vbus_current_set(uint8_t value)
Set the VBUS current limit.
int adp536x_oc_chg_hiccup_set(bool enable)
Enable charge hiccup protection mode.
int adp536x_charging_enable(bool enable)
Enable charging.
int adp536x_factory_reset(void)
Reset the device to its default values.
int adp536x_fg_volts(uint16_t *millivolts)
Read battery voltage.
int adp536x_fg_soc(uint8_t *percentage)
Read battery state of charge.
int adp536x_charger_status_1_read(uint8_t *buf)
Read the STATUS1 register.
int adp536x_init(const struct device *dev)
Initialize ADP536X.
int adp536x_fg_set_mode(enum adp536x_fg_enabled en, enum adp536x_fg_mode mode)
Set Fuel Gauge operating mode.
adp536x_fg_enabled
Definition adp536x.h:53
@ ADP566X_FG_DISABLED
Definition adp536x.h:54
@ ADP566X_FG_ENABLED
Definition adp536x.h:55
int adp536x_oc_dis_hiccup_set(bool enable)
Enable discharge hiccup protection mode.
adp536x_fg_mode
Definition adp536x.h:59
@ ADP566X_FG_MODE_SLEEP
Definition adp536x.h:61
@ ADP566X_FG_MODE_ACTIVE
Definition adp536x.h:60
int adp536x_charger_status_2_read(uint8_t *buf)
Read the STATUS2 register.