Does wiringPiISR() set up Synchronous or Asynchronous edge detection and are inputs e.g. pinMode( , INPUT) set up with hysteresis (Schmitt trigger)? All of these seem options in the Pi GPIO registers but I can't find any documentation or find it in the WiringPi code.


wiringPi uses the Linux sysfs interface to the GPIO for interrupts. I.e. it will not select synchronous or asynchronous, it will use whatever Linux does.

I don't know what Linux does.

I do not think wiringPi touches the hysteresis setting so it will be whatever was previously set (the default at power up in on).


I wrote a program to print out the GPIO registers - it shows the pi linux default is to use synchronous edge detection.

Using wiringPiISR(, INT_EDGE_FALLING,) sets bits in GPFEN0 and wiringPiISR(, INT_EDGE_RISING,) sets bits in GPREN0, wiringPiISR(, INT_EDGE_BOTH,) sets bits in both GPFEN0 and GPREN0. For asynchronous edge detection GPAREN0 and GPAFEN0 would have been used.

Input Hysteresis is controlled by the HYST bit in the GPIO PADS registers - wiringPi sets HYST on (and sets slew rate not limited) as a by product of calling setPadDrive(,) - I suspect it is on already.

  • I haven't figured out how to set Hysteresis, but have done quite a bit of testing on GPIO. To characterise the threshold I connected a DAC to GPIO and ramped up/down. If there is any Hysteresis by default it appears to be minimal. Most pins change state @ ~1.25V.
    – Milliways
    Feb 25 '18 at 23:05
  • Thanks - the reason I'm investigating this is that I have an issue of double triggering an interrupt (falling edge triggered). The input signal looks clean but does have slow edges (fall time about 1uS according to my scope). But if synchronous edge detection and hysteresis is on (which I think they are) there is little more I can do. Thanks for the info - the minimal hysteresis could well be a cause.
    – Steve R
    Feb 26 '18 at 0:34
  • See scribd.com/doc/101830961/GPIO-Pads-Control2 for info on the HYST bit.
    – Steve R
    Feb 26 '18 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.