添加USART1/2/3的管脚配置操作 (#6039)
This commit is contained in:
parent
4fa1beb812
commit
e622ef3aec
|
@ -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. */
|
||||
|
|
Loading…
Reference in New Issue