
CH32V003
Reference Manual
V1.3
54
7.2.9 Analog input configuration
Figure 7-5 The configuration structure when the GPIO module is used as an analog input
When the analog input is enabled, the output buffer is disconnected, the input of the Schmitt trigger in the
input driver is disabled to prevent the generation of consumption on the I/O port, the pull-up and pull-down
resistors are disabled, and the read input data register will always be 0.
7.2.10 GPIO settings for peripherals
The following table recommends the corresponding GPIO port configuration for each peripheral pin.
Table 7-1 Advanced-control timer (TIM1)
TIM1 pins
Configuration
GPIO configuration
TIM1_CHx
Input capture channel x
Floating input
Output comparison channel x
Push-pull multiplexed output
TIM1_CHxN
Complementary output channels x
Push-pull multiplexed output
TIM1_BKIN
Brake input
Floating input
TIM1_ETR
Externally triggered clock input
Floating input
Table 7-2 General-purpose timer (TIM2)
TIM2 pins
Configuration
GPIO configuration
TIM2_CHx
Input capture channel x
Floating input
Output comparison channel x
Push-pull multiplexed output
TIM2_ETR
Externally triggered clock input
Floating input
Table 7-3 Universal synchronous asynchronous serial transceiver (USART)
USART pins
Configuration
GPIO configuration
USARTx_TX
Full-duplex mode
Push-pull multiplexed outputs
Half-duplex synchronous mode
Push-pull multiplexed outputs
USARTx_RX
Full-duplex mode
Floating input or pull-up input
Half-duplex synchronous mode
Not used
USARTx_CK
Synchronous mode
Push-pull multiplexed output
USARTx_RTS
Hardware flow control
Push-pull multiplexed output
USARTx_CTS
Hardware flow control
Floating input or pull-up input
Table 7-4 Serial peripheral interface (SPI) modules
SPI pins
Configuration
GPIO configuration
SPIx_SCK
Master mode
Push-pull multiplexed output
Slave mode
Floating input
Input data
register
Output data
register
Bit set/reset
registers
Push-pull,
open-drain or
disabled
Protection
diode
Protection
diode
I/O pin
V
SS
V
DD
off
Analog Input
TTL Schmitt
trigger
Input driver
Output driver
To on-chip
peripheral
Read
Write
Read/write
0