battboost 2.1.0.0
battboost.h File Reference

This file contains API for BATT Boost 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  battboost_t
 BATT Boost Click context object. More...
 
struct  battboost_cfg_t
 BATT Boost Click configuration object. More...
 

Macros

#define BATTBOOST_REG_STATUS   0x00
 BATT Boost description register.
 
#define BATTBOOST_REG_CHENERGY_3   0x01
 
#define BATTBOOST_REG_CHENERGY_2   0x02
 
#define BATTBOOST_REG_CHENERGY_1   0x03
 
#define BATTBOOST_REG_CHENERGY_0   0x04
 
#define BATTBOOST_REG_VCAP   0x05
 
#define BATTBOOST_REG_VCHEND   0x06
 
#define BATTBOOST_REG_PROFILE_MSB   0x07
 
#define BATTBOOST_REG_COMMAND   0x08
 
#define BATTBOOST_REG_SET1   0x09
 
#define BATTBOOST_REG_SET2   0x0A
 
#define BATTBOOST_REG_SET3   0x0B
 
#define BATTBOOST_REG_SET4   0x0C
 
#define BATTBOOST_REG_SET5   0x0D
 
#define BATTBOOST_STATUS_LOWBAT   0x80
 BATT Boost status conditions.
 
#define BATTBOOST_STATUS_EW   0x40
 
#define BATTBOOST_STATUS_ALRM   0x20
 
#define BATTBOOST_STATUS_RDY   0x01
 
#define BATTBOOST_VCAP_BIT_MASK   0x1F
 BATT Boost storage capacitor voltage status bit mask.
 
#define BATTBOOST_VCHEND_BIT_MASK   0x1F
 BATT Boost target charge voltage bit mask.
 
#define BATTBOOST_SET2_VMIN_2_4V   2.4f
 BATT Boost minimum input voltage comparator threshold values.
 
#define BATTBOOST_SET2_VMIN_2_6V   2.6f
 
#define BATTBOOST_SET2_VMIN_2_8V   2.8f
 
#define BATTBOOST_SET2_VMIN_3_0V   3.0f
 
#define BATTBOOST_SET2_VMIN_3_2V   3.2f
 
#define BATTBOOST_SET2_VMIN_BIT_MASK   0xF8
 
#define BATTBOOST_SET2_ICH_BIT_MASK   0x1F
 
#define BATTBOOST_SET2_SET_VDH_VBT   0x10
 
#define BATTBOOST_SET3_VEW_2_4V   0
 BATT Boost input voltage comparator Early Warning voltage values.
 
#define BATTBOOST_SET3_VEW_2_6V   1
 
#define BATTBOOST_SET3_VEW_2_8V   2
 
#define BATTBOOST_SET3_VEW_3_0V   3
 
#define BATTBOOST_SET3_VEW_3_2V   4
 
#define BATTBOOST_SET3_VEW_3_4V   5
 
#define BATTBOOST_SET3_VEW_3_6V   6
 
#define BATTBOOST_SET3_VEW_3_84V   7
 
#define BATTBOOST_SET3_VEW_4_1V   8
 
#define BATTBOOST_SET3_VEW_4_3V   9
 
#define BATTBOOST_SET3_VEW_BIT_MASK   0x0F
 
#define BATTBOOST_SET3_EEW_DISABLE   0
 
#define BATTBOOST_SET3_EEW_ENABLE   1
 
#define BATTBOOST_SET5_OPT_MARG_MIN   0
 BATT Boost optimization margin values.
 
#define BATTBOOST_SET5_OPT_MARG_NORMAL   1
 
#define BATTBOOST_SET5_OPT_MARG_SAFE   2
 
#define BATTBOOST_SET5_OPT_MARG_EXTRA_SAFE   3
 
#define BATTBOOST_SET4_VCAPMAX_4_95V   0
 BATT Boost maximum storage voltage.
 
#define BATTBOOST_SET4_VCAPMAX_5_54V   1
 
#define BATTBOOST_SET4_VCAPMAX_BIT_MASK   0xEF
 
#define BATTBOOST_CMD_PROF_0_FIXED_MODE   0
 BATT Boost optimizer profiles values.
 
#define BATTBOOST_CMD_PROF_BIT_MASK   0xFC
 
#define BATTBOOST_CMD_BIT_MASK   0x0F
 
