xref: /dflybsd-src/share/man/man4/ppi.4 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino.\" Copyright (c) 1997
2*86d7f5d3SJohn Marino.\"      Michael Smith
3*86d7f5d3SJohn Marino.\"
4*86d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
5*86d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
6*86d7f5d3SJohn Marino.\" are met:
7*86d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
8*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer as
9*86d7f5d3SJohn Marino.\"    the first lines of this file unmodified.
10*86d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
11*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
12*86d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
13*86d7f5d3SJohn Marino.\"
14*86d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS''
15*86d7f5d3SJohn Marino.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*86d7f5d3SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*86d7f5d3SJohn Marino.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
18*86d7f5d3SJohn Marino.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19*86d7f5d3SJohn Marino.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20*86d7f5d3SJohn Marino.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21*86d7f5d3SJohn Marino.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22*86d7f5d3SJohn Marino.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23*86d7f5d3SJohn Marino.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24*86d7f5d3SJohn Marino.\" POSSIBILITY OF SUCH DAMAGE.
25*86d7f5d3SJohn Marino.\"
26*86d7f5d3SJohn Marino.\" $FreeBSD: src/share/man/man4/ppi.4,v 1.4.2.7 2001/12/17 11:30:12 ru Exp $
27*86d7f5d3SJohn Marino.\" $DragonFly: src/share/man/man4/ppi.4,v 1.4 2007/12/15 10:33:38 swildner Exp $
28*86d7f5d3SJohn Marino.\"
29*86d7f5d3SJohn Marino.Dd January 2, 1998
30*86d7f5d3SJohn Marino.Dt PPI 4
31*86d7f5d3SJohn Marino.Os
32*86d7f5d3SJohn Marino.Sh NAME
33*86d7f5d3SJohn Marino.Nm ppi
34*86d7f5d3SJohn Marino.Nd "user-space interface to ppbus parallel 'geek' port"
35*86d7f5d3SJohn Marino.Sh SYNOPSIS
36*86d7f5d3SJohn Marino.Cd "device ppi"
37*86d7f5d3SJohn Marino.Pp
38*86d7f5d3SJohn MarinoMinor numbering:  Unit numbers correspond directly to ppbus numbers.
39*86d7f5d3SJohn Marino.Sh DESCRIPTION
40*86d7f5d3SJohn MarinoThe
41*86d7f5d3SJohn Marino.Nm
42*86d7f5d3SJohn Marinodriver provides a convenient means for user applications to manipulate the
43*86d7f5d3SJohn Marinostate of the parallel port, enabling easy low-speed I/O operations without
44*86d7f5d3SJohn Marinothe security problems inherent with the use of the
45*86d7f5d3SJohn Marino.Pa /dev/io
46*86d7f5d3SJohn Marinointerface.
47*86d7f5d3SJohn Marino.Sh PROGRAMMING INTERFACE
48*86d7f5d3SJohn Marino.In dev/misc/ppi/ppi.h
49*86d7f5d3SJohn Marino.In bus/ppbus/ppbconf.h
50*86d7f5d3SJohn Marino.Pp
51*86d7f5d3SJohn MarinoAll I/O on the
52*86d7f5d3SJohn Marino.Nm
53*86d7f5d3SJohn Marinointerface is performed using
54*86d7f5d3SJohn Marino.Fn ioctl
55*86d7f5d3SJohn Marinocalls.  Each command takes a single
56*86d7f5d3SJohn Marino.Ft u_int8_t
57*86d7f5d3SJohn Marinoargument, transferring one byte of data.  The following commands are
58*86d7f5d3SJohn Marinoavailable:
59*86d7f5d3SJohn Marino.Bl -tag -width indent
60*86d7f5d3SJohn Marino.It Dv PPIGDATA , PPISDATA
61*86d7f5d3SJohn MarinoGet and set the contents of the data register.
62*86d7f5d3SJohn Marino.It Dv PPIGSTATUS , PPISSTATUS
63*86d7f5d3SJohn MarinoGet and set the contents of the status register.
64*86d7f5d3SJohn Marino.It Dv PPIGCTRL , PPISCTRL
65*86d7f5d3SJohn MarinoGet and set the contents of the control register.
66*86d7f5d3SJohn MarinoThe following defines correspond to bits in this register.  Setting
67*86d7f5d3SJohn Marinoa bit in the control register drives the corresponding output low.
68*86d7f5d3SJohn Marino.Bl -tag -width indent -compact
69*86d7f5d3SJohn Marino.It Dv STROBE
70*86d7f5d3SJohn Marino.It Dv AUTOFEED
71*86d7f5d3SJohn Marino.It Dv nINIT
72*86d7f5d3SJohn Marino.It Dv SELECTIN
73*86d7f5d3SJohn Marino.It Dv PCD
74*86d7f5d3SJohn Marino.El
75*86d7f5d3SJohn Marino.It Dv PPIGEPPA , PPISEPPA
76*86d7f5d3SJohn MarinoGet and set the address bits of the EPP control register.
77*86d7f5d3SJohn Marino.It Dv PPIGEPPD , PPISEPPD
78*86d7f5d3SJohn MarinoGet and set the data bits of the EPP control register.
79*86d7f5d3SJohn Marino.It Dv PPIGECR , PPISECR
80*86d7f5d3SJohn MarinoGet and set the contents of the ECP control register.
81*86d7f5d3SJohn Marino.It Dv PPIGFIFO , PPISFIFO
82*86d7f5d3SJohn MarinoRead and write the ECP FIFO (8-bit operations only).
83*86d7f5d3SJohn Marino.El
84*86d7f5d3SJohn Marino.Sh EXAMPLES
85*86d7f5d3SJohn MarinoTo present the value 0x5a to the data port, drive STROBE low and then high
86*86d7f5d3SJohn Marinoagain, the following code fragment can be used:
87*86d7f5d3SJohn Marino.Bd -literal -compact
88*86d7f5d3SJohn Marino
89*86d7f5d3SJohn Marino	int		fd;
90*86d7f5d3SJohn Marino	u_int8_t	val;
91*86d7f5d3SJohn Marino
92*86d7f5d3SJohn Marino	val = 0x5a;
93*86d7f5d3SJohn Marino	ioctl(fd, PPISDATA, &val);
94*86d7f5d3SJohn Marino	ioctl(fd, PPIGCTRL, &val);
95*86d7f5d3SJohn Marino	val |= STROBE;
96*86d7f5d3SJohn Marino	ioctl(fd, PPISCTRL, &val);
97*86d7f5d3SJohn Marino	val &= ~STROBE;
98*86d7f5d3SJohn Marino	ioctl(fd, PPISCTRL, &val);
99*86d7f5d3SJohn Marino
100*86d7f5d3SJohn Marino.Ed
101*86d7f5d3SJohn Marino.Sh BUGS
102*86d7f5d3SJohn MarinoThe inverse sense of signals is confusing.
103*86d7f5d3SJohn Marino.Pp
104*86d7f5d3SJohn MarinoThe
105*86d7f5d3SJohn Marino.Fn ioctl
106*86d7f5d3SJohn Marinointerface is slow, and there is no way (yet) to chain multiple operations together.
107