![GigaDevice Semiconductor GD32E23 Series User Manual Download Page 115](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794115.webp)
GD32E23x User Manual
115
ports are configured as the input floating mode that input disabled without
pull-up(PU)/pull-down(PD) resistors. But the Serial-Wired Debug pins are configured as AF
PU/PD mode after reset:
PA14: SWCLK in AF pull-down mode
PA13: SWDIO in AF pull-up mode
The GPIO pins can be configured as inputs or outputs. When the GPIO pins are configured
as input pins, all GPIO pins have an internal weak pull-up and weak pull-down which can be
chosen. When the GPIO pins are configured as input pins, the data on the external pads can
be captured at every AHB clock cycle to the port input status register (GPIOx_ISTAT).
When the GPIO pins are configured as output pins, the user can configure the speed of the
ports and chooses the output driver mode: push-pull or open-drain mode. The value of the
port output control register (GPIOx_OCTL) is output on the I/O pin.
There is no need to read-then-write when programming the GPIOx_OCTL at the bit level, the
user can modify only one bit or several bits in a single atomic AHB write access by
programming ‘1’ to the bit operate register (GPIOx_BOP, or for clearing only GPIOx_BC, or
for toggle only GPIOx_TG). The other bits will not be affected.
6.3.2.
Alternate functions (AF)
When the port is configured as AFIO (set CTLy bits t
o “0b10”, which is in GPIOx_CTL
registers), the port is used as peripheral alternate functions. Each port has sixteen alternate
functions
can
be
configured
by
GPIO
alternate
functions
select
registers
(GPIOx_AFSELy(y=0,1)). The detail alternate function assignments for each port are
described in the device datasheet.
6.3.3.
Additional functions
Some pins have additional functions, which have priority over the configuration in the
standard GPIO registers. When for ADC additional functions, the port must be configured as
analog mode. When for RTC, WKUPx and oscillators additional functions, the port type is set
automatically
by related RTC, PMU and RCU registers. These ports can be used as normal
GPIO when the additional functions disabled.
6.3.4.
Input configuration
When GPIO pin is configured as input:
The schmitt trigger input is activated.
The weak pull-up and pull-down resistors could be chosen.
Every AHB clock cycle the data present on the I/O pad is got to the port input status
register.
Disable the output buffer.