On Fri, 09 May 2014 16:11:00 +0200 Krystian Lewandowski <krystian....@gmail.com> wrote: > > I was working on GPIO under Plan9 - very simple thing but also supports > edge-raising/falling events. I had simple C code to print what pin > triggered an event. I'll try to push this simple test to github during > weekend. Though i'm not sure how it can be integrated - is events counting > enough?
I think for a rotary encoder you'd want to know about every transition. One idea is to return 1/0 on a up/down transition to a blocking read. Let the user re-enable the corresponding interrupt by writing 1 to the same fd. The user code reads from two pins and figures out which way the knob is turning. Similarly you can have user code count events if that is what you want.