
Rev. 1.00
135 of 486
July 31, 2018
32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F50231/HT32F50241
8 General Purpose I/O (GPIO)
Port C Lock Register – PCLOCKR
This register specifies the GPIO Port C lock configuration.
Offset:
0x018
Reset value: 0x0000_0000
31
30
29
28
27
26
25
24
PCLKEY
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
PCLKEY
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
PCLOCK
Type/Reset RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0 RW 0
Bits
Field
Descriptions
[31:16]
PCLKEY
GPIO Port C lock Key
0x5FA0: Port C Lock function is enabled
Others: Port C Lock function is disabled
To lock the Port C function, a value of 0x5FA0 should be written into the PCLKEY
field in this register. To execute a successful write operation on this lock register, the
value written into the PCLKEY field must be 0x5FA0. If the value written into this
field is not equal to 0x5FA0, any write operations on the PCLOCKR register will be
aborted. The result of a read operation on the PCLKEY field returns the GPIO Port
C Lock Status which indicates whether the GPIO Port C is locked or not. If the read
value of the PCLKEY field is 0, this indicates that the GPIO Port C Lock function is
disabled. Otherwise, it indicates that the GPIO Port C Lock function is enabled as
the read value is equal to 1.
[7:0]
PCLOCKn
GPIO Port C pin n Lock Control Bits (n = 0 ~ 7)
0: Port C pin n is not locked
1: Port C pin n is locked
The PCLOCKn bits are used to lock the configurations of corresponding GPIO Pins
when the correct Lock Key is applied to the PCLKEY field. The locked configurations
including PCDIRn, PCINENn, PCPUn, PCPDn, PCODn and PCDVn setting in the
related GPIO registers. Additionally, the GPCCFGHR or GPCCFGLR register which
is used to configure the alternative function of the associated GPIO pin will also be
locked. Note that the PCLOCKR register can only be written once which means that
PCLKEY and PCLOCKn (lock control bit) should be written together and can not be
changed until a system reset or GPIO Port C reset occurs.