Function esp_idf_svc::sys::twai_driver_install_v2
source · pub unsafe extern "C" fn twai_driver_install_v2(
g_config: *const twai_general_config_t,
t_config: *const twai_timing_config_t,
f_config: *const twai_filter_config_t,
ret_twai: *mut *mut twai_obj_t,
) -> i32
Expand description
@brief Install TWAI driver and return a handle
@note This is an advanced version of twai_driver_install
that can return a driver handle, so that it allows you to install multiple TWAI drivers.
Don’t forget to set the proper controller_id in the twai_general_config_t
Please refer to the documentation of twai_driver_install
for more details.
@param[in] g_config General configuration structure @param[in] t_config Timing configuration structure @param[in] f_config Filter configuration structure @param[out] ret_twai Pointer to a new created TWAI handle
@return - ESP_OK: Successfully installed TWAI driver - ESP_ERR_INVALID_ARG: Arguments are invalid, e.g. invalid clock source, invalid quanta resolution, invalid controller ID - ESP_ERR_NO_MEM: Insufficient memory - ESP_ERR_INVALID_STATE: Driver is already installed