EasyManua.ls Logo

Espressif ESP32-S2 - Page 447

Espressif ESP32-S2
1695 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
TOUCH_BUTTON_EVT_MAX
API Reference - Touch Slider
Header File
components/touch_element/include/touch_element/touch_slider.h
Functions
esp_err_t touch_slider_install(const touch_slider_global_config_t *global_config)
Touch slider initialize.
This function initializes touch slider object and acts on all touch slider instances.
Return
ESP_OK: Successfully initialized touch slider
ESP_ERR_INVALID_STATE: Touch element library was not initialized
ESP_ERR_INVALID_ARG: slider_init is NULL
ESP_ERR_NO_MEM: Insufficient memory
Parameters
[in] global_config: Touch slider global initialization configuration
void touch_slider_uninstall(void)
Release resources allocated using touch_slider_install()
Return
ESP_OK: Successfully released resources
esp_err_t touch_slider_create(const touch_slider_config_t *slider_config, touch_slider_handle_t
*slider_handle)
Create a new touch slider instance.
Note The index of Channel array and sensitivity array must be one-one correspondence
Return
ESP_OK: Successfully create touch slider
ESP_ERR_INVALID_STATE: Touch slider driver was not initialized
ESP_ERR_INVALID_ARG: Invalid configuration struct or arguments is NULL
ESP_ERR_NO_MEM: Insufficient memory
Parameters
[in] slider_config: Slider configuration
[out] slider_handle: Slider handle
esp_err_t touch_slider_delete(touch_slider_handle_t slider_handle)
Release resources allocated using touch_slider_create.
Return
ESP_OK: Successfully released resources
ESP_ERR_INVALID_STATE: Touch slider driver was not initialized
ESP_ERR_INVALID_ARG: slider_handle is null
ESP_ERR_NOT_FOUND: Input handle is not a slider handle
Parameters
[in] slider_handle: Slider handle
esp_err_t touch_slider_subscribe_event(touch_slider_handle_t slider_handle, uint32_t
event_mask, void *arg)
Touch slider subscribes event.
This function uses event mask to subscribe to touch slider events, once one of the subscribed events occurs,
the event message could be retrieved by calling touch_element_message_receive() or input callback routine.
Note Touch slider only support three kind of event masks, they are TOUCH_ELEM_EVENT_ON_PRESS,
TOUCH_ELEM_EVENT_ON_RELEASE. You can use those event masks in any combination to
achieve the desired effect.
Return
Espressif Systems 436
Submit Document Feedback
Release v4.4

Table of Contents