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

Function ls1c_uart_control

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

Source from the content-addressed store, hash-verified

42}
43
44static rt_err_t ls1c_uart_control(struct rt_serial_device *serial, int cmd, void *arg)
45{
46 struct rt_uart_ls1c *uart_dev = RT_NULL;
47
48 RT_ASSERT(serial != RT_NULL);
49 uart_dev = (struct rt_uart_ls1c *)serial->parent.user_data;
50
51 switch (cmd)
52 {
53 case RT_DEVICE_CTRL_CLR_INT: /* disable rx irq */
54 rt_hw_interrupt_mask(uart_dev->IRQ);
55 break;
56
57 case RT_DEVICE_CTRL_SET_INT: /* enable rx irq */
58 rt_hw_interrupt_umask(uart_dev->IRQ);
59 break;
60
61 default:
62 break;
63 }
64
65 return RT_EOK;
66
67}
68
69static int ls1c_uart_putc(struct rt_serial_device *serial, char c)
70{

Callers

nothing calls this directly

Calls 2

rt_hw_interrupt_maskFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50

Tested by

no test coverage detected