32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52220/HT32F52230
GPIO Locking Mechanism
The GPIO also offers a lock function to lock the port until a reset event occurs. The PxLOCKR (x
= A ~ B) registers are used to lock the port x and lock control options. The value 0x5FA0 is written
into the PxLKEY field in the PxLOCKR registers to freeze the PxDIRCR, PxINER, PxPUR,
PxPDR, PxODR, PxDRVR control and AFIO mode configuration (GPxCFGHR or GPxCFGLR,
where x = A ~ B). If the value in the PxLOCKR register is 0x5FA0_0001, it means that the Port x
Lock function is enabled and the Port x pin 0 is frozen
Register Map
The following table shows the GPIO registers and reset values of the Port A ~ B.
Table 21. GPIO Register Map
Register
GPIO A Base Address = 0x400B_0000
PADIRCR
0x000
PAINER
0x004
PAPUR
0x008
PAPDR
0x00C
PAODR
0x010
PADRVR
0x014
PALOCKR
0x018
PADINR
0x01C
PADOUTR
0x020
PASRR
0x024
PARR
0x028
GPIO B Base Address = 0x400B_2000
PBDIRCR
0x000
PBINER
0x004
PBPUR
0x008
PBPDR
0x00C
PBODR
0x010
PBDRVR
0x014
PBLOCKR
0x018
PBDINR
0x01C
PBDOUTR
0x020
PBSRR
0x024
PBRR
0x028
Rev. 1.10
Offset
Port A Data Direction Control Register
Port A Input Function Enable Control Register
Port A Pull-Up Selection Register
Port A Pull-Down Selection Register
Port A Open Drain Selection Register
Port A Drive Current Selection Register
Port A Lock Register
Port A Data Input Register
Port A Data Output Register
Port A Output Set and Reset Control Register
Port A Output Reset Control Register
Port B Data Direction Control Register
Port B Input Function Enable Control Register
Port B Pull-Up Selection Register
Port B Pull-Down Selection Register
Port B Open Drain Selection Register
Port B Drive Current Selection Register
Port B Lock Register
Port B Data Input Register
Port B Data Output Register
Port B Output Set and Reset Control Register
Port B Output Reset Control Register
107 of 366
Description
Reset Value
0x0000_0000
0x0000_0200
0x0000_3200
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_3200
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
0x0000_0000
November 09, 2018
Need help?
Do you have a question about the HT32F52220 and is the answer not in the manual?