7809
правок
Fizikdaos (обсуждение | вклад) (Новая страница: «Setting the interrupt is done by writing the values in the file "edge". Values can be: * "none" - disable interrupt * "rising" - enable interrupt on falling edge…») |
Fizikdaos (обсуждение | вклад) (Новая страница: «Example: <pre> root@wirenboard:~# echo 3 > /sys/class/gpio/export # export GPIO No. 3 (TB10 in WB3.3) root@wirenboard:~# cat /sys/class/gpio/gpio3/edge # check…») |
||
Строка 89: | Строка 89: | ||
* "both" - enable interrupt on both edges. | * "both" - enable interrupt on both edges. | ||
Example: | |||
<pre> | <pre> | ||
root@wirenboard:~# echo 3 > /sys/class/gpio/export # | root@wirenboard:~# echo 3 > /sys/class/gpio/export # export GPIO No. 3 (TB10 in WB3.3) | ||
root@wirenboard:~# cat /sys/class/gpio/gpio3/edge # | root@wirenboard:~# cat /sys/class/gpio/gpio3/edge # check the status of the interrupt | ||
none | none | ||
root@wirenboard:~# echo falling > /sys/class/gpio/gpio3/edge # | root@wirenboard:~# echo falling > /sys/class/gpio/gpio3/edge # set interrupt falling edge | ||
root@wirenboard:~# cat /proc/interrupts | grep gpiolib # | root@wirenboard:~# cat /proc/interrupts | grep gpiolib # interrupt appears in the list. 26 - internal interrupt, 0 - the number of events | ||
26: 0 gpio-mxs 3 gpiolib | 26: 0 gpio-mxs 3 gpiolib | ||
root@wirenboard:~# cat /proc/interrupts | grep gpiolib # | root@wirenboard:~# cat /proc/interrupts | grep gpiolib # After several events, 76 - the number of events | ||
26: 76 gpio-mxs 3 gpiolib | 26: 76 gpio-mxs 3 gpiolib | ||