Function esp_idf_svc::sys::mcpwm_comparator_set_compare_value
source · pub unsafe extern "C" fn mcpwm_comparator_set_compare_value(
cmpr: *mut mcpwm_cmpr_t,
cmp_ticks: u32,
) -> i32
Expand description
@brief Set MCPWM comparator’s compare value
@param[in] cmpr MCPWM comparator handle, allocated by mcpwm_new_comparator()
@param[in] cmp_ticks The new compare value
@return
- ESP_OK: Set MCPWM compare value successfully
- ESP_ERR_INVALID_ARG: Set MCPWM compare value failed because of invalid argument (e.g. the cmp_ticks is out of range)
- ESP_ERR_INVALID_STATE: Set MCPWM compare value failed because the operator doesn’t have a timer connected
- ESP_FAIL: Set MCPWM compare value failed because of other error