Function esp_idf_svc::hal::sys::ledc_find_suitable_duty_resolution
source ยท pub unsafe extern "C" fn ledc_find_suitable_duty_resolution(
src_clk_freq: u32,
timer_freq: u32,
) -> u32
Expand description
@brief Helper function to find the maximum possible duty resolution in bits for ledc_timer_config()
@param src_clk_freq LEDC timer source clock frequency (Hz) (See doxygen comments of ledc_clk_cfg_t
or get from esp_clk_tree_src_get_freq_hz
)
@param timer_freq Desired LEDC timer frequency (Hz)
@return - 0 The timer frequency cannot be achieved - Others The largest duty resolution value to be set