diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/board_config.c b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/board_config.c index 50cb97e85f..4870eedd43 100644 --- a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/board_config.c +++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/board_config.c @@ -23,6 +23,27 @@ rt_err_t rt_hw_board_uart_init(CM_USART_TypeDef *USARTx) switch ((rt_uint32_t)USARTx) { +#if defined(BSP_USING_UART1) + case (rt_uint32_t)CM_USART1: + /* Configure USART RX/TX pin. */ + GPIO_SetFunc(USART1_RX_PORT, USART1_RX_PIN, GPIO_FUNC_33); + GPIO_SetFunc(USART1_TX_PORT, USART1_TX_PIN, GPIO_FUNC_32); + break; +#endif +#if defined(BSP_USING_UART2) + case (rt_uint32_t)CM_USART2: + /* Configure USART RX/TX pin. */ + GPIO_SetFunc(USART2_RX_PORT, USART2_RX_PIN, GPIO_FUNC_37); + GPIO_SetFunc(USART2_TX_PORT, USART2_TX_PIN, GPIO_FUNC_36); + break; +#endif +#if defined(BSP_USING_UART3) + case (rt_uint32_t)CM_USART3: + /* Configure USART RX/TX pin. */ + GPIO_SetFunc(USART3_RX_PORT, USART3_RX_PIN, GPIO_FUNC_33); + GPIO_SetFunc(USART3_TX_PORT, USART3_TX_PIN, GPIO_FUNC_32); + break; +#endif #if defined(BSP_USING_UART4) case (rt_uint32_t)CM_USART4: /* Configure USART RX/TX pin. */