* 初始化串口2 */
| 198 | * 初始化串口2 |
| 199 | */ |
| 200 | void 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 | /* |
nothing calls this directly
no test coverage detected