| 22 | }; |
| 23 | |
| 24 | static 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 | |
| 44 | static rt_err_t ls1c_uart_control(struct rt_serial_device *serial, int cmd, void *arg) |
| 45 | { |
nothing calls this directly
no test coverage detected