#define BATTBOOST_PROF_MSB_BIT_MASK   0x03
 
#define BATTBOOST_PROF_BIT_MASK   0xF0
 
#define BATTBOOST_OP_MODE_STANDBY   0
 BATT Boost operation mode data values.
 
#define BATTBOOST_OP_MODE_STBY_BIT_MASK   0x06
 
#define BATTBOOST_OP_MODE_CHARGE   1
 
#define BATTBOOST_OP_MODE_CHG_BIT_MASK   0xF0
 
#define BATTBOOST_OP_MODE_SET_CHARGE   0x02
 
#define BATTBOOST_OP_MODE_ACTIVE   2
 
#define BATTBOOST_OP_MODE_SET_ACT_ACTIVE   0x04
 
#define BATTBOOST_CMD_RESET_BIT_MASK   0x08
 BATT Boost reset optimizer data values.
 
#define BATTBOOST_CMD_AUTOMODE_ENABLE   0x80
 BATT Boost auto mode data values.
 
#define BATTBOOST_SET1_VSET_1_8V   1.8f
 BATT Boost output voltage control values.
 
#define BATTBOOST_SET1_VSET_2_0V   2.0f
 
#define BATTBOOST_SET1_VSET_2_2V   2.2f
 
#define BATTBOOST_SET1_VSET_2_4V   2.4f
 
#define BATTBOOST_SET1_VSET_2_5V   2.5f
 
#define BATTBOOST_SET1_VSET_2_6V   2.6f
 
#define BATTBOOST_SET1_VSET_2_7V   2.7f
 
#define BATTBOOST_SET1_VSET_2_8V   2.8f
 
#define BATTBOOST_SET1_VSET_2_9V   2.9f
 
#define BATTBOOST_SET1_VSET_3_0V   3.0f
 
#define BATTBOOST_SET1_VSET_3_1V   3.1f
 
#define BATTBOOST_SET1_VSET_3_2V   3.2f
 
#define BATTBOOST_SET1_VSET_3_3V   3.3f
 
#define BATTBOOST_SET1_VSET_3_4V   3.4f
 
#define BATTBOOST_SET1_VSET_3_5V   3.5f
 
#define BATTBOOST_SET1_VSET_3_6V   3.6f
 
#define BATTBOOST_SET1_VSET_BIT_MASK   0xF0
 
#define BATTBOOST_SET1_VFIX_BIT_MASK   0x0F
 
#define BATTBOOST_CONDITION_STOP   0
 BATT Boost start ON pin conditions.
 
#define BATTBOOST_CONDITION_START   1
 
#define BATTBOOST_STATUS_NOT_READY   0
 BATT Boost ready pin states.
 
#define BATTBOOST_STATUS_READY   1
 
#define BATTBOOST_DEVICE_ADDRESS_0   0x2E
 BATT Boost device address setting.
 
#define BATTBOOST_DEVICE_ADDRESS_1   0x2F
 
#define BATTBOOST_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  battboost_return_value_t { BATTBOOST_OK = 0 , BATTBOOST_ERROR = -1 }
 BATT Boost Click return value data. More...
 
enum  battboost_vfix_t {
  BATTBOOST_VFIX_2_60V = 3 , BATTBOOST_VFIX_2_95V , BATTBOOST_VFIX_3_27V , BATTBOOST_VFIX_3_57V ,
  BATTBOOST_VFIX_3_84V , BATTBOOST_VFIX_4_10V , BATTBOOST_VFIX_4_33V , BATTBOOST_VFIX_4_55V ,
  BATTBOOST_VFIX_4_76V , BATTBOOST_VFIX_4_95V , BATTBOOST_VFIX_5_16V , BATTBOOST_VFIX_5_34V ,
  BATTBOOST_VFIX_5_54V
}
 BATT Boost Click capacitor end-of-charge voltage. More...
 
enum  battboost_ich_t {
  BATTBOOST_ICH_2_MA = 0 , BATTBOOST_ICH_4_MA , BATTBOOST_ICH_8_MA , BATTBOOST_ICH_16_MA ,
  BATTBOOST_ICH_50_MA
}
 BATT Boost Click capacitor charge current. More...
 

Functions

void battboost_cfg_setup (battboost_cfg_t *cfg)
 BATT Boost configuration object setup function.
 
err_t battboost_init (battboost_t *ctx, battboost_cfg_t *cfg)
 BATT Boost initialization function.
 
