Espressif ESP32-S2 Programming Manual page 413

Table of Contents

Advertisement

Chapter 2. API Reference
Parameters
• touch_num: touch pad index
esp_err_t
touch_pad_reset(void)
Reset the FSM of touch module.
Note Call this function after touch_pad_fsm_stop.
Return
• ESP_OK Success
touch_pad_t
touch_pad_get_current_meas_channel(void)
Get the current measure channel.
Note Should be called when touch sensor measurement is in cyclic scan mode.
Return
• touch channel number
uint32_t touch_pad_read_intr_status_mask(void)
Get the touch sensor interrupt status mask.
Return
• touch interrupt bit
esp_err_t touch_pad_intr_enable(touch_pad_intr_mask_t
Enable touch sensor interrupt by bitmask.
Note This API can be called in ISR handler.
Return
• ESP_OK on success
Parameters
• int_mask: Pad mask to enable interrupts
esp_err_t touch_pad_intr_disable(touch_pad_intr_mask_t
Disable touch sensor interrupt by bitmask.
Note This API can be called in ISR handler.
Return
• ESP_OK on success
Parameters
• int_mask: Pad mask to disable interrupts
esp_err_t touch_pad_intr_clear(touch_pad_intr_mask_t
Clear touch sensor interrupt by bitmask.
Return
• ESP_OK on success
Parameters
• int_mask: Pad mask to clear interrupts
esp_err_t touch_pad_isr_register(intr_handler_t
Register touch-pad ISR. The handler will be attached to the same CPU core that this function is running on.
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG Arguments error
• ESP_ERR_NO_MEM No memory
Parameters
• fn: Pointer to ISR handler
• arg: Parameter for ISR
• intr_mask: Enable touch sensor interrupt handler by bitmask.
esp_err_t
touch_pad_timeout_set(bool enable, uint32_t threshold)
Enable/disable the timeout check and set timeout threshold for all touch sensor channels measurements. If
enable: When the touch reading of a touch channel exceeds the measurement threshold, a timeout interrupt
will be generated. If disable: the FSM does not check if the channel under measurement times out.
Espressif Systems
int_mask)
fn, void *arg,
402
Submit Document Feedback
int_mask)
int_mask)
touch_pad_intr_mask_t
intr_mask)
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF