1 /*- 2 * Copyright (c) 1985, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)tablet.h 8.4 (Berkeley) 07/10/94 8 */ 9 10 #ifndef _SYS_TABLET_H_ 11 #define _SYS_TABLET_H_ 12 13 * Tablet line discipline. 14 */ 15 #include <sys/ioctl.h> 16 17 /* 18 * Reads on the tablet return one of the following structures, depending on 19 * the underlying tablet type. The first two are defined such that a read of 20 * sizeof (gtcopos) on a non-gtco tablet will return meaningful info. The 21 * in-proximity bit is simulated where the tablet does not directly provide 22 * the information. 23 */ 24 struct tbpos { 25 int32_t xpos, ypos; /* raw x-y coordinates */ 26 int16_t status; /* buttons/pen down */ 27 #define TBINPROX 0100000 /* pen in proximity of tablet */ 28 int16_t scount; /* sample count */ 29 }; 30 31 struct gtcopos { 32 int32_t xpos, ypos; /* raw x-y coordinates */ 33 int16_t status; /* as above */ 34 int16_t scount; /* sample count */ 35 int16_t xtilt, ytilt; /* raw tilt */ 36 int16_t pressure; 37 int16_t pad; /* pad to longword boundary */ 38 }; 39 40 struct polpos { 41 int16_t p_x, p_y, p_z; /* raw 3-space coordinates */ 42 int16_t p_azi, p_pit, p_rol; /* azimuth, pitch, and roll */ 43 int16_t p_stat; /* status, as above */ 44 char p_key; /* calculator input keyboard */ 45 }; 46 47 #define BIOSMODE _IOW('b', 1, int) /* set mode bit(s) */ 48 #define BIOGMODE _IOR('b', 2, int) /* get mode bit(s) */ 49 #define TBMODE 0xfff0 /* mode bits: */ 50 #define TBPOINT 0x0010 /* single point */ 51 #define TBRUN 0x0000 /* runs contin. */ 52 #define TBSTOP 0x0020 /* shut-up */ 53 #define TBGO 0x0000 /* ~TBSTOP */ 54 #define TBTYPE 0x000f /* tablet type: */ 55 #define TBUNUSED 0x0 56 #define TBHITACHI 0x1 /* hitachi tablet */ 57 #define TBTIGER 0x2 /* hitachi tiger */ 58 #define TBGTCO 0x3 /* gtco */ 59 #define TBPOL 0x4 /* polhemus 3space */ 60 #define TBHDG 0x5 /* hdg-1111b, low res */ 61 #define TBHDGHIRES 0x6 /* hdg-1111b, high res */ 62 #define TBDIGI 0x7 /* gtco digi-pad, low res */ 63 #define TBDIGIHIRES 0x8 /* gtco digi-pad, high res */ 64 #define BIOSTYPE _IOW('b', 3, int) /* set tablet type */ 65 #define BIOGTYPE _IOR('b', 4, int) /* get tablet type*/ 66 67 #endif /* !_SYS_TABLET_H_ */ 68