AT32F421
Series Reference Manual
2022.11.11
Page 84
Rev 2.02
6.2.7
IOMUX structure
Most of the pins supports output function mapping for multiple peripherals. It is possible to select the
peripheral input/output functions for each pin by using the IOMUX input/output checklist described in the
section of IOMUX input/output. The multiplexed function of pins is configured using the corresponding
GPIO multiplexed register low (GPIOx_MUXL) (for pin 0 ~ pin 7) or the GPIO multiplexed register high
(GPIOx_MUXH) (for pin 8 ~ pin 15). A single pin has up to 16 different IOMUX mapping configurations
for flexible selection.
It is only allowed to select one of the peripheral function for each pin by setting the GPIOx_MUXL or
GPIOx_MUXH register. Hence, it is not possible that a single pin is occupied by several peripherals at a
time.
When used as multiplexed function input, the I/O port should be configured as input modes (floating,
pull-up and pull-down), the same as those of general-purpose input functions.
To enable multiplexed function output, the port must be configured as multiplexed function output mode
and push-pull or open-drain by setting GPIOx_CFGR or GPIOx_OMODE register. In this case, the pin
is disconnected from GPIO controller, and controlled by IOMUX controller, instead.
To
achieve bidirectional multiplexed function, the port needs to be configured as multiplexed function
output modes (push-pull or open-drain), controlled by IOMUX controller.
Figure 6-2 IOMUX structure
IO
ESD
protect
SMT trigger
PU
PD
output data
output enable
input enable
input data
push/pull
strength control
analog input/output
AH
B
b
u
s
IO
M
U
X
co
n
tro
l
Single IO
Analog
module
Peripheral
Module
6.2.8
Multiplexed function input configuration
Mode
IOMC
PUPD
Multiplexed floating input
10
00
Multiplexed pull-down input
10
Multiplexed pull-up input
01
When I/O ports are configured as multiplexed function input:
Get I/O pin state by reading input data registers
Support floating input, pull-up or pull-down input configuration
Schmitt-trigger input is activated.
Pin output is disabled.