# WP85 interrupts

**URL:** <https://forum.legato.io/t/wp85-interrupts/169>\
**Category:** Legato Application Framework\
**Created:** [November 17, 2015, 11:04am UTC](https://forum.legato.io/t/wp85-interrupts/169 "2015-11-17T11:04:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnofleek](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@johnofleek](https://forum.legato.io/u/johnofleek)\
**Post date:** [November 17, 2015, 11:04am UTC](https://forum.legato.io/t/wp85-interrupts/169/1 "2015-11-17T11:04:59Z")

</div>

Hi

Can anyone explain how interrupts are handled and the preferred / best method using Legato / WP85?

For example GPIO2 is used on the Mangoh board (net GPIOEXP\_INT2) - can we generate Legato events from this IP or do we need to do something in Linux or something else?

I’ve just noticed that Legato 15.10 documentation exists - and that there is a new service  
[legato.io/legato-docs/15\_10/c\_gpio.html](http://www.legato.io/legato-docs/15_10/c_gpio.html)

Does this answer my question?

Thanks in advance

John

---

<div class="post-metadata">

**Author:** ![krima919](https://avatars.discourse-cdn.com/v4/letter/k/94ad74/32.png) [@krima919](https://forum.legato.io/u/krima919)\
**Post date:** [November 18, 2015, 11:59am UTC](https://forum.legato.io/t/wp85-interrupts/169/2 "2015-11-18T11:59:16Z")

</div>

According to the doc it should be exactly what you need.

le\_gpio\_AddChangeEventHandler:

[quote]Add handler function for EVENT ‘le\_gpio\_ChangeEvent’

Register a callback function to be called when an input pin changes state.

If the pin is not capable of interrupt-driven operation, then it will be sampled every sampleMs milliseconds. Otherwise, sampleMs will be ignored.[/quote]

---

<div class="post-metadata">

**Author:** ![johnofleek](https://avatars.discourse-cdn.com/v4/letter/j/e9bcb4/32.png) [@johnofleek](https://forum.legato.io/u/johnofleek)\
**Post date:** [November 18, 2015, 12:44pm UTC](https://forum.legato.io/t/wp85-interrupts/169/3 "2015-11-18T12:44:42Z")

</div>

Are any latency figures available for this function?

I’m hoping GPIO2 is a real interrupt input

---

<div class="post-metadata">

**Author:** ![amitchell](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/amitchell/32/68_2.png) [@amitchell](https://forum.legato.io/u/amitchell)\
**Post date:** [March 8, 2016, 10:43pm UTC](https://forum.legato.io/t/wp85-interrupts/169/4 "2016-03-08T22:43:52Z")

</div>

Hi John.

It should do what you need, but there will be some latency as you’re in userspace, so quite a lot has happened before you get called. I think the best thing would be to test and see.

Sorry for the delay in replying.
