www.geehy.com Page 87
Remapping
Each peripheral has multiple multiplexing functions, but only one multiplexing
function input can be selected for a pin, so the multiplexing function of the
peripheral can be mapped to other I/O pins, that is, the multiplexing function
signal can be reassigned to a pin address.
The multiplexing function and remapping address table of pins are shown in the
data manual.
I/O multiplexing configuration
When I/O port is connected to the peripheral multiplexing function, the following
debugging needs to be done:
After reset, the pin is configured with multiplexing function
I/O port is configured as input, output or analog input
The I/O port is connected to the defined AFx
Configure pin pull-up/pull-down and output speed
Configure I/O as multiplexing function in GPIOx_MODE
When the I/O port is configured with multiplexing function, its input and output
mode is as follows:
Open the output buffer
Output buffer is driven by peripheral
Activate schmitt trigger input
By configuring the pull-up/pull-down register GPIOx_PUPD, select
whether to use pull-up/pull-down resistors
The data on the I/O pin is sampled in each AHB clock cycle and stored
in the port input state register
Read the actual I/O state through the input data register GPIOx_IDATA
The multiplexing mode I/O structure is shown in the figure below:
Figure 21 I/O Structure in Multiplexing Mode
VDD
VSS
Push-pull,
open-drain,
disable
P-MOS
N-MOS
I/O pin
TTL Schmitt
trigger
Multiplexing function output
Multiplexing function input
V
DDIOx
V
SS
PULL
UP
PULL
DOWN
Output control
GPIO Locking Function
The locking mechanism of GPIO can protect the configuration of I/O port.
Write sequence (specific) to GPIOx_LOCK register so as to freeze the control