GD32W51x User Manual
233
8.3.2.
External interrupt/event lines
All ports have external interrupt capability. To use external interrupt lines, the port must be
configured as input mode.
8.3.3.
Alternate functions (AF)
When the port is configured as AFIO (set CTLy bits to “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 selected registers (GPIOx_AFSELz
(z = 0,1)). The detail alternate function assignments for each port are in the device datasheet.
8.3.4.
Additional functions
Some pins have additional functions, which have priority over the configuration in the standard
GPIO registers. When for ADC or DAC 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.
8.3.5.
Input configuration
When GPIO pin is configured as Input:
The schmitt trigger input is enabled.
The weak pull-up and pull-down resistors could be chosen.
Every AHB clock cycle the data present on the I/O pin is got to the port input status
register.
The output buffer is disabled.
Figure 8-2. Input configuration
shows the input configuration.
Figure 8-2. Input configuration
Input
Status
Register
Read
Alternate Function Input
Input driver
Schmitt
trigger
Vss
Vdd
I/O pin
ESD
protection
8.3.6.
Output configuration
When GPIO pin is configured as output: