Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MAX77658 Class Reference
MAX77658 Ultra-Low Power PMIC Featuring Single-Inductor, 3-Output Buck-Boost, 2-LDOs, Power-Path Charger for Small Li+, Fuel Gauge M5. More...
#include <MAX77658.h>
Public Types | |
| enum | reg_bit_int_glbl_t |
Register Configuration. More... | |
| enum | reg_bit_ercflag_t |
Register Configuration. More... | |
| enum | reg_bit_stat_glbl_t |
Register Configuration. More... | |
| enum | reg_bit_int_mask_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_glbl_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_gpio_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_wdt_t |
Register Configuration. More... | |
| enum | reg_bit_stat_chg_a_t |
Register Configuration. More... | |
| enum | decode_thm_dtls_t |
Register Configuration. More... | |
| enum | reg_bit_stat_chg_b_t |
Register Configuration. More... | |
| enum | decode_chg_dtls_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_chg_b_t |
Register Configuration. More... | |
| enum | decode_t_fast_chg_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_chg_g_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_chg_h_t |
Register Configuration. More... | |
| enum | decode_mux_sel_t |
Register Configuration. More... | |
| enum | reg_bit_cnfg_sbb_top_t |
Register Configuration. More... | |
| enum | decode_op_mode_t |
Register Configuration. More... | |
| enum | decode_ip_sbb_t |
Register Configuration. More... | |
| enum | decode_ade_sbb_t |
Register Configuration. More... | |
| enum | decode_en_sbb_t |
Register Configuration. More... | |
| enum | decode_tv_ldo_offset_a_t |
Register Configuration. More... | |
| enum | decode_en_ldo_t |
Register Configuration. More... | |
| enum | decode_ade_ldo_t |
Register Configuration. More... | |
| enum | decode_ldo_md_t |
Register Configuration. More... | |
| enum | reg_bit_status_t |
Register Configuration. More... | |
| enum | reg_bit_valrt_th_t |
Register Configuration. More... | |
| enum | reg_bit_talrt_th_t |
Register Configuration. More... | |
| enum | reg_bit_salrt_th_t |
Register Configuration. More... | |
| enum | reg_bit_config_t |
Register Configuration. More... | |
| enum | reg_bit_config2_t |
Register Configuration. More... | |
| enum | reg_bit_max_min_temp_t |
Register Configuration. More... | |
| enum | reg_bit_max_min_volt_t |
Register Configuration. More... | |
| enum | reg_bit_max_min_curr_t |
Register Configuration. More... | |
| typedef void(* | interrupt_handler_function )(void *) |
| Function pointer type to interrupt handler function. | |
Public Member Functions | |
| MAX77658 (I2C *i2c, PinName IRQPin=NC) | |
| MAX77658 constructor. | |
| ~MAX77658 () | |
| MAX77658 destructor. | |
| int | read_register (uint8_t reg, uint8_t *value) |
| Read from a register. | |
| int | write_register (uint8_t reg, const uint8_t *value) |
| Write to a register. | |
| int | read_fg_register (uint8_t reg, uint8_t *value) |
| Read from a fuel-gauge register. | |
| int | write_fg_register (uint8_t reg, const uint8_t *value) |
| Write to a fuel-gauge register. | |
| int | get_ercflag (reg_bit_ercflag_t bit_field, uint8_t *flag) |
| Get bit field of ERCFLAG (0x05) register. | |
| int | get_stat_glbl (reg_bit_stat_glbl_t bit_field, uint8_t *status) |
| Get bit field of STAT_GLBL (0x06) register. | |
| int | set_interrupt_mask (reg_bit_int_mask_t bit_field, uint8_t maskBit) |
| Set bit field of INT_M_CHG (0x07), INTM_GLBL0 (0x08) or INTM_GLBL1 (0x09) register. | |
| int | get_interrupt_mask (reg_bit_int_mask_t bit_field, uint8_t *maskBit) |
| Get bit field of INT_M_CHG (0x07), INTM_GLBL0 (0x08) or INTM_GLBL1 (0x09) register. | |
| int | set_cnfg_glbl (reg_bit_cnfg_glbl_t bit_field, uint8_t config) |
| Set CNFG_GLBL (0x10) register. | |
| int | get_cnfg_glbl (reg_bit_cnfg_glbl_t bit_field, uint8_t *config) |
| Get CNFG_GLBL (0x10) register. | |
| int | set_cnfg_gpio (reg_bit_cnfg_gpio_t bit_field, uint8_t channel, uint8_t config) |
| Set either CNFG_GPIO0 (0x11), CNFG_GPIO1 (0x12) or CNFG_GPIO2 (0x13). | |
| int | get_cnfg_gpio (reg_bit_cnfg_gpio_t bit_field, uint8_t channel, uint8_t *config) |
| Get either CNFG_GPIO0 (0x11), CNFG_GPIO1 (0x12) or CNFG_GPIO2 (0x13). | |
| int | get_cid (void) |
| Get bit field of CID (0x14) register. | |
| int | set_cnfg_wdt (reg_bit_cnfg_wdt_t bit_field, uint8_t config) |
| Set CNFG_WDT (0x17) register. | |
| int | get_cnfg_wdt (reg_bit_cnfg_wdt_t bit_field, uint8_t *config) |
| Get CNFG_WDT (0x17) register. | |
| int | get_stat_chg_a (reg_bit_stat_chg_a_t bit_field, uint8_t *status) |
| Get STAT_CHG_A (0x02) register. | |
| int | get_thm_dtls (decode_thm_dtls_t *thm_dtls) |
| Get Battery Temperature Details. | |
| int | get_stat_chg_b (reg_bit_stat_chg_b_t bit_field, uint8_t *status) |
| Get STAT_CHG_B (0x03) register. | |
| int | get_chg_dtls (decode_chg_dtls_t *chg_dtls) |
| Get Charger Details. | |
| int | set_thm_hot (int tempDegC) |
| Set the VHOT JEITA Temperature Threshold. | |
| int | get_thm_hot (int *tempDegC) |
| Get the VHOT JEITA Temperature Threshold. | |
| int | set_thm_warm (int tempDegC) |
| Set the VWARM JEITA Temperature Threshold. | |
| int | get_thm_warm (int *tempDegC) |
| Get the VWARM JEITA Temperature Threshold. | |
| int | set_thm_cool (int tempDegC) |
| Set the VCOOL JEITA Temperature Threshold. | |
| int | get_thm_cool (int *tempDegC) |
| Get the VCOOL JEITA Temperature Threshold. | |
| int | set_thm_cold (int tempDegC) |
| Set the VCOLD JEITA Temperature Threshold. | |
| int | get_thm_cold (int *tempDegC) |
| Get the VCOLD JEITA Temperature Threshold. | |
| int | set_cnfg_chg_b (reg_bit_cnfg_chg_b_t bit_field, uint8_t config) |
| Set CNFG_CHG_B (0x21) register. | |
| int | get_cnfg_chg_b (reg_bit_cnfg_chg_b_t bit_field, uint8_t *config) |
| Get CNFG_CHG_B (0x21) register. | |
| int | set_vchgin_min (float voltV) |
| Set Minimum CHGIN Regulation Voltage. | |
| int | get_vchgin_min (float *voltV) |
| Get Minimum CHGIN Regulation Voltage. | |
| int | set_ichgin_lim (int currentmA) |
| Set CHGIN Input Current Limit. | |
| int | get_ichgin_lim (int *currentmA) |
| Get CHGIN Input Current Limit. | |
| int | set_chg_pq (float voltV) |
| Set Battery Prequalification Voltage Threshold (VPQ). | |
| int | get_chg_pq (float *voltV) |
| Get Battery Prequalification Voltage Threshold (VPQ). | |
| int | set_i_term (float percent) |
| Set Charger Termination Current (ITERM). | |
| int | get_i_term (float *percent) |
| Get Charger Termination Current (ITERM). | |
| int | set_t_topoff (uint8_t minute) |
| Set Top-off Timer Value. | |
| int | get_t_topoff (uint8_t *minute) |
| Get Top-off Timer Value. | |
| int | set_tj_reg (uint8_t tempDegC) |
| Set the Die Junction Temperature Regulation Point, TJ-REG. | |
| int | get_tj_reg (uint8_t *tempDegC) |
| Get the Die Junction Temperature Regulation Point, TJ-REG. | |
| int | set_vsys_reg (float voltV) |
| Set System Voltage Regulation (VSYS-REG). | |
| int | get_vsys_reg (float *voltV) |
| Get System Voltage Regulation (VSYS-REG). | |
| int | set_chg_cc (float currentmA) |
| Set the Fast-Charge Constant Current Value, IFAST-CHG. | |
| int | get_chg_cc (float *currentmA) |
| Get the Fast-Charge Constant Current Value, IFAST-CHG. | |
| int | set_t_fast_chg (decode_t_fast_chg_t t_fast_chg) |
| Set the Fast-charge Safety timer, tFC. | |
| int | get_t_fast_chg (decode_t_fast_chg_t *t_fast_chg) |
| Get the Fast-charge Safety timer, tFC. | |
| int | set_chg_cc_jeita (float currentmA) |
| Set IFAST-CHG-JEITA when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds. | |
| int | get_chg_cc_jeita (float *currentmA) |
| Get IFAST-CHG-JEITA when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds. | |
| int | set_cnfg_chg_g (reg_bit_cnfg_chg_g_t bit_field, uint8_t config) |
| Set CNFG_CHG_G (0x26) register. | |
| int | get_cnfg_chg_g (reg_bit_cnfg_chg_g_t bit_field, uint8_t *config) |
| Get CNFG_CHG_G (0x26) register. | |
| int | set_chg_cv (float voltV) |
| Set Fast-Charge Battery Regulation Voltage, VFAST-CHG. | |
| int | get_chg_cv (float *voltV) |
| Get Fast-Charge Battery Regulation Voltage, VFAST-CHG. | |
| int | set_cnfg_chg_h (reg_bit_cnfg_chg_h_t bit_field, uint8_t config) |
| Set CNFG_CHG_H (0x27) register. | |
| int | get_cnfg_chg_h (reg_bit_cnfg_chg_h_t bit_field, uint8_t *config) |
| Get CNFG_CHG_H (0x27) register. | |
| int | set_chg_cv_jeita (float voltV) |
| Set the modified VFAST-CHG-JEITA for when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds. | |
| int | get_chg_cv_jeita (float *voltV) |
| Get the modified VFAST-CHG-JEITA for when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds. | |
| int | set_imon_dischg_scale (float currentmA) |
| Set the Battery Discharge Current Full-Scale Current Value. | |
| int | get_imon_dischg_scale (float *currentmA) |
| Get the Battery Discharge Current Full-Scale Current Value. | |
| int | set_mux_sel (decode_mux_sel_t selection) |
| Set the analog channel to connect to AMUX. | |
| int | get_mux_sel (decode_mux_sel_t *selection) |
| Get the analog channel to connect to AMUX. | |
| int | set_cnfg_sbb_top (reg_bit_cnfg_sbb_top_t bit_field, uint8_t config) |
| Set CNFG_SBB_TOP (0x38) register. | |
| int | get_cnfg_sbb_top (reg_bit_cnfg_sbb_top_t bit_field, uint8_t *config) |
| Get CNFG_SBB_TOP (0x38) register. | |
| int | set_tv_sbb_a (uint8_t channel, float voltV) |
| Set SIMO Buck-Boost Channel x Target Output Voltage. | |
| int | get_tv_sbb_a (uint8_t channel, float *voltV) |
| Get SIMO Buck-Boost Channel x Target Output Voltage. | |
| int | set_op_mode (uint8_t channel, decode_op_mode_t mode) |
| Set Operation mode of SBBx. | |
| int | get_op_mode (uint8_t channel, decode_op_mode_t *mode) |
| Get Operation mode of SBBx. | |
| int | set_ip_sbb (uint8_t channel, decode_ip_sbb_t ip_sbb) |
| Set SIMO Buck-Boost Channel x Peak Current Limit. | |
| int | get_ip_sbb (uint8_t channel, decode_ip_sbb_t *ip_sbb) |
| Get SIMO Buck-Boost Channel x Peak Current Limit. | |
| int | set_ade_sbb (uint8_t channel, decode_ade_sbb_t ade_sbb) |
| Set SIMO Buck-Boost Channel x Active-Discharge Enable. | |
| int | get_ade_sbb (uint8_t channel, decode_ade_sbb_t *ade_sbb) |
| Get SIMO Buck-Boost Channel x Active-Discharge Enable. | |
| int | set_en_sbb (uint8_t channel, decode_en_sbb_t en_sbb) |
| Set Enable Control for SIMO Buck-Boost Channel x. | |
| int | get_en_sbb (uint8_t channel, decode_en_sbb_t *en_sbb) |
| Get Enable Control for SIMO Buck-Boost Channel x. | |
| int | set_tv_sbb_dvs (float voltV) |
| Set SIMO Buck-Boost Channel 0 Target Output Voltage. | |
| int | get_tv_sbb_dvs (float *voltV) |
| Get SIMO Buck-Boost Channel 0 Target Output Voltage. | |
| int | set_tv_ldo_volt_a (uint8_t channel, float voltV) |
| Set LDO Output Channel x Target Output Voltage. | |
| int | get_tv_ldo_volt_a (uint8_t channel, float *voltV) |
| Get LDO Output Channel x Target Output Voltage. | |
| int | set_tv_ldo_offset_a (uint8_t channel, decode_tv_ldo_offset_a_t offset) |
| Set LDO Output Channel x Target Output Voltage. | |
| int | get_tv_ldo_offset_a (uint8_t channel, decode_tv_ldo_offset_a_t *offset) |
| Get LDO Output Channel x Target Output Voltage. | |
| int | set_en_ldo (uint8_t channel, decode_en_ldo_t en_ldo) |
| Set Enable Control for LDO Channel x. | |
| int | get_en_ldo (uint8_t channel, decode_en_ldo_t *en_ldo) |
| Get Enable Control for LDO Channel x. | |
| int | set_ade_ldo (uint8_t channel, decode_ade_ldo_t ade_ldo) |
| Set LDO Channel x Active-Discharge Enable. | |
| int | get_ade_ldo (uint8_t channel, decode_ade_ldo_t *ade_ldo) |
| Get LDO Channel x Active-Discharge Enable. | |
| int | set_ldo_md (uint8_t channel, decode_ldo_md_t mode) |
| Set Operation mode of LDOx. | |
| int | get_ldo_md (uint8_t channel, decode_ldo_md_t *mode) |
| Get Operation mode of LDOx. | |
| int | set_fg_status (reg_bit_status_t bit_field, uint8_t status) |
| Set bit field of Fuel-gauge Status[15:0] (0x00) register. | |
| int | get_fg_status (reg_bit_status_t bit_field, uint8_t *status) |
| Get bit field of Fuel-gauge Status[15:0] (0x00) register. | |
| int | set_fg_valrt_th (reg_bit_valrt_th_t bit_field, float voltV) |
| Set bit field of fuel-gauge VAlrtTh (0x01) register. | |
| int | get_fg_valrt_th (reg_bit_valrt_th_t bit_field, float *voltV) |
| Get bit field of fuel-gauge VAlrtTh (0x01) register. | |
| int | set_fg_talrt_th (reg_bit_talrt_th_t bit_field, int tempDegC) |
| Set bit field of fuel-gauge TAlrtTh (0x02) register. | |
| int | get_fg_talrt_th (reg_bit_talrt_th_t bit_field, int *tempDegC) |
| Get bit field of fuel-gauge TAlrtTh (0x02) register. | |
| int | set_fg_salrt_th (reg_bit_salrt_th_t bit_field, uint8_t soc) |
| Set bit field of fuel-gauge SAlrtTh (0x03) register. | |
| int | get_fg_salrt_th (reg_bit_salrt_th_t bit_field, uint8_t *soc) |
| Get bit field of fuel-gauge SAlrtTh (0x03) register. | |
| int | set_fg_full_soc_thr (float soc_thr) |
| Set bit field of fuel-gauge FullSocThr (0x13) register. | |
| int | get_fg_full_soc_thr (float *soc_thr) |
| Get bit field of fuel-gauge FullSocThr (0x13) register. | |
| int | set_fg_design_cap (float capacitymAh) |
| Set bit field of fuel-gauge DesignCap (0x18) register. | |
| int | get_fg_design_cap (float *capacitymAh) |
| Get bit field of fuel-gauge DesignCap (0x18) register. | |
| int | set_fg_config (reg_bit_config_t bit_field, uint8_t config) |
| Set bit field of fuel-gauge Config (0x1D) register. | |
| int | get_fg_config (reg_bit_config_t bit_field, uint8_t *config) |
| Get bit field of fuel-gauge Config (0x1D) register. | |
| int | set_fg_ichg_term (float currentA) |
| Set bit field of fuel-gauge IChgTerm (0x1E) register. | |
| int | get_fg_ichg_term (float *currentA) |
| Get bit field of fuel-gauge IChgTerm (0x1E) register. | |
| int | get_fg_dev_name (uint16_t *value) |
| Get bit field of fuel-gauge DevName (0x21) register. | |
| int | set_fg_nempty (uint8_t nempty) |
| Set the filtering for empty learning for both the I_Avgempty and QRTable registers. | |
| int | get_fg_nempty (uint8_t *nempty) |
| Get the filtering for empty learning for both the I_Avgempty and QRTable registers. | |
| int | set_fg_nmix (float second) |
| Set the time constant for the mixing algorithm. | |
| int | get_fg_nmix (float *second) |
| Get the time constant for the mixing algorithm. | |
| int | set_fg_navgcell (float second) |
| Set the time constant for the AverageVCELL register. | |
| int | get_fg_navgcell (float *second) |
| Get the time constant for the AverageVCELL register. | |
| int | set_fg_ncurr (float second) |
| Set the time constant for the AverageCurrent register. | |
| int | get_fg_ncurr (float *second) |
| Get the time constant for the AverageCurrent register. | |
| int | set_fg_iavg_empty (float currentA) |
| Set bit field of fuel-gauge IAvgEmpty (0x36) register. | |
| int | get_fg_iavg_empty (float *currentA) |
| Get bit field of fuel-gauge IAvgEmpty (0x36) register. | |
| int | set_fg_v_empty (float voltV) |
| Set the voltage level for detecting empty. | |
| int | get_fg_v_empty (float *voltV) |
| Get the voltage level for detecting empty. | |
| int | set_fg_v_recover (float voltV) |
| Set the voltage level for clearing empty detection. | |
| int | get_fg_v_recover (float *voltV) |
| Get the voltage level for clearing empty detection. | |
| int | set_fg_config2 (reg_bit_config2_t bit_field, uint8_t config2) |
| Set Config2 (0xBB) register holding all shutdown enable, alert enable, and temperature enable control bits. | |
| int | get_fg_config2 (reg_bit_config2_t bit_field, uint8_t *config2) |
| Get Config2 (0xBB) register holding all shutdown enable, alert enable, and temperature enable control bits. | |
| int | set_fg_isys_ncurr (float second) |
| Set the time constant for the AvgISys register. | |
| int | get_fg_isys_ncurr (float *second) |
| Get the time constant for the AvgISys register. | |
| int | set_fg_temp (float tempDegC) |
| Set bit field of fuel-gauge Temp (0x08) register. | |
| int | get_fg_temp (float *tempDegC) |
| Get bit field of fuel-gauge Temp (0x08) register. | |
| int | set_fg_vcell (float voltV) |
| Set bit field of fuel-gauge Vcell (0x09) register. | |
| int | get_fg_vcell (float *voltV) |
| Get bit field of fuel-gauge Vcell (0x09) register. | |
| int | set_fg_current (float currentA) |
| Set bit field of fuel-gauge Current (0x0A) register. | |
| int | get_fg_current (float *currentA) |
| Get bit field of fuel-gauge Current (0x0A) register. | |
| int | set_fg_avg_current (float currentA) |
| Set bit field of fuel-gauge AvgCurrent (0x0B) register. | |
| int | get_fg_avg_current (float *currentA) |
| Get bit field of fuel-gauge AvgCurrent (0x0B) register. | |
| int | set_fg_avgta (float tempDegC) |
| Set bit field of fuel-gauge AvgTA (0x16) register. | |
| int | get_fg_avgta (float *tempDegC) |
| Get bit field of fuel-gauge AvgTA (0x16) register. | |
| int | set_fg_avgvcell (float voltV) |
| Set bit field of fuel-gauge AvgVCell (0x19) register. | |
| int | get_fg_avgvcell (float *voltV) |
| Get bit field of fuel-gauge AvgVCell (0x19) register. | |
| int | set_fg_max_min_temp (reg_bit_max_min_temp_t bit_field, int tempDegC) |
| Set bit field of fuel-gauge MaxMinTemp (0x1A) register. | |
| int | get_fg_max_min_temp (reg_bit_max_min_temp_t bit_field, int *tempDegC) |
| Get bit field of fuel-gauge MaxMinTemp (0x1A) register. | |
| int | set_fg_max_min_volt (reg_bit_max_min_volt_t bit_field, float voltV) |
| Set bit field of fuel-gauge MaxMinVolt (0x1B) register. | |
| int | get_fg_max_min_volt (reg_bit_max_min_volt_t bit_field, float *voltV) |
| Get bit field of fuel-gauge MaxMinVolt (0x1B) register. | |
| int | set_fg_max_min_curr (reg_bit_max_min_curr_t bit_field, float currentA) |
| Set bit field of fuel-gauge MaxMinCurr (0x1C) register. | |
| int | get_fg_max_min_curr (reg_bit_max_min_curr_t bit_field, float *currentA) |
| Get bit field of fuel-gauge MaxMinCurr (0x1C) register. | |
| int | set_fg_ain0 (float percent) |
| Set bit field of fuel-gauge AIN0 (0x27) register. | |
| int | get_fg_ain0 (float *percent) |
| Get bit field of fuel-gauge AIN0 (0x27) register. | |
| int | set_fg_timer (float second) |
| Set bit field of fuel-gauge Timer (0x3E) register. | |
| int | get_fg_timer (float *second) |
| Get bit field of fuel-gauge Timer (0x3E) register. | |
| int | set_fg_shdnctr (float second) |
| Set bit field of fuel-gauge ShdnTimer (0x3F) register. | |
| int | get_fg_shdnctr (float *second) |
| Get bit field of fuel-gauge ShdnTimer (0x3F) register. | |
| int | set_fg_shdn_thr (float second) |
| Set bit field of fuel-gauge ShdnTimer (0x3F) register. | |
| int | get_fg_shdn_thr (float *second) |
| Get bit field of fuel-gauge ShdnTimer (0x3F) register. | |
| int | set_fg_timerh (float hour) |
| Set bit field of fuel-gauge TimerH (0xBE) register. | |
| int | get_fg_timerh (float *hour) |
| Get bit field of fuel-gauge TimerH (0xBE) register. | |
| int | set_fg_rep_cap (float repCapmAh) |
| Set bit field of fuel-gauge RepCap (0x05) register. | |
| int | get_fg_rep_cap (float *repCapmAh) |
| Get bit field of fuel-gauge RepCap (0x05) register. | |
| int | set_fg_rep_soc (float percent) |
| Set bit field of fuel-gauge RepSOC (0x06) register. | |
| int | get_fg_rep_soc (float *percent) |
| Get bit field of fuel-gauge RepSOC (0x06) register. | |
| int | set_fg_av_soc (float percent) |
| Set bit field of fuel-gauge AvSOC (0x0E) register. | |
| int | get_fg_av_soc (float *percent) |
| Get bit field of fuel-gauge AvSOC (0x0E) register. | |
| int | set_fg_full_cap_reg (float repCapmAh) |
| Set bit field of fuel-gauge FullCapRep (0x10) register. | |
| int | get_fg_full_cap_reg (float *repCapmAh) |
| Get bit field of fuel-gauge FullCapRep (0x10) register. | |
| int | set_fg_tte (float minute) |
| Set bit field of fuel-gauge TTE (0x11) register. | |
| int | get_fg_tte (float *minute) |
| Get bit field of fuel-gauge TTE (0x11) register. | |
| int | set_fg_rcell (float resOhm) |
| Set bit field of fuel-gauge RCell (0x14) register. | |
| int | get_fg_rcell (float *resOhm) |
| Get bit field of fuel-gauge RCell (0x14) register. | |
| int | set_fg_cycles (uint16_t percent) |
| Set bit field of fuel-gauge Cycles (0x17) register. | |
| int | get_fg_cycles (uint16_t *percent) |
| Get bit field of fuel-gauge Cycles (0x17) register. | |
| int | set_fg_av_cap (float avCapmAh) |
| Set bit field of fuel-gauge AvCap (0x1F) register. | |
| int | get_fg_av_cap (float *avCapmAh) |
| Get bit field of fuel-gauge AvCap (0x1F) register. | |
| int | set_fg_ttf (float second) |
| Set bit field of fuel-gauge TTF (0x20) register. | |
| int | get_fg_ttf (float *second) |
| Get bit field of fuel-gauge TTF (0x20) register. | |
| int | irq_disable_all () |
| Disable all interrupts. | |
| void | set_interrupt_handler (reg_bit_int_glbl_t id, interrupt_handler_function func, void *cb) |
| Set Interrupt Handler for a Specific Interrupt ID. | |
Detailed Description
MAX77658 Ultra-Low Power PMIC Featuring Single-Inductor, 3-Output Buck-Boost, 2-LDOs, Power-Path Charger for Small Li+, Fuel Gauge M5.
The MAX77658 provides highly-integrated battery charging and power supply solutions for low-power applications where size and efficiency are critical.
Definition at line 60 of file MAX77658.h.
Member Typedef Documentation
| typedef void(* interrupt_handler_function)(void *) |
Function pointer type to interrupt handler function.
Definition at line 179 of file MAX77658.h.
Member Enumeration Documentation
| enum decode_ade_ldo_t |
Register Configuration.
- Register : CNFG_LDO0_B (0x49) and CNFG_LDO1_B (0x4B)
- Bit Fields : [3]
- Default : 0x0
- Description : LDO Channel 0 or 1 Active-Discharge Enable.
Definition at line 1568 of file MAX77658.h.
| enum decode_ade_sbb_t |
Register Configuration.
- Register : CNFG_SBB0_B (0x3A), CNFG_SBB1_B (0x3C) and CNFG_SBB2_B (0x3E)
- Bit Fields : [3]
- Default : 0x0
- Description : SIMO Buck-Boost Channel 0, 1 or 2 Active-Discharge Enable.
Definition at line 1343 of file MAX77658.h.
| enum decode_chg_dtls_t |
Register Configuration.
- Register : STAT_CHG_B (0x03)
- Bit Fields : [7:4]
- Default : 0x0
- Description : Charger Details.
Definition at line 601 of file MAX77658.h.
| enum decode_en_ldo_t |
Register Configuration.
- Register : CNFG_LDO0_B (0x49) and CNFG_LDO1_B (0x4B)
- Bit Fields : [2:0]
- Default : 0x0
- Description : Enable Control for LDO 0 or 1.
Definition at line 1528 of file MAX77658.h.
| enum decode_en_sbb_t |
Register Configuration.
- Register : CNFG_SBB0_B (0x3A), CNFG_SBB1_B (0x3C) and CNFG_SBB2_B (0x3E)
- Bit Fields : [2:0]
- Default : 0x0
- Description : Enable Control for SIMO Buck-Boost Channel 0, 1 or 2.
Definition at line 1377 of file MAX77658.h.
| enum decode_ip_sbb_t |
Register Configuration.
- Register : CNFG_SBB0_B (0x3A), CNFG_SBB1_B (0x3C) and CNFG_SBB2_B (0x3E)
- Bit Fields : [5:4]
- Default : 0x0
- Description : SIMO Buck-Boost Channel 0, 1 or 2 Peak Current Limit.
Definition at line 1307 of file MAX77658.h.
| enum decode_ldo_md_t |
Register Configuration.
- Register : CNFG_LDO0_B (0x49) and CNFG_LDO1_B (0x4B)
- Bit Fields : [4]
- Default : 0x0
- Description : Operation mode of LDO 0 or 1.
Definition at line 1602 of file MAX77658.h.
| enum decode_mux_sel_t |
Register Configuration.
- Register : CNFG_CHG_I (0x28)
- Bit Fields : [3:0]
- Default : 0x0
- Description : Analog channel to connect to AMUX.
Definition at line 1159 of file MAX77658.h.
| enum decode_op_mode_t |
Register Configuration.
- Register : CNFG_SBB0_B (0x3A), CNFG_SBB1_B (0x3C) and CNFG_SBB2_B (0x3E)
- Bit Fields : [7:6]
- Default : 0x0
- Description : Operation mode of SBB0, 1 or 2.
Definition at line 1271 of file MAX77658.h.
| enum decode_t_fast_chg_t |
Register Configuration.
- Register : CNFG_CHG_E (0x24)
- Bit Fields : [1:0]
- Default : 0x0
- Description : Fast-charge Safety timer, tFC.
Definition at line 952 of file MAX77658.h.
| enum decode_thm_dtls_t |
Register Configuration.
- Register : STAT_CHG_A (0x02)
- Bit Fields : [2:0]
- Default : 0x0
- Description : Battery Temperature Details.
Definition at line 545 of file MAX77658.h.
Register Configuration.
- Register : CNFG_LDO0_A (0x48) and CNFG_LDO1_A (0x4A)
- Bit Fields : [7]
- Default : 0x0
- Description : SIMO Buck-Boost Channel 0, 1 or 2 Peak Current Limit.
Definition at line 1487 of file MAX77658.h.
| enum reg_bit_cnfg_chg_b_t |
Register Configuration.
- Register : CNFG_CHG_B (0x21)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 726 of file MAX77658.h.
| enum reg_bit_cnfg_chg_g_t |
Register Configuration.
- Register : CNFG_CHG_G (0x26)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 1015 of file MAX77658.h.
| enum reg_bit_cnfg_chg_h_t |
Register Configuration.
- Register : CNFG_CHG_H (0x27)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 1073 of file MAX77658.h.
| enum reg_bit_cnfg_glbl_t |
Register Configuration.
- Register : CNFG_GLBL (0x10)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Event Recorder Flags.
Definition at line 390 of file MAX77658.h.
| enum reg_bit_cnfg_gpio_t |
Register Configuration.
- Register : CNFG_GPIO0 (0x11), CNFG_GPIO1 (0x12) or CNFG_GPIO2 (0x13)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Event Recorder Flags.
Definition at line 428 of file MAX77658.h.
Register Configuration.
- Register : CNFG_SBB_TOP (0x38)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 1207 of file MAX77658.h.
| enum reg_bit_cnfg_wdt_t |
Register Configuration.
- Register : CNFG_WDT (0x17)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 476 of file MAX77658.h.
| enum reg_bit_config2_t |
Register Configuration.
- Register : Fuel-gauge Config2 (0xBB)
- Bit Fields : [15:0]
- Default : 0x0000
- Description : The Config registers hold all shutdown enable, alert enable, and temperature enable control bits.
Definition at line 2079 of file MAX77658.h.
| enum reg_bit_config_t |
Register Configuration.
- Register : Fuel-gauge Config (0x1D)
- Bit Fields : [15:0]
- Default : 0x0000
- Description : The Config registers hold all shutdown enable, alert enable, and temperature enable control bits.
Definition at line 1846 of file MAX77658.h.
| enum reg_bit_ercflag_t |
Register Configuration.
- Register : ERCFLAG (0x05)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Event Recorder Flags.
Definition at line 268 of file MAX77658.h.
| enum reg_bit_int_glbl_t |
Register Configuration.
All Interrupt Flags combined from INT_GLBL0, INT_GLBL1 and INT_CHG.
- Register : INT_GLBL0 (0x00), INT_GLBL1(0x04) and INT_CHG (0x01)
- Bit Fields :
- Default : 0x0
- Description : Enumerated interrupts.
Definition at line 231 of file MAX77658.h.
| enum reg_bit_int_mask_t |
Register Configuration.
- Register : INT_M_CHG (0x07), INTM_GLBL0 (0x08) and INTM_GLBL1 (0x09)
- Bit Fields : [7:0]
- Default : 0x0
- Description : All interrupt mask bits.
Definition at line 331 of file MAX77658.h.
Register Configuration.
- Register : Fuel-gauge MaxMinCurr (0x1C)
- Bit Fields : [15:0]
- Default : 0x807F
- Description : All MaxMinCurr register bit fields.
Definition at line 2346 of file MAX77658.h.
Register Configuration.
- Register : Fuel-gauge MaxMinTemp (0x1A)
- Bit Fields : [15:0]
- Default : 0x7F80
- Description : All MaxMinTemp register bit fields.
Definition at line 2270 of file MAX77658.h.
Register Configuration.
- Register : Fuel-gauge MaxMinVolt (0x1B)
- Bit Fields : [15:0]
- Default : 0x00FF
- Description : All MaxMinVolt register bit fields.
Definition at line 2308 of file MAX77658.h.
| enum reg_bit_salrt_th_t |
Register Configuration.
- Register : Fuel-gauge SAlrtTh (0x03)
- Bit Fields : [15:0]
- Default : 0xFF00
- Description : The SAlrtTh register sets upper and lower limits that generate an alert if exceeded by RepSOC.
Definition at line 1763 of file MAX77658.h.
| enum reg_bit_stat_chg_a_t |
Register Configuration.
- Register : STAT_CHG_A (0x02)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 514 of file MAX77658.h.
| enum reg_bit_stat_chg_b_t |
Register Configuration.
- Register : STAT_CHG_B (0x03)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Watchdog Timer Configuration.
Definition at line 575 of file MAX77658.h.
| enum reg_bit_stat_glbl_t |
Register Configuration.
- Register : STAT_GLBL (0x06)
- Bit Fields : [7:0]
- Default : 0x0
- Description : Event Recorder Flags.
Definition at line 301 of file MAX77658.h.
| enum reg_bit_status_t |
Register Configuration.
- Register : Fuel-gauge Status (0x00)
- Bit Fields : [15:0]
- Default : 0x0000
- Description : All Status register bit fields.
Definition at line 1639 of file MAX77658.h.
| enum reg_bit_talrt_th_t |
Register Configuration.
- Register : Fuel-gauge TAlrtTh (0x02)
- Bit Fields : [15:0]
- Default : 0x7F80 (Disabled)
- Description : All TAlrtTh register bit fields.
Definition at line 1725 of file MAX77658.h.
| enum reg_bit_valrt_th_t |
Register Configuration.
- Register : Fuel-gauge VAlrtTh (0x01)
- Bit Fields : [15:0]
- Default : 0xFF00 (Disabled)
- Description : The VAlrtTh register sets upper and lower limits that generate an alert if exceeded by the VCell register value.
Definition at line 1687 of file MAX77658.h.
Constructor & Destructor Documentation
| MAX77658 | ( | I2C * | i2c, |
| PinName | IRQPin = NC |
||
| ) |
MAX77658 constructor.
Definition at line 41 of file MAX77658.cpp.
| ~MAX77658 | ( | ) |
MAX77658 destructor.
Definition at line 63 of file MAX77658.cpp.
Member Function Documentation
| int get_ade_ldo | ( | uint8_t | channel, |
| decode_ade_ldo_t * | ade_ldo | ||
| ) |
Get LDO Channel x Active-Discharge Enable.
- Parameters:
-
[in] channel Channel number: 0 or 1. [out] ade_ldo LDO channel x active-discharge enable bit to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2180 of file MAX77658.cpp.
| int get_ade_sbb | ( | uint8_t | channel, |
| decode_ade_sbb_t * | ade_sbb | ||
| ) |
Get SIMO Buck-Boost Channel x Active-Discharge Enable.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] ade_sbb SIMO buck-boost channel 2 active-discharge enable bit to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1882 of file MAX77658.cpp.
| int get_chg_cc | ( | float * | currentmA ) |
Get the Fast-Charge Constant Current Value, IFAST-CHG.
Bit 7:2 of CNFG_CHG_E (0x24) register.
- Parameters:
-
[out] currentmA Pointer of value to be read. 7.5mA, 15.0mA, 22.5mA, ... 292.5mA, 300.0mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1337 of file MAX77658.cpp.
| int get_chg_cc_jeita | ( | float * | currentmA ) |
Get IFAST-CHG-JEITA when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds.
Bit 7:2 of CNFG_CHG_F (0x25) register.
- Parameters:
-
[out] currentmA Pointer of value to be read. 7.5mA, 15.0mA, 22.5mA, ... 292.5mA, 300.0mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1390 of file MAX77658.cpp.
| int get_chg_cv | ( | float * | voltV ) |
Get Fast-Charge Battery Regulation Voltage, VFAST-CHG.
Bit 7:2 of CNFG_CHG_G (0x26) register.
- Parameters:
-
[out] voltV Pointer of value to be read. 3.600V, 3.625V, 3.650V, ... 4.575V, 4.600V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1475 of file MAX77658.cpp.
| int get_chg_cv_jeita | ( | float * | voltV ) |
Get the modified VFAST-CHG-JEITA for when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds.
Bit 7:2 of CNFG_CHG_H (0x27) register.
- Parameters:
-
[out] voltV Pointer of value to be read. 3.600V, 3.625V, 3.650V, ... 4.575V, 4.600V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1558 of file MAX77658.cpp.
| int get_chg_dtls | ( | decode_chg_dtls_t * | chg_dtls ) |
Get Charger Details.
- Parameters:
-
[out] chg_dtls Charger details field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 917 of file MAX77658.cpp.
| int get_chg_pq | ( | float * | voltV ) |
Get Battery Prequalification Voltage Threshold (VPQ).
Bit 7:5 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[out] voltV Pointer of value to be read. 2.3V, 2.4V, 2.5V, 2.6V, 2.7V, 2.8V, 2.9V, 3.0V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1190 of file MAX77658.cpp.
| int get_cid | ( | void | ) |
Get bit field of CID (0x14) register.
- Returns:
- CID on success, error code on failure.
Definition at line 762 of file MAX77658.cpp.
| int get_cnfg_chg_b | ( | reg_bit_cnfg_chg_b_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_CHG_B (0x21) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1088 of file MAX77658.cpp.
| int get_cnfg_chg_g | ( | reg_bit_cnfg_chg_g_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_CHG_G (0x26) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1433 of file MAX77658.cpp.
| int get_cnfg_chg_h | ( | reg_bit_cnfg_chg_h_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_CHG_H (0x27) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1516 of file MAX77658.cpp.
| int get_cnfg_glbl | ( | reg_bit_cnfg_glbl_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_GLBL (0x10) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 508 of file MAX77658.cpp.
| int get_cnfg_gpio | ( | reg_bit_cnfg_gpio_t | bit_field, |
| uint8_t | channel, | ||
| uint8_t * | config | ||
| ) |
Get either CNFG_GPIO0 (0x11), CNFG_GPIO1 (0x12) or CNFG_GPIO2 (0x13).
- Parameters:
-
[in] bit_field Register bit field to be written. [in] channel Channel number: 0, 1 or 2 [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 655 of file MAX77658.cpp.
| int get_cnfg_sbb_top | ( | reg_bit_cnfg_sbb_top_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_SBB_TOP (0x38) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Configuration value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1665 of file MAX77658.cpp.
| int get_cnfg_wdt | ( | reg_bit_cnfg_wdt_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get CNFG_WDT (0x17) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] config Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 806 of file MAX77658.cpp.
| int get_en_ldo | ( | uint8_t | channel, |
| decode_en_ldo_t * | en_ldo | ||
| ) |
Get Enable Control for LDO Channel x.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] en_ldo Enable control for LDO channel x field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2139 of file MAX77658.cpp.
| int get_en_sbb | ( | uint8_t | channel, |
| decode_en_sbb_t * | en_sbb | ||
| ) |
Get Enable Control for SIMO Buck-Boost Channel x.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] en_sbb Enable control for SIMO buck-boost channel x field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1936 of file MAX77658.cpp.
| int get_ercflag | ( | reg_bit_ercflag_t | bit_field, |
| uint8_t * | flag | ||
| ) |
Get bit field of ERCFLAG (0x05) register.
- Parameters:
-
[in] bit_field ERCFLAG register bit field to be written. [out] flag Pointer to save result of ercglag bit states. For individual bit 0x0: ERCFLAG has not occurred, 0x1: ERCFLAG has occurred.
- Returns:
- 0 on success, error code on failure.
Definition at line 175 of file MAX77658.cpp.
| int get_fg_ain0 | ( | float * | percent ) |
Get bit field of fuel-gauge AIN0 (0x27) register.
- Parameters:
-
[out] percent Pointer to save result value. AIN register with an LSB of 0.0122%. The value from 0% to 100%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3508 of file MAX77658.cpp.
| int get_fg_av_cap | ( | float * | avCapmAh ) |
Get bit field of fuel-gauge AvCap (0x1F) register.
- Parameters:
-
[out] avCapmAh Pointer to save result value. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3897 of file MAX77658.cpp.
| int get_fg_av_soc | ( | float * | percent ) |
Get bit field of fuel-gauge AvSOC (0x0E) register.
- Parameters:
-
[out] percent Pointer to save result value. LSB is 1/256%. Min value is 0.0% and Max value is 255.9961%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3739 of file MAX77658.cpp.
| int get_fg_avg_current | ( | float * | currentA ) |
Get bit field of fuel-gauge AvgCurrent (0x0B) register.
- Parameters:
-
[out] currentA Pointer to save result value. The current register has a LSB value of 31.25uA, a register scale of 1.024A
- Returns:
- 0 on success, error code on failure.
Definition at line 3236 of file MAX77658.cpp.
| int get_fg_avgta | ( | float * | tempDegC ) |
Get bit field of fuel-gauge AvgTA (0x16) register.
- Parameters:
-
[out] tempDegC Pointer to save result value. LSB is 1/256°C. Min value is -128.0°C and Max value is 127.996°C.
- Returns:
- 0 on success, error code on failure.
Definition at line 3271 of file MAX77658.cpp.
| int get_fg_avgvcell | ( | float * | voltV ) |
Get bit field of fuel-gauge AvgVCell (0x19) register.
- Parameters:
-
[out] voltV Pointer to save result value. LSB is 1.25mV/16. Min value is 0.0V and Max value is 5.11992V.
- Returns:
- 0 on success, error code on failure.
Definition at line 3307 of file MAX77658.cpp.
| int get_fg_config | ( | reg_bit_config_t | bit_field, |
| uint8_t * | config | ||
| ) |
Get bit field of fuel-gauge Config (0x1D) register.
- Parameters:
-
[in] bit_field Config bit field to be written to register. [out] config Pointer to save result value.
- Returns:
- 0 on success, error code on failure.
Definition at line 2676 of file MAX77658.cpp.
| int get_fg_config2 | ( | reg_bit_config2_t | bit_field, |
| uint8_t * | config2 | ||
| ) |
Get Config2 (0xBB) register holding all shutdown enable, alert enable, and temperature enable control bits.
- Parameters:
-
[in] bit_field Config bit field to be written to register. [out] config2 value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 3043 of file MAX77658.cpp.
| int get_fg_current | ( | float * | currentA ) |
Get bit field of fuel-gauge Current (0x0A) register.
- Parameters:
-
[out] currentA Pointer to save result value. The current register has a LSB value of 31.25uA, a register scale of 1.024A.
- Returns:
- 0 on success, error code on failure.
Definition at line 3201 of file MAX77658.cpp.
| int get_fg_cycles | ( | uint16_t * | percent ) |
Get bit field of fuel-gauge Cycles (0x17) register.
- Parameters:
-
[out] percent Pointer to save result value. The LSB indicates 1% of a battery cycle (1% charge + 1% discharge).
- Returns:
- 0 on success, error code on failure.
Definition at line 3869 of file MAX77658.cpp.
| int get_fg_design_cap | ( | float * | capacitymAh ) |
Get bit field of fuel-gauge DesignCap (0x18) register.
- Parameters:
-
[out] capacitymAh Pointer to save result value. LSB unit is 0.1mAh. Min is 0.0mAh and Max is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 2595 of file MAX77658.cpp.
| int get_fg_dev_name | ( | uint16_t * | value ) |
Get bit field of fuel-gauge DevName (0x21) register.
- Parameters:
-
[out] value Pointer to save result value.
- Returns:
- 0 on success, error code on failure.
Definition at line 2778 of file MAX77658.cpp.
| int get_fg_full_cap_reg | ( | float * | repCapmAh ) |
Get bit field of fuel-gauge FullCapRep (0x10) register.
- Parameters:
-
[out] repCapmAh Pointer to save result value. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3774 of file MAX77658.cpp.
| int get_fg_full_soc_thr | ( | float * | soc_thr ) |
Get bit field of fuel-gauge FullSocThr (0x13) register.
- Parameters:
-
[out] soc_thr Pointer to save result value. FullSOCThr comes from OTP if the OTP register is enabled. Otherwise it POR’s to a default of 95%. LSB unit is 1/256%.
- Returns:
- 0 on success, error code on failure.
Definition at line 2564 of file MAX77658.cpp.
| int get_fg_iavg_empty | ( | float * | currentA ) |
Get bit field of fuel-gauge IAvgEmpty (0x36) register.
- Parameters:
-
[out] currentA Pointer to save result value. The current register has a LSB value of 156.25μA, a register scale range of ± 5.12 A.
- Returns:
- 0 on success, error code on failure.
Definition at line 2909 of file MAX77658.cpp.
| int get_fg_ichg_term | ( | float * | currentA ) |
Get bit field of fuel-gauge IChgTerm (0x1E) register.
- Parameters:
-
[out] currentA Pointer to save result value. The current register has a LSB value of 156.25μA, a register scale range of ± 5.12 A.
- Returns:
- 0 on success, error code on failure.
Definition at line 2758 of file MAX77658.cpp.
| int get_fg_isys_ncurr | ( | float * | second ) |
Get the time constant for the AvgISys register.
Bit 3:0 of Config2(0xBB) register.
- Parameters:
-
[out] second Time constant to be read. The default POR value of 0100b gives a time constant of 5.625. The equation setting the period is: AvgISys time constant = 45s x 2^(ISysNCurr-7).
- Returns:
- 0 on success, error code on failure.
Definition at line 3100 of file MAX77658.cpp.
| int get_fg_max_min_curr | ( | reg_bit_max_min_curr_t | bit_field, |
| float * | currentA | ||
| ) |
Get bit field of fuel-gauge MaxMinCurr (0x1C) register.
- Parameters:
-
[in] bit_field MaxMinCurr register bit field to be written. [out] currentA Pointer to save result value. The maximum and minimum currents are each stored as two’s complement 8-bit values with 8mA resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3468 of file MAX77658.cpp.
| int get_fg_max_min_temp | ( | reg_bit_max_min_temp_t | bit_field, |
| int * | tempDegC | ||
| ) |
Get bit field of fuel-gauge MaxMinTemp (0x1A) register.
- Parameters:
-
[in] bit_field to be written to register. [out] tempDegC Pointer to save result value. The maximum and minimum temperatures are each stored as two’s complement 8-bit values with 1°C resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3354 of file MAX77658.cpp.
| int get_fg_max_min_volt | ( | reg_bit_max_min_volt_t | bit_field, |
| float * | voltV | ||
| ) |
Get bit field of fuel-gauge MaxMinVolt (0x1B) register.
- Parameters:
-
[in] bit_field MaxMinVolt register bit field to be written. [out] voltV Pointer to save result value. The maximum and minimum voltages are each stored as 8-bit values with a 20mV resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3411 of file MAX77658.cpp.
| int get_fg_navgcell | ( | float * | second ) |
Get the time constant for the AverageVCELL register.
Bit 6:4 of FilterCfg (0x29) register.
- Parameters:
-
[out] second The equation setting the period is: AverageVCELL time constant = 175.8ms × 2^(6+NAVGVCELL) to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2851 of file MAX77658.cpp.
| int get_fg_ncurr | ( | float * | second ) |
Get the time constant for the AverageCurrent register.
Bit 3:0 of FilterCfg (0x29) register.
- Parameters:
-
[out] second The equation setting the period is: AverageCurrent time constant = 175.8ms × 2^(2+NCURR) to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2878 of file MAX77658.cpp.
| int get_fg_nempty | ( | uint8_t * | nempty ) |
Get the filtering for empty learning for both the I_Avgempty and QRTable registers.
Bit 15:14 of FilterCfg (0x29) register.
- Parameters:
-
[out] nempty Iavg_empty is learned with(NEMPTY+3) right shifts. QRTable is learned with (NEMPTY + sizeof(Iavgempty) – sizeof (AvgCurrent)) right shifts.
- Returns:
- 0 on success, error code on failure.
Definition at line 2799 of file MAX77658.cpp.
| int get_fg_nmix | ( | float * | second ) |
Get the time constant for the mixing algorithm.
Bit 10:7 of FilterCfg (0x29) register.
- Parameters:
-
[out] second The equation setting the period is: Mixing Period = 175.8ms × 2^(5+NMIX) to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2824 of file MAX77658.cpp.
| int get_fg_rcell | ( | float * | resOhm ) |
Get bit field of fuel-gauge RCell (0x14) register.
- Parameters:
-
[out] resOhm Pointer to save result value. LSB is 1/4096Ohm. Min value is 0.0Ohm and Max value is 15.99976Ohm.
- Returns:
- 0 on success, error code on failure.
Definition at line 3841 of file MAX77658.cpp.
| int get_fg_rep_cap | ( | float * | repCapmAh ) |
Get bit field of fuel-gauge RepCap (0x05) register.
RepCap is the reported remaining capacity in mAh.
- Parameters:
-
[out] repCapmAh Pointer to save result value. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3669 of file MAX77658.cpp.
| int get_fg_rep_soc | ( | float * | percent ) |
Get bit field of fuel-gauge RepSOC (0x06) register.
- Parameters:
-
[out] percent Pointer to save result value. LSB is 1/256%. Min value is 0.0% and Max value is 255.9961%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3704 of file MAX77658.cpp.
| int get_fg_salrt_th | ( | reg_bit_salrt_th_t | bit_field, |
| uint8_t * | soc | ||
| ) |
Get bit field of fuel-gauge SAlrtTh (0x03) register.
- Parameters:
-
[in] bit_field SAlrtTh register bit field to be written. [out] soc Pointer to save result value. Interrupt threshold limits are configurable with 1% resolution over the full operating range of the RepSOC register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2524 of file MAX77658.cpp.
| int get_fg_shdn_thr | ( | float * | second ) |
Get bit field of fuel-gauge ShdnTimer (0x3F) register.
Shutdown timeout period from a minimum of 45s to a maximum of 1.6h. Bit 15:13.
- Parameters:
-
[out] second Pointer to save result value. Shutdown Timeout Period = 175.8ms × 2^(8+THR).
- Returns:
- 0 on success, error code on failure.
Definition at line 3601 of file MAX77658.cpp.
| int get_fg_shdnctr | ( | float * | second ) |
Get bit field of fuel-gauge ShdnTimer (0x3F) register.
Shutdown Counter. Bit 12:0.
- Parameters:
-
[out] second Pointer to save result value. The counter LSB is 1.4s.
- Returns:
- 0 on success, error code on failure.
Definition at line 3570 of file MAX77658.cpp.
| int get_fg_status | ( | reg_bit_status_t | bit_field, |
| uint8_t * | status | ||
| ) |
Get bit field of Fuel-gauge Status[15:0] (0x00) register.
- Parameters:
-
[in] bit_field Status bit field to be written to register. [out] status Pointer to save result value.
- Returns:
- 0 on success, error code on failure.
Definition at line 2314 of file MAX77658.cpp.
| int get_fg_talrt_th | ( | reg_bit_talrt_th_t | bit_field, |
| int * | tempDegC | ||
| ) |
Get bit field of fuel-gauge TAlrtTh (0x02) register.
- Parameters:
-
[in] bit_field TAlrtTh register bit field to be written. [out] tempDegC Pointer to save result value. Interrupt threshold limits are stored in two’s-complement format with 1°C resolution over the full operating range of the Temp register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2467 of file MAX77658.cpp.
| int get_fg_temp | ( | float * | tempDegC ) |
Get bit field of fuel-gauge Temp (0x08) register.
- Parameters:
-
[out] tempDegC Pointer to save result value. The LSB is 0.0039˚C.
- Returns:
- 0 on success, error code on failure.
Definition at line 3131 of file MAX77658.cpp.
| int get_fg_timer | ( | float * | second ) |
Get bit field of fuel-gauge Timer (0x3E) register.
- Parameters:
-
[out] second Pointer to save result value. The Timer register LSB is 175.8ms, giving a full-scale range of 0 to 3.2 hours.
- Returns:
- 0 on success, error code on failure.
Definition at line 3539 of file MAX77658.cpp.
| int get_fg_timerh | ( | float * | hour ) |
Get bit field of fuel-gauge TimerH (0xBE) register.
- Parameters:
-
[out] hour Pointer to save result value. A 3.2-hour LSB gives a full-scale range for the register of up to 23.94 years.
- Returns:
- 0 on success, error code on failure.
Definition at line 3635 of file MAX77658.cpp.
| int get_fg_tte | ( | float * | minute ) |
Get bit field of fuel-gauge TTE (0x11) register.
- Parameters:
-
[out] minute Pointer to save result value. LSB is 5.625s. Min value is 0.0s and Max value is 102.3984h.
- Returns:
- 0 on success, error code on failure.
Definition at line 3806 of file MAX77658.cpp.
| int get_fg_ttf | ( | float * | second ) |
Get bit field of fuel-gauge TTF (0x20) register.
- Parameters:
-
[out] second Pointer to save result value. LSB is 5.625s. Min value is 0.0s and Max value is 102.3984h.
- Returns:
- 0 on success, error code on failure.
Definition at line 3931 of file MAX77658.cpp.
| int get_fg_v_empty | ( | float * | voltV ) |
Get the voltage level for detecting empty.
Bit 15:7 of VEmpty(0x3A) register.
- Parameters:
-
[out] voltV Empty voltage to be read. A 10mV resolution gives a 0 to 5.11V range.
- Returns:
- 0 on success, error code on failure.
Definition at line 2945 of file MAX77658.cpp.
| int get_fg_v_recover | ( | float * | voltV ) |
Get the voltage level for clearing empty detection.
Bit 6:0 of VEmpty(0x3A) register.
- Parameters:
-
[out] voltV Recovery voltage to be read. A 40mV resolution gives a 0 to 5.08V range.
- Returns:
- 0 on success, error code on failure.
Definition at line 2979 of file MAX77658.cpp.
| int get_fg_valrt_th | ( | reg_bit_valrt_th_t | bit_field, |
| float * | voltV | ||
| ) |
Get bit field of fuel-gauge VAlrtTh (0x01) register.
- Parameters:
-
[in] bit_field VAlrtTh register bit field to be written. [out] voltV Pointer to save result value. Interrupt threshold limits are selectable with 20mV resolution over the full operating range of the VCell register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2409 of file MAX77658.cpp.
| int get_fg_vcell | ( | float * | voltV ) |
Get bit field of fuel-gauge Vcell (0x09) register.
VCell reports the voltage measured between BATT and GND.
- Parameters:
-
[out] voltV Pointer to save result value. VCell register reports the 2.5X the voltage measured at the CELLX pin.
- Returns:
- 0 on success, error code on failure.
Definition at line 3167 of file MAX77658.cpp.
| int get_i_term | ( | float * | percent ) |
Get Charger Termination Current (ITERM).
I_TERM[1:0] sets the charger termination current as a percentage of the fast charge current IFAST-CHG. Bit 4:3 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[out] percent Pointer of value to be read. 5%, 7.5%, 10%, 15%.
- Returns:
- 0 on success, error code on failure.
Definition at line 1218 of file MAX77658.cpp.
| int get_ichgin_lim | ( | int * | currentmA ) |
Get CHGIN Input Current Limit.
Bit 4:2 of CNFG_CHG_B (0x21) register.
- Parameters:
-
[out] currentmA Pointer of value to be read. 95mA, 190mA, 285mA, 380mA, 475mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1161 of file MAX77658.cpp.
| int get_imon_dischg_scale | ( | float * | currentmA ) |
Get the Battery Discharge Current Full-Scale Current Value.
Bit 7:4 of CNFG_CHG_I (0x28) register.
- Parameters:
-
[out] currentmA Pointer of value to be read. 8.2mA, 40.5mA, 72.3mA, 103.4mA, 134.1mA, 164.1mA, 193.7mA, 222.7mA, 251.2mA, 279.3mA, 300.0mA
- Returns:
- 0 on success, error code on failure.
Definition at line 1593 of file MAX77658.cpp.
| int get_interrupt_mask | ( | reg_bit_int_mask_t | bit_field, |
| uint8_t * | maskBit | ||
| ) |
Get bit field of INT_M_CHG (0x07), INTM_GLBL0 (0x08) or INTM_GLBL1 (0x09) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] maskBit 0x0: Interrupt is unmasked, 0x1: Interrupt is masked.
- Returns:
- 0 on success, error code on failure.
Definition at line 368 of file MAX77658.cpp.
| int get_ip_sbb | ( | uint8_t | channel, |
| decode_ip_sbb_t * | ip_sbb | ||
| ) |
Get SIMO Buck-Boost Channel x Peak Current Limit.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] ip_sbb SIMO buck-boost channel 2 peak current limit field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1828 of file MAX77658.cpp.
| int get_ldo_md | ( | uint8_t | channel, |
| decode_ldo_md_t * | mode | ||
| ) |
Get Operation mode of LDOx.
- Parameters:
-
[in] channel Channel number: 0 or 1. [out] mode Operation mode of LDOx bit to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 2223 of file MAX77658.cpp.
| int get_mux_sel | ( | decode_mux_sel_t * | selection ) |
Get the analog channel to connect to AMUX.
- Parameters:
-
[out] selection AMUX value field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1629 of file MAX77658.cpp.
| int get_op_mode | ( | uint8_t | channel, |
| decode_op_mode_t * | mode | ||
| ) |
Get Operation mode of SBBx.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] mode Operation mode of SBBx bit to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1774 of file MAX77658.cpp.
| int get_stat_chg_a | ( | reg_bit_stat_chg_a_t | bit_field, |
| uint8_t * | status | ||
| ) |
Get STAT_CHG_A (0x02) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] status Pointer of value to be read. For individual bit, 0x0 = It is not engaged, 0x1 = It is engaged.
- Returns:
- 0 on success, error code on failure.
Definition at line 840 of file MAX77658.cpp.
| int get_stat_chg_b | ( | reg_bit_stat_chg_b_t | bit_field, |
| uint8_t * | status | ||
| ) |
Get STAT_CHG_B (0x03) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [out] status Pointer of value to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 887 of file MAX77658.cpp.
| int get_stat_glbl | ( | reg_bit_stat_glbl_t | bit_field, |
| uint8_t * | status | ||
| ) |
Get bit field of STAT_GLBL (0x06) register.
- Parameters:
-
[in] bit_field STAT_GLBL register bit field to be written. [out] status Pointer to save result of Status Global bit state.
- Returns:
- 0 on success, error code on failure.
Definition at line 217 of file MAX77658.cpp.
| int get_t_fast_chg | ( | decode_t_fast_chg_t * | t_fast_chg ) |
Get the Fast-charge Safety timer, tFC.
Bit 1:0 of CNFG_CHG_E (0x24) register.
- Parameters:
-
[out] t_fast_chg Fast-charge safety timer field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 1362 of file MAX77658.cpp.
| int get_t_topoff | ( | uint8_t * | minute ) |
Get Top-off Timer Value.
Bit 2:0 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[out] minute Pointer of value to be read. 0 minutes, 5 minutes, 10 minutes 15 minutes, 20 minutes, 25 minutes, 30 minutes, 35 minutes.
- Returns:
- 0 on success, error code on failure.
Definition at line 1251 of file MAX77658.cpp.
| int get_thm_cold | ( | int * | tempDegC ) |
Get the VCOLD JEITA Temperature Threshold.
Bit 1:0 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[out] tempDegC Pointer of value to be read. -10ºC, -5ºC, 0ºC or 5ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 1040 of file MAX77658.cpp.
| int get_thm_cool | ( | int * | tempDegC ) |
Get the VCOOL JEITA Temperature Threshold.
Bit 3:2 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[out] tempDegC Pointer of value to be read. 0ºC, 5ºC, 10ºC or 15ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 1008 of file MAX77658.cpp.
| int get_thm_dtls | ( | decode_thm_dtls_t * | thm_dtls ) |
Get Battery Temperature Details.
Valid only when CHGIN_DTLS[1:0] = 0b11.
- Parameters:
-
[out] thm_dtls Battery temperature details field to be read.
- Returns:
- 0 on success, error code on failure.
Definition at line 874 of file MAX77658.cpp.
| int get_thm_hot | ( | int * | tempDegC ) |
Get the VHOT JEITA Temperature Threshold.
Bit 7:6 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[out] tempDegC Pointer of value to be read. 45ºC, 50ºC, 55ºC or 60ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 944 of file MAX77658.cpp.
| int get_thm_warm | ( | int * | tempDegC ) |
Get the VWARM JEITA Temperature Threshold.
Bit 5:4 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[out] tempDegC Pointer of value to be read. 35ºC, 40ºC, 45ºC or 50ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 976 of file MAX77658.cpp.
| int get_tj_reg | ( | uint8_t * | tempDegC ) |
Get the Die Junction Temperature Regulation Point, TJ-REG.
Bit 7:5 of CNFG_CHG_D (0x23) register.
- Parameters:
-
[out] tempDegC Pointer of value to be read. 60ºC, 70ºC, 80ºC, 90ºC, 100ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 1279 of file MAX77658.cpp.
| int get_tv_ldo_offset_a | ( | uint8_t | channel, |
| decode_tv_ldo_offset_a_t * | offset | ||
| ) |
Get LDO Output Channel x Target Output Voltage.
Bit 7. CNFG_LDO0_A (0x48) and CNFG_LDO1_A (0x4A)
- Parameters:
-
[in] channel Channel number: 0 or 1. [out] offset LDO Output Channel x target output voltage offset field to be read. 0b0 = No Offset 0b1 = 1.325V Offset
- Returns:
- 0 on success, error code on failure.
Definition at line 2096 of file MAX77658.cpp.
| int get_tv_ldo_volt_a | ( | uint8_t | channel, |
| float * | voltV | ||
| ) |
Get LDO Output Channel x Target Output Voltage.
Bit 6:0. CNFG_LDO0_A (0x48) and CNFG_LDO1_A (0x4A)
- Parameters:
-
[in] channel Channel number: 0 or 1. [out] voltV LDO Output Channel x target output voltage field to be read. LDOx = 500mV + 25mV x TV_LDOx[6:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 3.650, 3.675.
When TV_LDO[7] = 0, TV_LDO[6:0] sets the LDO's output voltage range from 0.5V to 3.675V. When TV_LDO[7] = 1, TV_LDO[6:0] sets the LDO's output voltage from 1.825V to 5V.
- Returns:
- 0 on success, error code on failure.
Definition at line 2047 of file MAX77658.cpp.
| int get_tv_sbb_a | ( | uint8_t | channel, |
| float * | voltV | ||
| ) |
Get SIMO Buck-Boost Channel x Target Output Voltage.
CNFG_SBB0_A (0x39), CNFG_SBB1_A (0x3B) and CNFG_SBB2_A (0x3D)
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [out] voltV SIMO buck-boost channel x target output voltage field to be read. SBBx = 500mV + 25mV x TV_SBBx[7:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 5.425V, 5.450V, 5.475V, 5.500V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1718 of file MAX77658.cpp.
| int get_tv_sbb_dvs | ( | float * | voltV ) |
Get SIMO Buck-Boost Channel 0 Target Output Voltage.
Bit 7:0 of CNFG_DVS_SBB0_A (0x3F).
- Parameters:
-
[out] voltV SIMO buck-boost channel 0 target output voltage field to be read. SBBx = 500mV + 25mV x TV_SBBx[7:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 5.425V, 5.450V, 5.475V, 5.500V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1981 of file MAX77658.cpp.
| int get_vchgin_min | ( | float * | voltV ) |
Get Minimum CHGIN Regulation Voltage.
Bit 7:5 of CNFG_CHG_B (0x21) register.
- Parameters:
-
[in] voltV Pointer of value to be read. 4.0V, 4.1V, 4.2V, 4.3V, 4.4V, 4.5V, 4.6V, 4.7V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1133 of file MAX77658.cpp.
| int get_vsys_reg | ( | float * | voltV ) |
Get System Voltage Regulation (VSYS-REG).
Bit 4:0 of CNFG_CHG_D (0x23) register.
- Parameters:
-
[out] voltV Pointer of value to be read. 3.300V, 3.350V, 3.400V, ... 4.750V, 4.800V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1308 of file MAX77658.cpp.
| int irq_disable_all | ( | ) |
Disable all interrupts.
- Returns:
- 0 on success, error code on failure
Definition at line 3949 of file MAX77658.cpp.
| int read_fg_register | ( | uint8_t | reg, |
| uint8_t * | value | ||
| ) |
Read from a fuel-gauge register.
- Parameters:
-
[in] reg Address of a fuel-gauge register to be written. [out] value Pointer to save result value.
- Returns:
- 0 on success, negative error code on failure.
Definition at line 112 of file MAX77658.cpp.
| int read_register | ( | uint8_t | reg, |
| uint8_t * | value | ||
| ) |
Read from a register.
- Parameters:
-
[in] reg Address of a register to be written. [out] value Pointer to save result value.
- Returns:
- 0 on success, negative error code on failure.
Definition at line 75 of file MAX77658.cpp.
| int set_ade_ldo | ( | uint8_t | channel, |
| decode_ade_ldo_t | ade_ldo | ||
| ) |
Set LDO Channel x Active-Discharge Enable.
- Parameters:
-
[in] channel Channel number: 0 or 1. [in] ade_ldo LDO channel x active-discharge enable bit to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2162 of file MAX77658.cpp.
| int set_ade_sbb | ( | uint8_t | channel, |
| decode_ade_sbb_t | ade_sbb | ||
| ) |
Set SIMO Buck-Boost Channel x Active-Discharge Enable.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] ade_sbb SIMO buck-boost channel 2 active-discharge enable bit to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1860 of file MAX77658.cpp.
| int set_chg_cc | ( | float | currentmA ) |
Set the Fast-Charge Constant Current Value, IFAST-CHG.
Bit 7:2 of CNFG_CHG_E (0x24) register.
- Parameters:
-
[in] currentmA 7.5mA, 15.0mA, 22.5mA, ... 292.5mA, 300.0mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1322 of file MAX77658.cpp.
| int set_chg_cc_jeita | ( | float | currentmA ) |
Set IFAST-CHG-JEITA when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds.
Bit 7:2 of CNFG_CHG_F (0x25) register.
- Parameters:
-
[in] currentmA 7.5mA, 15.0mA, 22.5mA, ... 292.5mA, 300.0mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1375 of file MAX77658.cpp.
| int set_chg_cv | ( | float | voltV ) |
Set Fast-Charge Battery Regulation Voltage, VFAST-CHG.
Bit 7:2 of CNFG_CHG_G (0x26) register.
- Parameters:
-
[in] voltV 3.600V, 3.625V, 3.650V, ... 4.575V, 4.600V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1460 of file MAX77658.cpp.
| int set_chg_cv_jeita | ( | float | voltV ) |
Set the modified VFAST-CHG-JEITA for when the battery is either cool or warm as defined by the VCOOL and VWARM temperature thresholds.
Bit 7:2 of CNFG_CHG_H (0x27) register.
- Parameters:
-
[in] voltV Pointer of value to be read. 3.600V, 3.625V, 3.650V, ... 4.575V, 4.600V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1543 of file MAX77658.cpp.
| int set_chg_pq | ( | float | voltV ) |
Set Battery Prequalification Voltage Threshold (VPQ).
Bit 7:5 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[in] voltV 2.3V, 2.4V, 2.5V, 2.6V, 2.7V, 2.8V, 2.9V, 3.0V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1175 of file MAX77658.cpp.
| int set_cnfg_chg_b | ( | reg_bit_cnfg_chg_b_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_CHG_B (0x21) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Register bit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1058 of file MAX77658.cpp.
| int set_cnfg_chg_g | ( | reg_bit_cnfg_chg_g_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_CHG_G (0x26) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Register bit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1406 of file MAX77658.cpp.
| int set_cnfg_chg_h | ( | reg_bit_cnfg_chg_h_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_CHG_H (0x27) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Register bit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1489 of file MAX77658.cpp.
| int set_cnfg_glbl | ( | reg_bit_cnfg_glbl_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_GLBL (0x10) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Register bit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 472 of file MAX77658.cpp.
| int set_cnfg_gpio | ( | reg_bit_cnfg_gpio_t | bit_field, |
| uint8_t | channel, | ||
| uint8_t | config | ||
| ) |
Set either CNFG_GPIO0 (0x11), CNFG_GPIO1 (0x12) or CNFG_GPIO2 (0x13).
- Parameters:
-
[in] bit_field Register bit field to be written. [in] channel Channel number: 0, 1 or 2 [in] config Register bit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 544 of file MAX77658.cpp.
| int set_cnfg_sbb_top | ( | reg_bit_cnfg_sbb_top_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_SBB_TOP (0x38) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Configuration value to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1641 of file MAX77658.cpp.
| int set_cnfg_wdt | ( | reg_bit_cnfg_wdt_t | bit_field, |
| uint8_t | config | ||
| ) |
Set CNFG_WDT (0x17) register.
- Parameters:
-
[in] bit_field Register bit field to be written. [in] config Field value to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 772 of file MAX77658.cpp.
| int set_en_ldo | ( | uint8_t | channel, |
| decode_en_ldo_t | en_ldo | ||
| ) |
Set Enable Control for LDO Channel x.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] en_ldo Enable control for LDO channel x field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2121 of file MAX77658.cpp.
| int set_en_sbb | ( | uint8_t | channel, |
| decode_en_sbb_t | en_sbb | ||
| ) |
Set Enable Control for SIMO Buck-Boost Channel x.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] en_sbb Enable control for SIMO buck-boost channel x field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1914 of file MAX77658.cpp.
| int set_fg_ain0 | ( | float | percent ) |
Set bit field of fuel-gauge AIN0 (0x27) register.
- Parameters:
-
[in] percent to be written to register. AIN register with an LSB of 0.0122%. The value from 0% to 100%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3496 of file MAX77658.cpp.
| int set_fg_av_cap | ( | float | avCapmAh ) |
Set bit field of fuel-gauge AvCap (0x1F) register.
- Parameters:
-
[in] avCapmAh to be written to register. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3882 of file MAX77658.cpp.
| int set_fg_av_soc | ( | float | percent ) |
Set bit field of fuel-gauge AvSOC (0x0E) register.
- Parameters:
-
[in] percent to be written to register. LSB is 1/256%. Min value is 0.0% and Max value is 255.9961%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3723 of file MAX77658.cpp.
| int set_fg_avg_current | ( | float | currentA ) |
Set bit field of fuel-gauge AvgCurrent (0x0B) register.
- Parameters:
-
[in] currentA to be written to register. The current register has a LSB value of 31.25uA, a register scale of 1.024A
- Returns:
- 0 on success, error code on failure.
Definition at line 3220 of file MAX77658.cpp.
| int set_fg_avgta | ( | float | tempDegC ) |
Set bit field of fuel-gauge AvgTA (0x16) register.
- Parameters:
-
[in] tempDegC to be written to register. LSB is 1/256°C. Min value is -128.0°C and Max value is 127.996°C.
- Returns:
- 0 on success, error code on failure.
Definition at line 3255 of file MAX77658.cpp.
| int set_fg_avgvcell | ( | float | voltV ) |
Set bit field of fuel-gauge AvgVCell (0x19) register.
- Parameters:
-
[in] voltV to be written to register. LSB is 1.25mV/16. Min value is 0.0V and Max value is 5.11992V.
- Returns:
- 0 on success, error code on failure.
Definition at line 3291 of file MAX77658.cpp.
| int set_fg_config | ( | reg_bit_config_t | bit_field, |
| uint8_t | config | ||
| ) |
Set bit field of fuel-gauge Config (0x1D) register.
- Parameters:
-
[in] bit_field Config bit field to be written to register. [in] config to be written to register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2610 of file MAX77658.cpp.
| int set_fg_config2 | ( | reg_bit_config2_t | bit_field, |
| uint8_t | config2 | ||
| ) |
Set Config2 (0xBB) register holding all shutdown enable, alert enable, and temperature enable control bits.
- Parameters:
-
[in] bit_field Config bit field to be written to register. [in] config2 value to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2998 of file MAX77658.cpp.
| int set_fg_current | ( | float | currentA ) |
Set bit field of fuel-gauge Current (0x0A) register.
- Parameters:
-
[in] currentA to be written to register. The current register has a LSB value of 31.25uA, a register scale of 1.024A
- Returns:
- 0 on success, error code on failure.
Definition at line 3185 of file MAX77658.cpp.
| int set_fg_cycles | ( | uint16_t | percent ) |
Set bit field of fuel-gauge Cycles (0x17) register.
- Parameters:
-
[in] percent to be written to register. The LSB indicates 1% of a battery cycle (1% charge + 1% discharge).
- Returns:
- 0 on success, error code on failure.
Definition at line 3860 of file MAX77658.cpp.
| int set_fg_design_cap | ( | float | capacitymAh ) |
Set bit field of fuel-gauge DesignCap (0x18) register.
- Parameters:
-
[in] capacitymAh to be written to register. LSB unit is 0.1mAh. Min is 0.0mAh and Max is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 2579 of file MAX77658.cpp.
| int set_fg_full_cap_reg | ( | float | repCapmAh ) |
Set bit field of fuel-gauge FullCapRep (0x10) register.
- Parameters:
-
[in] repCapmAh to be written to register. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3758 of file MAX77658.cpp.
| int set_fg_full_soc_thr | ( | float | soc_thr ) |
Set bit field of fuel-gauge FullSocThr (0x13) register.
- Parameters:
-
[in] soc_thr to be written to register. FullSOCThr comes from OTP if the OTP register is enabled. Otherwise it POR’s to a default of 95%. LSB unit is 1/256%.
- Returns:
- 0 on success, error code on failure.
Definition at line 2552 of file MAX77658.cpp.
| int set_fg_iavg_empty | ( | float | currentA ) |
Set bit field of fuel-gauge IAvgEmpty (0x36) register.
- Parameters:
-
[in] currentA to be written to register. The current register has a LSB value of 156.25μA, a register scale range of ± 5.12 A.
- Returns:
- 0 on success, error code on failure.
Definition at line 2893 of file MAX77658.cpp.
| int set_fg_ichg_term | ( | float | currentA ) |
Set bit field of fuel-gauge IChgTerm (0x1E) register.
- Parameters:
-
[in] currentA to be written to register. The current register has a LSB value of 156.25μA, a register scale range of ± 5.12 A.
- Returns:
- 0 on success, error code on failure.
Definition at line 2742 of file MAX77658.cpp.
| int set_fg_isys_ncurr | ( | float | second ) |
Set the time constant for the AvgISys register.
Bit 3:0 of Config2(0xBB) register.
- Parameters:
-
[in] second Time constant to be written. The default POR value of 0100b gives a time constant of 5.625. The equation setting the period is: AvgISys time constant = 45s x 2^(ISysNCurr-7).
- Returns:
- 0 on success, error code on failure.
Definition at line 3088 of file MAX77658.cpp.
| int set_fg_max_min_curr | ( | reg_bit_max_min_curr_t | bit_field, |
| float | currentA | ||
| ) |
Set bit field of fuel-gauge MaxMinCurr (0x1C) register.
- Parameters:
-
[in] bit_field MaxMinCurr register bit field to be written. [in] currentA to be written to register. The maximum and minimum currents are each stored as two’s complement 8-bit values with 8mA resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3439 of file MAX77658.cpp.
| int set_fg_max_min_temp | ( | reg_bit_max_min_temp_t | bit_field, |
| int | tempDegC | ||
| ) |
Set bit field of fuel-gauge MaxMinTemp (0x1A) register.
- Parameters:
-
[in] bit_field to be written to register. [in] tempDegC to be written to register. The maximum and minimum temperatures are each stored as two’s complement 8-bit values with 1°C resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3326 of file MAX77658.cpp.
| int set_fg_max_min_volt | ( | reg_bit_max_min_volt_t | bit_field, |
| float | voltV | ||
| ) |
Set bit field of fuel-gauge MaxMinVolt (0x1B) register.
- Parameters:
-
[in] bit_field MaxMinVolt register bit field to be written. [in] voltV to be written to register. The maximum and minimum voltages are each stored as 8-bit values with a 20mV resolution.
- Returns:
- 0 on success, error code on failure.
Definition at line 3382 of file MAX77658.cpp.
| int set_fg_navgcell | ( | float | second ) |
Set the time constant for the AverageVCELL register.
Bit 6:4 of FilterCfg (0x29) register.
- Parameters:
-
[in] second The equation setting the period is: AverageVCELL time constant = 175.8ms × 2^(6+NAVGVCELL) to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2839 of file MAX77658.cpp.
| int set_fg_ncurr | ( | float | second ) |
Set the time constant for the AverageCurrent register.
Bit 3:0 of FilterCfg (0x29) register.
- Parameters:
-
[in] second The equation setting the period is: AverageCurrent time constant = 175.8ms × 2^(2+NCURR) to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2866 of file MAX77658.cpp.
| int set_fg_nempty | ( | uint8_t | nempty ) |
Set the filtering for empty learning for both the I_Avgempty and QRTable registers.
Bit 15:14 of FilterCfg (0x29) register.
- Parameters:
-
[in] nempty Iavg_empty is learned with(NEMPTY+3) right shifts. QRTable is learned with (NEMPTY + sizeof(Iavgempty) – sizeof (AvgCurrent)) right shifts.
- Returns:
- 0 on success, error code on failure.
Definition at line 2791 of file MAX77658.cpp.
| int set_fg_nmix | ( | float | second ) |
Set the time constant for the mixing algorithm.
Bit 10:7 of FilterCfg (0x29) register.
- Parameters:
-
[in] second The equation setting the period is: Mixing Period = 175.8ms × 2^(5+NMIX) to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2812 of file MAX77658.cpp.
| int set_fg_rcell | ( | float | resOhm ) |
Set bit field of fuel-gauge RCell (0x14) register.
- Parameters:
-
[in] resOhm to be written to register. LSB is 1/4096Ohm. Min value is 0.0Ohm and Max value is 15.99976Ohm.
- Returns:
- 0 on success, error code on failure.
Definition at line 3825 of file MAX77658.cpp.
| int set_fg_rep_cap | ( | float | repCapmAh ) |
Set bit field of fuel-gauge RepCap (0x05) register.
RepCap is the reported remaining capacity in mAh.
- Parameters:
-
[in] repCapmAh to be written to register. LSB is 0.1mAh. Min value is 0.0mAh and Max value is 6553.5mAh.
- Returns:
- 0 on success, error code on failure.
Definition at line 3653 of file MAX77658.cpp.
| int set_fg_rep_soc | ( | float | percent ) |
Set bit field of fuel-gauge RepSOC (0x06) register.
- Parameters:
-
[in] percent to be written to register. LSB is 1/256%. Min value is 0.0% and Max value is 255.9961%.
- Returns:
- 0 on success, error code on failure.
Definition at line 3688 of file MAX77658.cpp.
| int set_fg_salrt_th | ( | reg_bit_salrt_th_t | bit_field, |
| uint8_t | soc | ||
| ) |
Set bit field of fuel-gauge SAlrtTh (0x03) register.
- Parameters:
-
[in] bit_field SAlrtTh register bit field to be written. [in] soc to be written to register. Interrupt threshold limits are configurable with 1% resolution over the full operating range of the RepSOC register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2496 of file MAX77658.cpp.
| int set_fg_shdn_thr | ( | float | second ) |
Set bit field of fuel-gauge ShdnTimer (0x3F) register.
Shutdown timeout period from a minimum of 45s to a maximum of 1.6h. Bit 15:13.
- Parameters:
-
[in] second to be written to register. Shutdown Timeout Period = 175.8ms × 2^(8+THR).
- Returns:
- 0 on success, error code on failure.
Definition at line 3585 of file MAX77658.cpp.
| int set_fg_shdnctr | ( | float | second ) |
Set bit field of fuel-gauge ShdnTimer (0x3F) register.
Shutdown Counter. Bit 12:0.
- Parameters:
-
[in] second to be written to register. The counter LSB is 1.4s.
- Returns:
- 0 on success, error code on failure.
Definition at line 3558 of file MAX77658.cpp.
| int set_fg_status | ( | reg_bit_status_t | bit_field, |
| uint8_t | status | ||
| ) |
Set bit field of Fuel-gauge Status[15:0] (0x00) register.
- Parameters:
-
[in] bit_field Status bit field to be written to register. [in] status to be written to register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2248 of file MAX77658.cpp.
| int set_fg_talrt_th | ( | reg_bit_talrt_th_t | bit_field, |
| int | tempDegC | ||
| ) |
Set bit field of fuel-gauge TAlrtTh (0x02) register.
- Parameters:
-
[in] bit_field TAlrtTh register bit field to be written. [in] tempDegC to be written to register. Interrupt threshold limits are stored in two’s-complement format with 1°C resolution over the full operating range of the Temp register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2437 of file MAX77658.cpp.
| int set_fg_temp | ( | float | tempDegC ) |
Set bit field of fuel-gauge Temp (0x08) register.
- Parameters:
-
[in] tempDegC to be written to register. The LSB is 0.0039˚C.
- Returns:
- 0 on success, error code on failure.
Definition at line 3115 of file MAX77658.cpp.
| int set_fg_timer | ( | float | second ) |
Set bit field of fuel-gauge Timer (0x3E) register.
- Parameters:
-
[in] second to be written to register. The Timer register LSB is 175.8ms, giving a full-scale range of 0 to 3.2 hours.
- Returns:
- 0 on success, error code on failure.
Definition at line 3523 of file MAX77658.cpp.
| int set_fg_timerh | ( | float | hour ) |
Set bit field of fuel-gauge TimerH (0xBE) register.
- Parameters:
-
[in] hour to be written to register. A 3.2-hour LSB gives a full-scale range for the register of up to 23.94 years.
- Returns:
- 0 on success, error code on failure.
Definition at line 3620 of file MAX77658.cpp.
| int set_fg_tte | ( | float | minute ) |
Set bit field of fuel-gauge TTE (0x11) register.
- Parameters:
-
[in] minute to be written to register. LSB is 5.625s. Min value is 0.0s and Max value is 102.3984h.
- Returns:
- 0 on success, error code on failure.
Definition at line 3793 of file MAX77658.cpp.
| int set_fg_ttf | ( | float | second ) |
Set bit field of fuel-gauge TTF (0x20) register.
- Parameters:
-
[in] second to be written to register. LSB is 5.625s. Min value is 0.0s and Max value is 102.3984h.
- Returns:
- 0 on success, error code on failure.
Definition at line 3915 of file MAX77658.cpp.
| int set_fg_v_empty | ( | float | voltV ) |
Set the voltage level for detecting empty.
Bit 15:7 of VEmpty(0x3A) register.
- Parameters:
-
[in] voltV Empty voltage to be written. A 10mV resolution gives a 0 to 5.11V range.
- Returns:
- 0 on success, error code on failure.
Definition at line 2929 of file MAX77658.cpp.
| int set_fg_v_recover | ( | float | voltV ) |
Set the voltage level for clearing empty detection.
Bit 6:0 of VEmpty(0x3A) register.
- Parameters:
-
[in] voltV Recovery voltage to be written. A 40mV resolution gives a 0 to 5.08V range.
- Returns:
- 0 on success, error code on failure.
Definition at line 2963 of file MAX77658.cpp.
| int set_fg_valrt_th | ( | reg_bit_valrt_th_t | bit_field, |
| float | voltV | ||
| ) |
Set bit field of fuel-gauge VAlrtTh (0x01) register.
- Parameters:
-
[in] bit_field VAlrtTh register bit field to be written. [in] voltV to be written to register. Interrupt threshold limits are selectable with 20mV resolution over the full operating range of the VCell register.
- Returns:
- 0 on success, error code on failure.
Definition at line 2380 of file MAX77658.cpp.
| int set_fg_vcell | ( | float | voltV ) |
Set bit field of fuel-gauge Vcell (0x09) register.
VCell reports the voltage measured between BATT and GND.
- Parameters:
-
[in] voltV to be written to register. VCell register reports the 2.5X the voltage measured at the CELLX pin.
- Returns:
- 0 on success, error code on failure.
Definition at line 3151 of file MAX77658.cpp.
| int set_i_term | ( | float | percent ) |
Set Charger Termination Current (ITERM).
I_TERM[1:0] sets the charger termination current as a percentage of the fast charge current IFAST-CHG. Bit 4:3 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[in] percent 5%, 7.5%, 10%, 15%.
- Returns:
- 0 on success, error code on failure.
Definition at line 1204 of file MAX77658.cpp.
| int set_ichgin_lim | ( | int | currentmA ) |
Set CHGIN Input Current Limit.
Bit 4:2 of CNFG_CHG_B (0x21) register.
- Parameters:
-
[in] currentmA 95mA, 190mA, 285mA, 380mA, 475mA.
- Returns:
- 0 on success, error code on failure.
Definition at line 1147 of file MAX77658.cpp.
| int set_imon_dischg_scale | ( | float | currentmA ) |
Set the Battery Discharge Current Full-Scale Current Value.
Bit 7:4 of CNFG_CHG_I (0x28) register.
- Parameters:
-
[in] currentmA 8.2mA, 40.5mA, 72.3mA, 103.4mA, 134.1mA, 164.1mA, 193.7mA, 222.7mA, 251.2mA, 279.3mA, 300.0mA
- Returns:
- 0 on success, error code on failure.
Definition at line 1572 of file MAX77658.cpp.
| void set_interrupt_handler | ( | reg_bit_int_glbl_t | id, |
| interrupt_handler_function | func, | ||
| void * | cb | ||
| ) |
Set Interrupt Handler for a Specific Interrupt ID.
- Parameters:
-
[in] id reg_bit_reg_bit_int_glbl_t id, one of INTR_ID_*. [in] func Interrupt handler function. [in] cb Interrupt handler data.
Definition at line 3982 of file MAX77658.cpp.
| int set_interrupt_mask | ( | reg_bit_int_mask_t | bit_field, |
| uint8_t | maskBit | ||
| ) |
Set bit field of INT_M_CHG (0x07), INTM_GLBL0 (0x08) or INTM_GLBL1 (0x09) register.
- Parameters:
-
[in] bit_field Register bit field to be set. [out] maskBit 0x0: Interrupt is unmasked, 0x1: Interrupt is masked.
- Returns:
- 0 on success, error code on failure.
Definition at line 259 of file MAX77658.cpp.
| int set_ip_sbb | ( | uint8_t | channel, |
| decode_ip_sbb_t | ip_sbb | ||
| ) |
Set SIMO Buck-Boost Channel x Peak Current Limit.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] ip_sbb SIMO buck-boost channel 2 peak current limit field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1806 of file MAX77658.cpp.
| int set_ldo_md | ( | uint8_t | channel, |
| decode_ldo_md_t | mode | ||
| ) |
Set Operation mode of LDOx.
- Parameters:
-
[in] channel Channel number: 0 or 1. [in] mode Operation mode of LDOx bit to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 2205 of file MAX77658.cpp.
| int set_mux_sel | ( | decode_mux_sel_t | selection ) |
Set the analog channel to connect to AMUX.
- Parameters:
-
[in] selection AMUX value field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1621 of file MAX77658.cpp.
| int set_op_mode | ( | uint8_t | channel, |
| decode_op_mode_t | mode | ||
| ) |
Set Operation mode of SBBx.
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] mode Operation mode of SBBx bit to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1752 of file MAX77658.cpp.
| int set_t_fast_chg | ( | decode_t_fast_chg_t | t_fast_chg ) |
Set the Fast-charge Safety timer, tFC.
Bit 1:0 of CNFG_CHG_E (0x24) register.
- Parameters:
-
[in] t_fast_chg Fast-charge safety timer field to be written.
- Returns:
- 0 on success, error code on failure.
Definition at line 1354 of file MAX77658.cpp.
| int set_t_topoff | ( | uint8_t | minute ) |
Set Top-off Timer Value.
Bit 2:0 of CNFG_CHG_C (0x22) register.
- Parameters:
-
[in] minute 0 minutes, 5 minutes, 10 minutes 15 minutes, 20 minutes, 25 minutes, 30 minutes, 35 minutes.
- Returns:
- 0 on success, error code on failure.
Definition at line 1238 of file MAX77658.cpp.
| int set_thm_cold | ( | int | tempDegC ) |
Set the VCOLD JEITA Temperature Threshold.
Bit 1:0 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[in] tempDegC Register bit field to be read. -10ºC, -5ºC, 0ºC or 5ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 1026 of file MAX77658.cpp.
| int set_thm_cool | ( | int | tempDegC ) |
Set the VCOOL JEITA Temperature Threshold.
Bit 3:2 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[in] tempDegC Register bit field to be read. 0ºC, 5ºC, 10ºC or 15ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 994 of file MAX77658.cpp.
| int set_thm_hot | ( | int | tempDegC ) |
Set the VHOT JEITA Temperature Threshold.
Bit 7:6 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[in] tempDegC Register bit field to be read. 45ºC, 50ºC, 55ºC or 60ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 930 of file MAX77658.cpp.
| int set_thm_warm | ( | int | tempDegC ) |
Set the VWARM JEITA Temperature Threshold.
Bit 5:4 of CNFG_CHG_A (0x20) register.
- Parameters:
-
[in] tempDegC Register bit field to be read. 35ºC, 40ºC, 45ºC or 50ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 962 of file MAX77658.cpp.
| int set_tj_reg | ( | uint8_t | tempDegC ) |
Set the Die Junction Temperature Regulation Point, TJ-REG.
Bit 7:5 of CNFG_CHG_D (0x23) register.
- Parameters:
-
[in] tempDegC 60ºC, 70ºC, 80ºC, 90ºC, 100ºC.
- Returns:
- 0 on success, error code on failure.
Definition at line 1265 of file MAX77658.cpp.
| int set_tv_ldo_offset_a | ( | uint8_t | channel, |
| decode_tv_ldo_offset_a_t | offset | ||
| ) |
Set LDO Output Channel x Target Output Voltage.
Bit 7. CNFG_LDO0_A (0x48) and CNFG_LDO1_A (0x4A)
- Parameters:
-
[in] channel Channel number: 0 or 1. [in] offset LDO Output Channel x target output voltage offset field to be read. 0b0 = No Offset 0b1 = 1.325V Offset
- Returns:
- 0 on success, error code on failure.
Definition at line 2078 of file MAX77658.cpp.
| int set_tv_ldo_volt_a | ( | uint8_t | channel, |
| float | voltV | ||
| ) |
Set LDO Output Channel x Target Output Voltage.
Bit 6:0. CNFG_LDO0_A (0x48) and CNFG_LDO1_A (0x4A)
- Parameters:
-
[in] channel Channel number: 0 or 1. [in] voltV LDO Output Channel x target output voltage field to be read. LDOx = 500mV + 25mV x TV_LDOx[6:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 3.650, 3.675.
When TV_LDO[7] = 0, TV_LDO[6:0] sets the LDO's output voltage range from 0.5V to 3.675V. When TV_LDO[7] = 1, TV_LDO[6:0] sets the LDO's output voltage from 1.825V to 5V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1998 of file MAX77658.cpp.
| int set_tv_sbb_a | ( | uint8_t | channel, |
| float | voltV | ||
| ) |
Set SIMO Buck-Boost Channel x Target Output Voltage.
CNFG_SBB0_A (0x39), CNFG_SBB1_A (0x3B) and CNFG_SBB2_A (0x3D)
- Parameters:
-
[in] channel Channel number: 0, 1 or 2. [in] voltV SIMO buck-boost channel x target output voltage field to be written. SBBx = 500mV + 25mV x TV_SBBx[7:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 5.425V, 5.450V, 5.475V, 5.500V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1689 of file MAX77658.cpp.
| int set_tv_sbb_dvs | ( | float | voltV ) |
Set SIMO Buck-Boost Channel 0 Target Output Voltage.
Bit 7:0 of CNFG_DVS_SBB0_A (0x3F).
- Parameters:
-
[in] voltV SIMO buck-boost channel 0 target output voltage field to be written. SBBx = 500mV + 25mV x TV_SBBx[7:0] 0.500V, 0.525V, 0.550V, 0.575V, 0.600V, 0.625V, 0.650V, 0.675V, 0.700V, ... 5.425V, 5.450V, 5.475V, 5.500V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1966 of file MAX77658.cpp.
| int set_vchgin_min | ( | float | voltV ) |
Set Minimum CHGIN Regulation Voltage.
Bit 7:5 of CNFG_CHG_B (0x21) register.
- Parameters:
-
[in] voltV 4.0V, 4.1V, 4.2V, 4.3V, 4.4V, 4.5V, 4.6V, 4.7V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1118 of file MAX77658.cpp.
| int set_vsys_reg | ( | float | voltV ) |
Set System Voltage Regulation (VSYS-REG).
Bit 4:0 of CNFG_CHG_D (0x23) register.
- Parameters:
-
[in] voltV 3.300V, 3.350V, 3.400V, ... 4.750V, 4.800V.
- Returns:
- 0 on success, error code on failure.
Definition at line 1293 of file MAX77658.cpp.
| int write_fg_register | ( | uint8_t | reg, |
| const uint8_t * | value | ||
| ) |
Write to a fuel-gauge register.
- Parameters:
-
[in] reg Address of a fuel-gauge register to be written. [out] value Pointer of value to be written to fuel-gauge register.
- Returns:
- 0 on success, negative error code on failure.
Definition at line 130 of file MAX77658.cpp.
| int write_register | ( | uint8_t | reg, |
| const uint8_t * | value | ||
| ) |
Write to a register.
- Parameters:
-
[in] reg Address of a register to be written. [out] value Pointer of value to be written to register.
- Returns:
- 0 on success, negative error code on failure.
Definition at line 93 of file MAX77658.cpp.
Generated on Fri Aug 26 2022 12:03:39 by
1.7.2