General-purpose I/Os (GPIO) RM0401
140/771 RM0401 Rev 3
Figure 17. Selecting an alternate function
1. Configured in FS.
6.3.3 I/O port control registers
Each of the GPIOs has four 32-bit memory-mapped control registers (GPIOx_MODER,
GPIOx_OTYPER, GPIOx_OSPEEDR, GPIOx_PUPDR) to configure up to 16 I/Os.
The GPIOx_MODER register is used to select the I/O direction (input, output, AF, analog).
The GPIOx_OTYPER and GPIOx_OSPEEDR registers are used to select the output type
(push-pull or open-drain) and speed (the I/O speed pins are directly connected to the
corresponding GPIOx_OSPEEDR register bits whatever the I/O direction). The
GPIOx_PUPDR register is used to select the pull-up/pull-down whatever the I/O direction.
06Y9
)RUSLQVWRWKH*3,2[B$)5/>@UHJLVWHUVHOHFWVWKHGHGLFDWHGDOWHUQDWHIXQFWLRQ
$)V\VWHP
$)7,0/37,0
$)7,0
$)7,0
$),&
$)63,
$)63,
$)86$57
$)86$57
$),&
$)
$)
$)
$)
$)
$)(9(17287
3LQ[[
$)5/>@
)RUSLQVWRWKH*3,2[B$)5+>@UHJLVWHUVHOHFWVWKHGHGLFDWHGDOWHUQDWHIXQFWLRQ
3LQ[[
$)5+>@
$)V\VWHP
$)7,0/37,0
$)7,0
$)7,0
$),&
$)63,
$)63,
$)86$57
$)86$57
$),&
$)
$)
$)
$)
$)
$)(9(17287