linux 应用层gpio中断,使用sysfs的Linux用户空间GPIO中断

I would like to use interrupts with GPIO on userspace using sysfs.

I use these commands :

[root@at91]:gpio109 > echo 109 > export

[root@at91]:gpio109 > cd gpio109/

[root@at91]:gpio109 > ll

-rw-r--r-- 1 root 0 4096 Jan 1 00:17 direction

drwxr-xr-x 2 root 0 0 Jan 1 00:17 power

lrwxrwxrwx 1 root 0 0 Jan 1 00:17 subsystem -> ../../gpio

-rw-r--r-- 1 root 0 4096 Jan 1 00:17 uevent

-rw-r--r-- 1 root 0 4096 Jan 1 00:17 value

The gpio works well but I can't use interrupts.

I read everywhere i must have an edge file to poll this file. But on my system this file doesn't exist.

I made a lot of tries to find a solution but remain unsuccessfull.

My target is an AT91SAM9263 on linux kernel 2.6.30.

At the boot of my board I got this message on interrupts :

AT91: 160 gpio irqs in 5 banks

which show that the function at91_gpio_irq_setup() is well executed.

Have you any idea ?

解决方案

The "edge" file only exists if that GPIO pin can be configured as a an interrupt generting pin. See: http://www.mjmwired.net/kernel/Documentation/gpio.txt#634.

Since you don't see it, it means the driver and possibly the hardware do not support using that GPIO pin for interrupt source.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值