Robert Heller | 10 Jul 2002 21:03
Favicon

Re: [PARPORT] *Simple* Parallel port I/O...


In message <20020710194653.E19674 <at> redhat.com>, Tim Waugh writes:
>
>On Wed, Jul 10, 2002 at 01:40:15PM -0400, Robert Heller wrote:
>
>> Does there exist a really simple driver that allows one to read (in user
>> mode) the state of the parallel port.
>
>Use tunelp.

I am looking for a driver that *user mode* code can access with a
'read()' that reads the data port, as a single byte, not the status
bits!  The read() should not hang (eg should return right away with one
byte of data).  I am hoping some simple, stupid driver that does this
already exists out there, so I don't have to write one from scratch.

What I am looking to do is use an old laptop as part of a control panel
for a Model RR control station.  I'm playing on connecting stuff like
thottle and brake controls to the Joystick port *some* buttons/switches to
the Joystick buttons, but I need more than the 4 On/Off inputs the
Joystick port provides and I want to put the extra on the parallel port.
I'm planing on feeding a video source (from a Axis network camera or
similar) to the display panel.  I just want to poll the extra switches
on the parallel port.

Oh, I am thinking of using a 2.2.x kernel, if possible.

>
>Tim.
>*/
(Continue reading)

Blaise Gassend | 10 Jul 2002 22:09

Re: [PARPORT] *Simple* Parallel port I/O...

Hi Robert,

> I am looking for a driver that *user mode* code can access with a
> 'read()' that reads the data port, as a single byte, not the status
> bits!  The read() should not hang (eg should return right away with one
> byte of data).  I am hoping some simple, stupid driver that does this
> already exists out there, so I don't have to write one from scratch.

> Oh, I am thinking of using a 2.2.x kernel, if possible.

In that case, I don't think that ppdev will be available, though there
might be a backport available.

Your simplest bet in 2.2.x would probably to use ioperm and inb to get the
job done. Or you could try to port ppdev, it would be easier than
rewriting a driver from scratch. And ppdev really does exactly what you
want.

Blaise

--  To unsubscribe, send mail to: linux-parport-request <at> torque.net --
--  with the single word "unsubscribe" in the body of the message. --

Robert Heller | 11 Jul 2002 00:02
Favicon

Re: [PARPORT] *Simple* Parallel port I/O...

  Tim Waugh <twaugh <at> redhat.com>,
  In a message on Wed, 10 Jul 2002 21:35:34 +0100, wrote :

TW> On Wed, Jul 10, 2002 at 04:09:18PM -0400, Blaise Gassend wrote:
TW> 
TW> > And ppdev really does exactly what you want.
TW> 
TW> So does /dev/port on a much less fine-grained basis.  But libieee1284
TW> will figure out which is available and use whichever it can.

There seems to be a backport/patch for 2.2.17 of ppdev.  I might use this.

TW> 
TW> Tim.
TW> */
TW> 
TW> 
TW> 
TW> This message contains data in an unrecognized format, application/pgp-signature,
TW> which is being decoded and written to the file named "/home/heller/Mail/Attachments/mm.y4XIka".
TW> If you do not want this data, you probably should delete that file.
TW> Wrote file /home/heller/Mail/Attachments/mm.y4XIka
TW> 
TW>                                

                                     \/
Robert Heller                        ||InterNet:   heller <at> cs.umass.edu
http://vis-www.cs.umass.edu/~heller  ||            heller <at> deepsoft.com
http://www.deepsoft.com              /\FidoNet:    1:321/153

(Continue reading)

Tim Waugh | 10 Jul 2002 22:35
Picon
Favicon
Gravatar

Re: [PARPORT] *Simple* Parallel port I/O...

On Wed, Jul 10, 2002 at 04:09:18PM -0400, Blaise Gassend wrote:

> And ppdev really does exactly what you want.

So does /dev/port on a much less fine-grained basis.  But libieee1284
will figure out which is available and use whichever it can.

Tim.
*/
Tim Waugh | 10 Jul 2002 21:11
Picon
Favicon
Gravatar

Re: [PARPORT] *Simple* Parallel port I/O...

On Wed, Jul 10, 2002 at 03:03:47PM -0400, Robert Heller wrote:

> I am looking for a driver that *user mode* code can access with a
> 'read()' that reads the data port, as a single byte, not the status
> bits!

Sorry, I misread your mail.  Try libieee1284.  It should fall back to
using /dev/port if nothing else works.

Tim.
*/

Gmane