GPIO in the kernel: an introduction
GPIO in the kernel: an introduction
Posted Oct 3, 2016 19:27 UTC (Mon) by nybble41 (subscriber, #55106)In reply to: GPIO in the kernel: an introduction by annonch
Parent article: GPIO in the kernel: an introduction
Generally speaking, no. I'm not familiar with your specific platform, but typically one configures the interrupt controller to look for either a rising edge or a falling edge (or low/high level) for each input and it generates a single interrupt when that event occurs. As a result, there is no way to statically configure it to watch for both rising and falling edges.
You could try dynamically reconfiguring the interrupt—set it as falling-edge in the rising-edge handler, and vice-versa—but performance would probably become an issue and you might miss some events depending on how long the handler is delayed. A better option, if you control the wiring and have a spare interrupt-capable GPIO, would be to route the same signal to two separate pins and set up a handler for each pin, one rising-edge and one falling-edge.
