Architecture
928
SPRUH82C – April 2013 – Revised September 2016
Copyright © 2013–2016, Texas Instruments Incorporated
General-Purpose Input/Output (GPIO)
20.2.6.2.1 Driving a GPIO Output Signal High
To drive a GPIO signal high, use one of the following methods:
•
Write a logic 1 to the bit in SET_DATA associated with the desired GPIO signal(s) to be driven high.
Bit positions in SET_DATA containing logic 0 do not affect the state of the associated output signals.
•
Modify the bit in OUT_DATA associated with the desired GPIO signal by using a read-modify-write
operation. The logic states driven on the GPIO output signals match the logic values written to all bits
in OUT_DATA.
For GPIO signals configured as inputs, the values written to the associated SET_DATA, CLR_DATA, and
OUT_DATA bits have no effect.
20.2.6.2.2 Driving a GPIO Output Signal Low
To drive a GPIO signal low, use one of the following methods:
•
Write a logic 1 to the bit in CLR_DATA associated with the desired GPIO signal(s) to be driven low. Bit
positions in CLR_DATA containing logic 0 do not affect the state of the associated output signals.
•
Modify the bit in OUT_DATA associated with the desired GPIO signal by using a read-modify-write
operation. The logic states driven on the GPIO output signals match the logic values written to all bits
in OUT_DATA.
For GPIO signals configured as inputs, the values written to the associated SET_DATA, CLR_DATA, and
OUT_DATA bits have no effect.
20.2.7 Using a GPIO Signal as an Input
GPIO signals are configured to operate as inputs or outputs by writing the appropriate value to the GPIO
direction register (DIR). This section describes using the GPIO signal as an input signal.
20.2.7.1 Configuring a GPIO Input Signal
To configure a given GPIO signal as an input, set the bit in DIR that is associated with the desired GPIO
signal. For detailed information on DIR, see
.
20.2.7.2 Reading a GPIO Input Signal
The current state of the GPIO signals is read using the GPIO input data register (IN_DATA).
•
For GPIO signals configured as inputs, reading IN_DATA returns the state of the input signal
synchronized to the GPIO peripheral clock.
•
For GPIO signals configured as outputs, reading IN_DATA returns the output value being driven by the
device.
Some signals may utilize open-drain output buffers for wired-logic operations. For open-drain GPIO
signals, reading IN_DATA returns the wired-logic value on the signal (which will not be driven by the
device alone). Information on any signals using open-drain outputs is available in your device-specific data
manual.
To use GPIO input signals as interrupt sources, see
.
20.2.8 Reset Considerations
The GPIO peripheral has two reset sources: software reset and hardware reset.
20.2.8.1 Software Reset Considerations
A software reset (such as a reset initiated through the emulator) does not modify the configuration and
state of the GPIO signals. A reset invoked via the Power and Sleep Controller (PSC) (GPIO clock disable,
PSC reset, followed by GPIO clock enable) will result in the default configuration register settings. For
details on the PSC, see the
Power and Sleep Controller (PSC)
chapter.