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