100 return static_cast<Derived *
>(
this)->
ReadChannelV(channel, voltage_v);
CRTP-based template interface for ADC operations.
Definition ntc_adc_interface.hpp:55
AdcInterface & operator=(const AdcInterface &)=delete
uint8_t GetResolutionBits() const
Get the ADC resolution in bits.
Definition ntc_adc_interface.hpp:115
float GetReferenceVoltage() const
Get the reference voltage of the ADC.
Definition ntc_adc_interface.hpp:107
bool IsChannelAvailable(uint8_t channel) const
Check if a specific ADC channel is available.
Definition ntc_adc_interface.hpp:79
AdcInterface(AdcInterface &&)=default
bool EnsureInitialized()
Ensure ADC is initialized, initializing if necessary.
Definition ntc_adc_interface.hpp:70
bool IsInitialized() const
Check if ADC is initialized.
Definition ntc_adc_interface.hpp:61
AdcError ReadChannelV(uint8_t channel, float *voltage_v)
Read voltage value from specified channel.
Definition ntc_adc_interface.hpp:99
~AdcInterface()=default
Protected destructor.
AdcInterface(const AdcInterface &)=delete
AdcError ReadChannelCount(uint8_t channel, uint32_t *count)
Read raw ADC count value from specified channel.
Definition ntc_adc_interface.hpp:89
AdcInterface & operator=(AdcInterface &&)=default
AdcInterface()=default
Protected constructor to prevent direct instantiation.
Definition ntc_adc_interface.hpp:9
AdcError
ADC error codes.
Definition ntc_adc_interface.hpp:14
@ HardwareError
Hardware-level error.
@ Success
Operation successful.
@ ReadFailed
ADC read operation failed.
@ InvalidChannel
Invalid ADC channel.
@ NotInitialized
ADC not initialized.
@ Timeout
Operation timeout.