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

Function ls1c_uart_getc

bsp/loongson/ls1cdev/drivers/drv_uart.c:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static int ls1c_uart_getc(struct rt_serial_device *serial)
82{
83 struct rt_uart_ls1c *uart_dev = RT_NULL;
84
85 RT_ASSERT(serial != RT_NULL);
86
87 uart_dev = (struct rt_uart_ls1c *)serial->parent.user_data;
88 void *uart_base = uart_get_base(uart_dev->UARTx);
89
90 if (LSR_RXRDY & reg_read_8(uart_base + LS1C_UART_LSR_OFFSET))
91 {
92 return reg_read_8(uart_base + LS1C_UART_DAT_OFFSET);
93 }
94
95 return -1;
96}
97
98/* UART interrupt handler */
99static void uart_irq_handler(int vector, void *param)

Callers

nothing calls this directly

Calls 2

uart_get_baseFunction · 0.50
reg_read_8Function · 0.50

Tested by

no test coverage detected