Register configuration of GPIO of STM32F4XX

The GPIO related configuration register
STM32F407ZGT6 has a total of 7 groups of IO ports, each group of IO ports has 16 IOs, a total of 16X7=112 IOs, plus 2 PH0 and PH1, a total of 114 IO ports.

  • A port mode register (GPIOx_MODER)
  • A port output type register (GPIOx_OTYPER)
  • A port output speed register (GPIOx_OSPEEDR)
  • A port pull-up and pull-down register (GPIOx_PUPDR)
  • One port input data register (GPIOx_IDR)
  • One port output data register (GPIOx_ODR)
  • A port set/reset register (GPIOx_BSRR)
  • A port configuration latch register (GPIOx_LCKR)
  • Two alternate function registers (low GPIOx_AFRL & GPIOx_AFRH)

Each IO port contains the following 10 registers. That is, 10 registers can control 16 IO ports of a group of GPIO in total.

1. Port mode register (GPIOx_MODER)

GPIO port mode register
Insert picture description here

2. Port output type register (GPIOx_OTYPER)

GPIO port output type register
Insert picture description here

3. Port output speed register (GPIOx_OSPEEDR)

GPIO port output speed register
Insert picture description here

4. Port pull-up and pull-down register (GPIOx_PUPDR)

GPIO port pull-up/pull-down register
Insert picture description here

5. Port input data register (GPIOx_IDR)

GPIO port input data register
Insert picture description here

6. Port output data register (GPIOx_ODR)

GPIO port output data register
Insert picture description here

7. Port set/reset register (GPIOx_BSRR)

GPIO port bit set/reset register
Insert picture description here

8. Port configuration latch register (GPIOx_LCKR)

GPIO port configuration lock register
Insert picture description here
Insert picture description here

9. GPIO multiplexing function low register (GPIOx_AFRL)

GPIO alternate function low register
Insert picture description here

10. GPIO multiplexing function high register (GPIOx_AFRH)

GPIO alternate function high register
Insert picture description here

Guess you like

Origin blog.csdn.net/mahoon411/article/details/110822217