Function esp_idf_sys::timer_isr_callback_add
source · pub unsafe extern "C" fn timer_isr_callback_add(
group_num: timer_group_t,
timer_num: timer_idx_t,
isr_handler: timer_isr_t,
arg: *mut c_void,
intr_alloc_flags: c_int,
) -> esp_err_t
Expand description
@brief Add ISR handle callback for the corresponding timer.
@param group_num Timer group number @param timer_num Timer index of timer group @param isr_handler Interrupt handler function, it is a callback function. @param arg Parameter for handler function @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info.
@note This ISR handler will be called from an ISR. This ISR handler do not need to handle interrupt status, and should be kept short. If you want to realize some specific applications or write the whole ISR, you can call timer_isr_register(…) to register ISR.
The callback should return a bool value to determine whether need to do YIELD at
the end of the ISR.
If the intr_alloc_flags value ESP_INTR_FLAG_IRAM is set,
the handler function must be declared with IRAM_ATTR attribute
and can only call functions in IRAM or ROM. It cannot call other timer APIs.
@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error