/** * \brief Read a single byte from the UART. * * Blocks until at least a byte is available. */ u8 a10_uart_rx_blocking(void *uart_base) { struct a10_uart *uart = uart_base; while (rx_fifo_empty(uart)) ; return read32(&uart->rbr); }
uint8_t data_ready() { uint8_t status = get_status(); if ( status & (1 << RX_DR) ) return 1; return !rx_fifo_empty(); }
/** * \brief Read a single byte from the UART. * * Blocks until at least a byte is available. */ static u8 a10_uart_rx_blocking(struct a10_uart *uart) { while (rx_fifo_empty(uart)); return read32(&uart->rbr); }