Skip to main content

ledc_timer_set

Function ledc_timer_set 

Source
pub unsafe extern "C" fn ledc_timer_set(
    speed_mode: ledc_mode_t,
    timer_sel: ledc_timer_t,
    clock_divider: u32,
    duty_resolution: u32,
    clk_src: ledc_clk_src_t,
) -> esp_err_t
Expand description

@brief Configure LEDC timer settings

This function does not take care of whether the chosen clock source is enabled or not, also does not handle the clock source to meet channel sleep mode choice.

If the chosen clock source is a new clock source to the LEDC timer, please use ledc_timer_config; If the clock source is kept to be the same, but frequency needs to be updated, please use ledc_set_freq.

@param speed_mode Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode. @param timer_sel Timer index (0-3), there are 4 timers in LEDC module @param clock_divider Timer clock divide value, the timer clock is divided from the selected clock source @param duty_resolution Resolution of duty setting in number of bits. The range is [1, SOC_LEDC_TIMER_BIT_WIDTH] @param clk_src Select LEDC source clock.

@return - (-1) Parameter error - Other Current LEDC duty