@GPIO_IRQENABLEx
Register
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
@GPIO_IRQENABLEx
Register
1
0
0
0
0
0
0
1
0
0
0
0
1
1
1
0
Write @GPIO_SETIRQENABLE
(1000 0000 0000 1110b)
Functional Description
25.3.4.2.2.3 Set Instruction Example
Assume the interrupt enable1 (or enable2) register (or the data output register) contains the binary value,
0000 0001 0000 0000h, and you want to set bits 15, 3, 2, and 1.
With the set instruction feature, write 1000 0000 0000 1110h at the address of the set interrupt enable1
(or enable2) register (or at the address of the set data output register). After this write operation, a reading
of the interrupt enable1 (or enable2) register (or the data output register) returns 1000 0001 0000 1110h;
bits 15, 3, 2, and 1 are set.
NOTE:
Although the general-purpose interface registers are 32-bits wide, only the 16 least-
significant bits are represented in this example.
Figure 25-5. Write @ GPIO_SETIRQENABLEx Register Example
25.3.4.3 Data Input (Capture)/Output (Drive)
The output enable register (GPIO_OE) controls the output/input capability for each pin. At reset, all the
GPIO-related pins are configured as input and output capabilities are disabled. This register is not used
within the module; its only function is to carry the pads configuration.
When configured as an output (the desired bit reset in GPIO_OE), the value of the corresponding bit in the
GPIO_DATAOUT register is driven on the corresponding GPIO pin. Data is written to the data output
register synchronously with the interface clock. This register can be accessed with read/write operations or
by using the alternate set and clear protocol register update feature. This feature lets you set or clear
specific bits of this register with a single write access to the set data output register
(GPIO_SETDATAOUT) or to the clear data output register (GPIO_CLEARDATAOUT) address. If the
application uses a pin as an output and does not want interrupt generation from this pin, the application
must properly configure the interrupt enable registers.
When configured as an input (the desired bit set to 1 in GPIO_OE), the state of the input can be read from
the corresponding bit in the GPIO_DATAIN register. The input data is sampled synchronously with the
interface clock and then captured in the data input register synchronously with the interface clock. When
the GPIO pin levels change, they are captured into this register after two interface clock cycles (the
required cycles to synchronize and to write data). If the application uses a pin as an input, the application
must properly configure the interrupt enable registers to the interrupt as needed.
25.3.4.4 Debouncing Time
To enable the debounce feature for a pin, the GPIO configuration registers must be programmed as
follows:
•
The GPIO pin must be configured as input in the output enable register (write 1 to the corresponding
bit of the GPIO_OE register).
•
The debouncing time must be set in the debouncing value register (GPIO_DEBOUNCINGTIME). The
GPIO_DEBOUNCINGTIME register is used to set the debouncing time for all input lines in the GPIO
module. The value is global for all the ports of one GPIO module, so up to six different debouncing
values are possible. The debounce cell is running with the debounce clock (32 kHz). This register
represents the number of the clock cycle(s) (one cycle is 31 microseconds long) to be used.
The following formula describes the required input stable time to be propagated to the debounced
output:
Debouncing time = (DEBOUN 1) × 31 µs
4066
General-Purpose Input/Output
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated