embeded/raspberry pi2015. 9. 7. 16:43

흐음.. 한번 써봐야지


int waitForInterrupt (int pin, int timeOut) ;

gpio edge 0 falling


int wiringPiISR (int pin, int edgeType,  void (*function)(void)) ;

INT_EDGE_FALLING

INT_EDGE_RISING

INT_EDGE_BOTH

INT_EDGE_SETUP


gpio edge <pin> rising/falling/both/none

This enables the given pin for edge interrupt triggering on the rising, falling or both edges. (Or none which disables it)



       edge   This exports a GPIO pin  in  the  /sys/class/gpio  directory,  set  the

              direction  to  input and set the edge interrupt method to none, rising,

              falling or both.  Use like the  export  command  above  and  note  that

              BCM_GPIO pin number is used not not wiringPi pin numbering.


              Like the export commands above, ownership is set to that of the calling

              user, allowing subsequent access from user programs  without  requiring

              root/sudo. 


[링크 : http://wiringpi.com/reference/priority-interrupts-and-threads/]

[링크 : https://projects.drogon.net/raspberry-pi/wiringpi/functions/]

Posted by 구차니