Chapter 2. API Reference
Return
• ESP_OK: Configured correctly.
• ESP_ERR_INVALID_ARG: Touch channel number error.
Parameters
• touch_num: Touch pad index. In this version, pass the parameter TOUCH_PAD_MAX.
• count: The cumulative times of measurements for proximity pad. Range: 0 ~ 255.
esp_err_t touch_pad_proximity_get_data(touch_pad_t
Get the accumulated measurement of the proximity sensor. The proximity sensor measurement is the accu-
mulation of touch channel measurements.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG Touch num is not proximity
Parameters
• touch_num: touch pad index
• measure_out: If the accumulation process does not end, the measure_out is the process
value.
esp_err_t touch_pad_sleep_channel_get_info(touch_pad_sleep_channel_t
Get parameter of touch sensor sleep channel. The touch sensor can works in sleep mode to wake up sleep.
Note After the sleep channel is configured, Please use special functions for sleep channel. e.g. The user should
uses touch_pad_sleep_channel_read_data instead of touch_pad_read_raw_data to
obtain the sleep channel reading.
Return
• ESP_OK Success
Parameters
• slp_config: touch sleep pad config.
esp_err_t touch_pad_sleep_channel_enable(touch_pad_t
Enable/Disable sleep channel function for touch sensor. The touch sensor can works in sleep mode to wake up
sleep.
Note ESP32S2 only support one sleep channel.
Note After the sleep channel is configured, Please use special functions for sleep channel. e.g. The user should
uses touch_pad_sleep_channel_read_data instead of touch_pad_read_raw_data to
obtain the sleep channel reading.
Return
• ESP_OK Success
Parameters
• pad_num: Set touch channel number for sleep pad. Only one touch sensor channel is supported in
deep sleep mode.
• enable: true: enable sleep pad for touch sensor; false: disable sleep pad for touch sensor;
esp_err_t touch_pad_sleep_channel_enable_proximity(touch_pad_t
Enable/Disable proximity function for sleep channel. The touch sensor can works in sleep mode to wake up
sleep.
Note ESP32S2 only support one sleep channel.
Return
• ESP_OK Success
Parameters
• pad_num: Set touch channel number for sleep pad. Only one touch sensor channel is supported in
deep sleep mode.
• enable: true: enable proximity for sleep channel; false: disable proximity for sleep channel;
esp_err_t touch_pad_sleep_set_threshold(touch_pad_t
Set the trigger threshold of touch sensor in deep sleep. The threshold determines the sensitivity of the touch
sensor.
Note In general, the touch threshold during sleep can use the threshold parameter parameters before sleep.
Return
Espressif Systems
406
Submit Document Feedback
touch_num, uint32_t *measure_out)
*slp_config)
pad_num, bool enable)
pad_num, bool enable)
pad_num, uint32_t touch_thres)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?