Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ppi(4) [posix man page]

PPI(4)							   BSD Kernel Interfaces Manual 						    PPI(4)

ppi -- user-space interface to ppbus parallel 'geek' port SYNOPSIS
device ppi Minor numbering: unit numbers correspond directly to ppbus numbers. #include <dev/ppbus/ppi.h> #include <dev/ppbus/ppbconf.h> DESCRIPTION
The ppi driver provides a convenient means for user applications to manipulate the state of the parallel port, enabling easy low-speed I/O operations without the security problems inherent with the use of the /dev/io interface. PROGRAMMING INTERFACE
All I/O on the ppi 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); BUGS
The inverse sense of signals is confusing. The ioctl() interface is slow, and there is no way (yet) to chain multiple operations together. The headers required for user applications are not installed as part of the standard system. BSD
January 2, 1998 BSD

Check Out this Related Man Page

LPT(4)							   BSD Kernel Interfaces Manual 						    LPT(4)

lpt -- generic printer device driver SYNOPSIS
device ppc device ppbus device lpt DESCRIPTION
The current lpt driver is the port of the original lpt driver to the ppbus(4) system. One purpose of this port was to allow parallel port sharing with other parallel devices. Secondly, inb()/outb() calls have been replaced by ppbus function calls. lpt is now arch-independent thanks to the ppbus interface. See ppbus(4) for more info about the ppbus system. The parallel port bus is allocated by lpt when the printer device is opened and released only when the transfer is completed: either when the device is closed or when the entire buffer is sent in interrupt driven mode. The driver can be configured to be either interrupt-driven, or to poll the printer. Ports that are configured to be interrupt-driven can be switched to polled mode by using the lptcontrol(8) command. Depending on your hardware, extended capabilities may be configured with the lptcontrol(8) command. With an ECP/ISA port, you can take advantage of FIFO and DMA. In order to retrieve printer info from /dev/lpt0, just apply the cat command to the device. If the printer supports IEEE1284 nibble mode and has data to send to the host, you will get it. FILES
/dev/lpt0 first parallel port driver SEE ALSO
ppbus(4), ppc(4), lptcontrol(8) HISTORY
This driver replaces the functionality of the lpa driver, which is now defunct. BUGS
There are lots of them, especially in cheap parallel port implementations. It is only possible to open a lpt port when a printer is connected and on-line, making it impossible to run lptcontrol(8) when there is no printer connected. This driver could still stand a rewrite. BSD
February 14, 1999 BSD
Man Page