General Purpose Input/Output (GPIO)
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
61
Fig 8-3 Read back of external gpio_ext_port
X
data timing
8.2.1.4
Synchronization of Data to System Clock
Synchronization of gpio_ext_port
X
to pclk prior to an APB read is enabled if the corresponding signal configuration parameter
GPIO_P
x
_SYNC_EXT_DATA is set (
x
= A, B, C, or D); this is shown in Fig 8-2.
8.2.2
Interrupts
Port A can be programmed to accept external signals as interrupt sources on any of the bits of the signal. The type of interrupt is
programmable with one of the following settings:
Active-high and level
Active-low and level
Rising edge
Falling edge
Both edge
The interrupts can be masked by programming the gpio_intmask register. The interrupt status can be read before masking (called raw status)
and after masking.
The interrupts are also combined into a single interrupt output signal, which has the same polarity as the individual interrupts. Either individual
interrupts (gpio_intr or gpio_intr_n) or a single combined interrupt (gpio_intr_flag or gpio_intr_flag_n) can be generated. In order to mask the
combined interrupt, all individual interrupts have to be masked. The single combined interrupt does not have its own mask bit.
Whenever Port A is configured for interrupts, the data direction must be set to Input and the mode must be set to Software for interrupts to be
latched. If the data direction register is reprogrammed to Output or the mode register is programmed to enable Hardware mode, then any
pending interrupts are not lost. However, no new interrupts are generated.
Fig 8-4 illustrates how the interrupts are generated and how the data flows. The signal names in the diagram correspond to either I/O signals or
memory-mapped registers.
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03