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

Function ls2k_uart_control

bsp/loongson/ls2kdev/drivers/drv_uart.c:69–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 return RT_EOK;
68}
69static rt_err_t ls2k_uart_control(struct rt_serial_device *serial, int cmd, void *arg)
70{
71 struct rt_uart_ls2k *uart_dev = RT_NULL;
72 RT_ASSERT(serial != RT_NULL);
73 uart_dev = (struct rt_uart_ls2k *)serial->parent.user_data;
74 switch (cmd)
75 {
76 case RT_DEVICE_CTRL_CLR_INT: /* Disable RX IRQ */
77 rt_hw_interrupt_mask(uart_dev->IRQ);
78 break;
79 case RT_DEVICE_CTRL_SET_INT: /* Enable RX IRQ */
80 rt_hw_interrupt_umask(uart_dev->IRQ);
81 UART_IER(uart_dev->base) |= (IER_IRxE | IER_ILE);
82 break;
83 default:
84 break;
85 }
86 return RT_EOK;
87}
88static rt_bool_t uart_is_transmit_empty(struct rt_uart_ls2k *uart_dev)
89{
90 unsigned char status = UART_LSR(uart_dev->base);

Callers

nothing calls this directly

Calls 2

rt_hw_interrupt_maskFunction · 0.70
rt_hw_interrupt_umaskFunction · 0.70

Tested by

no test coverage detected