battman2 2.0.0.0
BATT-MAN 2 Click Driver

API for configuring and manipulating BATT-MAN 2 Click driver. More...

Topics

 BATT-MAN 2 Registers List
 List of registers of BATT-MAN 2 Click driver.
 
 BATT-MAN 2 Registers Settings
 Settings for registers of BATT-MAN 2 Click driver.
 
 BATT-MAN 2 Charger status
 Charger status of BATT-MAN 2 Click driver.
 
 BATT-MAN 2 MikroBUS Map
 MikroBUS pin mapping of BATT-MAN 2 Click driver.
 

Functions

void battman2_cfg_setup (battman2_cfg_t *cfg)
 BATT-MAN 2 configuration object setup function.
 
err_t battman2_init (battman2_t *ctx, battman2_cfg_t *cfg)
 BATT-MAN 2 initialization function.
 
err_t battman2_default_cfg (battman2_t *ctx)
 BATT-MAN 2 default configuration function.
 
err_t battman2_generic_write (battman2_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 BATT-MAN 2 I2C writing function.
 
err_t battman2_generic_read (battman2_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 BATT-MAN 2 I2C reading function.
 
err_t battman2_hw_reset (battman2_t *ctx)
 BATT-MAN 2 hw reset function.
 
err_t battman2_check_int_glbl (battman2_t *ctx, uint8_t *int_glbl0, uint8_t *int_glbl1)
 BATT-MAN 2 check global interrupts function.
 
err_t battman2_check_faults_occurred (battman2_t *ctx, uint8_t *faults)
 BATT-MAN 2 check faults occurred function.
 
err_t battman2_check_stat (battman2_t *ctx, uint8_t *stat)
 BATT-MAN 2 check states function.
 
err_t battman2_set_gpio_output (battman2_t *ctx, uint8_t gpio_sel, uint8_t led_state)
 BATT-MAN 2 set gpio output state function.
 
err_t battman2_get_id (battman2_t *ctx, uint8_t *cid)
 BATT-MAN 2 get device ID function.
 
err_t battman2_set_charger_enable (battman2_t *ctx, uint8_t en_chg)
 BATT-MAN 2 set charger enable function.
 
err_t battman2_set_charger_cfg (battman2_t *ctx, battman2_chg_cnfg_t chg_cnfg)
 BATT-MAN 2 set charger configuration function.
 
err_t battman2_get_charger_cfg (battman2_t *ctx, battman2_chg_cnfg_t *chg_cnfg)
 BATT-MAN 2 get charger configuration function.
 
err_t battman2_get_chg_status (battman2_t *ctx, battman2_stat_chg_t *chg_stat)
 BATT-MAN 2 get charger status function.
 
err_t battman2_set_sbb_config (battman2_t *ctx, uint8_t sbb_sel, battman2_sbb_cnfg_t sbb_cfg)
 BATT-MAN 2 set SBB configuration function.
 
err_t battman2_get_sbb_config (battman2_t *ctx, uint8_t sbb_sel, battman2_sbb_cnfg_t *sbb_cfg)
 BATT-MAN 2 get SBB configuration function.
 
err_t battman2_set_ldo_config (battman2_t *ctx, battman2_ldo_cnfg_t ldo_cfg)
 BATT-MAN 2 set LDO configuration function.
 
err_t battman2_get_ldo_config (battman2_t *ctx, battman2_ldo_cnfg_t *ldo_cfg)
 BATT-MAN 2 get LDO configuration function.
 
uint8_t battman2_check_interrupt (battman2_t *ctx)
 BATT-MAN 2 check interrupt function.
 
void battman2_led_intro (battman2_t *ctx)
 BATT-MAN 2 LED intro function.
 

Detailed Description

API for configuring and manipulating BATT-MAN 2 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

◆ battman2_cfg_setup()

void battman2_cfg_setup ( battman2_cfg_t * cfg)

BATT-MAN 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ battman2_check_faults_occurred()

err_t battman2_check_faults_occurred ( battman2_t * ctx,
uint8_t * faults )

BATT-MAN 2 check faults occurred function.

This function check error flags of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_check_int_glbl()

err_t battman2_check_int_glbl ( battman2_t * ctx,
uint8_t * int_glbl0,
uint8_t * int_glbl1 )

BATT-MAN 2 check global interrupts function.

This function check global interrupts of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
[out]int_glbl0: Global interrupts register 0 data.
[out]int_glbl1: Global interrupts register 1 data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_check_interrupt()

uint8_t battman2_check_interrupt ( battman2_t * ctx)

BATT-MAN 2 check interrupt function.

This function check state of the interrupt ( IRQ pin ) of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
Returns
  • 0 - IRQ pin state low,
  • 1 - IRQ pin state high.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_check_stat()

err_t battman2_check_stat ( battman2_t * ctx,
uint8_t * stat )

BATT-MAN 2 check states function.

This function check global states of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_default_cfg()

err_t battman2_default_cfg ( battman2_t * ctx)

BATT-MAN 2 default configuration function.

This function executes a default configuration of BATT-MAN 2 click board.

Parameters
[in]ctx: Click context object. See battman2_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.

◆ battman2_generic_read()

err_t battman2_generic_read ( battman2_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

BATT-MAN 2 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 battman2_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_generic_write()

err_t battman2_generic_write ( battman2_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

BATT-MAN 2 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 battman2_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_get_charger_cfg()

err_t battman2_get_charger_cfg ( battman2_t * ctx,
battman2_chg_cnfg_t * chg_cnfg )

BATT-MAN 2 get charger configuration function.

This function get charger configuration of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_get_chg_status()

err_t battman2_get_chg_status ( battman2_t * ctx,
battman2_stat_chg_t * chg_stat )

BATT-MAN 2 get charger status function.

This function get charger status of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_get_id()

err_t battman2_get_id ( battman2_t * ctx,
uint8_t * cid )

BATT-MAN 2 get device ID function.

This function read device ID data of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_get_ldo_config()

err_t battman2_get_ldo_config ( battman2_t * ctx,
battman2_ldo_cnfg_t * ldo_cfg )

BATT-MAN 2 get LDO configuration function.

This function get linear regulator configuration of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_get_sbb_config()

err_t battman2_get_sbb_config ( battman2_t * ctx,
uint8_t sbb_sel,
battman2_sbb_cnfg_t * sbb_cfg )

BATT-MAN 2 get SBB configuration function.

This function get Buck and Boost configuration of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
[in]sbb_sel: Buck and boost channel selection:
  • 0x00 ( BATTMAN2_SBB_CH_0 ) - VSB0,
  • 0x01 ( BATTMAN2_SBB_CH_1 ) - VSB1,
  • 0x02 ( BATTMAN2_SBB_CH_2 ) - VSB1.
[out]sbb_cfg: Buck and boost configuration object.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_hw_reset()

err_t battman2_hw_reset ( battman2_t * ctx)

BATT-MAN 2 hw reset function.

This function performs a hardware reset of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_init()

err_t battman2_init ( battman2_t * ctx,
battman2_cfg_t * cfg )

BATT-MAN 2 initialization function.

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

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

◆ battman2_led_intro()

void battman2_led_intro ( battman2_t * ctx)

BATT-MAN 2 LED intro function.

This function LED indicator test of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
Returns
  • 0 - IRQ pin state low,
  • 1 - IRQ pin state high.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_set_charger_cfg()

err_t battman2_set_charger_cfg ( battman2_t * ctx,
battman2_chg_cnfg_t chg_cnfg )

BATT-MAN 2 set charger configuration function.

This function set desired configuration of the charger of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_set_charger_enable()

err_t battman2_set_charger_enable ( battman2_t * ctx,
uint8_t en_chg )

BATT-MAN 2 set charger enable function.

This function set desired charger work mode of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
[in]en_chg: Desired charger work mode:
  • 0x00 ( BATTMAN2_SET_CHARGER_DISABLE ) - Disable charging,
  • 0x01 ( BATTMAN2_SET_CHARGER_ENABLE ) - Enable charging.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_set_gpio_output()

err_t battman2_set_gpio_output ( battman2_t * ctx,
uint8_t gpio_sel,
uint8_t led_state )

BATT-MAN 2 set gpio output state function.

This function sets desare gpio output state of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
[in]gpio_sel: GPIO selection:
  • 0x00 ( BATTMAN2_SEL_LED_RED ) - Red LED,
  • 0x01 ( BATTMAN2_SEL_LED_YELLOW ) - Yellow LED,
  • 0x02 ( BATTMAN2_SEL_LED_BLUE ) - Blue LED.
[in]led_state: LED stete selection:
  • 0x00 ( BATTMAN2_PIN_STATE_OFF ) - Turn On LED,
  • 0x01 ( BATTMAN2_PIN_STATE_ON ) - Turn Off LED.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ battman2_set_ldo_config()

err_t battman2_set_ldo_config ( battman2_t * ctx,
battman2_ldo_cnfg_t ldo_cfg )

BATT-MAN 2 set LDO configuration function.

This function set desired configuration of the linear regulator of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

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

◆ battman2_set_sbb_config()

err_t battman2_set_sbb_config ( battman2_t * ctx,
uint8_t sbb_sel,
battman2_sbb_cnfg_t sbb_cfg )

BATT-MAN 2 set SBB configuration function.

This function set desired configuration of the SIMO Buck-Boost of the MAX77654 Ultra-Low Power PMIC Featuring SingleInductor, 3-Output Buck-Boost, 2-LDOs, PowerPath Charger for Small Li+, and Ship Mode on the BATT-MAN 2 click board™.

Parameters
[in]ctx: Click context object. See battman2_t object definition for detailed explanation.
[in]sbb_sel: Buck and boost channel selection:
  • 0x00 ( BATTMAN2_SBB_CH_0 ) - VSB0,
  • 0x01 ( BATTMAN2_SBB_CH_1 ) - VSB1,
  • 0x02 ( BATTMAN2_SBB_CH_2 ) - VSB1.
[in]sbb_cfg: Buck and boost configuration object.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.