Chapter 2. API Reference
state, channel number) will be obtained in touch sensor interrupt service routine. When the specified channel event
occurs, and those hardware information will be passed to the esp-timer callback routine, esp-timer callback routine
will dispatch the touch sensor channel information to the touch elements(such as button, slider etc). Then runs the
specified algorithm to update touch element’s state or calculate its position, dispatch the result to user.
So using Touch Element library, user doesn’t need to care about the implementation of touch sensor peripheral,
Touch Element library will handle most of the hardware information and pass the more meaningful messages to user
event handler routine.
Workflow of Touch Element library is illustrated in the picture below.
Touch Element library
Interrupt message
queue
Timer routine
[Not supported by viewer]
Process channel state
Process channel state
[Not supported by viewer]
Process channel state
[Not supported by viewer]
......
Button
Slider
Matrix
Update channel state
Update channel state
Update channel state
Touch interrupt routine
Channel number
[Not supported by viewer]
[Not supported by viewer]
Event handler task
Event handler function
Or
Send event message
Invoke Callback
Or
Touch application handler
...
[Not supported by viewer]
Dispatch event
[Not supported by viewer]
<font style="font-size: 10px">touch_element_message_receive()</font>
[Not supported by viewer]
[Not supported by viewer]
Fig. 13: Touch Element architecture
The features in relation to the Touch Element library in ESP32-S2 are given in the table below.
Features ESP32S2
Touch Element waterproof ✓
✓
✓
Touch Element button ✓
✓
✓
Touch Element slider ✓
✓
✓
Touch Element matrix button ✓
✓
✓
Peripheral ESP32-S2 integrates one touch sensor peripheral with several physical channels.
• 14 physical capacitive touch channels
• Timer or software FSM trigger mode
• Up to 5 kinds of interrupt(Upper threshold and lower threshold interrupt, measure one channel finish and
measure all channels finish interrupt, measurement timeout interrupt)
Espressif Systems 419
Submit Document Feedback
Release v4.4