charger25 2.1.0.0
charger25.h File Reference

This file contains API for Charger 25 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  charger25_t
 Charger 25 Click context object. More...
 
struct  charger25_cfg_t
 Charger 25 Click configuration object. More...
 
struct  charger25_status_t
 Charger 25 Click status object. More...
 
struct  charger25_adc_ctrl_t
 Charger 25 Click ADC control object. More...
 
struct  charger25_adc_func_t
 Charger 25 Click ADC function object. More...
 

Macros

#define CHARGER25_REG_MINIMAL_SYSTEM_VOLTAGE   0x00
 Charger 25 description register.
 
#define CHARGER25_REG_CHARGE_VOLTAGE_LIMIT   0x01
 
#define CHARGER25_REG_CHARGE_CURRENT_LIMIT   0x03
 
#define CHARGER25_REG_INPUT_VOLTAGE_LIMIT   0x05
 
#define CHARGER25_REG_INPUT_CURRENT_LIMIT   0x06
 
#define CHARGER25_REG_PRECHARGE_CONTROL   0x08
 
#define CHARGER25_REG_TERMINATION_CONTROL   0x09
 
#define CHARGER25_REG_RECHARGE_CONTROL   0x0A
 
#define CHARGER25_REG_VOTG_REGULATION   0x0B
 
#define CHARGER25_REG_IOTG_REGULATION   0x0D
 
#define CHARGER25_REG_TIMER_CONTROL   0x0E
 
#define CHARGER25_REG_CHARGER_CONTROL_0   0x0F
 
#define CHARGER25_REG_CHARGER_CONTROL_1   0x10
 
#define CHARGER25_REG_CHARGER_CONTROL_2   0x11
 
#define CHARGER25_REG_CHARGER_CONTROL_3   0x12
 
#define CHARGER25_REG_CHARGER_CONTROL_4   0x13
 
#define CHARGER25_REG_CHARGER_CONTROL_5   0x14
 
#define CHARGER25_REG_RESERVED   0x15
 
#define CHARGER25_REG_TEMPERATURE_CONTROL   0x16
 
#define CHARGER25_REG_NTC_CONTROL_0   0x17
 
#define CHARGER25_REG_NTC_CONTROL_1   0x18
 
#define CHARGER25_REG_ICO_CURRENT_LIMIT   0x19
 
#define CHARGER25_REG_CHARGER_STATUS_0   0x1B
 
#define CHARGER25_REG_CHARGER_STATUS_1   0x1C
 
#define CHARGER25_REG_CHARGER_STATUS_2   0x1D
 
#define CHARGER25_REG_CHARGER_STATUS_3   0x1E
 
#define CHARGER25_REG_CHARGER_STATUS_4   0x1F
 
#define CHARGER25_REG_FAULT_STATUS_0   0x20
 
#define CHARGER25_REG_FAULT_STATUS_1   0x21
 
#define CHARGER25_REG_CHARGER_FLAG_0   0x22
 
#define CHARGER25_REG_CHARGER_FLAG_1   0x23
 
#define CHARGER25_REG_CHARGER_FLAG_2   0x24
 
#define CHARGER25_REG_CHARGER_FLAG_3   0x25
 
#define CHARGER25_REG_FAULT_FLAG_0   0x26
 
#define CHARGER25_REG_FAULT_FLAG_1   0x27
 
#define CHARGER25_REG_CHARGER_MASK_0   0x28
 
#define CHARGER25_REG_CHARGER_MASK_1   0x29
 
#define CHARGER25_REG_CHARGER_MASK_2   0x2A
 
#define CHARGER25_REG_CHARGER_MASK_3   0x2B
 
#define CHARGER25_REG_FAULT_MASK_0   0x2C
 
#define CHARGER25_REG_FAULT_MASK_1   0x2D
 
#define CHARGER25_REG_ADC_CONTROL   0x2E
 
#define CHARGER25_REG_ADC_FUNCTION_DISABLE_0   0x2F
 
#define CHARGER25_REG_ADC_FUNCTION_DISABLE_1   0x30
 
#define CHARGER25_REG_IBUS_ADC   0x31
 
