Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
88
/
631
GPIO and AFIO
Summary
GPIO (General purpose input/output) is general purpose I/O, and AFIO (Alternate-function input/output) is alternate
function I/O. The chip supports up to 52 GPIOs, which are divided into 4 groups (GPIOA/GPIOB/GPIOC/GPIOD).
GPIO ports share pins with other alternate peripherals, and users can configure them flexibly according to their needs.
Each GPIO pin can be independently configured as an output, input or alternate peripheral function port. Except for
the analog pins, other GPIO pins have high current capacity.
GPIO ports have the following characteristics:
Each GPIO port can be individually configured into multiple modes by software
Input floating
Input pull-up
Input pull-down
Analog function
Open-drain output and pull-up/pull-down can be configured
Push-pull output and pull-up/pull-down can be configured
Push-pull alternate function and pull-up/pull-down can be configured
Open-drain alternate function and pull-up/pull-down can be configured
Individual bit set or bit clear function
All IO supports external interrupt function
All IO supports low power mode wake-up, rising or falling edge configurable
16 EXTI can be used to wake up from STOP2 mode, and all I/O can be reused as EXTI
PA8/PA0/PC13 can be used to wake up in STANDBY mode, the maximum I/O filter time is 5us
Support software remapping I/O alternate function
Support GPIO lock mechanism, reset the lock state to clear
Each I/O port bit can be programmed arbitrarily, but the I/O port registers must be accessed as 32-bit words (16-bit
half-word or 8-bit byte access is not allowed). The figure below shows the basic structure of an I/O port.