charger6 2.0.0.0
charger6.h File Reference

This file contains API for Charger 6 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  charger6_t
 Charger 6 Click context object. More...
 
struct  charger6_cfg_t
 Charger 6 Click configuration object. More...
 
struct  charger6_status_t
 Charger 6 Click data status structure definition. More...
 

Macros

#define CHARGER6_REGISTER_00   0x00
 Charger 6 description register.
 
#define CHARGER6_REGISTER_01   0x01
 
#define CHARGER6_REGISTER_02   0x02
 
#define CHARGER6_REGISTER_03   0x03
 
#define CHARGER6_REGISTER_04   0x04
 
#define CHARGER6_REGISTER_05   0x05
 
#define CHARGER6_REGISTER_06   0x06
 
#define CHARGER6_REGISTER_07   0x07
 
#define CHARGER6_REGISTER_08   0x08
 
#define CHARGER6_REGISTER_09   0x09
 
#define CHARGER6_REGISTER_0A   0x0A
 
#define CHARGER6_REGISTER_0B   0x0B
 
#define CHARGER6_PSEL_SW_MANUAL   0x00
 Charger 6 description register.
 
#define CHARGER6_PSEL_500_mA   0x01
 
#define CHARGER6_SYS_MIN_VTG_2600mV   2600
 Charger 6 description system minimum voltage.
 
#define CHARGER6_SYS_MIN_VTG_2800mV   2800
 
#define CHARGER6_SYS_MIN_VTG_3000mV   3000
 
#define CHARGER6_SYS_MIN_VTG_3200mV   3200
 
#define CHARGER6_SYS_MIN_VTG_3400mV   3400
 
#define CHARGER6_SYS_MIN_VTG_3500mV   3500
 
#define CHARGER6_SYS_MIN_VTG_3600mV   3600
 
#define CHARGER6_SYS_MIN_VTG_3700mV   3700
 
#define CHARGER6_TOPOFF_TIMER_DISABLE   0
 Charger 6 description top off timer.
 
#define CHARGER6_TOPOFF_TIMER_15_MINUTES   15
 
#define CHARGER6_TOPOFF_TIMER_30_MINUTES   30
 
#define CHARGER6_TOPOFF_TIMER_45_MINUTES   45
 
#define CHARGER6_R00_EN_HIZ_DISABLE   0x00
 Charger 6 description setting.
 
#define CHARGER6_R00_EN_HIZ_ENABLE   0x80
 
#define CHARGER6_R00_EN_ICHG_MON_ENABLE   0x00
 
#define CHARGER6_R00_EN_ICHG_MON_DISABLE_STAT   0x60
 
#define CHARGER6_R00_IINDPM_1600mA   0x10
 
#define CHARGER6_R00_IINDPM_800mA   0x08
 
#define CHARGER6_R00_IINDPM_400mA   0x04
 
#define CHARGER6_R00_IINDPM_200mA   0x02
 
#define CHARGER6_R00_IINDPM_100mA   0x01
 
#define CHARGER6_R01_PFM_ENABLE   0x00
 Charger 6 REG01 Field Descriptions.
 
#define CHARGER6_R01_PFM_DISABLE   0x80
 
#define CHARGER6_R01_WD_RST_NORMAL   0x00
 
#define CHARGER6_R01_WD_RST_RESET   0x40
 
#define CHARGER6_R01_OTG_DISABLE   0x00
 
#define CHARGER6_R01_OTG_ENABLE   0x20
 
#define CHARGER6_R01_CHARGE_DISABLE   0x00
 
#define CHARGER6_R01_CHARGE_ENABLE   0x10
 
#define CHARGER6_R01_SYS_MIN_2600mV   0x00
 
#define CHARGER6_R01_SYS_MIN_2800mV   0x02
 
#define CHARGER6_R01_SYS_MIN_3000mV   0x04
 
#define CHARGER6_R01_SYS_MIN_3200mV   0x06
 
#define CHARGER6_R01_SYS_MIN_3400mV   0x08
 
#define CHARGER6_R01_SYS_MIN_3500mV   0x0A
 
#define CHARGER6_R01_SYS_MIN_3600mV   0x0C
 
#define CHARGER6_R01_SYS_MIN_3700mV   0x0E
 
#define CHARGER6_R01_MIN_VBAT_SEL_2800mV   0x00
 
#define CHARGER6_R01_MIN_VBAT_SEL_2500mV   0x01
 
#define CHARGER6_R02_BOOST_LIM_500mA   0x00
 Charger 6 REG02 Field Descriptions.
 
#define CHARGER6_R02_BOOST_LIM_1200mA   0x80
 
#define CHARGER6_R02_Q1_FULLON_BETTER_ACCURACY   0x00
 
