Chapter 2. API Reference
touch_xxxx_set_callback(element_handle, element_handler);
handler function
→
...
}
/* --------------------------------------------------------------------------------
------------------------------ */
→
Waterproof Usage
1. To initialize Touch Element waterproof, the waterproof shield sensor is always-on after Touch El-
ement waterproof is initialized, however the waterproof guard sensor is optional, hence if user
doesn't need the guard sensor, TOUCH_WATERPROOF_GUARD_NOUSE has to be passed to
touch_element_waterproof_install()
2. To associate the touch element with the guard sensor, pass the touch element's handle to the Touch Element
waterproof's masked list by calling touch_element_waterproof_add(). By associating a touch
element with the Guard sensor, the touch element will be disabled when the guard sensor is triggered by a
stream of water so as to protect the touch element.
The Touch Element Waterproof example is available in peripherals/touch_element/touch_element_waterproof direc-
tory.
In code, the waterproof configuration may look like as follows:
void
app_main()
{
...
touch_xxxx_install();
etc)
→
touch_xxxx_create(&element_handle);
...
touch_element_waterproof_install();
waterproof
→
touch_element_waterproof_add(element_handle);
with guard sensor
→
...
}
Application Example
All the Touch Element library examples could be found in the peripherals/touch_element directory of ESP-IDF ex-
amples.
API Reference - Touch Element core
Header File
•
components/touch_element/include/touch_element/touch_element.h
Functions
esp_err_t
touch_element_install(const
Touch element processing initialization.
Note To reinitialize the touch element object, call touch_element_uninstall() first
Espressif Systems
by the configuration struct.
//Initialize instance (button,
//Create a new Touch element
touch_elem_global_config_t
428
Submit Document Feedback
(continued from previous page)
//Register an
//Initialize Touch
//Let a element
associates␣
*global_config)
event␣
slider,␣
Element␣
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?