nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
adp536x.h File Reference

Driver for ADP536X. More...

#include <stdint.h>
#include <stdbool.h>
#include <zephyr/device.h>

Go to the source code of this file.

Macros

#define ADP536X_VBUS_ILIM_50mA   0x00
 
#define ADP536X_VBUS_ILIM_100mA   0x01
 
#define ADP536X_VBUS_ILIM_150mA   0x02
 
#define ADP536X_VBUS_ILIM_200mA   0x03
 
#define ADP536X_VBUS_ILIM_250mA   0x04
 
#define ADP536X_VBUS_ILIM_300mA   0x05
 
#define ADP536X_VBUS_ILIM_400mA   0x06
 
#define ADP536X_VBUS_ILIM_500mA   0x07
 
#define ADP536X_CHG_CURRENT_10mA   0x00
 
#define ADP536X_CHG_CURRENT_50mA   0x04
 
#define ADP536X_CHG_CURRENT_100mA   0x09
 
#define ADP536X_CHG_CURRENT_150mA   0x0E
 
#define ADP536X_CHG_CURRENT_200mA   0x13
 
#define ADP536X_CHG_CURRENT_250mA   0x18
 
#define ADP536X_CHG_CURRENT_300mA   0x1D
 
#define ADP536X_CHG_CURRENT_320mA   0x1F
 
#define ADP536X_OC_CHG_THRESHOLD_25mA   0x00
 
#define ADP536X_OC_CHG_THRESHOLD_50mA   0x01
 
#define ADP536X_OC_CHG_THRESHOLD_100mA   0x02
 
#define ADP536X_OC_CHG_THRESHOLD_150mA   0x03
 
#define ADP536X_OC_CHG_THRESHOLD_200mA   0x04
 
#define ADP536X_OC_CHG_THRESHOLD_250mA   0x05
 
#define ADP536X_OC_CHG_THRESHOLD_300mA   0x06
 
#define ADP536X_OC_CHG_THRESHOLD_400mA   0x07
 

Enumerations

enum  adp536x_fg_enabled { ADP566X_FG_DISABLED = 0 , ADP566X_FG_ENABLED = 1 }
 
enum  adp536x_fg_mode { ADP566X_FG_MODE_ACTIVE = 0 , ADP566X_FG_MODE_SLEEP = 1 }
 

Functions

int adp536x_init (const struct device *dev)
 Initialize ADP536X.
 
int adp536x_vbus_current_set (uint8_t value)
 Set the VBUS current limit.
 
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_charging_enable (bool enable)
 Enable charging.
 
int adp536x_charger_status_1_read (uint8_t *buf)
 Read the STATUS1 register.
 
int adp536x_charger_status_2_read (uint8_t *buf)
 Read the STATUS2 register.
 
int adp536x_oc_chg_hiccup_set (bool enable)
 Enable charge hiccup protection mode.
 
int adp536x_oc_dis_hiccup_set (bool enable)
 Enable discharge hiccup protection mode.
 
int adp536x_factory_reset (void)
 Reset the device to its default values.
 
int adp536x_oc_chg_current_set (uint8_t value)
 Set the charge over-current threshold.
 
int adp536x_fg_set_mode (enum adp536x_fg_enabled en, enum adp536x_fg_mode mode)
 Set Fuel Gauge operating mode.
 
int adp536x_fg_soc (uint8_t *percentage)
 Read battery state of charge.
 
int adp536x_fg_volts (uint16_t *millivolts)
 Read battery voltage.
 

Detailed Description

Driver for ADP536X.