
Rev. 1.00
164 of 576
January 28, 2022
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F54231/HT32F54241/HT32F54243/HT32F54253
8 General Purpose I/O (GPIO)
Port D Lock Register – PDLOCKR
This register specifies the GPIO Port D lock configuration.
Offset:
0x018
Reset value: 0x0000_0000
31
30
29
28
27
26
25
24
PDLKEY
Type/Reset RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0
23
22
21
20
19
18
17
16
PDLKEY
Type/Reset RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0
15
14
13
12
11
10
9
8
Reserved
Type/Reset
7
6
5
4
3
2
1
0
Reserved
PDLOCK
Type/Reset
RW 0 RW 0 RW 0 RW 0 RW 0 RW 0
Bits
Field
Descriptions
[31:16]
PDLKEY
GPIO Port D Lock Key
0x5FA0: Port D Lock function is enable
Others: Port D Lock function is disable
To lock the Port D function, a value 0x5FA0 should be written into the PDLKEY field
in this register. To execute a successful write operation on this lock register, the
value written into the PDLKEY field must be 0x5FA0. If the value written into this
field is not equal to 0x5FA0, any write operations on the PDLOCKR register will be
aborted. The result of a read operation on the PDLKEY field returns the GPIO Port
D Lock Status which indicates whether the GPIO Port D is locked or not. If the read
value of the PDLKEY field is 0, this indicates that the GPIO Port D Lock function is
disabled. Otherwise, it indicates that the GPIO Port D Lock function is enabled as
the read value is equal to 1.
[5:0]
PDLOCKn
GPIO Port D pin n Lock Control Bits (n = 0 ~ 5)
0: Port D pin n is not locked
1: Port D pin n is locked
The PDLOCKn bits are used to lock the configurations of corresponding GPIO Pins
when the correct Lock Key is applied to the PDLKEY field. The locked configurations
including PDDIRn, PDINENn, PDPUn, PDPDn, PDODn and PDDVn setting in the
related GPIO registers. Additionally, the GPDCFGHR or GPDCFGLR field which
is used to configure the alternative function of the associated GPIO pin will also
be locked. Note that the PDLOCKR can only be written once which means that
PDLKEY and PDLOCKn (lock control bit) should be written together and cannot be
changed until a system reset or GPIO Port D reset occurs.