man.bsd.lv manual page server

Manual Page Search Parameters

PPI(4) Device Drivers Manual PPI(4)

ppiuser-space interface to ppbus parallel 'geek' port

device ppi

Minor numbering: Unit numbers correspond directly to ppbus numbers.

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.

<dev/misc/ppi/ppi.h> <bus/ppbus/ppbconf.h>

All I/O on the ppi interface is performed using () calls. Each command takes a single u_int8_t argument, transferring one byte of data. The following commands are available:

, PPISDATA
Get and set the contents of the data register.
, PPISSTATUS
Get and set the contents of the status register.
, 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.
 
 
 
 
 
, PPISEPPA
Get and set the address bits of the EPP control register.
, PPISEPPD
Get and set the data bits of the EPP control register.
, PPISECR
Get and set the contents of the ECP control register.
, PPISFIFO
Read and write the ECP FIFO (8-bit operations only).

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);

The inverse sense of signals is confusing.

The ioctl() interface is slow, and there is no way (yet) to chain multiple operations together.

January 2, 1998 DragonFly-5.6.1