Function esp_idf_svc::hal::sys::ledc_set_duty_and_update
source ยท pub unsafe extern "C" fn ledc_set_duty_and_update(
speed_mode: u32,
channel: u32,
duty: u32,
hpoint: u32,
) -> i32
Expand description
@brief A thread-safe API to set duty for LEDC channel and return when duty updated.
@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 (0 - LEDC_CHANNEL_MAX-1), select from ledc_channel_t @param duty Set the LEDC duty, the range of duty setting is [0, (2duty_resolution)] @param hpoint Set the LEDC hpoint value, the range is [0, (2duty_resolution)-1]
@return - ESP_OK Success - ESP_ERR_INVALID_STATE Channel not initialized - ESP_ERR_INVALID_ARG Parameter error - ESP_FAIL Fade function init error