Contents
How does the wiringpi function on Raspberry Pi work?
This is accomplished via a suitable call to the gpio utility program, so it need to be available. The pin number is supplied in the current mode – native wiringPi, BCM_GPIO, physical or Sys modes. This function will work in any mode, and does not need root privileges to work. The function will be called when the interrupt triggers.
What are the functions of the wiringpi program?
WiringPi provides some helper functions to allow you to manage your program (or thread) priority and to help launch a new thread from inside your program. Threads run concurrently with your main program and can be used for a variety of purposes. To learn more about threads, search for “Posix Threads”
When to use waitforinterrupt function on Raspberry Pi?
Note: Jan 2013: The waitForInterrupt () function is deprecated – you should use the newer and easier to use wiringPiISR () function below. When called, it will wait for an interrupt event to happen on that pin and your program will be stalled. The timeOut parameter is given in milliseconds, or can be -1 which means to wait forever.
What is the function to receive interrupts on a specified pin?
This function registers a function to received interrupts on the specified pin. The edgeType parameter is either INT_EDGE_FALLING, INT_EDGE_RISING, INT_EDGE_BOTH or INT_EDGE_SETUP.
What is the GPIO utility for wiring Pi?
The GPIO utility WiringPi comes with a separate program to help manage the on-board GPIO interface as well as additional modules such as the PiFace and other devices like the Gertboard as well as generic GPIO expander type devices. This program, called gpio, can also be used in scripts to manipulate the GPIO pins – set outputs and read inputs.
What is the return value of wiringpi function?
The return value is 0 for success and -1 for error. If an error is returned, the program should then consult the errno global variable, as per the usual conventions. Note: Only programs running as root can change their priority. If called from a non-root program then nothing happens.