From the STM32F10xxx reference manual(RM0008), here is an example about USART1's pin remapping configuration:
By default, PA9 and PA10 is USART1's pin mapping, however, we are able to remap it to PB6 and PB7.
After remap the pins,first thing you need to do the is reconfigure the GPIO type for this pin:
{ GPIO_Mode_AIN = 0x0,
GPIO_Mode_IN_FLOATING = 0x04,
GPIO_Mode_IPD = 0x28,
GPIO_Mode_IPU = 0x48,
GPIO_Mode_Out_OD = 0x14,
GPIO_Mode_Out_PP = 0x10,
GPIO_Mode_AF_OD = 0x1C,
GPIO_Mode_AF_PP = 0x18
}GPIOMode_TypeDef;
Notes:
after setting the pin to Alternate funciton output, write to the corresponding output register wont work
but for alternate function input, you can still read the value from input data register.



No comments:
Post a Comment