Re: [PARPORT] Handling interrupts with select and poll?

From: Bob Tanner (tanner@real-time.com)
Date: Thu May 01 2003 - 16:25:38 EDT

  • Next message: Bob Tanner: "Re: [PARPORT] Handling interrupts with select and poll?"

    On Thursday 01 May 2003 02:08 pm, Bob Tanner wrote:
    > Just want to confirm that the only want to handle interrupts is with select
    > or poll on the port.
    >
    > There isn't any sort of signals being sent by the libieee1284 or parport
    > that I could handle in my code.
    >
    > I don't see any in the code, but I want to post here for verification.

    I guess I need to step back. Is there something special I need to do to get
    interrupts working when the port is in epp-1.9 mode?

    The ieee1284_get_irq_fd(port) just returns the fd associated with the port.
    Which I understand I can select/poll on.

    But I can't seem to find where the library is looking at nINTR (nACK in SPP
    mode, pin 10) to handle any peripheral interrupts.

    Code snippet:

      /* Boiler plate code */
      ieee1284_find_ports(&list, 0);
      port = list.portv[0];
      ieee1284_open(port, 0, NULL);
      ieee1284_claim(port);

      int irq = ieee1284_get_irq_fd(port);
      FD_ZERO(&rfds);
      FD_SET(irq, &rfds);
      ret = select(irq+1, &rfds, &rfds, &rfds, 0);
      if (ret) {
            ieee1284_clear_irq(port, &count);
            printf("Event occurred count:%d\n", count);
      }

    The peripheral side, I have complete control over the pins (custom hardware),
    I've tried asserting and de-asserting pin 10, but select() never returns.

    I feel like I need to set something up before going into select to tell the
    library I want it to look at pin 10 (nINTR) and I want to be notified when
    something happens on that pin.

    -- 
    Bob Tanner <tanner@real-time.com>         | Phone : (952)943-8700
    http://www.mn-linux.org, Minnesota, Linux | Fax   : (952)943-8500
    Key fingerprint = AB15 0BDF BCDE 4369 5B42  1973 7CF1 A709 2CC1 B288
    

    -- 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 : Thu May 01 2003 - 16:27:58 EDT