EasyManuals Logo

Espressif ESP32-S2 User Manual

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
Page #409 background imageLoading...
Page #409 background image
Chapter 2. API Reference
Configuration Enabling the touch sensor functionality for a particular GPIO is done with
touch_pad_config().
Use the function touch_pad_set_fsm_mode() to select if touch pad measurement (operated by FSM)
should be started automatically by a hardware timer, or by software. If software mode is selected, use
touch_pad_sw_start() to start the FSM.
Touch State Measurements The following function come in handy to read raw measurements from the sensor:
touch_pad_read_raw_data()
It can also be used, for example, to evaluate a particular touch pad design by checking the range of sensor readings
when a pad is touched or released. This information can be then used to establish a touch threshold.
For the demonstration of how to read the touch pad data, check the application example peripher-
als/touch_sensor/touch_sensor_v2/touch_pad_read.
Optimization of Measurements A touch sensor has several configurable parameters to match the characteristics
of a particular touch pad design. For instance, to sense smaller capacity changes, it is possible to narrow down the
reference voltage range within which the touch pads are charged / discharged. The high and low reference voltages
are set using the function touch_pad_set_voltage().
Besides the ability to discern smaller capacity changes, a positive side effect is reduction of power consumption for
low power applications. A likely negative eect is an increase in measurement noise. If the dynamic range of obtained
readings is still satisfactory, then further reduction of power consumption might be done by reducing the measurement
time with touch_pad_set_meas_time().
The following list summarizes available measurement parameters and corresponding setfunctions:
Touch pad charge / discharge parameters:
voltage range: touch_pad_set_voltage()
speed (slope): touch_pad_set_cnt_mode()
Measurement time: touch_pad_set_meas_time()
Relationship between the voltage range (high / low reference voltages), speed (slope), and measurement time is shown
in the figure below.
Fig. 12: Touch pad - relationship between measurement parameters
The last chart Output represents the touch sensor reading, i.e., the count of pulses collected within the measurement
time.
Espressif Systems 398
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish