/********************************************************************* * file: h/scrn/caravan.h * part #: * internal sequence #: * * ************************************************************ * * " c Copyright Hewlett-Packard Company, 1984.* All * * * rights are reserved. Copying or other reproduction * * * of this program except for archival purposes is * * * prohibited without the prior written consent of * * * Hewlett-Packard Company." * * ************************************************************ * * This is the include file for the caravan driver. It contains * defines, structure definitions and external definitions. * It must have sys/types.h (for tty.h) and sys/tty.h included before it. * * * Pisces Q-DOS project * Karen Helt PCD * ---------------------------------------------------- * initial 12/20/83 * */ #define CAR_GETSTAT ('k' << 8) | 1 #define CAR_SETSTAT ('k' << 8) | 2 #define CAR_RDCONFIG ('k' << 8) | 3 #define CAR_RDMAP ('k' << 8) | 4 #define CAR_WRMAP ('k' << 8) | 5 #define CAR_ENINT ('k' << 8) | 6 #define CAR_DISINT ('k' << 8) | 7 #define CAR_PROTECT ('k' << 8) | 8 #define CAR_UNPROTECT ('k' << 8) | 9 #define CAR_KEYID ('k' << 8) | 10 #define CAR_REG0 (*(char *)0x660001) #define CAR_REG1 (*(char *)0x660003) #define CAR_REG2 (*(char *)0x660005) #define CAR_REG3 (*(char *)0x660007) #define CAR_SWITCH (*(char *)0x660041) #define INTERFACE_CLR 0x00 #define PASSTHRU 0x01 #define LOOPBACK 0x02 #define ID_AND_DESCRB 0x03 #define SOFT_RESET 0x04 #define SELF_TEST 0x05 #define CMD_TRAILER 0x06 #define DATA_TRAILER 0x07 #define AUTOCONFIG 0x09 #define POLL 0x10 #define REPOLL 0x20 #define REPORT_NAME 0x30 #define REPORT_STAT 0x31 #define DIS_AUTOREP 0x3D #define EN_AUTOREP_30 0x3E #define EN_AUTOREP_60 0x3F #define PROMPT0 0x40 #define PROMPT1 0x41 #define PROMPT2 0x42 #define PROMPT3 0x43 #define PROMPT4 0x44 #define PROMPT5 0x45 #define PROMPT6 0x46 #define PROMPT7 0x47 #define ACKNOWLEDGE0 0x48 #define ACKNOWLEDGE1 0x49 #define ACKNOWLEDGE2 0x4A #define ACKNOWLEDGE3 0x4B #define ACKNOWLEDGE4 0x4C #define ACKNOWLEDGE5 0x4D #define ACKNOWLEDGE6 0x4E #define ACKNOWLEDGE7 0x4F #define MASTER_RESET 0xFB #define DATA_ERROR 0xFC #define CONFIG_ERROR 0xFD #define HARD_RESET 0xFE #define LOOPBACK_SWITCH 0x00 #define LOOP0 0x01 #define LOOP1 0x02 #define LINK_LOOPS 0x03 #define UNIVERSAL 0x00 #define COMMAND 0x08 #define CAR_BUSY 0x10 #define WAIT_16MS 1200 #define WAIT_500MS 37500 #define INT 0x01 #define NMI 0x02 #define LERR 0x04 #define PERR 0x08 #define FERR 0x10 #define FOF 0x20 #define RPOLL 0x40 #define DERR 0x80 #define APE 0x02 #define IPF 0x04 #define TEST 0x01 #define SHIFT_AD 0x80 #define EXTEND_AD 0x100 #define CONTROL_AD 0x200 #define CTRL_MOD 0x9F #define DEVNAMESIZE 20 #define MAXDEV 7 #define NUMKEYS 128 #define NUMMUTES 5 #define NUMMUTECHARS 15 #define CURSOR 0 #define ROLL 1 struct key_state { unsigned caps; unsigned alt; unsigned auto_repeat; unsigned fast_cursor; unsigned to_buf; unsigned to_sm; }; struct error_state { unsigned fifo_overflow; unsigned data_lost; unsigned too_many_dev; unsigned reconfig; }; struct car_stat { int num_devices; char intr_enable; struct key_state keyboard; struct error_state errors; unsigned char prompts[MAXDEV + 1]; }; struct keymap { unsigned char codes[NUMKEYS * 4]; unsigned char function[(NUMKEYS * 4) / 8]; unsigned char caps[(NUMKEYS * 4) / 8]; unsigned char repeat[(NUMKEYS * 4) / 8]; unsigned char mutes[NUMMUTECHARS][NUMMUTES + 1]; }; struct device_info { int id; int num_axes; char sixteen_bit; char abs_position; char two_sets_axes; int scale_factor; int max_x; int max_y; int max_z; int num_prompts; int num_buttons; char name[DEVNAMESIZE]; }; struct car_config { int num_dev; struct device_info device[MAXDEV + 1]; }; struct fifo_data { unsigned int data; unsigned int addr; }; struct car_data { char shift; char control; char extend; char curs_up; char curs_down; char curs_right; char curs_left; char mute; char protect; int mute_val; int repeat; int keyid; struct clist c_readq; struct clist c_intrq; }; extern struct car_stat car; extern car_timeout (); extern car_ioctl ();