uart_poll_in_u16

Function uart_poll_in_u16 

Source
pub unsafe extern "C" fn uart_poll_in_u16(
    dev: *const device,
    p_u16: *mut u16,
) -> i32
Expand description

@brief Read a 16-bit datum from the device for input.

This routine checks if the receiver has valid data. When the receiver has valid data, it reads a 16-bit datum from the device, stores to the location pointed to by p_u16, and returns 0 to the calling thread. It returns -1, otherwise. This function is a non-blocking call.

@param dev UART device instance. @param p_u16 Pointer to 16-bit data.

@retval 0 If data arrived. @retval -1 If no data was available to read (i.e., the UART input buffer was empty). @retval -ENOTSUP If API is not enabled. @retval -ENOSYS If the function is not implemented. @retval -EBUSY If async reception was enabled using @ref uart_rx_enable