|
Home > Archive > Unix Programming > January 2007 > Linux and the Parallel Port
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Linux and the Parallel Port
|
|
| Jason Curl 2007-01-16, 1:18 pm |
| Hello,
I'm trying to write a userspace driver under Linux to read data from the
parallel port. It doesn't need any IEEE modes, it just needs to monitor
inputs at arbitrary times to sense state of a particular hardware device
(e.g. when a user presses a button).
Reading a single byte from the Status Register, writing an individual
byte to the Control Register and writing to the Data Register all work
when using ioctl().
However, using (from ppdev) the PPDATADIR ioctl() doesn't seem to work
and the Data register appears to be still driving an output. Writing
directly to the control register also doesn't seem to work.
The parallel port should support bidirectional communications, although
I'm trying to figure out how to confirm that.
Is there a more specific newsgroup I should ask, or can someone else
here also give me ideas?
Thanks & Best Regards,
Jason.
| |
| David T. Ashley 2007-01-17, 7:28 pm |
| "Jason Curl" <j_dot_curl@motorola.com> wrote in message
news:eoilcn$8rk$1@engnntp2.cig.mot.com...
> Hello,
>
> I'm trying to write a userspace driver under Linux to read data from the
> parallel port. It doesn't need any IEEE modes, it just needs to monitor
> inputs at arbitrary times to sense state of a particular hardware device
> (e.g. when a user presses a button).
>
> Reading a single byte from the Status Register, writing an individual byte
> to the Control Register and writing to the Data Register all work when
> using ioctl().
>
> However, using (from ppdev) the PPDATADIR ioctl() doesn't seem to work and
> the Data register appears to be still driving an output. Writing directly
> to the control register also doesn't seem to work.
>
> The parallel port should support bidirectional communications, although
> I'm trying to figure out how to confirm that.
>
> Is there a more specific newsgroup I should ask, or can someone else here
> also give me ideas?
If nothing gets you closer, you might try contacting Donald Becker (linked
to at the page below), and see if he has any suggestions for you.
Him who writes network card drivers may know those who write parallel port
drivers, and associated newsgroups.
http://www.tux.org/pub/net/donald-becker/
--
David T. Ashley (dta@e3ft.com)
http://www.e3ft.com (Consulting Home Page)
http://www.dtashley.com (Personal Home Page)
http://gpl.e3ft.com (GPL Publications and Projects)
| |
| Jason Curl 2007-01-18, 1:17 pm |
| David T. Ashley wrote:
> "Jason Curl" <j_dot_curl@motorola.com> wrote in message
> news:eoilcn$8rk$1@engnntp2.cig.mot.com...
>
> If nothing gets you closer, you might try contacting Donald Becker (linked
> to at the page below), and see if he has any suggestions for you.
>
> Him who writes network card drivers may know those who write parallel port
> drivers, and associated newsgroups.
Thanks - I'll try posting first to the linux.parport newsgroup (e.g.
from gmane) and wait for an answer there, before contacting anybody
directly. I figured out that the features linux supports for this
particular PCMCIA parallel port (delock) is only PCSPP, missing the
TRISTATE feature to get this to work (although the website says otherwise).
>
> http://www.tux.org/pub/net/donald-becker/
>
| |
| A. W. Dunstan 2007-01-20, 7:25 pm |
| Jason Curl wrote:
> Hello,
>
> I'm trying to write a userspace driver under Linux to read data from the
> parallel port. It doesn't need any IEEE modes, it just needs to monitor
> inputs at arbitrary times to sense state of a particular hardware device
> (e.g. when a user presses a button).
>
> Reading a single byte from the Status Register, writing an individual
> byte to the Control Register and writing to the Data Register all work
> when using ioctl().
>
> However, using (from ppdev) the PPDATADIR ioctl() doesn't seem to work
> and the Data register appears to be still driving an output. Writing
> directly to the control register also doesn't seem to work.
>
> The parallel port should support bidirectional communications, although
> I'm trying to figure out how to confirm that.
>
> Is there a more specific newsgroup I should ask, or can someone else
> here also give me ideas?
>
> Thanks & Best Regards,
> Jason.
The book "Linux Device Drivers" (by Alessandro Rubini & Jonathan Corbet)
develops a parallel port driver to teach you about writing device drivers.
It's not userspace, but it might have enough information on the parallel
port to get you going. The 2nd edition is available online -
http://www.xml.com/ldd/chapter/book/. I think the parallel port stuff
starts in chapter 8.
awd
|
|
|
|
|