GD32W51x User Manual
235
Figure 8-4. Analog configuration
8.3.8.
Alternate function (AF) configuration
To suit for different device packages, the GPIO supports some alternate functions mapped to
some other pins by software.
When be configured as alternate function:
The output buffer is enabled in open-drain or push-pull configuration.
The output buffer is driven by the peripheral.
The schmitt trigger input is enabled.
The weak pull-up and pull-down resistors could be chosen.
The I/O pin data is stored into the port input status register every AHB clock.
A read access to the port input status register gets the I/O state.
A read access to the port output control register gets the last written value.
Figure 8-5. Alternate function configuration
shows the alternate function configuration.
Figure 8-5. Alternate function configuration
8.3.9.
GPIO locking function
The locking mechanism allows the IO configuration to be protected.
The protected registers are GPIOx_CTL, GPIOx_OMODE, GPIOx_OSPD, GPIOx_PUD and
Analog ( Input / Output )
I/O pin
ESD
protection
Vss
Output
Control
Vdd
Alternate Function Output
Alternate Function Input
Input driver
Output driver
I/O pin
Schmitt
trigger
ESD
protection
Vdd
Vss