Chapter 2. API Reference
Return
• Interrupt status
Parameters
• group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1
void
timer_group_clr_intr_sta_in_isr(timer_group_t
Clear the masked interrupt status, just used in ISR.
Parameters
• group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1
• intr_mask: Masked interrupt.
bool
timer_group_get_auto_reload_in_isr(timer_group_t
Get auto reload enable status, just used in ISR.
Return
• True Auto reload enabled
• False Auto reload disabled
Parameters
• group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1
• timer_num: Timer index
esp_err_t timer_spinlock_take(timer_group_t
Take timer spinlock to enter critical protect.
Note Deprecated, the recommended way is to use ISR callbacks instead, see timer_group_example_main
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG Parameter error
Parameters
• group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1
esp_err_t timer_spinlock_give(timer_group_t
Give timer spinlock to exit critical protect.
Note Deprecated, the recommended way is to use ISR callbacks instead, see timer_group_example_main
Return
• ESP_OK Success
• ESP_ERR_INVALID_ARG Parameter error
Parameters
• group_num: Timer group number, 0 for TIMERG0 or 1 for TIMERG1
Macros
TIMER_BASE_CLK
Frequency of the clock on the input of the timer groups
Type Definitions
typedef bool (*timer_isr_t)(void *)
Interrupt handle callback function. User need to retrun a bool value in callback.
Return
• True Do task yield at the end of ISR
• False Not do task yield at the end of ISR
Note If you called FreeRTOS functions in callback, you need to return true or false based on the retrun value
of argument pxHigherPriorityTaskWoken. For example, xQueueSendFromISR is called in
callback, if the return value pxHigherPriorityTaskWoken of any FreeRTOS calls is pdTRUE,
return true; otherwise return false.
typedef
intr_handle_t
timer_isr_handle_t
Interrupt handle, used in order to free the isr after use. Aliases to an int handle for now.
Espressif Systems
timer_num)
group_num)
group_num)
246
Submit Document Feedback
group_num,
timer_intr_t
intr_mask)
group_num,
timer_idx_t
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers