PPUI(9) NetBSD Kernel Manual PPUI(9)
NAME
- ppui
- user-space parallel port interface
SYNOPSIS
#include <sys/ioctl.h>
#include <dev/ppbus/ppui.h>
#include <dev/ppbus/ppbus_conf.h>
DESCRIPTION
All I/O on the ppui interface is performed using ioctl() calls. Each
command takes a single u_int8_t argument, transferring one byte of data.
The following commands are available:
- PPIGDATA, PPISDATA
- Get and set the contents of the data register.
- PPIGSTATUS, PPISSTATUS
- Get and set the contents of the status register.
- PPIGCTRL, PPISCTRL
-
Get and set the contents of the control register. The following
defines correspond to bits in this register. Setting a bit in
the control register drives the corresponding output low.
- STROBE
- AUTOFEED
- nINIT
- SELECTIN
- PCD
- PPIGEPP, PPISEPP
- Get and set the contents of the EPP control register.
- PPIGECR, PPISECR
- Get and set the contents of the ECP control register.
- PPIGFIFO, PPISFIFO
- Read and write the ECP FIFO (8-bit operations only).
EXAMPLES
To present the value 0x5a to the data port, drive STROBE low and then
high again, the following code fragment can be used:
int fd;
u_int8_t val;
val = 0x5a;
ioctl(fd, PPISDATA, &val);
ioctl(fd, PPIGCTRL, &val);
val |= STROBE;
ioctl(fd, PPISCTRL, &val);
val &= ~STROBE;
ioctl(fd, PPISCTRL, &val);
FILES
None: see BUGS.
SEE ALSO
ioctl(2), atppc(4), io(4), ppbus(4), ppui(4)
HISTORY
ppui originally appeared in FreeBSD as ppi(4).
AUTHORS
This manual page is based on the FreeBSD ppi(4) manual page and was updated
for NetBSD's port by Gary Thorpe.
BUGS
- The inverse sense of signals is confusing.
- The ioctl() interface is slow, and there is no way (yet) to chain
multiple operations together.
- ppui needs to be assigned a major device number manually. The
device special file also needs to be created manually.
February 16, 2003