hilreg.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* $OpenBSD: hilreg.h,v 1.6 2006/08/10 23:43:45 miod Exp $ */
  2. /* $NetBSD: hilreg.h,v 1.6 1997/02/02 09:39:21 thorpej Exp $ */
  3. /*
  4. * Copyright (c) 1988 University of Utah.
  5. * Copyright (c) 1990, 1993
  6. * The Regents of the University of California. All rights reserved.
  7. *
  8. * This code is derived from software contributed to Berkeley by
  9. * the Systems Programming Group of the University of Utah Computer
  10. * Science Department.
  11. *
  12. * Redistribution and use in source and binary forms, with or without
  13. * modification, are permitted provided that the following conditions
  14. * are met:
  15. * 1. Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the distribution.
  20. * 3. Neither the name of the University nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  25. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  27. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  30. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  31. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  32. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  33. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  34. * SUCH DAMAGE.
  35. *
  36. * from: Utah $Hdr: hilreg.h 1.10 92/01/21$
  37. *
  38. * @(#)hilreg.h 8.1 (Berkeley) 6/10/93
  39. */
  40. #include <machine/hil_machdep.h>
  41. #define HIL_BUSY 0x02
  42. #define HIL_DATA_RDY 0x01
  43. /* HIL status bits */
  44. #define HIL_POLLDATA 0x10 /* HIL poll data follows */
  45. #define HIL_COMMAND 0x08 /* Start of original command */
  46. #define HIL_ERROR 0x80 /* HIL error */
  47. #define HIL_RECONFIG 0x80 /* HIL has reconfigured */
  48. #define HIL_UNPLUGGED 0x84 /* HIL cable unplugged */
  49. #define HIL_SSHIFT 4 /* Bits to shift status over */
  50. #define HIL_SMASK 0x0f /* Service request status mask */
  51. #define HIL_DEVMASK 0x07
  52. /* HIL status types */
  53. #define HIL_68K 0x04 /* Data from the 68k is ready */
  54. #define HIL_STATUS 0x05 /* HIL status in data register */
  55. #define HIL_DATA 0x06 /* HIL data in data register */
  56. #define HIL_CTRLSHIFT 0x08 /* key + CTRL + SHIFT */
  57. #define HIL_CTRL 0x09 /* key + CTRL */
  58. #define HIL_SHIFT 0x0a /* key + SHIFT */
  59. #define HIL_KEY 0x0b /* key only */
  60. /* HIL commands */
  61. #define HIL_IDENTIFY 0x03 /* Get device information */
  62. #define HIL_READTIME 0x13 /* Read real time register */
  63. #define HIL_RNAME 0x30 /* Report name */
  64. #define HIL_RSTATUS 0x31 /* Report status */
  65. #define HIL_DESCRIBE 0x32 /* Extended describe */
  66. #define HIL_SECURITY 0x33 /* Read security bits */
  67. #define HIL_DKR 0x3d /* Disable auto repeat */
  68. #define HIL_ER1 0x3e /* Enable auto repeat 1/30 */
  69. #define HIL_ER2 0x3f /* Enable auto repeat 1/60 */
  70. #define HIL_PROMPT1 0x40 /* Prompt #1 */
  71. #define HIL_PROMPT2 0x41 /* Prompt #2 */
  72. #define HIL_PROMPT3 0x42 /* Prompt #3 */
  73. #define HIL_PROMPT4 0x43 /* Prompt #4 */
  74. #define HIL_PROMPT5 0x44 /* Prompt #5 */
  75. #define HIL_PROMPT6 0x45 /* Prompt #6 */
  76. #define HIL_PROMPT7 0x46 /* Prompt #7 */
  77. #define HIL_PROMPT 0x47 /* Prompt */
  78. #define HIL_ACK1 0x48 /* Acknowledge #1 */
  79. #define HIL_ACK2 0x49 /* Acknowledge #2 */
  80. #define HIL_ACK3 0x4a /* Acknowledge #3 */
  81. #define HIL_ACK4 0x4b /* Acknowledge #4 */
  82. #define HIL_ACK5 0x4c /* Acknowledge #5 */
  83. #define HIL_ACK6 0x4d /* Acknowledge #6 */
  84. #define HIL_ACK7 0x4e /* Acknowledge #7 */
  85. #define HIL_ACK 0x4f /* Acknowledge */
  86. #define HIL_INTON 0x5c /* Turn on interrupts. */
  87. #define HIL_INTOFF 0x5d /* Turn off interrupts. */
  88. #define HIL_SETARD 0xa0 /* Set auto-repeat delay */
  89. #define HIL_SETARR 0xa2 /* Set auto-repeat rate */
  90. #define HIL_SETTONE 0xa3 /* Set tone generator */
  91. #define HIL_CNMT 0xb2 /* Clear nmi */
  92. #define HIL_TRIGGER 0xc5 /* Trigger command */
  93. #define HIL_STARTCMD 0xe0 /* Start loop command */
  94. #define HIL_TIMEOUT 0xfe /* Timeout */
  95. /* Read/write various registers on the 8042. */
  96. #define HIL_READBUSY 0x02 /* internal "busy" register */
  97. #define HIL_READKBDLANG 0x12 /* read keyboard language code */
  98. #define HIL_WRITEKBDSADR 0xe9
  99. #define HIL_WRITELPSTAT 0xea
  100. #define HIL_WRITELPCTRL 0xeb
  101. #define HIL_READKBDSADR 0xf9
  102. #define HIL_READLPSTAT 0xfa
  103. #define HIL_READLPCTRL 0xfb
  104. /* BUSY bits */
  105. #define BSY_LOOPBUSY 0x04
  106. /* LPCTRL bits */
  107. #define LPC_AUTOPOLL 0x01 /* enable auto-polling */
  108. #define LPC_NOERROR 0x02 /* don't report errors */
  109. #define LPC_NORECONF 0x04 /* don't report reconfigure */
  110. #define LPC_KBDCOOK 0x10 /* cook all keyboards */
  111. #define LPC_RECONF 0x80 /* reconfigure the loop */
  112. /* LPSTAT bits */
  113. #define LPS_DEVMASK 0x07 /* number of loop devices */
  114. #define LPS_CONFGOOD 0x08 /* reconfiguration worked */
  115. #define LPS_CONFFAIL 0x80 /* reconfiguration failed */
  116. /* HIL packet headers */
  117. #define HIL_MOUSEDATA 0x02
  118. #define HIL_KBDDATA 0x70
  119. #define HIL_MOUSEMOTION 0x02 /* mouse movement event */
  120. #define HIL_TABLET 0x02 /* tablet motion event */
  121. #define HIL_KNOBBOX 0x03 /* knob box motion data */
  122. #define HIL_KBDBUTTON 0x40 /* keyboard button event */
  123. #define HIL_MOUSEBUTTON 0x40 /* mouse button event */
  124. #define HIL_BUTTONBOX 0x60 /* button box event */
  125. /* ID module defines */
  126. #define HILSCBIT 0x04
  127. /* For setting auto repeat on the keyboard */
  128. #define ar_format(x) ~((x - 10) / 10)
  129. #define KBD_ARD 400 /* initial delay in msec (10 - 2560) */
  130. #define KBD_ARR 60 /* rate (10 - 2550 msec, 2551 == off) */
  131. /* Device information bits */
  132. #define HIL_ABSOLUTE 0x40 /* absolute positioning data */
  133. #define HIL_16_BITS 0x20 /* 16 bit position accuracy */
  134. #define HIL_IOB 0x10 /* I/O description byte follows */
  135. #define HIL_AXMASK 0x03 /* Number of axes supported */
  136. #define HILIOB_PROMPT 0x80 /* prompt and acknowledge (leds) supported */
  137. #define HILIOB_PMASK 0x70 /* number of prompt & acknowledge supported */
  138. #define HILIOB_PIO 0x08 /* proximity in/out (pressure) supported */
  139. #define HILIOB_BMASK 0x07 /* number of buttons supported */