Espressif ESP32-S2 Programming Manual page 854

Table of Contents

Advertisement

Chapter 2. API Reference
Parameters
• [in] event_base: the base of the event with which to unregister the handler
• [in] event_id: the id of the event with which to unregister the handler
• [in] instance: the instance object of the registration to be unregistered
esp_err_t esp_event_post(esp_event_base_t
Posts an event to the system default event loop. The event loop library keeps a copy of event_data and manages
the copy's lifetime automatically (allocation + deletion); this ensures that the data the handler recieves is
always valid.
Return
• ESP_OK: Success
• ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired, queue full when posting
from ISR
• ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
• Others: Fail
Parameters
• [in] event_base: the event base that identifies the event
• [in] event_id: the event id that identifies the event
• [in] event_data: the data, specific to the event occurence, that gets passed to the handler
• [in] event_data_size: the size of the event data
• [in] ticks_to_wait: number of ticks to block on a full event queue
esp_err_t esp_event_post_to(esp_event_loop_handle_t
Posts an event to the specified event loop. The event loop library keeps a copy of event_data and manages the
copy's lifetime automatically (allocation + deletion); this ensures that the data the handler recieves is always
valid.
This function behaves in the same manner as esp_event_post_to, except the additional specification of the event
loop to post the event to.
Return
• ESP_OK: Success
• ESP_ERR_TIMEOUT: Time to wait for event queue to unblock expired, queue full when posting
from ISR
• ESP_ERR_INVALID_ARG: Invalid combination of event base and event id
• Others: Fail
Parameters
• [in] event_loop: the event loop to post to, must not be NULL
• [in] event_base: the event base that identifies the event
• [in] event_id: the event id that identifies the event
• [in] event_data: the data, specific to the event occurence, that gets passed to the handler
• [in] event_data_size: the size of the event data
• [in] ticks_to_wait: number of ticks to block on a full event queue
esp_err_t esp_event_isr_post(esp_event_base_t
Special variant of esp_event_post for posting events from interrupt handlers.
Note this function is only available when CONFIG_ESP_EVENT_POST_FROM_ISR is enabled
Note when this function is called from an interrupt handler placed in IRAM, this function should be placed in
IRAM as well by enabling CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR
Return
• ESP_OK: Success
• ESP_FAIL: Event queue for the default event loop full
• ESP_ERR_INVALID_ARG: Invalid combination of event base and event id, data size of more than
4 bytes
• Others: Fail
Parameters
Espressif Systems
event_base, int32_t event_id, void *event_data, size_t
event_data_size, TickType_t ticks_to_wait)
int32_t event_id, void *event_data, size_t event_data_size, TickType_t
ticks_to_wait)
event_base, int32_t event_id, void *event_data, size_t
event_data_size, BaseType_t *task_unblocked)
843
Submit Document Feedback
event_loop,
esp_event_base_t
event_base,
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?

Table of Contents

Save PDF