General-purpose I/Os (GPIO)
RM0365
157/1080
DocID025202 Rev 7
10.3.1 General-purpose
I/O
(GPIO)
During and just after reset, the alternate functions are not active and most of the I/O ports
are configured in input floating mode.
The debug pins are in AF pull-up/pull-down after reset:
When the pin is configured as output, the value written to the output data register
(GPIOx_ODR) is output on the I/O pin. It is possible to use the output driver in push-pull
mode or open-drain mode (only the low level is driven, high level is HI-Z).
The input data register (GPIOx_IDR) captures the data present on the I/O pin at every AHB
clock cycle.
Table 30. Port bit configuration table
(1)
1. GP = general-purpose, PP = push-pull, PU = pull-up, PD = pull-down, OD = open-drain, AF = alternate
function.
MODER(i)
[1:0]
OTYPER(i)
OSPEEDR(i)
[1:0]
PUPDR(i)
[1:0]
I/O configuration
01
0
SPEED
[1:0]
0
0
GP output
PP
0
0
1
GP output
PP + PU
0
1
0
GP output
PP + PD
0
1
1
Reserved
1
0
0
GP output
OD
1
0
1
GP output
OD + PU
1
1
0
GP output
OD + PD
1
1
1
Reserved (GP output OD)
10
0
SPEED
[1:0]
0
0
AF
PP
0
0
1
AF
PP + PU
0
1
0
AF
PP + PD
0
1
1
Reserved
1
0
0
AF
OD
1
0
1
AF
OD + PU
1
1
0
AF
OD + PD
1
1
1
Reserved
00
x
x
x
0
0
Input
Floating
x
x
x
0
1
Input
PU
x
x
x
1
0
Input
PD
x
x
x
1
1
Reserved (input floating)
11
x
x
x
0
0
Input/output
Analog
x
x
x
0
1
Reserved
x
x
x
1
0
x
x
x
1
1