
CH32V003
Reference Manual
V1.3
56
R32_GPIOD_BCR
0x40011414
PD port reset register
0x00000000
R32_GPIOA_LCKR
0x40010818
PA port configuration lock register
0x00000000
R32_GPIOC_LCKR
0x40011018
PC port configuration lock register
0x00000000
R32_GPIOD_LCKR
0x40011418
PD port configuration lock register
0x00000000
7.3.1.1 Port configuration register low (GPIOx_CFGLR) (x=A/C/D)
Offset address: 0x00
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
CNF7[1:0] MODE7[1:0] CNF6[1:0] MODE6[1:0
]
CNF5[1:0] MODE5[1:0
]
CNF4[1:0] MODE4[1:0]
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
CNF3[1:0] MODE3[1:0] CNF2[1:0] MODE2[1:0
]
CNF1[1:0] MODE1[1:0
]
CNF0[1:0] MODE0[1:0]
Bit
Name
Access
Description
Reset value
[31:30]
[27:26]
[23:22]
[19:18]
[15:14]
[11:10]
[7:6]
[3:2]
CNFy
RW
(y=0-7), the configuration bits for port x, by which
the corresponding port is configured.
When in input mode (MODE=00b).
00: Analog input mode.
01: Floating input mode.
10: With pull-up and pull-down mode.
11: Reserved.
In output mode (MODE>00b).
00: Universal push-pull output mode.
01: Universal open-drain output mode.
10: Multiplexed function push-pull output mode.
11: Multiplexing function open-drain output
mode.
01b
[29:28]
[25:24]
[21:20]
[17:16]
[13:12]
[9:8]
[5:4]
[1:0]
MODEy
RW
(y=0-7), port x mode selection, configure the
corresponding port by these bits.
00: Input mode.
01: Output mode, maximum speed 10MHz;
10: Output mode, maximum speed 2MHz.
11: Output mode, maximum speed 50MHz.
0
7.3.1.2 Port input Register (GPIOx_INDR) (x=A/C/D)
Offset address: 0x08
31
30
29
28
27
26
25
24
23
22
21
20
19
18
17
16
Reserved
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reserved
IDR7
IDR6
IDR5
IDR4
IDR3
IDR2
IDR1
IDR0
Bit
Name
Access
Description
Reset value
[31:8] Reserved
RO Reserved
0
[7:0]
IDRy
RO
(y=0-7), the port input data. These bits are read-
only and can only be read out in 16-bit form. The
value read is the high and low state of the
corresponding bit.
X