SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
axp1xx::AdcTraitsBase< AXP202Core > Class Reference

AXP202 ADC traits specialization. More...

#include <AXP202AdcTraits.hpp>

Static Public Member Functions

static uint32_t getChannelMask (PmicAdcBase::Channel ch)
 Map PmicAdcBase::Channel to AXP202 ADC enable mask.
 
static bool hasSpecialEnablement (PmicAdcBase::Channel ch)
 AXP202 does not require special channel enablement.
 
static bool enableSpecialChannel (AXP202Core &core, PmicAdcBase::Channel ch)
 No special enablement needed for AXP202.
 
static bool disableSpecialChannel (AXP202Core &core, PmicAdcBase::Channel ch)
 No special disablement needed for AXP202.
 
static bool readChannel (AXP202Core &core, PmicAdcBase::Channel ch, float &out)
 Read a single ADC channel value for AXP202.
 

Static Public Attributes

static constexpr uint8_t ADC_EN1_ADDR = axp202_regs::adc::ADC_EN1
 
static constexpr uint8_t ADC_EN2_ADDR = axp202_regs::adc::ADC_EN2
 

Detailed Description

AXP202 ADC traits specialization.

Implements the AdcTraitsBase interface for AXP202, providing:

  • Register addresses for ADC control
  • Channel mask definitions (includes GPIO0, GPIO1, BAT_PERCENTAGE)
  • ADC reading logic for all supported channels
Note
AXP202 uses a hybrid readRegBuff approach for some channels and supports additional GPIO/percentage channels.

Definition at line 60 of file AXP202AdcTraits.hpp.

Member Function Documentation

◆ disableSpecialChannel()

static bool axp1xx::AdcTraitsBase< AXP202Core >::disableSpecialChannel ( AXP202Core core,
PmicAdcBase::Channel  ch 
)
inlinestatic

No special disablement needed for AXP202.

Definition at line 93 of file AXP202AdcTraits.hpp.

◆ enableSpecialChannel()

static bool axp1xx::AdcTraitsBase< AXP202Core >::enableSpecialChannel ( AXP202Core core,
PmicAdcBase::Channel  ch 
)
inlinestatic

No special enablement needed for AXP202.

Definition at line 83 of file AXP202AdcTraits.hpp.

◆ getChannelMask()

◆ hasSpecialEnablement()

static bool axp1xx::AdcTraitsBase< AXP202Core >::hasSpecialEnablement ( PmicAdcBase::Channel  ch)
inlinestatic

AXP202 does not require special channel enablement.

Definition at line 74 of file AXP202AdcTraits.hpp.

◆ readChannel()

Member Data Documentation

◆ ADC_EN1_ADDR

constexpr uint8_t axp1xx::AdcTraitsBase< AXP202Core >::ADC_EN1_ADDR = axp202_regs::adc::ADC_EN1
staticconstexpr

Definition at line 63 of file AXP202AdcTraits.hpp.

◆ ADC_EN2_ADDR

constexpr uint8_t axp1xx::AdcTraitsBase< AXP202Core >::ADC_EN2_ADDR = axp202_regs::adc::ADC_EN2
staticconstexpr

Definition at line 64 of file AXP202AdcTraits.hpp.


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