[PARPORT] Re: libieee1284: access ecp control reg?

From: Tim Waugh (twaugh@redhat.com)
Date: Tue Aug 12 2003 - 06:14:17 EDT

  • Next message: Luis LLN: "[PARPORT] Problems with parallel port"

    On Tue, Aug 12, 2003 at 03:02:57AM -0500, Ryan Underwood wrote:

    > Original Turbo C++ code:
    >
    > while (inp (status_reg)&0x80)) i++;
    > if (i > threshold) exit(1);
    >
    > // outp (control_reg, 0x24);
    > outp (control_reg, 0x26);
    > readval=inp (data_reg);
    > // outp (control_reg, 0x24);
    >
    > outp (control_reg, 0x04);
    > outp (data_reg, val);
    > outp (control_reg, 0x05);
    > outp (control_reg, 0x04);
    >
    > return readval;

    Does this work with as-is, or did you add the //s during translation?
    It could be a timing thing I suppose. Each one is an extra ISA cycle
    (for the author).

    Also, there seems to be a condition here where the data lines are
    going to be driven by both the host and the peripheral -- immediately
    after reading the data lines, you turn on the data line drivers but
    presumably the peripheral is still driving them. I think that's
    probably what the commented lines were there to avoid.

    Tim.
    */



    -- 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 : Tue Aug 12 2003 - 06:33:06 EDT