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

Function ls1c_uart_configure

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

Source from the content-addressed store, hash-verified

22};
23
24static rt_err_t ls1c_uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
25{
26 struct rt_uart_ls1c *uart_dev = RT_NULL;
27 ls1c_uart_info_t uart_info = {0};
28
29 RT_ASSERT(serial != RT_NULL);
30 RT_ASSERT(cfg != RT_NULL);
31
32 uart_dev = (struct rt_uart_ls1c *)serial->parent.user_data;
33
34 // 初始化串口
35 uart_info.UARTx = uart_dev->UARTx;
36 uart_info.baudrate = cfg->baud_rate;
37 uart_info.rx_enable = TRUE;
38 uart_init(&uart_info);
39
40 return RT_EOK;
41
42}
43
44static rt_err_t ls1c_uart_control(struct rt_serial_device *serial, int cmd, void *arg)
45{

Callers

nothing calls this directly

Calls 1

uart_initFunction · 0.50

Tested by

no test coverage detected