135
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
GPIO and AFIO
Summary
GPIO is general purpose input/output, and AFIO is alternate function input/output. Up to 97 GPIO are supported on
the chip, which are divided into 7 groups (GPIOA/GPIOB/GPIOC/GPIOD/GPIOE/GPIOF/GPIOG ) with 16 ports
in each group (10 in group F and 7 in group G). GPIO port and other alternate peripherals share pins, which can be
configured by users according to requirements. Each GPIO pin can be independently configured as an output, input
or alternate peripheral function port. Except for the analog function pin, all other GPIO pins have the ability to pass
large current.
GPIO ports can be configured in the following modes by software:
■ Input floating
■ Input pull-up
■ Input pull-down
■ Analog function
■ Open drain output
■ Push-pull output
■ Push-pull alternate function
■ Open-drain alternate function
Each I/O port bit can be programmed arbitrarily, but the I/O port register must be accessed as a 32-bit word (16-bit
half word or 8-bit byte access is not allowed). The figure below shows the basic structure of an I/O port.