MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / uart_is_transmit_empty

Function uart_is_transmit_empty

bsp/loongson/ls1cdev/libraries/ls1c_uart.c:144–157  ·  view source on GitHub ↗

* 判断FIFO是否为空 * @uartx 串口号 * @ret TRUE or FALSE */

Source from the content-addressed store, hash-verified

142 * @ret TRUE or FALSE
143 */
144BOOL uart_is_transmit_empty(ls1c_uart_t uartx)
145{
146 void *uart_base = uart_get_base(uartx);
147 unsigned char status = reg_read_8(uart_base + LS1C_UART_LSR_OFFSET);
148
149 if (status & (LS1C_UART_LSR_TE | LS1C_UART_LSR_TFE))
150 {
151 return TRUE;
152 }
153 else
154 {
155 return FALSE;
156 }
157}
158
159
160/*

Callers 1

uart_putcFunction · 0.70

Calls 2

uart_get_baseFunction · 0.70
reg_read_8Function · 0.70

Tested by

no test coverage detected