C28 General-Purpose Input/Output (GPIO)
378
SPRUH22I – April 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
General-Purpose Input/Output (GPIO)
4.2.4 Digital General Purpose I/O Control
For pins that are configured as GPIO you can change the values on the pins by using the registers in
.
Table 4-39. GPIO Data Registers
Name
Address
Size (x16)
Register Description
GPADAT
0x5FC0
4
GPIO A Data Register (GPIO0
- GPIO31)
GPASET
0x5FC2
4
GPIO A Set Register (GPIO0 -
GPIO31)
GPACLEAR
0x5FC4
4
GPIO A Clear Register (GPIO0
- GPIO31)
GPATOGGLE
0x5FC6
4
GPIO A Toggle Register
(GPIO0 - GPIO31)
GPBDAT
0x5FC8
4
GPIO B Data Register
(GPIO32 - GPIO63)
GPBSET
0x5FCA
4
GPIO B Set Register (GPIO32
- GPIO63)
GPBCLEAR
0x5FCC
4
GPIO B Clear Register
(GPIO32 - GPIO63)
GPBTOGGLE
0x5FCE
4
GPIO B Toggle Register
(GPIO32 - GPIO63)
GPCDAT
0x5FD0
4
GPIO C Data Register
(GPIO68 - GPIO71)
GPCSET
0x5FD2
4
GPIO C Set Register (GPIO68
- GPIO71)
GPCCLEAR
0x5FD4
4
GPIO C Clear Register
(GPIO68 - GPIO71)
GPCTOGGLE
0x5FD6
4
GPIO C Toggle Register
(GPIO68 - GPIO71)
GPEDAT
0x6FC0
4
GPIO E Data Register
(GPIO128 - GPIO135)
GPESET
0x6FC2
4
GPIO E Set Register
(GPIO128 - GPIO135)
GPECLEAR
0x6FC4
4
GPIO E Clear Register
(GPIO128 - GPIO135)
GPETOGGLE
0x6FC6
4
GPIO E Toggle Register
(GPIO128 - GPIO135)
AIODAT
0x6FD8
4
Analog IO Data Register (AIO0
- AIO31)
AIOSET
0x6FDA
4
Analog IO Set Register (AIO0 -
AIO31)
AIOCLEAR
0x6FDC
4
Analog IO Clear Register
(AIO0 - AIO31)
AIOTOGGLE
0x6FDE
4
Analog IO Toggle Register
(AIO0 - AIO31)
•
GPxDAT/AIODAT Registers
Each I/O port has one data register. Each bit in the data register corresponds to one GPIO pin. No
matter how the pin is configured (GPIO or peripheral function), the corresponding bit in the data
register reflects the current state of the pin after qualification (This does not apply to AIOx pins).
Writing to the GPxDAT/AIODAT register clears or sets the corresponding output latch and if the pin is
enabled as a general purpose output (GPIO output) the pin will also be driven either low or high. If the
pin is not configured as a GPIO output then the value will be latched, but the pin will not be driven.
Only if the pin is later configured as a GPIO output, will the latched value be driven onto the pin.
When using the GPxDAT register to change the level of an output pin, you should be cautious not to