uart_poll_in

Function uart_poll_in 

Source
pub unsafe extern "C" fn uart_poll_in(
    dev: *const device,
    p_char: *mut u8,
) -> i32
Expand description

@brief Read a character from the device for input.

This routine checks if the receiver has valid data. When the receiver has valid data, it reads a character from the device, stores to the location pointed to by p_char, 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_char Pointer to character.

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