Technical data
SunOS 5.5 Devices bpp(7D)
NAME bpp − bi-directional parallel port driver
SYNOPSIS SUNW,bpp@slot,offset:bppn
DESCRIPTION The bpp driver provides a general-purpose bi-directional interface to parallel devices. It
supports a variety of output (printer) and input (scanner) devices, usingprogrammable
timing relationships between the various handshakesignals.
APPLICATION
PROGRAMMING
INTERFACE
The bpp driver is an exclusive-usedevice. If the device has already been opened, subse-
quent opens fail withEBUSY.
Default Operation Each time the bpp device is opened, the default configuration isBPP_ACK_BUSY_HS for
read handshake,BPP_ACK_HS for write handshake, 1 microsecond for all setup times
and strobe widths, and 60 seconds for both timeouts. This configuration (in the write
mode) drives many common personal computer parallel printers with Centronics-type
interfaces. The application should use theBPPIOC_SETPARMS ioctl request to configure
the bpp for the particular device which is attached, if necessary.
Write Operation If a failure or error condition occurs during a write(2), the number of bytes successfully
written is returned (short write). Note that errno will not be set. The contents of certain
status bits will be captured at the time of the error, and can be retrieved by the applica-
tion program, using theBPPIOC_GETERR ioctl request. Subsequent write(2) calls may
fail with the system error ENXIO if the error condition is not rectified. The captured
status information will be overwritten each time an attempted transfer or a
BPPIOC_TESTIO ioctl request occurs.
Read Operations If a failure or error condition occurs during a read(2), the number of bytes successfully
read is returned (short read). Note that errno will not be set. The contents of certain
status bits will be captured at the time of the error, and can be retrieved by the applica-
tion, using theBPPIOC_GETERR ioctl request. Subsequent read(2) calls may fail with
ENXIO if the error condition is not rectified. The captured register information will be
overwritten each time an attempted transfer or a BPPIOC_TESTIO ioctl request.
If the read_handshake element of the bpp_transfer_parms structure (see below) is set to
BPP_CLEAR_MEM or BPP_SET_MEM, zeroes or ones, respectively, are written into the
user buffer.
Read/Write
Operation
When the driver is opened for reading and writing, it is assumed that scanningwill take
place, as scanners are the only devices supported by this mode. Most scanners require
that theSLCT_IN or AFX pin be set to tell the scanner the direction of the transfer. The
AFX line is set when the read_handshake element of the bpp_transfer_parms structure is
set to BPP_HSCAN_HS, otherwise theSLCT_IN pin is set. Normally, scanningstarts by
writing a command to the scanner, at which time the pin is set. When the scan data is
read back, the pin is reset.
modified 22 Aug 1994 7D-43










