![ARTERY AT32F421 GPIO User Manual Download Page 10](http://html1.mh-extra.com/html/artery/at32f421-gpio/at32f421-gpio_user-manual_2977597010.webp)
AT32F421 GPIO user guide
2020.07.30
10
Rev.1.0.0
AFIO
I/O alternate function input/output
Most peripherals share the same GPIO pin (For example, PA0 can be used as TMR1_ETR /
USART2_CTS /I2C2_SCL / COMP_OUT)
A GPIO pin is connected to only one peripheral at any time.
Some peripheral functions can also be remapped to other pins so as to get more peripherals
that can be used at the same time
Selecting one of the active alternate functions on each port line is determined by GPIOx_AFRL or
GPIOx_AFRH alternate function register. The user can use these two registers to connect alternate
function module to other pins according to the application requirements.
Table 5. Configure port A alternate function by GPIOA_AFR register
Pin
name
AF0
AF1
AF2
AF3
AF4
AF5
AF6
AF7
PA0
-
USART2_CTS
-
-
I2C2_SCL
TMR1_ETR
-
COMP_OUT
PA1
EVENTOUT
USART2_RTS
-
-
I2C2_SDA
TMR15_CH1N
-
-
PA2
TMR15_CH1
USART2_TX
-
-
-
-
-
-
PA3
TMR15_CH2
USART2_RX
-
-
-
I2S2_MCK
-
-
PA4
SPI1_NSS/
I2S1_WS
USART2_CK
-
-
TMR14_CH1
-
-
-
PA5
SPI1_SCK/
I2S1_CK
-
-
-
-
-
-
-
PA6
SPI1_MISO/
I2S1_MCK
TMR3_CH1
TMR1_BKIN
I2S2_MCK
-
TMR16_CH1
EVENTOUT
COMP_OUT
PA7
SPI1_MOSI/
I2S1_SD
TMR3_CH2
TMR1_CH1N
-
TMR14_CH1
TMR17_CH1
EVENTOUT
-
PA8
CLKOUT
USART1_CK
TMR1_CH1
EVENTOUT
USART2_TX
-
-
I2C2_SCL
PA9
TMR15_BKIN
USART1_TX
TMR1_CH2
-
I2C1_SCL
CLKOUT
-
I2C2_SMBA
PA10
TMR17_BKIN
USART1_RX
TMR1_CH3
-
I2C1_SDA
-
-
-
PA11
EVENTOUT
USART1_CTS
TMR1_CH4
-
I2C1_SMBA
I2C2_SCL
-
COMP_OUT
PA12
EVENTOUT
USART1_RTS
TMR1_ETR
-
-
I2C2_SDA
-
-
PA13
SWDIO
IR_OUT
-
-
-
-
SPI2_MISO/
I2S2_MCK
-
PA14
SWCLK
USART2_TX
-
-
-
-
SPI2_MOSI/
I2S2_SD
-
PA15
SPI1_NSS/
I2S1_WS
USART2_RX
-
EVENTOUT
-
-
SPI2_NSS/
I2S2_WS
-