Function esp_idf_svc::hal::sys::gptimer_enable

source ·
pub unsafe extern "C" fn gptimer_enable(timer: *mut gptimer_t) -> i32
Expand description

@brief Enable GPTimer

@note This function will transit the timer state from “init” to “enable”. @note This function will enable the interrupt service, if it’s lazy installed in gptimer_register_event_callbacks. @note This function will acquire a PM lock, if a specific source clock (e.g. APB) is selected in the gptimer_config_t, while CONFIG_PM_ENABLE is enabled. @note Enable a timer doesn’t mean to start it. See also gptimer_start for how to make the timer start counting.

@param[in] timer Timer handle created by gptimer_new_timer @return - ESP_OK: Enable GPTimer successfully - ESP_ERR_INVALID_ARG: Enable GPTimer failed because of invalid argument - ESP_ERR_INVALID_STATE: Enable GPTimer failed because the timer is already enabled - ESP_FAIL: Enable GPTimer failed because of other error