|
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 5 |
| #define | PMIC_SCL 6 |
| #define | PMIC_IRQ 21 |
| #define | CHECK_FOR_ERRORS(condition) if (condition) {Serial.println("SY6970 error"); while(1)delay(1000);} |
Functions | |
| void | printBanner () |
| void | setup () |
| void | loop () |
Variables | |
| volatile bool | isFaultTrigger = false |
| uint32_t | interval = 0 |
| PmicSY6970 | 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 sy6970_charger.ino.
| #define CHECK_FOR_ERRORS | ( | condition | ) | if (condition) {Serial.println("SY6970 error"); while(1)delay(1000);} |
Definition at line 50 of file sy6970_charger.ino.
| #define PMIC_IRQ 21 |
Definition at line 42 of file sy6970_charger.ino.
| #define PMIC_SCL 6 |
Definition at line 38 of file sy6970_charger.ino.
| #define PMIC_SDA 5 |
Definition at line 34 of file sy6970_charger.ino.
| void loop | ( | ) |
Definition at line 139 of file sy6970_charger.ino.
References PmicSY6970::adc(), PmicAdcBase::BAT_CURRENT, PmicAdcBase::BAT_TEMPERATURE, PmicAdcBase::BAT_VOLTAGE, bmu, PmicChargerBase::Status::chargeDone, PmicSY6970::charger(), PmicChargerBase::Status::fault, PmicChargerBase::Status::faultCode, SY6970Power::getBoostVoltage(), SY6970Charger::getStatus(), interval, SY6970Power::isBoostEnabled(), SY6970Charger::isCharging(), isFaultTrigger, PmicChargerBase::Status::online, PmicSY6970::power(), SY6970Adc::read(), PmicAdcBase::VBUS_VOLTAGE, PmicChargerBase::Status::vbusPresent, and PmicAdcBase::VSYS_VOLTAGE.
| void printBanner | ( | ) |
Definition at line 52 of file sy6970_charger.ino.
Referenced by setup().
| void setup | ( | ) |
Definition at line 61 of file sy6970_charger.ino.
References PmicSY6970::adc(), SY6970Adc::ADC_CONV_START, PmicSY6970::begin(), bmu, PmicSY6970::charger(), CHECK_FOR_ERRORS, PmicLedBase::DISABLE, SY6970Adc::enableChannels(), SY6970Charger::getChargeVoltage(), SY6970Charger::getFastChargeCurrent(), SY6970Power::getInputCurrentLimit(), SY6970Power::getInputVoltageLimit(), SY6970Power::getMinimumSystemVoltage(), SY6970Charger::getPreChargeCurrent(), SY6970Charger::getTerminationCurrent(), isFaultTrigger, PmicSY6970::led(), PMIC_IRQ, PMIC_SCL, PMIC_SDA, PmicSY6970::power(), printBanner(), SY6970Charger::setChargeVoltage(), SY6970Charger::setFastChargeCurrent(), SY6970Power::setInputCurrentLimit(), SY6970Power::setInputVoltageLimit(), SY6970Power::setMinimumSystemVoltage(), SY6970Led::setMode(), SY6970Charger::setPreChargeCurrent(), and SY6970Charger::setTerminationCurrent().
| PmicSY6970 bmu |
Definition at line 48 of file sy6970_charger.ino.
| uint32_t interval = 0 |
Definition at line 46 of file sy6970_charger.ino.
Referenced by loop().
| volatile bool isFaultTrigger = false |
Definition at line 45 of file sy6970_charger.ino.