SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP517Bc12 Class Reference

AXP517 BC1.2 detection module. More...

#include <AXP517Bc12.hpp>

Inheritance diagram for AXP517Bc12:
[legend]

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...
 

Detailed Description

AXP517 BC1.2 detection module.

Depends on:

Definition at line 43 of file AXP517Bc12.hpp.

Constructor & Destructor Documentation

◆ AXP517Bc12()

AXP517Bc12::AXP517Bc12 ( AXP517Core core)
explicit

Construct an AXP517 BC1.2 driver.

Parameters
coreShared AXP517 register transport.

Definition at line 37 of file AXP517Bc12.cpp.

Member Function Documentation

◆ enableAutoDetect()

bool AXP517Bc12::enableAutoDetect ( bool  enable)
overridevirtual

Enable or disable automatic BC1.2 detection.

Note
This function controls the automatic detection feature of the BC1.2 module.
Parameters
enabletrue to enable, false to disable.
Return values
trueon 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().

◆ isDetecting()

bool AXP517Bc12::isDetecting ( )
overridevirtual

Check if BC1.2 detection is currently in progress.

Note
This function checks the PMIC status to determine if a BC1.2 detection cycle is currently active.
Return values
trueif 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().

◆ readResult()

PmicBc12Base::Result AXP517Bc12::readResult ( )
overridevirtual

Read the current BC1.2 detection result.

Note
This function retrieves the result of the most recent BC1.2 detection cycle, including the detected port type and raw code.
Returns
Result containing detection status, port type, and raw code.

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().

◆ triggerDetect()

bool AXP517Bc12::triggerDetect ( )
overridevirtual

Trigger a BC1.2 detection cycle.

Note
This function forces the PMIC to perform a BC1.2 detection cycle immediately.
Return values
trueon 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().


The documentation for this class was generated from the following files: