Skip to main content

uart_callback_set

Function uart_callback_set 

Source
pub unsafe extern "C" fn uart_callback_set(
    dev: *const device,
    callback: uart_callback_t,
    user_data: *mut c_void,
) -> c_int
Expand description

@brief Set event handler function.

Since it is mandatory to set callback to use other asynchronous functions, it can be used to detect if the device supports asynchronous API. Remaining API does not have that detection.

@param dev UART device instance. @param callback Event handler. @param user_data Data to pass to event handler function.

@retval 0 on success. @retval -ENOSYS Not supported by the device. @retval -ENOTSUP API not enabled.