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

Function ls1b_uart_control

bsp/loongson/ls1bdev/drivers/drv_uart.c:45–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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