![GigaDevice Semiconductor GD32E23 Series User Manual Download Page 113](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794113.webp)
GD32E23x User Manual
113
6.
General-purpose and alternate-function I/Os (GPIO
and AFIO)
6.1.
Overview
There are up to 39 general purpose I/O pins, (GPIO), named PA0 ~ PA15 and PB0 ~ PB15,
PC13 ~ PC15, PF0 ~ PF1, PF6 ~ PF7 for the GD32E230xx device to implement logic
input/output functions. There are up to 37 general purpose I/O pins, (GPIO), named PA0 ~
PA15 and PB0 ~ PB8, PB10 ~ PB15, PC14 ~ PC15, PF0 ~ PF1, PF6 ~ PF7 for the
GD32E231xx device to implement logic input/output functions. Each GPIO port has related
control and configuration registers to satisfy the requirements of specific applications.
The GPIO ports are pin-shared with other alternative functions (AFs) to obtain maximum
flexibility on the package pins. The GPIO pins can be used as alternative functional pins by
configuring the corresponding registers such as the AF input or output pins.
Each of the GPIO pins can be configured by software as output (push-pull or open-drain),
input, peripheral alternate function or analog mode. Each GPIO pin can be configured as
pull-up, pull-down or floating. All GPIOs are high-current capable except for analog mode.
6.2.
Characteristics
Input/output direction control
Schmitt trigger input function enable control
Each pin weak pull-up/pull-down function
Output push-pull/open-drain enable control
Output set/reset control
Output drive speed selection
Analog input/output configuration
Alternate function input/output configuration
Port configuration lock
Single cycle toggle output capability
6.3.
Function overview
Each of the general-purpose I/O ports can be configured as GPIO inputs, GPIO outputs, AF
function or analog mode by GPIO 32-bit control register (GPIOx_CTL). AFIO input or output
direction is decided by AFIO function after AFIO enable. When the port is output (GPIO
output or AFIO output), it can be configured as push-pull or open drain mode by GPIO output
mode registers (GPIOx_OMODE). And the port max speed can be configured by GPIO
output speed registers (GPIOx_OSPD). Each port can be configured as floating (no pull-up