9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Bakul Shah <bakul@bitblocks.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] radio
Date: Fri,  9 May 2014 16:21:47 -0700	[thread overview]
Message-ID: <20140509232147.44E86B827@mail.bitblocks.com> (raw)
In-Reply-To: Your message of "Fri, 09 May 2014 16:11:00 +0200." <CALU+4c42BySF=OXTTHiTw4m0anQ7dnqfJds2a9Rs2rTucCurhw@mail.gmail.com>

On Fri, 09 May 2014 16:11:00 +0200 Krystian Lewandowski <krystian.lew@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.



  parent reply	other threads:[~2014-05-09 23:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 11:06 Steve Simon
2014-05-08 17:19 ` Bakul Shah
2014-05-08 17:58   ` Steve Simon
2014-05-08 18:36     ` Bakul Shah
2014-05-09 14:11       ` Krystian Lewandowski
2014-05-09 15:43         ` Skip Tavakkolian
2014-05-09 23:21         ` Bakul Shah [this message]
2014-05-10 11:35           ` Krystian Lewandowski
2014-05-08 18:51   ` Skip Tavakkolian
2014-05-08 19:04     ` Steve Simon
2014-05-08 20:07       ` Steven Stallion
2014-05-08 20:26         ` Skip Tavakkolian
2014-05-09 12:34   ` Steve Simon
2014-05-09 12:46     ` erik quanstrom
2014-05-09 12:54       ` lucio
2014-05-09 12:59         ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140509232147.44E86B827@mail.bitblocks.com \
    --to=bakul@bitblocks.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).