9 #include <esp_adc_cal.h> 10 #include "driver/adc.h" 18 #if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 7)) || \ 19 (ESP_IDF_VERSION_MAJOR == 5 && \ 20 ((ESP_IDF_VERSION_MINOR == 0 && ESP_IDF_VERSION_PATCH >= 5) || \ 21 (ESP_IDF_VERSION_MINOR == 1 && ESP_IDF_VERSION_PATCH >= 3) || \ 22 (ESP_IDF_VERSION_MINOR >= 2)) \ 25 static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_12;
27 static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_11;
50 void setup()
override;
81 #if ESP_IDF_VERSION_MAJOR >= 5 84 esp_adc_cal_characteristics_t cal_characteristics_[ADC_ATTEN_MAX] = {};
85 #endif // ESP_IDF_VERSION_MAJOR
Abstract interface for components to request voltage (usually ADC readings)
This class simplifies creating components that periodically check a state.
void set_channel2(adc2_channel_t channel)
void set_channel1(adc1_channel_t channel)
void setup() override
Setup ADC.
void set_is_temperature()
void set_sample_count(uint8_t sample_count)
void set_output_raw(bool output_raw)
void set_attenuation(adc_atten_t attenuation)
Set the attenuation for this pin. Only available on the ESP32.
std::string unique_id() override
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM]
void update() override
Update ADC values.
Implementation of SPI Controller mode.
void set_autorange(bool autorange)
void set_pin(InternalGPIOPin *pin)
Base-class for all sensors.
float get_setup_priority() const override
HARDWARE_LATE setup priority
void dump_config() override