Function esp_idf_svc::hal::sys::mcpwm_new_generator

source ·
pub unsafe extern "C" fn mcpwm_new_generator(
    oper: *mut mcpwm_oper_t,
    config: *const mcpwm_generator_config_t,
    ret_gen: *mut *mut mcpwm_gen_t,
) -> i32
Expand description

@brief Allocate MCPWM generator from given operator

@param[in] oper MCPWM operator, allocated by mcpwm_new_operator() @param[in] config MCPWM generator configuration @param[out] ret_gen Returned MCPWM generator @return - ESP_OK: Create MCPWM generator successfully - ESP_ERR_INVALID_ARG: Create MCPWM generator failed because of invalid argument - ESP_ERR_NO_MEM: Create MCPWM generator failed because out of memory - ESP_ERR_NOT_FOUND: Create MCPWM generator failed because can’t find free resource - ESP_FAIL: Create MCPWM generator failed because of other error