battman2 2.0.0.0
|
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. | |
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.
void battman2_cfg_setup | ( | battman2_cfg_t * | cfg | ) |
BATT-MAN 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See battman2_cfg_t object definition for detailed explanation. |
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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | faults | : Error flags data. |
0
- Success, -1
- Error.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™.
[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. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
0
- IRQ pin state low, 1
- IRQ pin state high.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | stat | : Global states data. |
0
- Success, -1
- Error.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.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | chg_cnfg | : Charger configuration object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | chg_stat | : Charger status object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | cid | : Device ID data. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[out] | ldo_cfg | : Linear regulator object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | sbb_sel | : Buck and boost channel selection:
|
[out] | sbb_cfg | : Buck and boost configuration object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
0
- Success, -1
- Error.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.
[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. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
0
- IRQ pin state low, 1
- IRQ pin state high.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | chg_cnfg | : Charger configuration object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | en_chg | : Desired charger work mode:
|
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO selection:
|
[in] | led_state | : LED stete selection:
|
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | ldo_cfg | : Linear regulator object. |
0
- Success, -1
- Error.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™.
[in] | ctx | : Click context object. See battman2_t object definition for detailed explanation. |
[in] | sbb_sel | : Buck and boost channel selection:
|
[in] | sbb_cfg | : Buck and boost configuration object. |
0
- Success, -1
- Error.