err_t battboost_default_cfg (battboost_t *ctx)
 BATT Boost default configuration function.
 
err_t battboost_generic_write (battboost_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 BATT Boost I2C writing function.
 
err_t battboost_generic_read (battboost_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 BATT Boost I2C reading function.
 
err_t battboost_get_status (battboost_t *ctx, uint8_t *status)
 BATT Boost gets the status function.
 
err_t battboost_get_chenergy (battboost_t *ctx, uint32_t *chenergy)
 BATT Boost gets the charge cycle count function.
 
err_t battboost_get_vcap (battboost_t *ctx, float *vcap)
 BATT Boost gets the storage capacitor voltage status function.
 
err_t battboost_get_vchend (battboost_t *ctx, uint8_t *vchend)
 BATT Boost gets the target charge voltage function.
 
err_t battboost_set_prof (battboost_t *ctx, uint8_t prof)
 BATT Boost sets optimizer profile number function.
 
err_t battboost_get_prof (battboost_t *ctx, uint8_t *prof)
 BATT Boost gets optimizer profile number function.
 
err_t battboost_set_op_mode (battboost_t *ctx, uint8_t op_mode)
 BATT Boost sets the operating mode function.
 
err_t battboost_reset_optimizer (battboost_t *ctx)
 BATT Boost reset optimizer result function.
 
err_t battboost_set_automode (battboost_t *ctx)
 BATT Boost sets the auto mode function.
 
err_t battboost_set_vset (battboost_t *ctx, float vset)
 BATT Boost sets the output voltage function.
 
err_t battboost_set_vfix (battboost_t *ctx, battboost_vfix_t vfix)
 BATT Boost sets the end-of-charge voltage function.
 
err_t battboost_set_vmin (battboost_t *ctx, float vmin)
 BATT Boost sets the input threshold voltage function.
 
err_t battboost_set_ich (battboost_t *ctx, battboost_ich_t ich)
 BATT Boost sets the charge current function.
 
err_t battboost_high_impedance_mode (battboost_t *ctx)
 BATT Boost sets the high-impedance mode function.
 
err_t battboost_vdh_vbt_mode (battboost_t *ctx)
 BATT Boost sets the Vvdh Vvbt mode function.
 
err_t battboost_set_vew (battboost_t *ctx, uint8_t vew, uint8_t eew)
 BATT Boost sets the early warning voltage function.
 
err_t battboost_set_vcapmax (battboost_t *ctx, uint8_t vcapmax)
 BATT Boost sets the capacitor maximum storage voltage function.
 
err_t battboost_set_opt_marg (battboost_t *ctx, uint8_t opt_marg)
 BATT Boost sets the optimization margin voltage function.
 
void battboost_set_on_pin_state (battboost_t *ctx, uint8_t start)
 BATT Boost sets the ON pin state function.
 
uint8_t battboost_get_ready (battboost_t *ctx)
 BATT Boost gets ready state function.
 

Detailed Description

This file contains API for BATT Boost Click Driver.

Enumeration Type Documentation

◆ battboost_ich_t

BATT Boost Click capacitor charge current.

Predefined enum values for capacitor charge current.

Enumerator
BATTBOOST_ICH_2_MA 
BATTBOOST_ICH_4_MA 
BATTBOOST_ICH_8_MA 
BATTBOOST_ICH_16_MA 
BATTBOOST_ICH_50_MA 

◆ battboost_return_value_t

BATT Boost Click return value data.

Predefined enum values for driver return values.

Enumerator
BATTBOOST_OK 
BATTBOOST_ERROR 

◆ battboost_vfix_t

BATT Boost Click capacitor end-of-charge voltage.

Predefined enum values for capacitor end-of-charge voltage.

Enumerator
BATTBOOST_VFIX_2_60V 
BATTBOOST_VFIX_2_95V 
BATTBOOST_VFIX_3_27V 
BATTBOOST_VFIX_3_57V 
BATTBOOST_VFIX_3_84V 
BATTBOOST_VFIX_4_10V 
BATTBOOST_VFIX_4_33V 
BATTBOOST_VFIX_4_55V 
BATTBOOST_VFIX_4_76V 
BATTBOOST_VFIX_4_95V 
BATTBOOST_VFIX_5_16V 
BATTBOOST_VFIX_5_34V 
BATTBOOST_VFIX_5_54V