[][src]Function esp_idf_sys::ledc_set_duty

pub unsafe extern "C" fn ledc_set_duty(
    speed_mode: ledc_mode_t,
    channel: ledc_channel_t,
    duty: u32
) -> esp_err_t

@brief LEDC set duty This function do not change the hpoint value of this channel. if needed, please call ledc_set_duty_with_hpoint. only after calling ledc_update_duty will the duty update. @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 a fade operation is running in progress on that channel, the driver would not allow it to be stopped. Other duty operations will have to wait until the fade operation has finished. @param speed_mode Select the LEDC speed_mode, high-speed mode and low-speed mode @param channel LEDC channel (0-7), select from ledc_channel_t @param duty Set the LEDC duty, the range of duty setting is [0, (2**duty_resolution)]

@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error