GD32F403xx User Manual
135
Table 8-1. GPIO configuration table
Configuration mode
CTL[1:0]
SPDy: MD[1:0]
OCTL
Input
Analog
00
x 00
don’t care
Input floating
01
don’t care
Input pull-down
10
0
Input pull-up
10
1
General purpose
Output (GPIO)
Push-pull
00
x 00: Reserved
x 01: Speed up to 10MHz
x 10: Speed up to 2MHz
0 11: Speed up to 50MHz
1 11: Speed up to 168MHz
(1)
(SPDy required to be set to 0b1)
0 or 1
Open-drain
01
0 or 1
Alternate Function
Output (AFIO)
Push-pull
10
don’t care
Open-drain
11
don’t care
1. When the port output speed is more than 50 MHz, the user should enable the I/O
compensation cell. Refer to IO compensation control register (AFIO_CPSCTL).
Figure 8-1. Basic structure of a standard I/O port bit
shows the basic structure of an I/O
port bit.
Figure 8-1. Basic structure of a standard I/O port bit
Vss
Output
Control
Vdd
Output
Control
Register
Input
Status
Register
Write
Read/Write
Alternate Function Output
Read
Alternate Function Input
Analog ( Input / Output )
Input driver
Output driver
I/O pin
Schmitt
trigger
Bit Operate
Registers
ESD
protection
Vdd
Vss
8.3.1.
GPIO pin configuration
During or just after the reset period, the alternative functions are all inactive and the GPIO
ports are configured as the input floating mode without Pull-Up (PU)/Pull-Down (PD) resistors.
But the JTAG/Serial-Wired Debug pins are configured as input PU/PD mode after reset:
PA15: JTDI in PU mode.
PA14: JTCK / SWCLK in PD mode.