ESPHome 2025.7.3
|
#include <esp32_touch.h>
Public Member Functions | |
void | register_touch_pad (ESP32TouchBinarySensor *pad) |
void | set_setup_mode (bool setup_mode) |
void | set_sleep_duration (uint16_t sleep_duration) |
void | set_measurement_duration (uint16_t meas_cycle) |
void | set_low_voltage_reference (touch_low_volt_t low_voltage_reference) |
void | set_high_voltage_reference (touch_high_volt_t high_voltage_reference) |
void | set_voltage_attenuation (touch_volt_atten_t voltage_attenuation) |
void | setup () override |
void | dump_config () override |
void | loop () override |
float | get_setup_priority () const override |
void | on_shutdown () override |
void | set_filter_mode (touch_filter_mode_t filter_mode) |
void | set_debounce_count (uint32_t debounce_count) |
void | set_noise_threshold (uint32_t noise_threshold) |
void | set_jitter_step (uint32_t jitter_step) |
void | set_smooth_level (touch_smooth_mode_t smooth_level) |
void | set_denoise_grade (touch_pad_denoise_grade_t denoise_grade) |
void | set_denoise_cap (touch_pad_denoise_cap_t cap_level) |
void | set_waterproof_guard_ring_pad (touch_pad_t pad) |
void | set_waterproof_shield_driver (touch_pad_shield_driver_t drive_capability) |
void | set_iir_filter (uint32_t iir_filter) |
![]() | |
float | get_actual_setup_priority () const |
void | set_setup_priority (float priority) |
virtual float | get_loop_priority () const |
priority of loop(). | |
void | call () |
virtual void | on_safe_shutdown () |
virtual bool | teardown () |
Called during teardown to allow component to gracefully finish operations. | |
virtual void | on_powerdown () |
Called after teardown is complete to power down hardware. | |
uint8_t | get_component_state () const |
void | reset_to_construction_state () |
Reset this component back to the construction state to allow setup to run again. | |
bool | is_in_loop_state () const |
Check if this component has completed setup and is in the loop state. | |
virtual void | mark_failed () |
Mark this component as failed. | |
void | mark_failed (const char *message) |
void | disable_loop () |
Disable this component's loop. | |
void | enable_loop () |
Enable this component's loop. | |
void | enable_loop_soon_any_context () |
Thread and ISR-safe version of enable_loop() that can be called from any context. | |
bool | is_failed () const |
bool | is_ready () const |
virtual bool | can_proceed () |
bool | status_has_warning () const |
bool | status_has_error () const |
void | status_set_warning (const char *message="unspecified") |
void | status_set_error (const char *message="unspecified") |
void | status_clear_warning () |
void | status_clear_error () |
void | status_momentary_warning (const std::string &name, uint32_t length=5000) |
void | status_momentary_error (const std::string &name, uint32_t length=5000) |
bool | has_overridden_loop () const |
void | set_component_source (const char *source) |
Set where this component was loaded from for some debug messages. | |
const char * | get_component_source () const |
Get the integration where this component was declared as a string. | |
bool | should_warn_of_blocking (uint32_t blocking_time) |
Protected Member Functions | |
void | dump_config_base_ () |
void | dump_config_sensors_ () |
bool | create_touch_queue_ () |
void | cleanup_touch_queue_ () |
void | configure_wakeup_pads_ () |
void | process_setup_mode_logging_ (uint32_t now) |
bool | should_check_for_releases_ (uint32_t now) |
void | publish_initial_state_if_needed_ (ESP32TouchBinarySensor *child, uint32_t now) |
void | check_and_disable_loop_if_all_released_ (size_t pads_off) |
void | calculate_release_timeout_ () |
bool | iir_filter_enabled_ () const |
bool | filter_configured_ () const |
bool | denoise_configured_ () const |
bool | waterproof_configured_ () const |
uint32_t | read_touch_value (touch_pad_t pad) const |
void | update_touch_state_ (ESP32TouchBinarySensor *child, bool is_touched) |
bool | check_and_update_touch_state_ (ESP32TouchBinarySensor *child) |
![]() | |
virtual void | call_loop () |
virtual void | call_setup () |
virtual void | call_dump_config () |
void | set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a unique name. | |
void | set_interval (const char *name, uint32_t interval, std::function< void()> &&f) |
Set an interval function with a const char* name. | |
void | set_interval (uint32_t interval, std::function< void()> &&f) |
bool | cancel_interval (const std::string &name) |
Cancel an interval function. | |
bool | cancel_interval (const char *name) |
void | set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
Set an retry function with a unique name. | |
void | set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f) |
bool | cancel_retry (const std::string &name) |
Cancel a retry function. | |
void | set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a unique name. | |
void | set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f) |
Set a timeout function with a const char* name. | |
void | set_timeout (uint32_t timeout, std::function< void()> &&f) |
bool | cancel_timeout (const std::string &name) |
Cancel a timeout function. | |
bool | cancel_timeout (const char *name) |
void | defer (const std::string &name, std::function< void()> &&f) |
Defer a callback to the next loop() call. | |
void | defer (const char *name, std::function< void()> &&f) |
Defer a callback to the next loop() call with a const char* name. | |
void | defer (std::function< void()> &&f) |
Defer a callback to the next loop() call. | |
bool | cancel_defer (const std::string &name) |
Cancel a defer callback using the specified name, name must not be empty. | |
Static Protected Member Functions | |
static void | touch_isr_handler (void *arg) |
static void | touch_isr_handler (void *arg) |
static const char * | get_low_voltage_reference_str (touch_low_volt_t ref) |
static const char * | get_high_voltage_reference_str (touch_high_volt_t ref) |
static const char * | get_voltage_attenuation_str (touch_volt_atten_t atten) |
Protected Attributes | |
std::vector< ESP32TouchBinarySensor * > | children_ |
bool | setup_mode_ {false} |
uint32_t | setup_mode_last_log_print_ {0} |
uint32_t | last_release_check_ {0} |
uint32_t | release_timeout_ms_ {1500} |
uint32_t | release_check_interval_ms_ {50} |
uint16_t | sleep_cycle_ {4095} |
uint16_t | meas_cycle_ {65535} |
touch_low_volt_t | low_voltage_reference_ {TOUCH_LVOLT_0V5} |
touch_high_volt_t | high_voltage_reference_ {TOUCH_HVOLT_2V7} |
touch_volt_atten_t | voltage_attenuation_ {TOUCH_HVOLT_ATTEN_0V} |
QueueHandle_t | touch_queue_ {nullptr} |
uint32_t | iir_filter_ {0} |
touch_filter_mode_t | filter_mode_ {TOUCH_PAD_FILTER_MAX} |
uint32_t | debounce_count_ {0} |
uint32_t | noise_threshold_ {0} |
uint32_t | jitter_step_ {0} |
touch_smooth_mode_t | smooth_level_ {TOUCH_PAD_SMOOTH_MAX} |
touch_pad_denoise_grade_t | grade_ {TOUCH_PAD_DENOISE_MAX} |
touch_pad_denoise_cap_t | cap_level_ {TOUCH_PAD_DENOISE_CAP_MAX} |
touch_pad_t | waterproof_guard_ring_pad_ {TOUCH_PAD_MAX} |
touch_pad_shield_driver_t | waterproof_shield_driver_ {TOUCH_PAD_SHIELD_DRV_MAX} |
![]() | |
const char * | component_source_ {nullptr} |
uint16_t | warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_MS} |
Warn if blocked for this many ms (max 65.5s) | |
uint8_t | component_state_ {0x00} |
State of this component - each bit has a purpose: Bits 0-1: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED) Bit 2: STATUS_LED_WARNING Bit 3: STATUS_LED_ERROR Bits 4-7: Unused - reserved for future expansion (50% of the bits are free) | |
volatile bool | pending_enable_loop_ {false} |
ISR-safe flag for enable_loop_soon_any_context. | |
Static Protected Attributes | |
static constexpr uint32_t | MINIMUM_RELEASE_TIME_MS = 100 |
Definition at line 34 of file esp32_touch.h.
|
protected |
Definition at line 136 of file esp32_touch_common.cpp.
|
protected |
Definition at line 129 of file esp32_touch_common.cpp.
|
protected |
Definition at line 34 of file esp32_touch_v2.cpp.
|
protected |
Definition at line 63 of file esp32_touch_common.cpp.
|
protected |
Definition at line 70 of file esp32_touch_common.cpp.
|
protected |
Definition at line 42 of file esp32_touch_common.cpp.
|
inlineprotected |
Definition at line 161 of file esp32_touch.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 72 of file esp32_touch_v1.cpp.
|
protected |
Definition at line 14 of file esp32_touch_common.cpp.
|
protected |
Definition at line 31 of file esp32_touch_common.cpp.
|
inlineprotected |
Definition at line 158 of file esp32_touch.h.
|
inlinestaticprotected |
Definition at line 197 of file esp32_touch.h.
|
inlinestaticprotected |
Definition at line 182 of file esp32_touch.h.
|
inlineoverridevirtual |
Reimplemented from esphome::Component.
Definition at line 54 of file esp32_touch.h.
|
inlinestaticprotected |
Definition at line 212 of file esp32_touch.h.
|
inlineprotected |
Definition at line 127 of file esp32_touch.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 88 of file esp32_touch_v1.cpp.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 168 of file esp32_touch_v1.cpp.
|
protected |
Definition at line 94 of file esp32_touch_common.cpp.
|
protected |
Definition at line 118 of file esp32_touch_common.cpp.
|
protected |
Definition at line 379 of file esp32_touch_v2.cpp.
|
inline |
Definition at line 36 of file esp32_touch.h.
|
inline |
Definition at line 60 of file esp32_touch.h.
|
inline |
Definition at line 65 of file esp32_touch.h.
|
inline |
Definition at line 64 of file esp32_touch.h.
|
inline |
Definition at line 59 of file esp32_touch.h.
|
inline |
Definition at line 44 of file esp32_touch.h.
|
inline |
Definition at line 71 of file esp32_touch.h.
|
inline |
Definition at line 62 of file esp32_touch.h.
|
inline |
Definition at line 41 of file esp32_touch.h.
|
inline |
Definition at line 40 of file esp32_touch.h.
|
inline |
Definition at line 61 of file esp32_touch.h.
|
inline |
Definition at line 38 of file esp32_touch.h.
|
inline |
Definition at line 39 of file esp32_touch.h.
|
inline |
Definition at line 63 of file esp32_touch.h.
|
inline |
Definition at line 47 of file esp32_touch.h.
|
inline |
Definition at line 66 of file esp32_touch.h.
|
inline |
Definition at line 67 of file esp32_touch.h.
|
overridevirtual |
Reimplemented from esphome::Component.
Definition at line 21 of file esp32_touch_v1.cpp.
|
protected |
Definition at line 110 of file esp32_touch_common.cpp.
|
staticprotected |
Definition at line 182 of file esp32_touch_v1.cpp.
|
staticprotected |
|
protected |
Definition at line 14 of file esp32_touch_v2.cpp.
|
inlineprotected |
Definition at line 164 of file esp32_touch.h.
|
protected |
Definition at line 152 of file esp32_touch.h.
|
protected |
Definition at line 90 of file esp32_touch.h.
|
protected |
Definition at line 145 of file esp32_touch.h.
|
protected |
Definition at line 144 of file esp32_touch.h.
|
protected |
Definition at line 151 of file esp32_touch.h.
|
protected |
Definition at line 101 of file esp32_touch.h.
|
protected |
Definition at line 125 of file esp32_touch.h.
|
protected |
Definition at line 147 of file esp32_touch.h.
|
protected |
Definition at line 93 of file esp32_touch.h.
|
protected |
Definition at line 100 of file esp32_touch.h.
|
protected |
Definition at line 99 of file esp32_touch.h.
|
staticconstexprprotected |
Definition at line 105 of file esp32_touch.h.
|
protected |
Definition at line 146 of file esp32_touch.h.
|
protected |
Definition at line 95 of file esp32_touch.h.
|
protected |
Definition at line 94 of file esp32_touch.h.
|
protected |
Definition at line 91 of file esp32_touch.h.
|
protected |
Definition at line 92 of file esp32_touch.h.
|
protected |
Definition at line 98 of file esp32_touch.h.
|
protected |
Definition at line 148 of file esp32_touch.h.
|
protected |
Definition at line 113 of file esp32_touch.h.
|
protected |
Definition at line 102 of file esp32_touch.h.
|
protected |
Definition at line 155 of file esp32_touch.h.
|
protected |
Definition at line 156 of file esp32_touch.h.