/************************************************/
/* uPD7210 driver				*/
/*----------------------------------------------*/
/*	for FreeBSD 3.4-RELEASE			*/
/*						*/
/************************************************/


/***** Feature test switches ************************************************/
#ifndef	_I386_ISA_GP_UPD7210_H_
#define	_I386_ISA_GP_UPD7210_H_


/***** System headers *******************************************************/
#include <sys/ioccom.h>


/***** Local headers ********************************************************/
/***** Constat values *******************************************************/
#define GPIB_MAX_DEVICE  15	/* Maxmum GPIB Devices */
#define GPIB_MAX_ADDRESS 30	/* address area is 0 to 30 */

/* error code */
#define GPIB_NOERR	0	/* No error */
#define GPIB_EUNKNOWN	-1	/* Unknown error */
#define GPIB_ERANGE	-2	/* Value out of range */
#define GPIB_ETIME	-3	/* Timeout */
#define GPIB_ECTRL	-4	/* GP-IB must be controller */
#define GPIB_EPASS	-5	/* Pass control not permitted */
#define GPIB_EADDR	-6	/* Improper addressing */
#define GPIB_EBFULL	-7	/* Buffer full */

/* delimiter code */
#define GPIB_DLM_CR	0x01
#define GPIB_DLM_LF	0x02
#define GPIB_DLM_EOI	0x80



/***** Typedefs *************************************************************/
typedef struct
{
    int talker;
    int listener[GPIB_MAX_DEVICE];
    int delim;
    int msglen;
    char *pbuf;
    int errno;
} GPIB_PACKET;


/***** Macros ***************************************************************/
/* Level 0 Change default value group */
#define GPIB_DELIM	_IOW( 'G', 20, int )
#define GPIB_TIMEOUT	_IOW( 'G', 21, int )


/* Level 1 Low level function group */
#define GPIB_IFC	_IOWR( 'G', 30, GPIB_PACKET )
#define GPIB_ATNON	_IOWR( 'G', 31, GPIB_PACKET )
#define GPIB_ATNOFF	_IOWR( 'G', 32, GPIB_PACKET )
#define GPIB_REMOTE	_IOWR( 'G', 33, GPIB_PACKET )
#define GPIB_LOCAL	_IOWR( 'G', 34, GPIB_PACKET )
#define GPIB_COMMAND	_IOWR( 'G', 35, GPIB_PACKET )
#define GPIB_UNT	_IOWR( 'G', 36, GPIB_PACKET )
#define GPIB_UNL	_IOWR( 'G', 37, GPIB_PACKET )
#define GPIB_STA	_IOWR( 'G', 38, GPIB_PACKET )
#define GPIB_SLA	_IOWR( 'G', 39, GPIB_PACKET )


/* Level 2 High level function group */
#define GPIB_DCL	_IOWR( 'G', 50, GPIB_PACKET )
#define GPIB_GTL	_IOWR( 'G', 51, GPIB_PACKET )
#define GPIB_LLO	_IOWR( 'G', 52, GPIB_PACKET )
#define GPIB_SDC	_IOWR( 'G', 53, GPIB_PACKET )
#define GPIB_GET	_IOWR( 'G', 54, GPIB_PACKET )
#define GPIB_TALK	_IOWR( 'G', 55, GPIB_PACKET )
#define GPIB_LISTEN	_IOWR( 'G', 56, GPIB_PACKET )
#define GPIB_SP		_IOWR( 'G', 57, GPIB_PACKET )
#define GPIB_REQ	_IOW( 'G', 58, int )


/***** Global variables *****************************************************/
/***** Function prototypes **************************************************/
/***** Inline functions *****************************************************/


#endif
