'\" t .\" Title: ieee1284_data .\" Author: Tim Waugh .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 04/07/2024 .\" Manual: Functions .\" Source: [FIXME: source] .\" Language: English .\" .TH "IEEE1284_DATA" "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_data, ieee1284_write_data, ieee1284_data_dir, ieee1284_wait_data \- control the data lines .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ ieee1284_read_data('u .BI "int ieee1284_read_data(struct\ parport\ *" "port" ");" .HP \w'void\ ieee1284_write_data('u .BI "void ieee1284_write_data(struct\ parport\ *" "port" ", unsigned\ char\ " "dt" ");" .HP \w'int\ ieee1284_data_dir('u .BI "int ieee1284_data_dir(struct\ parport\ *" "port" ", int\ " "reverse" ");" .HP \w'int\ ieee1284_wait_data('u .BI "int ieee1284_wait_data(struct\ parport\ *" "port" ", unsigned\ char\ " "mask" ", unsigned\ char\ " "val" ", struct\ timeval\ *" "timeout" ");" .SH "DESCRIPTION" .PP These functions manipulate the data lines of the parallel port associated with \fIport\fR (which must have been claimed using \fBieee1284_claim\fR(3))\&. The lines are represented by an 8\-bit number (one line per bit) and a direction\&. The data lines are driven as a group; they may be all host\-driven (forward direction) or not (reverse direction)\&. When the peripheral is driving them the host must not\&. .PP For \fBieee1284_data_dir\fR the \fIreverse\fR parameter should be zero to turn the data line drivers on and non\-zero to turn them off\&. Some port types may be unable to switch off the data line drivers\&. .PP Setting the data lines may have side effects on some port types (for example, some Amiga ports pulse nStrobe)\&. .PP \fBieee1284_wait_data\fR waits, up until the \fItimeout\fR, for the data bits specified in \fImask\fR to have the corresponding values in \fIval\fR\&. .SH "RETURN VALUE" .PP \fBieee1284_read_data\fR returns the 8\-bit number representing the data lines unless it is not possible to return such a value with this port type, in which case it returns an error code\&. Possible error codes: .PP \fBE1284_NOTAVAIL\fR .RS 4 Bi\-directional data lines are not available on this system\&. .RE .PP \fBE1284_INVALIDPORT\fR .RS 4 The \fIport\fR parameter is invalid (perhaps it has not been claimed, for instance)\&. .RE .PP \fBE1284_SYS\fR .RS 4 There was an error at the operating system level, and \fIerrno\fR has been set accordingly\&. .RE .PP \fBE1284_TIMEDOUT\fR .RS 4 The \fItimeout\fR has elapsed\&. .RE .PP Whereas \fBieee1284_read_data\fR may return \fBE1284_NOTAVAIL\fR on its first invocation on the port, if it does not do so then it cannot until \fBieee1284_close\fR is called for that port\&. .SH "AUTHOR" .PP \fBTim Waugh\fR <\&twaugh@redhat.com\&> .RS 4 Author. .RE .SH "COPYRIGHT" .br Copyright \(co 2001-2003 Tim Waugh .br