Could I use any GPIO pin as interrupt input signal which worked at edge detection mode?Hi,
Because 6 dedicated IRQ(0~5) pins are not enough for me, I need other GPIO pin work as interrupt input signal. So, I have below two questions:
1. Could any GPIO be used as interrupt signal input, which worked at edge detection mode?
2. If above 1 is yes, what difference between dedicated IRQ and GPIO? Maybe is response priority?
Thanks in advance!
Best regards!
Jason
Re: Could I use any GPIO pin as interrupt input signal which worked at edge detection mode?Yes, an LS1021A GPIO can be used as an interrupt input, including edge-detection mode, as long as the pin is actually muxed/available as a GPIO input in your board configuration.
- GPIO as edge interrupt input
The GPIO block has interrupt control/status/mask registers: GPIER , GPIMR , and GPICR ; the GPICR configures event detection, including edge-triggered behavior, and the GPIO interrupt logic outputs a consolidated gpio_int request to the system. For each GPIO port line, the EDn bit selects whether the interrupt is generated on any state change or on a high-to-low transition . So GPIO interrupt input is supported, but note that the documented edge choices are not the same as a fully independent rising/falling/both-edge selector: the cited modes are “any change” or “high-to-low.”
- Dedicated IRQ vs GPIO interrupt
The main difference is the interrupt path and granularity:
- Dedicated IRQ0–IRQ5 pins are external I/O signals directly connected to interrupt-controller lines; their interrupt status is available in the corresponding GIC-400 registers, and their polarity is programmable through SCFG_INTPCR .
- GPIO interrupts are not separate GIC inputs per pin. The GPIO module detects/stores the pin event in GPIER , applies masking/control through GPIO registers, and then drives a consolidated GPIO interrupt request.The reference manual also states that all GPIO interrupts are ORed together for the GPIO interrupt source.
So the practical software difference is that a dedicated IRQ can be handled as its own interrupt source at the GIC level, while a GPIO interrupt normally requires the ISR to enter the GPIO block, read GPIER to determine which pin caused the event, then clear/service it.
Use dedicated IRQ pins for the most latency-sensitive or individually prioritized external interrupts; use GPIO interrupts when you need more inputs and can tolerate shared GPIO interrupt handling.
Re: Could I use any GPIO pin as interrupt input signal which worked at edge detection mode?Hi,
This question is about LS1021A. Any response is welcome!
Best regards!
Jason