tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Adding pulse support to gpio(4), gpioctl(8)
On Tue, Aug 23, 2011 at 08:24:03AM +0200, Marc Balmer wrote:
> Furthermore I am thinking if it would be useful if more than one process
> could open a gpio device, as a long as they use different pins, e.g. one
> process controlls a stepper motor using some of the pins while another
> process drives some LEDs.
Perhaps something like this?
gpioctl gpio0 attach gpio 0 0xf
(attaches gpio1 on pins 0..3 of gpio0)
gpioctl gpio0 attach gpio 4 0xf
(attaches gpio2 on pins 4..7 of gpio0)
gpioctl gpio0 attach gpio 1 0xc
(fails w/ EBUSY)
gpioctl gpio0 attach gpio 3 0x7
(fails w/ EBUSY)
Then the stepper-motor process operates exclusively on /dev/gpio1, and
the LED process exclusively on /dev/gpio2.
Dave
--
David Young OJC Technologies
dyoung%ojctech.com@localhost Urbana, IL * (217) 344-0444 x24
Home |
Main Index |
Thread Index |
Old Index