请问,如果像这样配置uart2
void EVB_Uart2Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
/* Enable the USART2 Pins Software Remapping */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
GPIO_PinRemapConfig(GPIO_Remap_USART2, ENABLE);
/* Configure USARTx_Tx as alternate function push-pull */
.....
GPIO_Init(GPIOD, &GPIO_InitStructure);
/* Configure USARTx_Rx as input floating */
.....
GPIO_Init(GPIOD, &GPIO_InitStructure);
USART_Init(USART2, &USART_InitStructure);
USART_Cmd(USART2, ENABLE);
}
那么同在GPIOD组的其他引脚是不是因为这一句代码
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
也被复用了,不能在同时做gpio用了?比如附件里的其他pd0,pd1,pd2。
还是说即使 使能GPIOD的afio,也还可以把相关的引脚配成gpio来用。
如果是remap之后呢?
|