1IEEE1284_STATUS(3)                 Functions                IEEE1284_STATUS(3)
2
3
4

NAME

6       ieee1284_read_status, ieee1284_wait_status - analyse status lines
7

SYNOPSIS

9       #include <ieee1284.h>
10
11       int ieee1284_read_status(struct parport *port);
12
13       int ieee1284_wait_status(struct parport *port, unsigned char mask,
14                                unsigned char val, struct timeval *timeout);
15

DESCRIPTION

17       There are five status lines, one of which is usually inverted on
18       PC-style ports. Where they differ, libieee1284 operates on the IEEE
19       1284 values, not the PC-style inverted values. The status lines are
20       represented by the following enumeration:
21
22           enum ieee1284_status_bits
23           {
24             S1284_NFAULT = 0x08,
25             S1284_SELECT = 0x10,
26             S1284_PERROR = 0x20,
27             S1284_NACK   = 0x40,
28             S1284_BUSY   = 0x80,
29             /* To convert those values into PC-style register values, use this: */
30             S1284_INVERTED = S1284_BUSY,
31           };
32
33       These functions all act on the parallel port associated with port,
34       which must be claimed.
35
36       The purpose of ieee1284_wait_status is to wait until particular status
37       lines have specified values. Its timeout parameter may be modified on
38       return.
39

RETURN VALUE

41       For ieee1284_read_status, the return value is a non-negative integer
42       with bits set as appropriate representing the status lines. A negative
43       result indicates an error.
44
45       For ieee1284_wait_status, the return value is E1284_OK if the status
46       lines now reflect the desired values (i.e. status & mask is val), or a
47       negative result indicating an error.
48
49       Possible error codes:
50
51       E1284_NOTIMPL
52           The port lacks the required capability. This could be due to a
53           limitation of this version of libieee1284, or a hardware
54           limitation.
55
56       E1284_NOTAVAIL
57           Access to the status lines is not available on this port type.
58
59       E1284_TIMEDOUT
60           The timeout has elapsed.
61
62       E1284_INVALIDPORT
63           The port parameter is invalid (for instance, perhaps the port is
64           not claimed).
65

NOTES

67       The nAck pin is often able to trigger interrupts on the host machine.
68       With operating system help these interrupts may be visible to the
69       application via the file descriptor returned by ieee1284_get_irq_fd.
70
71       Under Linux, the conditions are that the parallel port driver knows
72       which interrupt line to use and is using it, and that the relevant
73       /dev/parport device node is accessible and backed by a device driver.
74

AUTHOR

76       Tim Waugh <twaugh@redhat.com>
77           Author.
78
80       Copyright © 2001-2003 Tim Waugh
81
82
83
84[FIXME: source]                   01/19/2023                IEEE1284_STATUS(3)
Impressum