10#include <driver/touch_sens.h>
11#include <freertos/FreeRTOS.h>
12#include <freertos/queue.h>
27class ESP32TouchBinarySensor;
36#ifdef USE_ESP32_VARIANT_ESP32
42#if !defined(USE_ESP32_VARIANT_ESP32P4)
51 void setup()
override;
57#if defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32P4)
78#if SOC_TOUCH_SUPPORT_DENOISE_CHAN
117 static bool on_active_cb(touch_sensor_handle_t handle,
const touch_active_event_data_t *event,
void *ctx);
118 static bool on_inactive_cb(touch_sensor_handle_t handle,
const touch_inactive_event_data_t *event,
void *ctx);
132#ifdef USE_ESP32_VARIANT_ESP32
138#if !defined(USE_ESP32_VARIANT_ESP32P4)
143#ifdef USE_ESP32_VARIANT_ESP32
149#elif defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32P4)
160#if SOC_TOUCH_SUPPORT_DENOISE_CHAN
162 touch_denoise_chan_resolution_t
denoise_grade_{TOUCH_DENOISE_CHAN_RESOLUTION_BIT12};
Base class for all binary_sensor-type classes.
Simple helper class to expose a touch pad value as a binary sensor.
bool initial_state_published_
int get_channel_id() const
touch_channel_handle_t chan_handle_
uint32_t get_wakeup_threshold() const
void set_threshold(uint32_t threshold)
uint32_t get_value() const
Get the raw touch measurement value.
ESP32TouchBinarySensor(int channel_id, uint32_t threshold, uint32_t wakeup_threshold)
uint32_t get_threshold() const
uint32_t value_
Stores the last raw touch measurement value.
const uint32_t wakeup_threshold_
friend ESP32TouchComponent
void set_jitter_step(uint32_t jitter_step)
bool create_touch_queue_()
void set_high_voltage_reference(touch_volt_lim_h_t high_voltage_reference)
bool iir_filter_enabled_() const
void set_setup_mode(bool setup_mode)
void set_denoise_grade(touch_denoise_chan_resolution_t denoise_grade)
touch_smooth_filter_mode_t smooth_level_
uint32_t setup_mode_last_log_print_
static bool on_inactive_cb(touch_sensor_handle_t handle, const touch_inactive_event_data_t *event, void *ctx)
void set_charge_times(uint32_t charge_times)
void register_touch_pad(ESP32TouchBinarySensor *pad)
int waterproof_guard_ring_pad_
void set_filter_mode(touch_benchmark_filter_mode_t filter_mode)
void set_debounce_count(uint32_t debounce_count)
touch_benchmark_filter_mode_t filter_mode_
void set_smooth_level(touch_smooth_filter_mode_t smooth_level)
void publish_initial_state_if_needed_(ESP32TouchBinarySensor *child, uint32_t now)
touch_denoise_chan_resolution_t denoise_grade_
QueueHandle_t touch_queue_
float charge_duration_ms_
static bool on_active_cb(touch_sensor_handle_t handle, const touch_active_event_data_t *event, void *ctx)
touch_volt_lim_h_t high_voltage_reference_
void on_shutdown() override
void set_waterproof_guard_ring_pad(int channel_id)
uint32_t noise_threshold_
touch_denoise_chan_cap_t denoise_cap_level_
void process_setup_mode_logging_(uint32_t now)
void set_noise_threshold(uint32_t noise_threshold)
void set_waterproof_shield_driver(uint32_t drive_capability)
touch_volt_lim_l_t low_voltage_reference_
void set_iir_filter(uint32_t iir_filter)
std::vector< ESP32TouchBinarySensor * > children_
uint32_t waterproof_shield_driver_
touch_sensor_handle_t sens_handle_
void set_meas_interval_us(float meas_interval_us)
void cleanup_touch_queue_()
void configure_wakeup_pads_()
bool waterproof_configured_
void set_low_voltage_reference(touch_volt_lim_l_t low_voltage_reference)
void set_charge_duration_ms(float charge_duration_ms)
void set_denoise_cap(touch_denoise_chan_cap_t cap_level)
void dump_config() override