Library for interfacing Texas Instruments BQ25890/2 5-A switch-mode battery charge management and system power path management IC with I2C interface
The BQ25890 and BQ25892 are highly-integrated 5-A switch-mode battery charge management and system power path management device for single cell Li-Ion and Li-polymer battery. -) I2C interface with communication speed up to 400 kHz -) Single Input to Support USB Input and Adjustable High Voltage Adapters -) Integrated ADC for System Monitor (Voltage, Temperature, Charge Current) -) BATFET Control to Support Ship Mode, Wake Up, and Full System Reset
typical I2C clock speed to be used
Available BQ25890/2 I2C addresses
Initializes i2c communication with the BQ25892
First copies the I2C port and address to the transferred empty device handle.Afterward it is checked whether a chip supported by the library has been found.
Reads charging State and Power Good State (indicates a good input source) from the BQ25892
Activates ship mode
To extend battery life and minimize power when system is powered off, shipped, or storaged, the BQ25892 can disconnect the rechargeable batterie (turn off the BATFET) from the system voltage to minimize the battery leakage current. This mode is called ship mode.
Resets all BQ25892 registers which can be reset by REG_RST
absolute maximum I2C clock speed
Available register (Address | R/W | Default | Description)
REG00 configuration bits (High impedance mode and Input current limit)
REG01 configuration bits (Boost Mode Temperature Monitor Thresholds and Input Voltage Limit Offset)
Boost Mode Hot Temperature Monitor Threshold (REG01, bit 6-7)
REG02 configuration bits
REG03 configuration bits
REG04 configuration bits (Current pulse control Enable and Fast Charge Current Limit)
REG05 configuration bits (Precharge Current Limit and Termination Current Limit)
REG06 configuration bits (Charge Voltage Limit, Battery Precharge to Fast Charge Threshold and Battery Recharge Threshold Offset)
REG07 configuration bits
I2C Watchdog Timer Setting (REG07, bit 4-5)
Fast Charge Timer Setting (REG07, bit 1-2)
REG08 configuration bits (IR Compensation Resistor Setting, IR Compensation Voltage Clamp and Thermal Regulation Threshold)
Thermal Regulation Threshold (REG08, bit 0-1)
REG09 configuration bits
REG0A configuration bits (Boost Mode Voltage Regulation and Boost Mode Current Limit)
Boost Mode Current Limit (REG0A, bit 0-2)
REG0B register bits (Status information)
VBUS Status register (REG0B, bit 5-7)
Charging Status (REG0B, bit 3-4)
REG0C register bits (Fault status information)
Charge Fault Status (REG0C, bit 4-5)
NTC Fault Status (REG0C, bit 0-2)
REG0D configuration bits (VINDPM Threshold Setting Method and Absolute VINDPM Threshold)
REG0E register bits (Thermal Regulation Status and ADC conversion of Battery Voltage)
REG0F register bits (ADDC conversion of System Voltage)
REG10 register bits (ADC conversion of TS Voltage (TS) as percentage of REGN)
REG11 register bits (VBUS Good Status and ADC conversion of VBUS voltage)
REG12 register bits (ADC conversion of Charge Current (IBAT) when VBAT > VBATSHORT,)
REG13 register bits (VINDPM Status, IINDPM Status and Input Current Limit in effect while Input Current Optimizer,)
REG14 register bits
Device Configuration (REG14, bit 3-5)
Writes register of BQ25892
This function checks the given register and sends 2 bytes of data to the BQ25892. If the mask is set to only the bits which should be modified, the state of the other bits is preserved.
Reads register of BQ25892