General-Purpose Input/Output (GPIO)
356
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
General-Purpose Input/Output (GPIO)
4.1.6.14 GPIO Lock (GPIOLOCK) Register, offset 0x520
The GPIOLOCK register enables write access to the GPIOCR register. Writing 0x4C4F.434B to the
GPIOLOCK register unlocks the GPIOCR register. Writing any other value to the GPIOLOCK register re-
enables the locked state. Reading the GPIOLOCK register returns the lock status rather than the 32-bit
value that was previously written. Therefore, when write accesses are disabled, or locked, reading the
GPIOLOCK register returns 0x0000.0001. When write accesses are enabled, or unlocked, reading the
GPIOLOCK register returns 0x0000.0000.
Figure 4-17. GPIO Lock (GPIOLOCK) Register
31
16
LOCK
R/W-0
15
0
LOCK
R/W-0
LEGEND: R/W = Read/Write; R = Read only; -
n
= value after reset
Table 4-19. GPIO Lock (GPIOLOCK) Register Field Descriptions
Bit
Field
Value
Description
31-0
LOCK
GPIO Lock
A write of the value 0x4C4F.434B unlocks the GPIO Commit (GPIOCR) register for write access. A
write of any other value or a write to the GPIOCR register reapplies the lock, preventing any
register updates. A read of this register returns the following values:
0
The GPIOCR register is unlocked and may be modified.
1
The GPIOCR register is locked and may not be modified.
4.1.6.15 GPIO Commit (GPIOCR) Register, offset 0x524
The GPIOCR register is the commit register. The value of the GPIOCR register determines which bits of
the GPIOAFSEL, GPIOPUR, GPIOCSEL, and GPIODEN registers are committed when a write to these
registers is performed. If a bit in the GPIOCR register is cleared, the data being written to the
corresponding bit in the GPIOAFSEL, GPIOPUR, GPIOCSEL, or GPIODEN registers cannot be
committed and retains its previous value. If a bit in the GPIOCR register is set, the data being written to
the corresponding bit of the GPIOAFSEL, GPIOPUR, GPIOCSEL, or GPIODEN registers is committed to
the register and reflects the new value.
The contents of the GPIOCR register can only be modified if the status in the GPIOLOCK register is
unlocked. Writes to the GPIOCR register are ignored if the status in the GPIOLOCK register is locked.
Important:
This register is designed to prevent accidental programming of the registers that control
connectivity to the NMI hardware. By initializing the bit of the GPIOCR register to 0 for PB7, the NMI can
only be converted to a GPIO through a deliberate set of writes to the GPIOLOCK, GPIOCR, and the
corresponding registers.
Because this protection is currently only implemented on the NMI pin on PB7, all of the other bits in the
GPIOCR registers cannot be written with 0x0. These bits are hardwired to 0x1, ensuring that it is always
possible to commit new values to the GPIOAFSEL, GPIOPUR, GPIOCSEL, or GPIODEN register bits of
these other pins.