中级会员
 
- 积分
- 248
- 金钱
- 248
- 注册时间
- 2015-7-24
- 在线时间
- 32 小时
|
5金钱
STM32F4xx的GPIOA.9和GPIOA.10口配制成复用串口功能时,怎么知道哪个IO口是输入输出的?
GPIO_InitStruct.GPIO_Pin= GPIO_Pin_9;
GPIO_InitStruct.GPIO_Mode=GPIO_Mode_AF;
GPIO_InitStruct.GPIO_Speed=GPIO_Fast_Speed;
GPIO_InitStruct.GPIO_OType=GPIO_OType_PP;
GPIO_InitStruct.GPIO_PuPd=GPIO_PuPd_UP;
GPIO_Init(GPIOA,&GPIO_InitStruct);
GPIO_InitStruct.GPIO_Pin= GPIO_Pin_10;
GPIO_InitStruct.GPIO_Mode=GPIO_Mode_AF;
GPIO_InitStruct.GPIO_PuPd=GPIO_PuPd_UP;
GPIO_Init(GPIOA,&GPIO_InitStruct);
GPIO_PinAFConfig(GPIOA,GPIO_PinSource9,GPIO_AF_USART1);
GPIO_PinAFConfig(GPIOA,GPIO_PinSource10,GPIO_AF_USART1);
|
|