Function esp_idf_sys::ledc_update_duty
source · pub unsafe extern "C" fn ledc_update_duty(
speed_mode: ledc_mode_t,
channel: ledc_channel_t,
) -> esp_err_t
Expand description
@brief LEDC update channel parameters
@note Call this function to activate the LEDC updated parameters.
After ledc_set_duty, we need to call this function to update the settings.
And the new LEDC parameters don’t take effect until the next PWM cycle.
@note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to
control one LEDC channel in different tasks at the same time.
A thread-safe version of API is ledc_set_duty_and_update
@note If CONFIG_LEDC_CTRL_FUNC_IN_IRAM
is enabled, this function will be placed in the IRAM by linker,
makes it possible to execute even when the Cache is disabled.
@note This function is allowed to run within ISR context.
@param speed_mode Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode. @param channel LEDC channel (0 - LEDC_CHANNEL_MAX-1), select from ledc_channel_t
@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error