Function esp_idf_sys::esp_pm_lock_create
source · pub unsafe extern "C" fn esp_pm_lock_create(
lock_type: esp_pm_lock_type_t,
arg: c_int,
name: *const c_char,
out_handle: *mut esp_pm_lock_handle_t,
) -> esp_err_t
Expand description
@brief Initialize a lock handle for certain power management parameter
When lock is created, initially it is not taken. Call esp_pm_lock_acquire to take the lock.
This function must not be called from an ISR.
@param lock_type Power management constraint which the lock should control @param arg argument, value depends on lock_type, see esp_pm_lock_type_t @param name arbitrary string identifying the lock (e.g. “wifi” or “spi”). Used by the esp_pm_dump_locks function to list existing locks. May be set to NULL. If not set to NULL, must point to a string which is valid for the lifetime of the lock. @param[out] out_handle handle returned from this function. Use this handle when calling esp_pm_lock_delete, esp_pm_lock_acquire, esp_pm_lock_release. Must not be NULL. @return - ESP_OK on success - ESP_ERR_NO_MEM if the lock structure can not be allocated - ESP_ERR_INVALID_ARG if out_handle is NULL or type argument is not valid - ESP_ERR_NOT_SUPPORTED if CONFIG_PM_ENABLE is not enabled in sdkconfig