![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_371.png)
IDT General Purpose I/O Controller
Theory of Operation
79RC32438 User Reference Manual
12 - 3
November 4, 2002
Notes
GPIO Pin Configured As Output
When configured as an output in GPIOCFG and as a GPIO function in GPIOFUNC, the value written
into GPIOD will be output at the pin. The value of the output pin can be determined at any time by reading
GPIOD.
GPIO Pin Configured As an Alternate Function
When configured as an alternate function in GPIOFUNC register, the pin behaves as described in each
chapter associated with that function. The value of the alternate function pin can be determined at any time
by reading GPIOD.
GPIO Pins As Interrupt Sources
Each pin can also generate an interrupt to the Interrupt Controller, regardless of the configuration in
GPIOFUNC or GPIOCFG. This allows an alternate function, a write to GPIOD, or a GPIO input from an
external device, to generate an interrupt.
Interrupt generation is controlled using the GPIO interrupt level register (GPIOILEVEL) and GPIO inter-
rupt status register (GPIOISTAT). GPIOILEVEL describes the interrupt level (either active high or low) of the
signal that will cause the interrupt. When the value of a pin matches the level in GPIOILEVEL, the corre-
sponding bit in the GPIO interrupt status register (GPIOISTAT) will be set high. Once set, the bit in GPIO-
ISTAT will remain set even if the value of the GPIO pin changes. All GPIOISTAT bits are sent to the Interrupt
Controller to request interrupt servicing.
To clear the interrupt, the source of the interrupt must be cleared or serviced. (This could be an alternate
function service or clearing of GPIOD.) Then the bit in GPIOISTAT must also be cleared.
Note that if an interrupt is not wanted from a GPIO pin, it must be masked in the Interrupt Controller
Interrupt Mask 6 Register (IMASK6). See Chapter 8, Interrupt Controller.
GPIO Pins As Non-maskable Interrupt Sources
Each GPIO pin can also be programmed to generate a non-maskable interrupt (NMI) to the CPU regard-
less of the configuration in GPIOFUNC or GPIOCFG. GPIOILEVEL and GPIOISTAT must be set up to
generate an interrupt as described in the previous section. The GPIO Non-maskable Interrupt Enable
Register (GPIONMIEN) enables the corresponding bit in the GPIOISTAT register to generate an NMI. All
enabled NMI sources are logically combined to generate a single NMI to the CPU core. The GPIOSTAT
register can be read to determine the cause of the NMI.
Note that in addition to the generation of the NMI, an interrupt is also generated unless masked in the
Interrupt Controller.
GPIOFUNC
GPIOCFG
Pin Function
0
0
GPIO input
0
1
GPIO output
1
Don’t care
Alternate 1 function
Table 12.2 Possible GPIO Configurations