|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
AXP517 BC1.2 detection module. More...
#include <AXP517Bc12.hpp>
Public Member Functions | |
| AXP517Bc12 (AXP517Core &core) | |
| Construct an AXP517 BC1.2 driver. | |
| bool | enableAutoDetect (bool enable) override |
| Enable or disable automatic BC1.2 detection. | |
| bool | triggerDetect () override |
| Trigger a BC1.2 detection cycle. | |
| bool | isDetecting () override |
| Check if BC1.2 detection is currently in progress. | |
| Result | readResult () override |
| Read the current BC1.2 detection result. | |
Public Member Functions inherited from PmicBc12Base | |
| virtual | ~PmicBc12Base ()=default |
Additional Inherited Members | |
Public Types inherited from PmicBc12Base | |
| enum class | PortType : uint8_t { Unknown = 0 , None , SDP , CDP , DCP , Apple_1A , Apple_2A , Apple_2_4A } |
| Common detected port/source type. More... | |
AXP517 BC1.2 detection module.
Depends on:
Definition at line 43 of file AXP517Bc12.hpp.
|
explicit |
Construct an AXP517 BC1.2 driver.
| core | Shared AXP517 register transport. |
Definition at line 37 of file AXP517Bc12.cpp.
|
overridevirtual |
Enable or disable automatic BC1.2 detection.
| enable | true to enable, false to disable. |
| true | on success, false on register access failure. |
Implements PmicBc12Base.
Definition at line 42 of file AXP517Bc12.cpp.
References SensorCommWrapper::clrRegBit(), axp517_regs::bc12::CTRL3, and SensorCommWrapper::setRegBit().
Referenced by setup().
|
overridevirtual |
Check if BC1.2 detection is currently in progress.
| true | if detection is in progress, false otherwise. |
Implements PmicBc12Base.
Definition at line 60 of file AXP517Bc12.cpp.
References axp517_regs::bc12::CTRL0, and SensorCommWrapper::readReg().
Referenced by readResult().
|
overridevirtual |
Read the current BC1.2 detection result.
Implements PmicBc12Base.
Definition at line 68 of file AXP517Bc12.cpp.
References axp517_regs::bmu::BC_DETECT, PmicBc12Base::Result::detecting, isDetecting(), SensorCommWrapper::readReg(), and PmicBc12Base::Unknown.
Referenced by loop(), and readStatusSnapshot().
|
overridevirtual |
Trigger a BC1.2 detection cycle.
| true | on success, false on register access failure. |
Implements PmicBc12Base.
Definition at line 50 of file AXP517Bc12.cpp.
References axp517_regs::bc12::CTRL3, SensorCommWrapper::readReg(), and SensorCommWrapper::writeReg().