battboost 2.1.0.0
BATT Boost Click Driver

API for configuring and manipulating BATT Boost Click driver. More...

Topics

 BATT Boost Registers List
 List of registers of BATT Boost Click driver.
 
 BATT Boost Registers Settings
 Settings for registers of BATT Boost Click driver.
 
 BATT Boost MikroBUS Map
 MikroBUS pin mapping of BATT Boost Click driver.
 

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

API for configuring and manipulating BATT Boost Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ battboost_cfg_setup()

void battboost_cfg_setup ( battboost_cfg_t * cfg)

BATT Boost configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See battboost_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ battboost_default_cfg()

err_t battboost_default_cfg ( battboost_t * ctx)

BATT Boost default configuration function.

This function executes a default configuration of BATT Boost click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ battboost_generic_read()

err_t battboost_generic_read ( battboost_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

BATT Boost I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_generic_write()

err_t battboost_generic_write ( battboost_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

BATT Boost I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_get_chenergy()

err_t battboost_get_chenergy ( battboost_t * ctx,
uint32_t * chenergy )

BATT Boost gets the charge cycle count function.

This function reads the fuel gauge charge cycle count of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[out]chenergy: Charge cycle count data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_get_prof()

err_t battboost_get_prof ( battboost_t * ctx,
uint8_t * prof )

BATT Boost gets optimizer profile number function.

This function reads the actual optimizer profile number of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]prof: Optimizer profile selection.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_get_ready()

uint8_t battboost_get_ready ( battboost_t * ctx)

BATT Boost gets ready state function.

This function is used to check if device is ready to deliver full power of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Device is not ready,
  • 1 - Device is ready to deliver full power.
Note
None.

◆ battboost_get_status()

err_t battboost_get_status ( battboost_t * ctx,
uint8_t * status )

BATT Boost gets the status function.

This function reads the the status information of low battery input, capacitor input voltage early warning, VDH output alarm and ready state of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[out]status: Status data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_get_vcap()

err_t battboost_get_vcap ( battboost_t * ctx,
float * vcap )

BATT Boost gets the storage capacitor voltage status function.

This function is used to read the storage capacitor voltage status of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[out]vcap: Storage capacitor voltage.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_get_vchend()

err_t battboost_get_vchend ( battboost_t * ctx,
uint8_t * vchend )

BATT Boost gets the target charge voltage function.

This function reads the target charge voltage of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[out]vchend: Target charge voltage.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_high_impedance_mode()

err_t battboost_high_impedance_mode ( battboost_t * ctx)

BATT Boost sets the high-impedance mode function.

This function is used to configures the VDH high-impedance mode in Standby and Active states of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_init()

err_t battboost_init ( battboost_t * ctx,
battboost_cfg_t * cfg )

BATT Boost initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See battboost_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_reset_optimizer()

err_t battboost_reset_optimizer ( battboost_t * ctx)

BATT Boost reset optimizer result function.

This function is used to reset optimizer result of active profile of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_automode()

err_t battboost_set_automode ( battboost_t * ctx)

BATT Boost sets the auto mode function.

This function is used to set the auto mode of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_ich()

err_t battboost_set_ich ( battboost_t * ctx,
battboost_ich_t ich )

BATT Boost sets the charge current function.

This function is used to sets the charge current levels of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]ich: Charge current [2mA-50mAV]. See battboost_ich_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
For the emergency charge charge current is set to 50mA.

◆ battboost_set_on_pin_state()

void battboost_set_on_pin_state ( battboost_t * ctx,
uint8_t start )

BATT Boost sets the ON pin state function.

This function sets the desired states of the ON (RST) pin of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]start: ON pin state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_op_mode()

err_t battboost_set_op_mode ( battboost_t * ctx,
uint8_t op_mode )

BATT Boost sets the operating mode function.

This function is used to select the desired operating mode of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]op_mode: Operating state.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_opt_marg()

err_t battboost_set_opt_marg ( battboost_t * ctx,
uint8_t opt_marg )

BATT Boost sets the optimization margin voltage function.

This function sets the optimization margin voltage level of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]opt_marg: Optimization margin voltage.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_prof()

err_t battboost_set_prof ( battboost_t * ctx,
uint8_t prof )

BATT Boost sets optimizer profile number function.

This function sets desired optimizer profile number of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]prof: Optimizer profile selection.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
If profile 0 is selected, no optimization occurs, VFIX is applied.

◆ battboost_set_vcapmax()

err_t battboost_set_vcapmax ( battboost_t * ctx,
uint8_t vcapmax )

BATT Boost sets the capacitor maximum storage voltage function.

This function sets the capacitor maximum storage voltage level of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]vcapmax: Capacitor maximum storage voltage, 4.95V or 5.54V.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_vew()

err_t battboost_set_vew ( battboost_t * ctx,
uint8_t vew,
uint8_t eew )

BATT Boost sets the early warning voltage function.

This function sets and enables the early warning voltage level of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]vew: Early warning voltage [2.4V-4.3V].
[in]eew: Enable early warning.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_vfix()

err_t battboost_set_vfix ( battboost_t * ctx,
battboost_vfix_t vfix )

BATT Boost sets the end-of-charge voltage function.

This function is used to control the end-of-charge voltage levels of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]vfix: Capacitor end-of-charge voltage [2.6V-5.54V]. See battboost_vfix_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_vmin()

err_t battboost_set_vmin ( battboost_t * ctx,
float vmin )

BATT Boost sets the input threshold voltage function.

This function control the input threshold voltage levels of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]vmin: - Input threshold voltage [2.4V-3.2V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_set_vset()

err_t battboost_set_vset ( battboost_t * ctx,
float vset )

BATT Boost sets the output voltage function.

This function is used to control the output voltage levels of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
[in]vset: Output voltage [1.8V-3.6V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ battboost_vdh_vbt_mode()

err_t battboost_vdh_vbt_mode ( battboost_t * ctx)

BATT Boost sets the Vvdh Vvbt mode function.

This function is used to configures the VDH Vvdh=Vvbt mode in Standby and Active states of the NBM5100ABQX, Coin cell battery life booster with adaptive power optimization on the BATT Boost Click board.

Parameters
[in]ctx: Click context object. See battboost_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.