
CH32V003
Reference Manual
V1.3
53
7.2.7 Output configuration
Figure 7-3 GPIO module output configuration structure block diagram
When the I/O port is configured to output mode, the pair of MOS in the output driver can be configured to
push-pull or open-drain mode as needed, without using the multiplexing function. The pull-up and pull-down
resistors of the input driver are disabled, the TTL Schmitt trigger is activated, and the levels appearing on the
I/O pins will be sampled into the input data registers at each APB2 clock, so reading the input data registers
will give the I/O status, and in push-pull output mode, access to the output data registers will give the last
written value.
7.2.8 Multiplexing function configuration
Figure 7-4 The structure of GPIO module when it is multiplexed by other peripherals
When multiplexing is enabled, the output driver is enabled and can be configured to open-drain or push-pull
mode as desired, the Schmitt trigger is turned on, the input and output lines of the multiplexing function are
connected, but the output data registers are disconnected, and the levels appearing on the I/O pins will be
sampled into the input data registers at each APB2 clock. In open-drain mode, reading the input data register
will give the current status of the I/O port; in push-pull mode, reading the output data register will give the last
written value.
Output
control
Input data
register
Output data
register
Bit set/reset
registers
Push-pull,
open-drain or
disabled
Protection
diode
Protection
diode
I/O pin
P-MOS
N-MOS
V
SS
V
DD
V
SS
V
DD
on
TTL Schmitt
trigger
Input driver
Output driver
Read
Write
Read/write
Output
control
Input data
register
Output data
register
Bit set/reset
registers
Push-pull,
open-drain or
disabled
Protection
diode
Protection
diode
I/O pin
P-MOS
N-MOS
V
SS
V
DD
V
SS
V
DD
on
Alternate Function Input
TTL Schmitt
trigger
Input driver
Output driver
Alternate Function Output
To on-chip
peripheral
Read
Write
Read/write
from on-chip
peripheral