|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
@license MIT License More...
Go to the source code of this file.
Macros | |
| #define | PMIC_SDA 3 |
| #define | PMIC_SCL 2 |
| #define | PMIC_IRQ -1 |
| #define | CHECK_FOR_ERRORS(condition) if (condition) {Serial.println("BQ25896 error"); while(1)delay(1000);} |
Functions | |
| void | printBanner () |
| void | setup () |
| void | loop () |
Variables | |
| uint32_t | interval = 0 |
| PmicBQ25896 | bmu |
@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.
Definition in file bq25896_charger.ino.
| #define CHECK_FOR_ERRORS | ( | condition | ) | if (condition) {Serial.println("BQ25896 error"); while(1)delay(1000);} |
Definition at line 48 of file bq25896_charger.ino.
| #define PMIC_IRQ -1 |
Definition at line 42 of file bq25896_charger.ino.
| #define PMIC_SCL 2 |
Definition at line 38 of file bq25896_charger.ino.
| #define PMIC_SDA 3 |
Definition at line 34 of file bq25896_charger.ino.
| void loop | ( | ) |
Definition at line 130 of file bq25896_charger.ino.
References PmicBQ25896::adc(), PmicAdcBase::BAT_CURRENT, PmicAdcBase::BAT_TEMPERATURE, PmicAdcBase::BAT_VOLTAGE, bmu, PmicChargerBase::Status::chargeDone, PmicBQ25896::charger(), PmicBQ25896::core(), PmicChargerBase::Status::fault, BQ25896Power::getBoostVoltage(), BQ25896Charger::getStatus(), interval, BQ25896Power::isBoostEnabled(), BQ25896Charger::isCharging(), BQ25896Core::isIindpmActive(), BQ25896Core::isInputCurrentOptimizerOptimized(), BQ25896Core::isVindpmActive(), BQ25896Core::isVsysInRegulation(), PmicChargerBase::Status::online, PmicBQ25896::power(), BQ25896Adc::read(), PmicAdcBase::VBUS_VOLTAGE, PmicChargerBase::Status::vbusPresent, and PmicAdcBase::VSYS_VOLTAGE.
| void printBanner | ( | ) |
Definition at line 50 of file bq25896_charger.ino.
Referenced by setup().
| void setup | ( | ) |
Definition at line 59 of file bq25896_charger.ino.
References PmicBQ25896::adc(), BQ25896Adc::ADC_CONV_START, PmicBQ25896::begin(), bmu, PmicBQ25896::charger(), CHECK_FOR_ERRORS, PmicLedBase::DISABLE, BQ25896Adc::enableChannels(), BQ25896Charger::getChargeVoltage(), BQ25896Charger::getFastChargeCurrent(), BQ25896Power::getInputCurrentLimit(), BQ25896Power::getInputVoltageLimit(), BQ25896Power::getMinimumSystemVoltage(), BQ25896Charger::getPreChargeCurrent(), BQ25896Charger::getTerminationCurrent(), PmicBQ25896::led(), PMIC_SCL, PMIC_SDA, PmicBQ25896::power(), printBanner(), BQ25896Charger::setChargeVoltage(), BQ25896Charger::setFastChargeCurrent(), BQ25896Power::setInputCurrentLimit(), BQ25896Power::setInputVoltageLimit(), BQ25896Power::setMinimumSystemVoltage(), BQ25896Led::setMode(), BQ25896Charger::setPreChargeCurrent(), and BQ25896Charger::setTerminationCurrent().
| PmicBQ25896 bmu |
Definition at line 46 of file bq25896_charger.ino.
| uint32_t interval = 0 |
Definition at line 45 of file bq25896_charger.ino.
Referenced by loop().