186d7f5d3SJohn Marino.\" Copyright (c) 1997 286d7f5d3SJohn Marino.\" Michael Smith 386d7f5d3SJohn Marino.\" 486d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without 586d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions 686d7f5d3SJohn Marino.\" are met: 786d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright 886d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer as 986d7f5d3SJohn Marino.\" the first lines of this file unmodified. 1086d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright 1186d7f5d3SJohn Marino.\" notice, this list of conditions and the following disclaimer in the 1286d7f5d3SJohn Marino.\" documentation and/or other materials provided with the distribution. 1386d7f5d3SJohn Marino.\" 1486d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' 1586d7f5d3SJohn Marino.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1686d7f5d3SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1786d7f5d3SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE 1886d7f5d3SJohn Marino.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 1986d7f5d3SJohn Marino.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2086d7f5d3SJohn Marino.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2186d7f5d3SJohn Marino.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2286d7f5d3SJohn Marino.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2386d7f5d3SJohn Marino.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2486d7f5d3SJohn Marino.\" POSSIBILITY OF SUCH DAMAGE. 2586d7f5d3SJohn Marino.\" 2686d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man4/ppi.4,v 1.4.2.7 2001/12/17 11:30:12 ru Exp $ 2786d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man4/ppi.4,v 1.4 2007/12/15 10:33:38 swildner Exp $ 2886d7f5d3SJohn Marino.\" 2986d7f5d3SJohn Marino.Dd January 2, 1998 3086d7f5d3SJohn Marino.Dt PPI 4 3186d7f5d3SJohn Marino.Os 3286d7f5d3SJohn Marino.Sh NAME 3386d7f5d3SJohn Marino.Nm ppi 3486d7f5d3SJohn Marino.Nd "user-space interface to ppbus parallel 'geek' port" 3586d7f5d3SJohn Marino.Sh SYNOPSIS 3686d7f5d3SJohn Marino.Cd "device ppi" 3786d7f5d3SJohn Marino.Pp 3886d7f5d3SJohn MarinoMinor numbering: Unit numbers correspond directly to ppbus numbers. 3986d7f5d3SJohn Marino.Sh DESCRIPTION 4086d7f5d3SJohn MarinoThe 4186d7f5d3SJohn Marino.Nm 4286d7f5d3SJohn Marinodriver provides a convenient means for user applications to manipulate the 4386d7f5d3SJohn Marinostate of the parallel port, enabling easy low-speed I/O operations without 4486d7f5d3SJohn Marinothe security problems inherent with the use of the 4586d7f5d3SJohn Marino.Pa /dev/io 4686d7f5d3SJohn Marinointerface. 4786d7f5d3SJohn Marino.Sh PROGRAMMING INTERFACE 4886d7f5d3SJohn Marino.In dev/misc/ppi/ppi.h 4986d7f5d3SJohn Marino.In bus/ppbus/ppbconf.h 5086d7f5d3SJohn Marino.Pp 5186d7f5d3SJohn MarinoAll I/O on the 5286d7f5d3SJohn Marino.Nm 5386d7f5d3SJohn Marinointerface is performed using 5486d7f5d3SJohn Marino.Fn ioctl 5586d7f5d3SJohn Marinocalls. Each command takes a single 5686d7f5d3SJohn Marino.Ft u_int8_t 5786d7f5d3SJohn Marinoargument, transferring one byte of data. The following commands are 5886d7f5d3SJohn Marinoavailable: 5986d7f5d3SJohn Marino.Bl -tag -width indent 6086d7f5d3SJohn Marino.It Dv PPIGDATA , PPISDATA 6186d7f5d3SJohn MarinoGet and set the contents of the data register. 6286d7f5d3SJohn Marino.It Dv PPIGSTATUS , PPISSTATUS 6386d7f5d3SJohn MarinoGet and set the contents of the status register. 6486d7f5d3SJohn Marino.It Dv PPIGCTRL , PPISCTRL 6586d7f5d3SJohn MarinoGet and set the contents of the control register. 6686d7f5d3SJohn MarinoThe following defines correspond to bits in this register. Setting 6786d7f5d3SJohn Marinoa bit in the control register drives the corresponding output low. 6886d7f5d3SJohn Marino.Bl -tag -width indent -compact 6986d7f5d3SJohn Marino.It Dv STROBE 7086d7f5d3SJohn Marino.It Dv AUTOFEED 7186d7f5d3SJohn Marino.It Dv nINIT 7286d7f5d3SJohn Marino.It Dv SELECTIN 7386d7f5d3SJohn Marino.It Dv PCD 7486d7f5d3SJohn Marino.El 7586d7f5d3SJohn Marino.It Dv PPIGEPPA , PPISEPPA 7686d7f5d3SJohn MarinoGet and set the address bits of the EPP control register. 7786d7f5d3SJohn Marino.It Dv PPIGEPPD , PPISEPPD 7886d7f5d3SJohn MarinoGet and set the data bits of the EPP control register. 7986d7f5d3SJohn Marino.It Dv PPIGECR , PPISECR 8086d7f5d3SJohn MarinoGet and set the contents of the ECP control register. 8186d7f5d3SJohn Marino.It Dv PPIGFIFO , PPISFIFO 8286d7f5d3SJohn MarinoRead and write the ECP FIFO (8-bit operations only). 8386d7f5d3SJohn Marino.El 8486d7f5d3SJohn Marino.Sh EXAMPLES 8586d7f5d3SJohn MarinoTo present the value 0x5a to the data port, drive STROBE low and then high 8686d7f5d3SJohn Marinoagain, the following code fragment can be used: 8786d7f5d3SJohn Marino.Bd -literal -compact 8886d7f5d3SJohn Marino 8986d7f5d3SJohn Marino int fd; 9086d7f5d3SJohn Marino u_int8_t val; 9186d7f5d3SJohn Marino 9286d7f5d3SJohn Marino val = 0x5a; 9386d7f5d3SJohn Marino ioctl(fd, PPISDATA, &val); 9486d7f5d3SJohn Marino ioctl(fd, PPIGCTRL, &val); 9586d7f5d3SJohn Marino val |= STROBE; 9686d7f5d3SJohn Marino ioctl(fd, PPISCTRL, &val); 9786d7f5d3SJohn Marino val &= ~STROBE; 9886d7f5d3SJohn Marino ioctl(fd, PPISCTRL, &val); 9986d7f5d3SJohn Marino 10086d7f5d3SJohn Marino.Ed 10186d7f5d3SJohn Marino.Sh BUGS 10286d7f5d3SJohn MarinoThe inverse sense of signals is confusing. 10386d7f5d3SJohn Marino.Pp 10486d7f5d3SJohn MarinoThe 10586d7f5d3SJohn Marino.Fn ioctl 10686d7f5d3SJohn Marinointerface is slow, and there is no way (yet) to chain multiple operations together. 107