#define CHARGER25_REG_IBAT_ADC   0x33
 
#define CHARGER25_REG_VBUS_ADC   0x35
 
#define CHARGER25_REG_VAC1_ADC   0x37
 
#define CHARGER25_REG_VAC2_ADC   0x39
 
#define CHARGER25_REG_VBAT_ADC   0x3B
 
#define CHARGER25_REG_VSYS_ADC   0x3D
 
#define CHARGER25_REG_TS_ADC   0x3F
 
#define CHARGER25_REG_TDIE_ADC   0x41
 
#define CHARGER25_REG_D_P_ADC   0x43
 
#define CHARGER25_REG_D_M_ADC   0x45
 
#define CHARGER25_REG_DPDM_DRIVER   0x47
 
#define CHARGER25_REG_PART_INFORMATION   0x48
 
#define CHARGER25_SOFT_RESET   0x40
 Charger 25 software reset data.
 
#define CHARGER25_VSYS_MIN_BIT_MASK   0x3F
 Charger 25 software reset data.
 
#define CHARGER25_VSYS_MIN_STEP_SIZE   250
 
#define CHARGER25_VSYS_MIN_FIXED_OFFSET   2500
 
#define CHARGER25_VTG_LIM_MSB_BIT_MASK   0x07
 Charger 25 minimal system voltage and battery cell count data.
 
#define CHARGER25_VTG_CONV_V_MV   10
 
#define CHARGER25_VTG_CELL_COUNT_DIV   3
 
#define CHARGER25_VTG_CELL_SEL_1   1
 
#define CHARGER25_VTG_CELL_SEL_2   2
 
#define CHARGER25_VTG_CELL_SEL_3   3
 
#define CHARGER25_VTG_CELL_SEL_4   4
 
#define CHARGER25_VTG_CELL_COUNT_MIN   1
 
#define CHARGER25_VTG_CELL_COUNT_MAX   4
 
#define CHARGER25_VTG_CELL_COUNT_MUL   7
 
#define CHARGER25_CURR_LIM_MSB_BIT_MASK   0x01
 Charger 25 minimal system voltage and battery cell count data.
 
#define CHARGER25_CURR_CONV_A_MA   10
 
#define CHARGER25_INPUT_VTG_CONV_V_MV   100
 Charger 25 input voltage convertor data.
 
#define CHARGER25_SET_ADC_FUNC_ENABLE   0x00
 Charger 25 ADC function and control data.
 
#define CHARGER25_SET_ADC_FUNC_DISABLE   0x01
 
#define CHARGER25_SET_ADC_CTRL_DISABLE   0x00
 
#define CHARGER25_SET_ADC_CTRL_ENABLE   0x01
 
#define CHARGER25_SET_ADC_RATE_CONT_CNV   0x00
 Charger 25 ADC conversion rate control and sample speed data.
 
#define CHARGER25_SET_ADC_ONES_HOT_CNV   0x01
 
#define CHARGER25_SET_ADC_SAMPLE_15_BIT   0x00
 
#define CHARGER25_SET_ADC_SAMPLE_14_BIT   0x01
 
#define CHARGER25_SET_ADC_SAMPLE_13_BIT   0x02
 
#define CHARGER25_SET_ADC_SAMPLE_12_BIT   0x03
 
#define CHARGER25_SET_ADC_AVG_SINGLE_VAL   0x00
 Charger 25 ADC average initial value control data.
 
#define CHARGER25_SET_ADC_AVG_RUN_AVG   0x01
 
#define CHARGER25_SET_ADC_AVG_INIT_EXI_VAL   0x00
 
#define CHARGER25_SET_ADC_AVG_INIT_ADC_CNV   0x01
 
#define CHARGER25_CH_STAT_NOT_CHARGING   0x00
 Charger 25 charge status data.
 
#define CHARGER25_CH_STAT_TRICKLE_CHARGE   0x01
 
#define CHARGER25_CH_STAT_PRE_CHARGE   0x02
 
#define CHARGER25_CH_STAT_FAST_CHARGE   0x03
 
#define CHARGER25_CH_STAT_TAPER_CHARGE   0x04
 
#define CHARGER25_CH_STAT_TIMER_ACT_CHARGING   0x06
 
#define CHARGER25_CH_STAT_CHARGE_TERMIN_DONE   0x07
 
#define CHARGER25_STATE_PIN_QON_LOW   0x00
 Charger 25 I/O pins state data.
 
#define CHARGER25_STATE_PIN_QON_HIGH   0x01
 
#define CHARGER25_DEVICE_ADDRESS   0x6B
 Charger 25 device address setting.
 
#define CHARGER25_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  charger25_return_value_t { CHARGER25_OK = 0 , CHARGER25_ERROR = -1 }
 Charger 25 Click return value data. More...
 

Functions

void charger25_cfg_setup (charger25_cfg_t *cfg)
 Charger 25 configuration object setup function.
 
err_t charger25_init (charger25_t *ctx, charger25_cfg_t *cfg)
 Charger 25 initialization function.
 
err_t charger25_default_cfg (charger25_t *ctx)
 Charger 25 default configuration function.
 
err_t charger25_generic_write (charger25_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Charger 25 I2C writing function.
 
err_t charger25_generic_read (charger25_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Charger 25 I2C reading function.
 
void charger25_set_qon_pin (charger25_t *ctx, uint8_t state)
 Charger 25 set QON pin state function.
 
void charger25_enable (charger25_t *ctx)
 Charger 25 charge enable function.
 
void charger25_disable (charger25_t *ctx)
 Charger 25 charge disable function.
 
uint8_t charger25_get_interrupt (charger25_t *ctx)
 Charger 25 get interrupt function.
 
err_t charger25_sw_reset (charger25_t *ctx)
 Charger 25 software reset function.
 
err_t charger25_get_vbat (charger25_t *ctx, uint16_t *vbat)
 Charger 25 get VBAT function.
 
err_t charger25_get_vsys_min (charger25_t *ctx, uint16_t *vsys_min)
 Charger 25 get VSYS function.
 
err_t charger25_set_adc_control (charger25_t *ctx, charger25_adc_ctrl_t adc_ctrl)
 Charger 25 set ADC control function.
 
err_t charger25_set_adc_function (charger25_t *ctx, charger25_adc_func_t adc_func)
 Charger 25 set ADC function function.
 
err_t charger25_get_vbat_lim (charger25_t *ctx, uint16_t *vtg_lim)
 Charger 25 get battery voltage limit function.
 
err_t charger25_set_vbat_lim (charger25_t *ctx, uint16_t vtg_lim)
 Charger 25 set battery voltage limit function.
 
err_t charger25_get_cell_count (charger25_t *ctx, uint8_t *cell_count)
 Charger 25 get battery cell count function.
 
err_t charger25_set_cell_count (charger25_t *ctx, uint8_t cell_count)
 Charger 25 set battery cell count function.
 
err_t charger25_get_current_limit (charger25_t *ctx, uint16_t *current_lim)
 Charger 25 get charge current limit function.
 
err_t charger25_set_current_limit (charger25_t *ctx, uint16_t current_lim)
 Charger 25 set charge current limit function.
 
err_t charger25_get_input_vtg_limit (charger25_t *ctx, uint16_t *input_vtg_limit)
 Charger 25 get input voltage limit function.
 
err_t charger25_set_input_vtg_limit (charger25_t *ctx, uint16_t input_vtg_limit)
 Charger 25 set input voltage limit function.
 
err_t charger25_get_input_curr_limit (charger25_t *ctx, uint16_t *input_curr_limit)
 Charger 25 get input current limit function.
 
err_t charger25_set_input_curr_limit (charger25_t *ctx, uint16_t input_curr_limit)
 Charger 25 set input current limit function.
 
err_t charger25_get_status (charger25_t *ctx, charger25_status_t *status)
 Charger 25 get charging status function.
 

Detailed Description

This file contains API for Charger 25 Click Driver.

Enumeration Type Documentation

◆ charger25_return_value_t

Charger 25 Click return value data.

Predefined enum values for driver return values.

Enumerator
CHARGER25_OK 
CHARGER25_ERROR