'\" t .\" Title: ieee1284_status .\" Author: Tim Waugh .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 04/07/2024 .\" Manual: Functions .\" Source: [FIXME: source] .\" Language: English .\" .TH "IEEE1284_STATUS" "3" "04/07/2024" "[FIXME: source]" "Functions" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" ieee1284_read_status, ieee1284_wait_status \- analyse status lines .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ ieee1284_read_status('u .BI "int ieee1284_read_status(struct\ parport\ *" "port" ");" .HP \w'int\ ieee1284_wait_status('u .BI "int ieee1284_wait_status(struct\ parport\ *" "port" ", unsigned\ char\ " "mask" ", unsigned\ char\ " "val" ", struct\ timeval\ *" "timeout" ");" .SH "DESCRIPTION" .PP There are five status lines, one of which is usually inverted on PC\-style ports\&. Where they differ, libieee1284 operates on the IEEE 1284 values, not the PC\-style inverted values\&. The status lines are represented by the following enumeration: .sp .if n \{\ .RS 4 .\} .nf enum ieee1284_status_bits { S1284_NFAULT = 0x08, S1284_SELECT = 0x10, S1284_PERROR = 0x20, S1284_NACK = 0x40, S1284_BUSY = 0x80, /* To convert those values into PC\-style register values, use this: */ S1284_INVERTED = S1284_BUSY, }; .fi .if n \{\ .RE .\} .PP These functions all act on the parallel port associated with \fIport\fR, which must be claimed\&. .PP The purpose of \fBieee1284_wait_status\fR is to wait until particular status lines have specified values\&. Its \fItimeout\fR parameter may be modified on return\&. .SH "RETURN VALUE" .PP For \fBieee1284_read_status\fR, the return value is a non\-negative integer with bits set as appropriate representing the status lines\&. A negative result indicates an error\&. .PP For \fBieee1284_wait_status\fR, the return value is \fBE1284_OK\fR if the status lines now reflect the desired values (i\&.e\&. status & \fImask\fR is \fIval\fR), or a negative result indicating an error\&. .PP Possible error codes: .PP \fBE1284_NOTIMPL\fR .RS 4 The \fIport\fR lacks the required capability\&. This could be due to a limitation of this version of libieee1284, or a hardware limitation\&. .RE .PP \fBE1284_NOTAVAIL\fR .RS 4 Access to the status lines is not available on this port type\&. .RE .PP \fBE1284_TIMEDOUT\fR .RS 4 The \fItimeout\fR has elapsed\&. .RE .PP \fBE1284_INVALIDPORT\fR .RS 4 The \fIport\fR parameter is invalid (for instance, perhaps the \fIport\fR is not claimed)\&. .RE .SH "NOTES" .PP The nAck pin is often able to trigger interrupts on the host machine\&. With operating system help these interrupts may be visible to the application via the file descriptor returned by \fBieee1284_get_irq_fd\fR\&. .PP Under Linux, the conditions are that the parallel port driver knows which interrupt line to use and is using it, and that the relevant /dev/parport device node is accessible and backed by a device driver\&. .SH "AUTHOR" .PP \fBTim Waugh\fR <\&twaugh@redhat.com\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2001-2003 Tim Waugh .br