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

Function uart_msg_init

bsp/phytium/libraries/drivers/drv_usart_msg.c:214–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212};
213
214static int uart_msg_init(struct drv_usart_msg *uart_msg_dev)
215{
216 struct serial_configure config = RT_SERIAL_CONFIG_DEFAULT;
217
218 config.bufsz = RT_SERIAL_RB_BUFSZ;
219 uart_msg_dev->serial.ops = &_uart_ops;
220 uart_msg_dev->serial.config = config;
221
222 uart_msg_dev->config.isr_priority = 0xd0;
223 uart_msg_dev->config.isr_event_mask = RTOS_UART_MSG_RX_ISR_MASK | RTOS_UART_MSG_TX_ISR_MASK;
224 uart_msg_dev->config.uart_baudrate = BAUD_RATE_115200;
225
226 recv_ringbuffer = rt_ringbuffer_create(RING_BUFFER_SIZE);
227
228 RT_ASSERT(recv_ringbuffer != RT_NULL);
229
230 rt_hw_serial_register(&uart_msg_dev->serial, uart_msg_dev->name,
231 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX,
232 uart_msg_dev);
233
234 return 0;
235}
236
237#ifdef RT_USING_UART0_MSG
238 static FUartMsg Ft_Uart0_Msg;

Callers 1

rt_hw_uart_initFunction · 0.85

Calls 2

rt_ringbuffer_createFunction · 0.85
rt_hw_serial_registerFunction · 0.50

Tested by

no test coverage detected