EasyManua.ls Logo

Espressif ESP32-S2 - Page 439

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
(continued from previous page)
touch_xxxx_set_callback(element_handle, element_handler); //Register an event
,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
doesnt need the guard sensor, TOUCH_WATERPROOF_GUARD_NOUSE has to be passed to
touch_element_waterproof_install() by the configuration struct.
2. To associate the touch element with the guard sensor, pass the touch elements handle to the Touch Element
waterproofs 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(); //Initialize instance (button, slider,
,etc)
touch_xxxx_create(&element_handle); //Create a new Touch element
...
touch_element_waterproof_install(); //Initialize Touch Element
,waterproof
touch_element_waterproof_add(element_handle); //Let a element associates
,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_elem_global_config_t *global_config)
Touch element processing initialization.
Note To reinitialize the touch element object, call touch_element_uninstall() first
Espressif Systems 428
Submit Document Feedback
Release v4.4

Table of Contents