Firefly开源社区

标题: How to use GPIO Intterupts? [打印本页]

作者: Jeff    时间: 2015-10-19 20:21
标题: How to use GPIO Intterupts?
Hi I'am Jeff from Korea.

I want to use GPIO Interrupts for GPIO0_B5 / GPIO_A3 by Input Button.

When I use an interrupt for GPIO0_A7_U, it works fine.
If I push the button once , "Interrupt Service Routine (ISR)" works once.
But If I use it to GPIO0_B5_D, "ISR" works continuously.
I think it happens because GPIO Interrupts only work when it's ACTIVE_LOW.

Here is my question.
How can I use the "ISR" when GPIO working "Rising Edge" or "Falling Edge"

plz help!

thank you!
作者: 暴走的阿Sai    时间: 2015-10-20 09:40
When you use request_irq,you can try IRQF_TRIGGER_RISING or IRQF_TRIGGER_FALLING
like this:
request_irq(client->irq, gsl_ts_irq, IRQF_TRIGGER_RISING, client->name, ts);




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1