SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
BQ25896Core.hpp File Reference

@license MIT License More...

Include dependency graph for BQ25896Core.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  BQ25896Core
 

Namespaces

namespace  BQ25896Faults
 

Functions

bool BQ25896Faults::isWatchdogTimeout (uint8_t fault)
 
bool BQ25896Faults::isBoostFault (uint8_t fault)
 
bool BQ25896Faults::isChargeFault (uint8_t fault)
 
uint8_t BQ25896Faults::getChargeFaultType (uint8_t fault)
 
bool BQ25896Faults::isChargeInputFault (uint8_t fault)
 
bool BQ25896Faults::isChargeThermalFault (uint8_t fault)
 
bool BQ25896Faults::isChargeTimerFault (uint8_t fault)
 
bool BQ25896Faults::isBatteryFault (uint8_t fault)
 
uint8_t BQ25896Faults::getNtcFault (uint8_t fault)
 

Variables

constexpr uint8_t BQ25896Faults::WATCHDOG_TIMEOUT = 0x80
 
constexpr uint8_t BQ25896Faults::BOOST_FAULT = 0x40
 
constexpr uint8_t BQ25896Faults::CHARGE_FAULT_MASK = 0x30
 
constexpr uint8_t BQ25896Faults::CHARGE_FAULT_NORMAL = 0x00
 
constexpr uint8_t BQ25896Faults::CHARGE_FAULT_INPUT = 0x10
 
constexpr uint8_t BQ25896Faults::CHARGE_FAULT_THERMAL = 0x20
 
constexpr uint8_t BQ25896Faults::CHARGE_FAULT_TIMER = 0x30
 
constexpr uint8_t BQ25896Faults::BATTERY_FAULT = 0x08
 
constexpr uint8_t BQ25896Faults::NTC_FAULT_MASK = 0x07
 

Detailed Description

@license MIT License

Copyright (c) 2026 lewis he

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2026-04-09

BQ25896 Core Communication and Status Interface

This class provides low-level I2C communication and direct access to BQ25896 status and fault registers. It serves as the base class for charger, power, and ADC modules.

Overview

The BQ25896 is a USB BC1.2 compliant switch-mode charger IC featuring:

  • High-efficiency buck charging (up to 3A)
  • USB BC1.2 and HVDCP detection
  • Input Current Optimizer (ICO)
  • Integrated 10-bit ADC
  • OTG (On-The-Go) boost mode for power bank operation
  • JEITA battery temperature protection

Communication

  • I2C Address: 0x6B (7-bit)
  • Supports standard I2C read/write operations
  • 8-bit register addressing

Monitoring

The core provides access to:

  • VBUS presence detection
  • Charging state (pre-charge, fast-charge, done)
  • USB type detection (SDP, Adapter, OTG)
  • Power good status
  • VINDPM/IINDPM status
  • Fault conditions (watchdog, boost, battery, NTC)
See also
BQ25896Core.cpp for implementation
BQ25896Charger for charging functions
BQ25896Power for power/OTG functions
BQ25896Adc for ADC functions
BQ25896Regs.hpp for register definitions
BQ25896RegisterMap.md for detailed register descriptions

Definition in file BQ25896Core.hpp.