From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Fri, 09 May 2014 16:11:00 +0200." References: <275c3465707d98d4c1f88f81b40670fd@quintile.net> <20140508183622.E368BB827@mail.bitblocks.com> Date: Fri, 9 May 2014 16:21:47 -0700 From: Bakul Shah Message-Id: <20140509232147.44E86B827@mail.bitblocks.com> Subject: Re: [9fans] radio Topicbox-Message-UUID: e54121a4-ead8-11e9-9d60-3106f5b1d025 On Fri, 09 May 2014 16:11:00 +0200 Krystian Lewandowski 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.