Function esp_idf_sys::ledc_set_fade_with_time

source ยท
pub unsafe extern "C" fn ledc_set_fade_with_time(
    speed_mode: ledc_mode_t,
    channel: ledc_channel_t,
    target_duty: u32,
    max_fade_time_ms: c_int,
) -> esp_err_t
Expand description

@brief Set LEDC fade function, with a limited time.

@note Call ledc_fade_func_install() once before calling this function. Call ledc_fade_start() after this to start fading. @note ledc_set_fade_with_step, ledc_set_fade_with_time and ledc_fade_start 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_fade_step_and_start @note For ESP32, hardware does not support any duty change while a fade operation is running in progress on that channel. Other duty operations will have to wait until the fade operation has finished.

@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 index (0 - LEDC_CHANNEL_MAX-1), select from ledc_channel_t @param target_duty Target duty of fading [0, (2**duty_resolution)] @param max_fade_time_ms The maximum time of the fading ( ms ).

@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_ERR_INVALID_STATE Channel not initialized - ESP_FAIL Fade function init error