Contents
10
General-purpose I/Os (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
10.1
GPIO introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
10.2
GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
10.3
GPIO functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
10.3.1
10.3.2
10.3.3
10.3.4
10.3.5
10.3.6
10.3.7
10.3.8
10.3.9
10.3.10 Output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
10.3.11 Alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
10.3.12 Analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
10.3.13 Using the LSE oscillator pins as GPIOs . . . . . . . . . . . . . . . . . . . . . . . 408
10.3.14 Using the GPIO pins in the RTC supply domain . . . . . . . . . . . . . . . . . 408
10.3.15 Using PH3 as GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
10.4
GPIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
10.4.1
10.4.2
10.4.3
10.4.4
10.4.5
10.4.6
10.4.7
10.4.8
10.4.9
10.4.10 GPIOx alternate function high register (GPIOx_AFRH) (x = A to B) . . 414
10.4.11 GPIOx bit reset register (GPIOx_BRR) (x = A to B) . . . . . . . . . . . . . . . 415
10.4.12 GPIOC mode register (GPIOC_MODER) . . . . . . . . . . . . . . . . . . . . . . 415
10.4.13 GPIOC output type register (GPIOC_OTYPER) . . . . . . . . . . . . . . . . . 416
10.4.14 GPIOC output speed register (GPIOC_OSPEEDR) . . . . . . . . . . . . . . 416
10.4.15 GPIOC pull-up/pull-down register (GPIOC_PUPDR) . . . . . . . . . . . . . 417
10.4.16 GPIOC input data register (GPIOC_IDR) . . . . . . . . . . . . . . . . . . . . . . 418
14/1450
General purpose I/O (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
I/O pin alternate function multiplexer and mapping . . . . . . . . . . . . . . . 403
I/O port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
I/O port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
I/O data bitwise handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
GPIO locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
I/O alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
External interrupt/wake-up lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
GPIOx mode register (GPIOx_MODER) (x = A to B) . . . . . . . . . . . . . . 409
GPIOx output type register (GPIOx_OTYPER) (x = A to B) . . . . . . . . . 410
GPIOx output speed register (GPIOx_OSPEEDR) (x = A to B) . . . . . . 410
GPIOx pull-up/pull-down register (GPIOx_PUPDR) (x = A to B) . . . . . 411
GPIOx input data register (GPIOx_IDR) (x = A to B) . . . . . . . . . . . . . . 411
GPIOx output data register (GPIOx_ODR) (x = A to B) . . . . . . . . . . . . 412
GPIOx bit set/reset register (GPIOx_BSRR) (x = A to B) . . . . . . . . . . . 412
GPIOx configuration lock register (GPIOx_LCKR) (x = A to B) . . . . . . 413
GPIOx alternate function low register (GPIOx_AFRL) (x = A to B) . . . 414
RM0453 Rev 5
RM0453
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?