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