/*
 * $Header: /smsa/bsd:include/dev/cent.h:bsd  1.6  $
 * $Source: /smsa/bsd:include/dev/cent.h: $
 *
 * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __dev_cent_h
#define __dev_cent_h

/*
 * Centronics Device Registers: these vary according to the machine.
 * In all cases the data register is private.  On the A680 there is
 * also a private control register which contains the strobe bit
 * and other bits for control of the port (on write), and some bits
 * which report the printer's status (on read).  The A680 parallel
 * port may be operated in an input mode (not supported here).
 * This register lives at the address which on the A500 and A440 is
 * occupied by a register called EXT_B_LATCH.  This latter register 
 * is write-only, is shared with other devices, and has only one bit
 * in it to do with the printer interface, the "strobe" bit.  Further
 * confusion arises because this is bit 4 on the A500/A440 whereas 
 * "strobe" in the A680 control reg is bit 0.  Oh what a mess.
 */

/*
 * The data register is common to all machines: on the A680 this is r/w
 * (for input use also), on all other machines it is write only.  This 
 * driver currently only ever writes to it.
 */
#define	CENTRONICS_DATA	   ((volatile unsigned char *)0x3350010)
/*
 * Control/status register definitions
 * for A680 use only
 */
#define CENTRONICS_CONTROL ((volatile unsigned char *)0x3350018) /* write-only */
#define CENTRONICS_STATUS  ((volatile unsigned char *)0x3350018) /* read-only */

/*
 * Definitions of bits in control register (write-only) on A680 only.
 * [I] means bit is meaningful when port is being used as an input
 * (reading from e.g. scanner), [O] when as an output (sending to
 * printer).
 */

#define	CE_PRST		0x20			/* reset printer [O] */
#define	CE_CBSY		0x10			/* host busy [I] */
#define	CE_ACK		0x08			/* host ack pulse [I] */
#define	CE_ALF		0x04			/* set ALF on printer [O] */
#define	CE_PDIR		0x02			/* set port dirn: 0=out 1=in */
#define	CE_STRB		0x01			/* strobe data out [O] */

/*
 * Bits in status register (read-only) (A680 only).
 */

#define	CE_SELECT	0x80			/* printer on-line */
#define	CE_ERROR	0x40			/* printer error */
#define	CE_PE		0x01			/* paper error */


#define LPLOWAT		40
#define LPHIWAT		100
#define FORM		0xC

#endif/*__dev_cent_h*/

/* EOF cent.h */
