GD32F20x User Manual
139
Figure 7-5. Alternate function configuration
Vss
Output
Control
Vdd/Vdd_FT
(1)
Port input
status
register
Alternate Function Output
Read
Alternate Function Input
Input driver
Output driver
I/O pin
Schmitt trigger
Vdd
Vss
1. V
dd_FT
dedicated for five-volt tolerant I/Os and is different from V
dd
7.3.8.
IO pin function selection
Each IO pin can implement many functions, each function selected by GPIO registers.
GPIO:
Each IO pin can be used for GPIO input function by configuring MDy bits to 0b00 in
GPIOx_CTL0/GPIOx_CTL1 registers. And set output function by configuring MDy bits to 0b01,
0b10, or 0b11 and configuring CTLy bits of corresponding port in GPIOx_CTL0/GPIOx_CTL1
register to 0b00 (for GPIO push-pull output) or 0b01 (for GPIO open-drain output).
Alternate function:
Each IO pin can be used for AF input function by configuring MDy bits to 0b00 in
GPIOx_CTL0/GPIOx_CTL1 registers. And set output function by configuring MDy bits to 0b01,
0b10, or 0b11 and configuring CTLy bits of corresponding port in GPIOx_CTL0/GPIOx_CTL1
register to 0b10 (for AF push-pull output) or 0b11 (for AF open-drain output).
7.3.9.
GPIO locking function
The locking mechanism allows the IO configuration to be protected.
The protected registers are GPIOx_CTL0, GPIOx_CTL1. It allows the I/O configuration to be
frozen by the 32-bit locking register (GPIOx_LOCK). When the special LOCK sequence has
been occurred on LKK bit in GPIOx_LOCK register and the LKy bit is set in GPIOx_LOCK
register, the corresponding port is locked and the corresponding port configuration cannot be
modified until the next reset. It should be recommended to be used in the configuration of
driving a power module.
Summary of Contents for GD32F20 Series
Page 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Page 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Page 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Page 385: ...GD32F20x User Manual 385 ...
Page 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...