The AVR has support for pin-change interrupts. My GPS has a 1-pulse per second signal I'd like to see if I can connect to a pin, and then get an event in my app code every time that pulse occurs.
I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?
Getting events from a pin change interrupt
Moderator: tfAteba
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Getting events from a pin change interrupt
You may use as example the serial driver interrupt handlers. In ChibiOS/RT the interrupt handlers are written in the same way on all architectures, learn once use everywhere. There is also an "how to" in the documentation that may help you.
Giovanni
Giovanni
Re: Getting events from a pin change interrupt
I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?
__________________
dhoom
__________________
dhoom
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Getting events from a pin change interrupt
wicky wrote:I realize I need to write an interrupt handler. I guess inside that I need to generate the event, but I need to create some kind of source, too, right?
dhoom
The object is called EventSource, you just have to initialize it and then broadcast events using it.
Giovanni