DocID018909 Rev 11
283/1731
RM0090
General-purpose I/Os (GPIO)
290
8.4 GPIO
registers
This section gives a detailed description of the GPIO registers.
For a summary of register bits, register address offsets and reset values, refer to
The GPIO registers can be accessed by byte (8 bits), half-words (16 bits) or words (32 bits).
8.4.1
GPIO port mode register (GPIOx_MODER) (x = A..I/J/K)
Address offset: 0x00
Reset values:
•
0xA800 0000 for port A
•
0x0000 0280 for port B
•
0x0000 0000 for other ports
8.4.2
GPIO port output type register (GPIOx_OTYPER)
(x = A..I/J/K)
Address offset: 0x04
Reset value: 0x0000 0000
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
MODER15[1:0]
MODER14[1:0]
MODER13[1:0]
MODER12[1:0]
MODER11[1:0]
MODER10[1:0]
MODER9[1:0]
MODER8[1:0]
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
MODER7[1:0]
MODER6[1:0]
MODER5[1:0]
MODER4[1:0]
MODER3[1:0]
MODER2[1:0]
MODER1[1:0]
MODER0[1:0]
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
Bits 2y:2y+1
MODERy[1:0]:
Port x configuration bits (y = 0..15)
These bits are written by software to configure the I/O direction mode.
00: Input (reset state)
01: General purpose output mode
10: Alternate function mode
11: Analog mode
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
Reserved
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
OT15
OT14
OT13
OT12
OT11
OT10
OT9
OT8
OT7
OT6
OT5
OT4
OT3
OT2
OT1
OT0
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
Bits 31:16 Reserved, must be kept at reset value.
Bits 15:0
OTy
: Port x configuration bits (y = 0..15)
These bits are written by software to configure the output type of the I/O port.
0: Output push-pull (reset state)
1: Output open-drain