Firefly开源社区

打印 上一主题 下一主题

How to use GPIO Intterupts?

18

积分

0

威望

0

贡献

游客

积分
18

How to use GPIO Intterupts?

发表于 2015-10-19 20:21:32      浏览:7273 | 回复:1        打印      只看该作者   [复制链接] 楼主
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!
回复

使用道具 举报

发表于 2015-10-20 09:40:11        只看该作者  沙发
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);
暴走的创客!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表