SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
AXP1xxAdcTraits.hpp
Go to the documentation of this file.
1
30#pragma once
31
32#include <stdint.h>
33#include "../../PmicAdcBase.hpp"
34
35namespace axp1xx
36{
37
52template<typename CoreType>
54{
55public:
62 static constexpr uint8_t ADC_EN1_ADDR = 0x82;
63
70 static constexpr uint8_t ADC_EN2_ADDR = 0x83;
71
84 {
85 (void)ch;
86 return 0; // Default: no channels supported
87 }
88
100 {
101 (void)ch;
102 return false; // Default: no special handling
103 }
104
119 static bool enableSpecialChannel(CoreType &core, PmicAdcBase::Channel ch)
120 {
121 (void)core;
122 (void)ch;
123 return true;
124 }
125
136 static bool disableSpecialChannel(CoreType &core, PmicAdcBase::Channel ch)
137 {
138 (void)core;
139 (void)ch;
140 return true;
141 }
142
161 static bool readChannel(CoreType &core, PmicAdcBase::Channel ch, float &out)
162 {
163 (void)core;
164 (void)ch;
165 (void)out;
166 return false; // Default: unsupported
167 }
168};
169
170} // namespace axp1xx
Channel
ADC channel bitmask.
Base traits class for AXP1xxAdc template specialization.
static constexpr uint8_t ADC_EN2_ADDR
ADC_EN2 register address.
static bool disableSpecialChannel(CoreType &core, PmicAdcBase::Channel ch)
Perform special channel disablement.
static bool enableSpecialChannel(CoreType &core, PmicAdcBase::Channel ch)
Perform special channel enablement.
static bool hasSpecialEnablement(PmicAdcBase::Channel ch)
Check if a channel requires special enablement logic.
static bool readChannel(CoreType &core, PmicAdcBase::Channel ch, float &out)
Main ADC channel reading implementation.
static constexpr uint8_t ADC_EN1_ADDR
ADC_EN1 register address.
static uint32_t getChannelMask(PmicAdcBase::Channel ch)
Map a Channel enum to its hardware enable mask.