Re: [PARPORT] simple parallel device

From: Jason Majors (jason@kwiqsilver.org)
Date: Wed May 14 2003 - 03:01:30 EDT

  • Next message: Tim Waugh: "Re: [PARPORT] simple parallel device"

    > > I want the software to be able to use a blocking call like select() that'll
    > > just sit and wait for the parallel port to change (in its own thread).
    >
    > If you connect to the right pin (nAck), you'll get an interrupt, and
    > so you can literally use select() on the file descriptor you get from
    > ieee1284_get_irq_fd() (from libieee1284), or just the file descriptor
    > associated with the ppdev device.
    >
    Very cool! I started reading up on libieee1284. I think
    ieee1284_wait_status() will do exactly what I need.

    I'm using two threads one containing:
    ret = ieee1284_wait_status(paraport, S1284_SELECT, S1284_SELECT, &tv);
    and the other containing:
    ret = ieee1284_wait_status(paraport, S1284_NACK, S1284_NACK, &tv);

    If I read the man page correctly, it should sit until either tv.tv_sec
    seconds pass or the appropriate pin goes high, but they're coming back
    immediately. Do I need to set them low somehow? Nothing is connected to the
    parallel port on that machine yet.

    Also, which pin is associated with which enum value?

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



    This archive was generated by hypermail 2b29 : Wed May 14 2003 - 03:10:33 EDT