01-21-07 12:25 AM
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
[ Post a follow-up to this message ]
|