uart_fifo_read

Function uart_fifo_read 

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

@brief Read data from FIFO.

@details This function is expected to be called from UART interrupt handler (ISR), if uart_irq_rx_ready() returns true. Result of calling this function not from an ISR is undefined (hardware-dependent). It’s unspecified whether “RX ready” condition as returned by uart_irq_rx_ready() is level- or edge- triggered. That means that once uart_irq_rx_ready() is detected, uart_fifo_read() must be called until it reads all available data in the FIFO (i.e. until it returns less data than was requested).

@param dev UART device instance. @param rx_data Data container. @param size Container size.

@return Number of bytes read. @retval -ENOSYS If this function is not implemented. @retval -ENOTSUP If API is not enabled.