SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
PmicBc12Base.hpp
Go to the documentation of this file.
1
36#pragma once
37#include <stdint.h>
38
40{
41public:
42 virtual ~PmicBc12Base() = default;
43
47 enum class PortType : uint8_t {
48 Unknown = 0,
49 None,
50 SDP,
51 CDP,
52 DCP,
53 Apple_1A,
54 Apple_2A,
56 };
57
58 struct Result {
59 bool detecting = false;
61 uint8_t raw = 0;
62 };
63
67 virtual bool enableAutoDetect(bool enable) = 0;
68
72 virtual bool triggerDetect() = 0;
73
77 virtual bool isDetecting() = 0;
78
82 virtual Result readResult() = 0;
83};
virtual bool isDetecting()=0
Query whether PMIC is currently detecting.
virtual Result readResult()=0
Read current BC1.2 result.
virtual ~PmicBc12Base()=default
virtual bool enableAutoDetect(bool enable)=0
Enable/disable auto BC1.2 detection (if supported).
virtual bool triggerDetect()=0
Force/trigger a BC1.2 detection cycle (if supported).
PortType
Common detected port/source type.
@ SDP
Standard Downstream Port (USB 500mA/900mA)
@ None
no valid detection / not connected
@ DCP
Dedicated Charging Port.
@ CDP
Charging Downstream Port.
uint8_t raw
raw code from PMIC (chip-specific)
bool detecting
detection in progress