Functional Description
25.3.3.3 Interrupt Line Release
When the host processor receives an interrupt request issued by the GPIO module, it can read the
corresponding GPIO_IRQSTATUS_n register to find out which input GPIO has triggered the interrupt.
After servicing the interrupt, the processor resets the status bit and releases the interrupt line by writing a
1 in the corresponding bit of the GPIO_IRQSTATUS_n register. If there is still a pending interrupt request
to serve (all bits in the GPIO_IRQSTATUS_RAW_n register not masked by the
GPIO_IRQSTATUS_SET_n, which are not cleared by setting the GPIO_IRQSTATUS_CLR_n), the
interrupt line will be re-asserted.
25.3.4 General-Purpose Interface Basic Programming Model
25.3.4.1 Power Saving by Grouping the Edge/Level Detection
Each GPIO module implements four gated clocks used by the edge/level detection logic to save power.
Each group of eight input GPIO pins generates a separate enable signal depending on the edge/level
detection register setting (because the input is 32 bits, four groups of eight inputs are defined for each
GPIO module). If a group requires no edge/level detection, then the corresponding clock is gated (cut off).
Grouping the edge/level enable can save the power consumption of the module as described in the
following example.
If any of the registers:
•
GPIO_LEVELDETECT0
•
GPIO_LEVELDETECT1
•
GPIO_RISINGDETECT
•
GPIO_FALLINGDETECT
are set to 0101 0101h, then all clocks are active (power consumption is high);
are set to 0000 00FFh, then a single clock is active.
NOTE:
When the clocks are enabled by writing to the GPIO_LEVELDETECT0,
GPIO_LEVELDETECT1, GPIO_RISINGDETECT, and GPIO_FALLINGDETECT registers,
the detection starts after 5 clock cycles. This period is required to clean the synchronization
edge/level detection pipeline.
The mechanism is independent of each clock group. If the clock has been started before a
new setting is performed, the following is recommended: first, set the new detection required;
second, disable the previous setting (if necessary). In this way, the corresponding clock is
not gated and the detection starts immediately.
25.3.4.2 Set and Clear Instructions
The GPIO module implements the set-and-clear protocol register update for the data output and interrupt
enable registers. This protocol is an alternative to the atomic test and set operations and consists of
writing operations at dedicated addresses (one address for setting bit[s] and one address for clearing
bit[s]). The data to write is 1 at bit position(s) to clear (or to set) and 0 at unaffected bit(s).
Registers can be accessed in two ways:
•
Standard: Full register read and write operations at the primary register address
•
Set and clear (recommended): Separate addresses are provided to set (and clear) bits in registers.
Writing 1 at these addresses sets (or clears) the corresponding bit into the equivalent register; writing a
0 has no effect.
Therefore, for these registers, three addresses are defined for one unique physical register. Reading these
addresses has the same effect and returns the register value.
4064
General-Purpose Input/Output
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated