Chapter 2. API Reference
Return
• ESP_OK: Successfully initialized
• ESP_ERR_INVALID_ARG: Invalid argument
• ESP_ERR_NO_MEM: Insufficient memory
• ESP_ERR_INVALID_STATE: Touch element is already initialized
• Others: Unknown touch driver layer or lower layer error
Parameters
• [in] global_config: Global initialization configuration structure
esp_err_t touch_element_start(void)
Touch element processing start.
This function starts the touch element processing system
Note This function must only be called after all the touch element instances finished creating
Return
• ESP_OK: Successfully started to process
• Others: Unknown touch driver layer or lower layer error
esp_err_t touch_element_stop(void)
Touch element processing stop.
This function stops the touch element processing system
Note This function must be called before changing the system (hardware, software) parameters
Return
• ESP_OK: Successfully stopped to process
• Others: Unknown touch driver layer or lower layer error
void touch_element_uninstall(void)
Release resources allocated using touch_element_install.
Return
• ESP_OK: Successfully released touch element object
• ESP_ERR_INVALID_STATE: Touch element object is not initialized
• Others: Unknown touch driver layer or lower layer error
esp_err_t touch_element_message_receive(touch_elem_message_t *element_message, uint32_t
ticks_to_wait)
Get current event message of touch element instance.
This function will receive the touch element message (handle, event type, etc…) from te_event_give(). It will
block until a touch element event or a timeout occurs.
Return
• ESP_OK: Successfully received touch element event
• ESP_ERR_INVALID_STATE: Touch element library is not initialized
• ESP_ERR_INVALID_ARG: element_message is null
• ESP_ERR_TIMEOUT: Timed out waiting for event
Parameters
• [out] element_message: Touch element event message structure
• [in] ticks_to_wait: Number of FreeRTOS ticks to block for waiting event
esp_err_t touch_element_waterproof_install(const touch_elem_waterproof_config_t
*waterproof_config)
Touch element waterproof initialization.
This function enables the hardware waterproof, then touch element system uses Shield-Sensor and Guard-
Sensor to mitigate the influence of water-drop and water-stream.
Note If the waterproof function is used, Shield-Sensor can not be disabled and it will use channel 14 as it’s
internal channel. Hence, the user can not use channel 14 for another propose. And the Guard-Sensor is
not necessary since it is optional.
Note Shield-Sensor: It always uses channel 14 as the shield channel, so user must connect the channel 14 and
Shield-Layer in PCB since it will generate a synchronous signal automatically
Espressif Systems 429
Submit Document Feedback
Release v4.4