#define CHARGER6_R02_Q1_FULLON_BETTER_EFFICIENCY   0x40
 
#define CHARGER6_R02_ICHG_1920mA   0x20
 
#define CHARGER6_R02_ICHG_960mA   0x10
 
#define CHARGER6_R02_ICHG_480mA   0x08
 
#define CHARGER6_R02_ICHG_240mA   0x04
 
#define CHARGER6_R02_ICHG_120mA   0x02
 
#define CHARGER6_R02_ICHG_60mA   0x01
 
#define CHARGER6_R03_IPRECHG_480mA   0x80
 Charger 6 REG03 Field Descriptions.
 
#define CHARGER6_R03_IPRECHG_240mA   0x40
 
#define CHARGER6_R03_IPRECHG_120mA   0x20
 
#define CHARGER6_R03_IPRECHG_60mA   0x10
 
#define CHARGER6_R03_ITERM_480mA   0x08
 
#define CHARGER6_R03_ITERM_240mA   0x04
 
#define CHARGER6_R03_ITERM_120mA   0x02
 
#define CHARGER6_R03_ITERM_60mA   0x01
 
#define CHARGER6_R04_VREG_512mV   0x80
 Charger 6 REG04 Field Descriptions.
 
#define CHARGER6_R04_VREG_256mV   0x40
 
#define CHARGER6_R04_VREG_128mV   0x20
 
#define CHARGER6_R04_VREG_64mV   0x10
 
#define CHARGER6_R04_VREG_32mV   0x08
 
#define CHARGER6_R04_TOPOFF_TIMER_DISABLED   0x00
 
#define CHARGER6_R04_TOPOFF_TIMER_15_MIN   0x02
 
#define CHARGER6_R04_TOPOFF_TIMER_30_MIN   0x04
 
#define CHARGER6_R04_TOPOFF_TIMER_45_MIN   0x06
 
#define CHARGER6_R04_VRECHG_100mV   0x00
 
#define CHARGER6_R04_VRECHG_200mV   0x01
 
#define CHARGER6_R05_TERMINATION_DISABLE   0x00
 Charger 6 REG05 Field Descriptions.
 
#define CHARGER6_R05_TERMINATION_ENABLE   0x80
 
#define CHARGER6_R05_WATCHDOG_DISABLE   0x00
 
#define CHARGER6_R05_WATCHDOG_TIMER_40_SEC   0x10
 
#define CHARGER6_R05_WATCHDOG_TIMER_80_SEC   0x20
 
#define CHARGER6_R05_WATCHDOG_TIMER_160_SEC   0x30
 
#define CHARGER6_R05_TIMER_DISABLE   0x00
 
#define CHARGER6_R05_TIMER_ENABLE   0x08
 
#define CHARGER6_R05_CHG_TIMER_5_HOURS   0x00
 
#define CHARGER6_R05_CHG_TIMER_10_HOURS   0x04
 
#define CHARGER6_R05_TREG_90_C   0x00
 
#define CHARGER6_R05_TREG_110_C   0x02
 
#define CHARGER6_R05_JEITA_ISET_50   0x00
 
#define CHARGER6_R05_JEITA_ISET_20   0x01
 
#define CHARGER6_R06_OVP_TSH_5500mV   0x00
 Charger 6 REG06 Field Descriptions.
 
#define CHARGER6_R06_OVP_TSH_6500mV   0x40
 
#define CHARGER6_R06_OVP_TSH_10500mV   0x80
 
#define CHARGER6_R06_OVP_TSH_14000mV   0xC0
 
#define CHARGER6_R06_BOOSTV_4850mV   0x00
 
#define CHARGER6_R06_BOOSTV_5000mV   0x10
 
#define CHARGER6_R06_BOOSTV_5150mV   0x20
 
#define CHARGER6_R06_BOOSTV_5300mV   0x30
 
#define CHARGER6_R06_VINDPM_800mV   0x08
 
#define CHARGER6_R06_VINDPM_400mV   0x04
 
#define CHARGER6_R06_VINDPM_200mV   0x02
 
#define CHARGER6_R06_VINDPM_100mV   0x01
 
#define CHARGER6_R07_NOT_IN_INPUT_CURRENT_LIMIT   0x00
 Charger 6 REG07 Field Descriptions.
 
#define CHARGER6_R07_FORCE_INPUT_CURRENT_LIMIT   0x80
 
#define CHARGER6_R07_TMR2X_DISABLE   0x00
 
#define CHARGER6_R07_TMR2X_ENABLE   0x40
 
#define CHARGER6_R07_BATFET_ALLOW_Q4_TURN_ON   0x00
 
#define CHARGER6_R07_BATFET_TURN_OFF_Q4   0x20
 
#define CHARGER6_R07_JEITA_VSET_TO_4100mV   0x00
 
#define CHARGER6_R07_JEITA_VSET_TO_VREG   0x10
 
#define CHARGER6_R07_BATFET_IMMEDIATELY   0x00
 
#define CHARGER6_R07_BATFET_AFTER_10_SEC   0x08
 
#define CHARGER6_R07_BATFET_RST_DISABLE   0x00
 
#define CHARGER6_R07_BATFET_RST_ENABLE   0x04
 
#define CHARGER6_R07_VDPM_BAT_TRACK_DISABLE   0x00
 
#define CHARGER6_R07_VDPM_BAT_TRACK_VBAT_PLUS_200mV   0x01
 
#define CHARGER6_R07_VDPM_BAT_TRACK_VBAT_PLUS_250mV   0x02
 
#define CHARGER6_R07_VDPM_BAT_TRACK_VBAT_PLUS_300mV   0x03
 
#define CHARGER6_R08_VBUS_BIT_MASK   0xE0
 Charger 6 REG08 Field Descriptions.
 
#define CHARGER6_R08_VBUS_STAT_NO_INPUT   0x00
 
#define CHARGER6_R08_VBUS_STAT_USB_HOST_SDP   0x20
 
#define CHARGER6_R08_VBUS_STAT_ADAPTER_2_4_A   0x40
 
#define CHARGER6_R08_VBUS_OTG   0xE0
 
#define CHARGER6_R08_CHRG_STAT_BIT_MASK   0x18
 
#define CHARGER6_R08_CHRG_STAT_NOT_CHARGING   0x00
 
#define CHARGER6_R08_CHRG_STAT_PRE_CHARGE   0x08
 
#define CHARGER6_R08_CHRG_STAT_FAST_CHARGING   0x10
 
#define CHARGER6_R08_CHRG_STAT_CHARGE_TERMINATION   0x18
 
#define CHARGER6_R08_PG_STAT_BIT_MASK   0x04
 
#define CHARGER6_R08_PG_STAT_POWER_NOT_GOOD   0x00
 
#define CHARGER6_R08_PG_STAT_POWER_GOOD   0x04
 
#define CHARGER6_R08_THERM_STAT_BIT_MASK   0x02
 
#define CHARGER6_R08_THERM_STAT_NOT_mAl   0x00
 
#define CHARGER6_R08_THERM_STAT_mAl   0x02
 
#define CHARGER6_R08_VSYS_BIT_MASK   0x01
 
#define CHARGER6_R08_VSYS_STAT_NOT   0x00
 
#define CHARGER6_R08_VSYS_STAT_VSYSM   0x01
 
#define CHARGER6_R09_WATCHDOG_FAULT_BIT_MASK   0x80
 Charger 6 REG09 Field Descriptions.
 
#define CHARGER6_R09_WATCHDOG_FAULT_NORMAL   0x00
 
#define CHARGER6_R09_WATCHDOG_FAULT_TIMER_EXPIRATION   0x80
 
#define CHARGER6_R09_BOOST_FAULT_BIT_MASK   0x40
 
#define CHARGER6_R09_BOOST_FAULT_NORMAL   0x00
 
#define CHARGER6_R09_BOOST_FAULT_VBUS_OVERLOADED   0x40
 
#define CHARGER6_R09_CHRG_FAULT_BIT_MASK   0x30
 
#define CHARGER6_R09_CHRG_FAULT_NORMAL   0x00
 
#define CHARGER6_R09_CHRG_FAULT_INPUT_FAULT   0x10
 
#define CHARGER6_R09_CHRG_FAULT_THERMAL_SHUTDOWN   0x20
 
#define CHARGER6_R09_CHRG_FAULT_CHG_SAFETY_TIMER_EXP   0x30
 
#define CHARGER6_R09_BAT_FAULT_BIT_MASK   0x08
 
#define CHARGER6_R09_BAT_FAULT_NORMAL   0x00
 
#define CHARGER6_R09_BAT_FAULT_BATOVP   0x08
 
#define CHARGER6_R09_NTC_FAULT_BIT_MASK   0x07
 
#define CHARGER6_R09_NTC_FAULT_NORMAL   0x00
 
#define CHARGER6_R09_NTC_FAULT_WARM   0x02
 
#define CHARGER6_R09_NTC_FAULT_COOL   0x03
 
#define CHARGER6_R09_NTC_FAULT_COLD   0x05
 
#define CHARGER6_R09_NTC_FAULT_HOT   0x06
 
#define CHARGER6_R0A_VBUS_GD_BIT_MASK   0x80
 Charger 6 REG0A Field Descriptions.
 
#define CHARGER6_R0A_VBUS_GD_NOT_VBUS   0x00
 
#define CHARGER6_R0A_VBUS_GD_VBUS_ATTACHED   0x80
 
#define CHARGER6_R0A_VBUS_GD_VINDPM_BIT_MASK   0x40
 
#define CHARGER6_R0A_VBUS_GD_NOT_IN_VINDPM   0x00
 
#define CHARGER6_R0A_VBUS_GD_IN_VINDPM   0x40
 
#define CHARGER6_R0A_VBUS_GD_IINDPM_BIT_MASK   0x20
 
#define CHARGER6_R0A_VBUS_GD_NOT_IN_IINDPM   0x00
 
#define CHARGER6_R0A_VBUS_GD_IN_IINDPM   0x20
 
#define CHARGER6_R0A_TOP_OFF_BIT_MASK   0x08
 
#define CHARGER6_R0A_TOP_OFF_TIMER_NOT_COUNTING   0x00
 
#define CHARGER6_R0A_TOP_OFF_TIMER_COUNTING   0x08
 
#define CHARGER6_R0A_ACOV_STAT_BIT_MASK   0x04
 
#define CHARGER6_R0A_ACOV_STAT_NOT_IN_ACOV   0x00
 
#define CHARGER6_R0A_ACOV_STAT_IN_ACOV   0x04
 
#define CHARGER6_R0A_VINDPM_INT_MASK_ALLOW   0x00
 
#define CHARGER6_R0A_VINDPM_INT_MASK_MASK   0x02
 
#define CHARGER6_R0A_IINDPM_INT_MASK_ALLOW   0x00
 
#define CHARGER6_R0A_IINDPM_INT_MASK_MASK   0x01
 
#define CHARGER6_R0B_DEV_ID_BIT_MASK   0x78
 Charger 6 REG0B Field Descriptions.
 
#define CHARGER6_R0B_DEV_REV_BIT_MASK   0x03
 
#define CHARGER6_SET_DEV_ADDR   0x6B
 Charger 6 device address setting.
 
#define CHARGER6_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  charger6_return_value_t { CHARGER6_OK = 0 , CHARGER6_ERROR = -1 }
 Charger 6 Click return value data. More...
 

Functions

void charger6_cfg_setup (charger6_cfg_t *cfg)
 Charger 6 configuration object setup function.
 
err_t charger6_init (charger6_t *ctx, charger6_cfg_t *cfg)
 Charger 6 initialization function.
 
err_t charger6_default_cfg (charger6_t *ctx)
 Charger 6 default configuration function.
 
err_t charger6_generic_write (charger6_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Charger 6 I2C writing function.
 
err_t charger6_generic_read (charger6_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Charger 6 I2C reading function.
 
void charger6_enable_battery_charging (charger6_t *ctx)
 Charger 6 charge enable function.
 
void charger6_disable_battery_charging (charger6_t *ctx)
 Charger 6 charge disable function.
 
void charger6_power_source_selection (charger6_t *ctx, uint8_t pwr_sel)
 Charger 6 power source selection function.
 
err_t charger6_set_input_current_limit (charger6_t *ctx, uint16_t current_limit)
 Charger 6 set input current limit function.
 
err_t charger6_set_system_minimum_voltage (charger6_t *ctx, uint16_t sys_min_voltage)
 Charger 6 set system minimum voltage function.
 
err_t charger6_get_status (charger6_t *ctx, charger6_status_t *chg_status)
 Charger 6 get status function.
 
err_t charger6_set_fast_charge_current (charger6_t *ctx, uint16_t fast_chg_current)
 Charger 6 set fast charge current function.
 
uint16_t charger6_get_fast_charge_current (charger6_t *ctx)
 Charger 6 get fast charge current function.
 
err_t charger6_set_precharge_current (charger6_t *ctx, uint16_t precharge_current)
 Charger 6 set precharge current function.
 
err_t charger6_set_termination_current (charger6_t *ctx, uint16_t termination_current)
 Charger 6 set termination current function.
 
err_t charger6_set_charge_voltage (charger6_t *ctx, uint16_t charge_voltage)
 Charger 6 set charge voltage function.
 
err_t charger6_set_top_off_timer (charger6_t *ctx, uint8_t top_off_time)
 Charger 6 set top OFF timer function.
 
uint8_t charger6_check_interrupt (charger6_t *ctx)
 Charger 6 check interrupt function.
 
void charger6_hw_reset (charger6_t *ctx)
 Charger 6 hw reset function.
 

Detailed Description

This file contains API for Charger 6 Click Driver.

Enumeration Type Documentation

◆ charger6_return_value_t

Charger 6 Click return value data.

Predefined enum values for driver return values.

Enumerator
CHARGER6_OK 
CHARGER6_ERROR