Skip to main content

gptimer_get_captured_count

Function gptimer_get_captured_count 

Source
pub unsafe extern "C" fn gptimer_get_captured_count(
    timer: gptimer_handle_t,
    value: *mut u64,
) -> esp_err_t
Expand description

@brief Get GPTimer captured count value

@note Different from gptimer_get_raw_count, this function won’t trigger a software capture event. It just returns the last captured count value. It’s especially useful when the capture has already been triggered by an external event and you want to read the captured value. @note This function is allowed to run within ISR context @note If CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is enabled, this function will be placed in the IRAM by linker, makes it possible to execute even when the Flash Cache is disabled.

@param[in] timer Timer handle created by gptimer_new_timer @param[out] value Returned captured count value @return - ESP_OK: Get GPTimer captured count value successfully - ESP_ERR_INVALID_ARG: Get GPTimer captured count value failed because of invalid argument - ESP_FAIL: Get GPTimer captured count value failed because of other error