63#include "../../../SensorBuildOpt.h"
64#if !SENSORLIB_EXCLUDE_PMIC_BQ25896
66#include "../../PmicBase.hpp"
67#include "../../PmicPowerBase.hpp"
68#include "../../PmicAdcBase.hpp"
82static constexpr uint8_t BQ25896_SLAVE_ADDRESS = 0x6B;
94 PmicBQ25896() : _core(), _charger(_core), _power(_core), _adc(_core), _led(_core) {}
107 bool begin(TwoWire &wire, uint8_t addr,
int sda = -1,
int scl = -1)
109 return _core.
begin(wire, addr, sda, scl);
111#elif defined(ESP_PLATFORM)
112#if defined(SENSORLIB_USE_I2C_LEGACY)
123 bool begin(i2c_port_t port_num, uint8_t addr,
int sda = -1,
int scl = -1)
125 return _core.
begin(port_num, addr, sda, scl);
136 bool begin(i2c_master_bus_handle_t handle, uint8_t addr)
138 return _core.
begin(handle, addr);
157 return _core.
begin(callback, hal_cb, addr);
298 .chargeCurrentMin = 0,
299 .chargeCurrentMax = 3008,
300 .chargeCurrentStep = 64,
301 .chargeCurrentSteps = 48,
void end()
Deinitialize and release resources.
BQ25896 LED/STAT Pin Control.
bool begin(SensorCommCustom::CustomCallback cb, SensorCommCustomHal::CustomHalCallback hal_cb, uint8_t addr)
Initialize the sensor using custom callback interface.
void end()
Deinitialize and release resources.
PmicBQ25896()
Construct BQ25896 PMIC interface.
const char * getChipName() const override
Get PMIC device name.
const PmicConfig & getConfig() const override
Get device name.
BQ25896Core & core()
Get core interface (mutable)
PmicCapability::Capability getCapabilities() const override
Get supported PMIC capabilities.
PmicLedBase & getLed() override
Get LED interface.
PmicChargerBase * getCharger() override
Get charger interface (base class pointer)
bool begin(SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_cb, uint8_t addr)
Initialize using custom I2C callback.
BQ25896Charger & charger()
Get charger interface.
PmicPowerBase & getPower() override
Get power management interface.
const BQ25896Core & core() const
Get core interface (const)
PmicAdcBase & getAdc() override
Get ADC interface.
PMIC Base Abstract Class.
PMIC charger capability interface.
uint32_t(*)(Operation op, void *param1, void *param2) CustomHalCallback
bool(*)(uint8_t addr, uint8_t reg, uint8_t *buf, size_t len, bool writeReg, bool isWrite) CustomCallback
@ PmicSupportCharger
Battery charger support.
@ PmicSupportPower
Power management (input limits, boost, etc.)
@ PmicSupportAdc
Analog-to-Digital converter for monitoring.
PMIC static configuration data.
const char * chipName
e.g. "AXP2101"