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

Function uart2_init

bsp/loongson/ls1cdev/libraries/ls1c_uart.c:200–216  ·  view source on GitHub ↗

* 初始化串口2 */

Source from the content-addressed store, hash-verified

198 * 初始化串口2
199 */
200void uart2_init(void)
201{
202 unsigned int tx_gpio = 37;
203 unsigned int rx_gpio = 36;
204
205 // 设置复用
206 pin_set_remap(tx_gpio, PIN_REMAP_SECOND);
207 pin_set_remap(rx_gpio, PIN_REMAP_SECOND);
208
209 // 初始化相关寄存器
210 debug_uart_info.UARTx = LS1C_UART2;
211 debug_uart_info.baudrate = 115200;
212 debug_uart_info.rx_enable = FALSE; // 调试串口只需要打印(发送)功能,不需要接收功能
213 uart_init(&debug_uart_info);
214
215 return ;
216}
217
218
219/*

Callers

nothing calls this directly

Calls 2

pin_set_remapFunction · 0.70
uart_initFunction · 0.70

Tested by

no test coverage detected