lk201.h Source File

Back to the index.

lk201.h
Go to the documentation of this file.
1 /*
2  * This file contains definitions from two files in NetBSD, lk201.h and lk201.c.
3  *
4  * Technical information can be found here:
5  *
6  * https://www.netbsd.org/docs/Hardware/Machines/DEC/lk201.html
7  *
8  * The header file (lk201.h) in NetBSD did not have a separate copyright
9  * notice on it. Possible sources for lk201.h and lk201.c are the old files
10  * http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/pmax/dev/Attic/fb.c?rev=1.1&content-type=text/x-cvsweb-markup
11  * for the scan codes, and
12  * http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/pmax/dev/Attic/fbreg.h?rev=1.1&content-type=text/x-cvsweb-markup
13  * for other control codes, in which case the copyright is/was:
14  *
15  *
16  * Copyright (c) 1992 The Regents of the University of California.
17  * All rights reserved.
18  *
19  * This code is derived from software contributed to Berkeley by
20  * Ralph Campbell and Rick Macklem.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the above copyright
26  * notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  * must display the following acknowledgement:
32  * This product includes software developed by the University of
33  * California, Berkeley and its contributors.
34  * 4. Neither the name of the University nor the names of its contributors
35  * may be used to endorse or promote products derived from this software
36  * without specific prior written permission.
37  *
38  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
39  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
41  * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
42  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
43  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
44  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
46  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
47  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48  * SUCH DAMAGE.
49  *
50  *
51  *
52  * @(#)fb.c 7.2 (Berkeley) 12/20/92
53  * and
54  * @(#)fbreg.h 7.1 (Berkeley) 11/15/92
55  */
56 
57 #ifndef LK201_H
58 #define LK201_H
59 
60 /* $NetBSD: lk201.h,v 1.7 1999/03/19 18:34:01 ad Exp $ */
61 
62 
63 /*
64  * Ascii values of command keys.
65  */
66 #define KBD_TAB '\t'
67 #define KBD_DEL 127
68 #define KBD_RET '\r'
69 
70 /*
71  * Define "hardware-independent" codes for the control, shift, meta and
72  * function keys. Codes start after the last 7-bit ASCII code (127)
73  * and are assigned in an arbitrary order.
74  */
75 #define KBD_NOKEY 128
76 
77 #define KBD_F1 201
78 #define KBD_F2 202
79 #define KBD_F3 203
80 #define KBD_F4 204
81 #define KBD_F5 205
82 #define KBD_F6 206
83 #define KBD_F7 207
84 #define KBD_F8 208
85 #define KBD_F9 209
86 #define KBD_F10 210
87 #define KBD_F11 211
88 #define KBD_F12 212
89 #define KBD_F13 213
90 #define KBD_F14 214
91 #define KBD_HELP 215
92 #define KBD_DO 216
93 #define KBD_F17 217
94 #define KBD_F18 218
95 #define KBD_F19 219
96 #define KBD_F20 220
97 
98 #define KBD_FIND 221
99 #define KBD_INSERT 222
100 #define KBD_REMOVE 223
101 #define KBD_SELECT 224
102 #define KBD_PREVIOUS 225
103 #define KBD_NEXT 226
104 
105 #define KBD_KP_ENTER 227
106 #define KBD_KP_F1 228
107 #define KBD_KP_F2 229
108 #define KBD_KP_F3 230
109 #define KBD_KP_F4 231
110 #define KBD_LEFT 232
111 #define KBD_RIGHT 233
112 #define KBD_DOWN 234
113 #define KBD_UP 235
114 
115 #define KBD_CONTROL 236
116 #define KBD_SHIFT 237
117 #define KBD_CAPSLOCK 238
118 #define KBD_ALTERNATE 239
119 
120 
121 
122 /*
123  * Definitions for the Keyboard and mouse.
124  */
125 /*
126  * Special key values.
127  */
128 #define KEY_R_SHIFT 0xab
129 #define KEY_SHIFT 0xae
130 #define KEY_CONTROL 0xaf
131 #define KEY_CAPSLOCK 0xb0
132 #define KEY_R_ALT 0xb2
133 #define KEY_UP 0xb3
134 #define KEY_REPEAT 0xb4
135 #define KEY_F1 0x56
136 #define KEY_COMMAND KEY_F1
137 
138 /*
139  * Lk201/301 keyboard
140  */
141 #define LK_UPDOWN 0x86 /* bits for setting lk201 modes */
142 #define LK_AUTODOWN 0x82
143 #define LK_DOWN 0x80
144 #define LK_DEFAULTS 0xd3 /* reset mode settings */
145 #define LK_AR_ENABLE 0xe3 /* global auto repeat enable */
146 #define LK_CL_ENABLE 0x1b /* keyclick enable */
147 #define LK_KBD_ENABLE 0x8b /* keyboard enable */
148 #define LK_BELL_ENABLE 0x23 /* the bell */
149 #define LK_LED_ENABLE 0x13 /* light led */
150 #define LK_LED_DISABLE 0x11 /* turn off led */
151 #define LK_RING_BELL 0xa7 /* ring keyboard bell */
152 #define LED_1 0x81 /* led bits */
153 #define LED_2 0x82
154 #define LED_3 0x84
155 #define LED_4 0x88
156 #define LED_ALL 0x8f
157 #define LK_HELP 0x7c /* help key */
158 #define LK_DO 0x7d /* do key */
159 #define LK_KDOWN_ERROR 0x3d /* key down on powerup error */
160 #define LK_POWER_ERROR 0x3e /* keyboard failure on pwrup tst*/
161 #define LK_OUTPUT_ERROR 0xb5 /* keystrokes lost during inhbt */
162 #define LK_INPUT_ERROR 0xb6 /* garbage command to keyboard */
163 #define LK_LOWEST 0x56 /* lowest significant keycode */
164 
165 /* max volume is 0, lowest is 0x7 */
166 #define LK_PARAM_VOLUME(v) (0x80|((v)&0x7))
167 
168 /* mode command details */
169 #define LK_CMD_MODE(m,div) ((m)|((div)<<3))
170 
171 
172 /*
173  * Command characters for the mouse.
174  */
175 #define MOUSE_SELF_TEST 'T'
176 #define MOUSE_INCREMENTAL 'R'
177 
178 /*
179  * Mouse output bits.
180  *
181  * MOUSE_START_FRAME Start of report frame bit.
182  * MOUSE_X_SIGN Sign bit for X.
183  * MOUSE_Y_SIGN Sign bit for Y.
184  * MOUSE_X_OFFSET X offset to start cursor at.
185  * MOUSE_Y_OFFSET Y offset to start cursor at.
186  */
187 #define MOUSE_START_FRAME 0x80
188 #define MOUSE_X_SIGN 0x10
189 #define MOUSE_Y_SIGN 0x08
190 
191 /*
192  * Definitions for mouse buttons
193  */
194 #define EVENT_LEFT_BUTTON 0x01
195 #define EVENT_MIDDLE_BUTTON 0x02
196 #define EVENT_RIGHT_BUTTON 0x03
197 #define RIGHT_BUTTON 0x01
198 #define MIDDLE_BUTTON 0x02
199 #define LEFT_BUTTON 0x04
200 
201 #ifdef _KERNEL
202 extern int LKgetc __P((dev_t dev));
203 extern void lkdivert __P ((int (*getc_fn)(dev_t dev), dev_t dev));
204 #endif
205 
206 
207 /* This is also from netbsd, pmax/dev/lk201.c: */
208 
209 /*
210  * Keyboard to ASCII, unshifted.
211  */
212 static u_char unshiftedAscii[] = {
234 /* 54 */ KBD_NOKEY, KBD_NOKEY, KBD_F1, KBD_F2,
235 /* 58 */ KBD_F3, KBD_F4, KBD_F5, KBD_NOKEY,
238 /* 64 */ KBD_F6, KBD_F7, KBD_F8, KBD_F9,
241 /* 70 */ KBD_NOKEY, '\033', KBD_F12, KBD_F13,
244 /* 7c */ KBD_HELP, KBD_DO, KBD_NOKEY, KBD_NOKEY,
245 /* 80 */ KBD_F17, KBD_F18, KBD_F19, KBD_F20,
249 /* 90 */ KBD_NOKEY, KBD_NOKEY, '0', KBD_NOKEY,
250 /* 94 */ '.', KBD_KP_ENTER, '1', '2',
251 /* 98 */ '3', '4', '5', '6',
252 /* 9c */ ',', '7', '8', '9',
253 /* a0 */ '-', KBD_KP_F1, KBD_KP_F2, KBD_KP_F3,
255 /* a8 */ KBD_RIGHT, KBD_DOWN, KBD_UP, KBD_NOKEY,
260 /* bc */ KBD_DEL, KBD_RET, KBD_TAB, '`',
261 /* c0 */ '1', 'q', 'a', 'z',
262 /* c4 */ KBD_NOKEY, '2', 'w', 's',
263 /* c8 */ 'x', '<', KBD_NOKEY, '3',
264 /* cc */ 'e', 'd', 'c', KBD_NOKEY,
265 /* d0 */ '4', 'r', 'f', 'v',
266 /* d4 */ ' ', KBD_NOKEY, '5', 't',
267 /* d8 */ 'g', 'b', KBD_NOKEY, '6',
268 /* dc */ 'y', 'h', 'n', KBD_NOKEY,
269 /* e0 */ '7', 'u', 'j', 'm',
270 /* e4 */ KBD_NOKEY, '8', 'i', 'k',
271 /* e8 */ ',', KBD_NOKEY, '9', 'o',
272 /* ec */ 'l', '.', KBD_NOKEY, '0',
273 /* f0 */ 'p', KBD_NOKEY, ';', '/',
274 /* f4 */ KBD_NOKEY, '=', ']', '\\',
275 /* f8 */ KBD_NOKEY, '-', '[', '\'',
277 };
278 
279 /*
280  * Keyboard to Ascii, shifted.
281  */
282 static u_char shiftedAscii[] = {
304 /* 54 */ KBD_NOKEY, KBD_NOKEY, KBD_F1, KBD_F2,
305 /* 58 */ KBD_F3, KBD_F4, KBD_F5, KBD_NOKEY,
308 /* 64 */ KBD_F6, KBD_F7, KBD_F8, KBD_F9,
311 /* 70 */ KBD_NOKEY, KBD_F11, KBD_F12, KBD_F13,
314 /* 7c */ KBD_HELP, KBD_DO, KBD_NOKEY, KBD_NOKEY,
315 /* 80 */ KBD_F17, KBD_F18, KBD_F19, KBD_F20,
319 /* 90 */ KBD_NOKEY, KBD_NOKEY, '0', KBD_NOKEY,
320 /* 94 */ '.', KBD_KP_ENTER, '1', '2',
321 /* 98 */ '3', '4', '5', '6',
322 /* 9c */ ',', '7', '8', '9',
323 /* a0 */ '-', KBD_KP_F1, KBD_KP_F2, KBD_KP_F3,
325 /* a8 */ KBD_RIGHT, KBD_DOWN, KBD_UP, KBD_NOKEY,
330 /* bc */ KBD_DEL, KBD_RET, KBD_TAB, '~',
331 /* c0 */ '!', 'q', 'a', 'z',
332 /* c4 */ KBD_NOKEY, '@', 'w', 's',
333 /* c8 */ 'x', '>', KBD_NOKEY, '#',
334 /* cc */ 'e', 'd', 'c', KBD_NOKEY,
335 /* d0 */ '$', 'r', 'f', 'v',
336 /* d4 */ ' ', KBD_NOKEY, '%', 't',
337 /* d8 */ 'g', 'b', KBD_NOKEY, '^',
338 /* dc */ 'y', 'h', 'n', KBD_NOKEY,
339 /* e0 */ '&', 'u', 'j', 'm',
340 /* e4 */ KBD_NOKEY, '*', 'i', 'k',
341 /* e8 */ '<', KBD_NOKEY, '(', 'o',
342 /* ec */ 'l', '>', KBD_NOKEY, ')',
343 /* f0 */ 'p', KBD_NOKEY, ':', '?',
344 /* f4 */ KBD_NOKEY, '+', '}', '|',
345 /* f8 */ KBD_NOKEY, '_', '{', '"',
347 };
348 
349 #endif /* LK201_H */
KBD_F19
#define KBD_F19
Definition: lk201.h:95
KBD_F11
#define KBD_F11
Definition: lk201.h:87
KBD_LEFT
#define KBD_LEFT
Definition: lk201.h:110
KBD_F2
#define KBD_F2
Definition: lk201.h:78
KBD_INSERT
#define KBD_INSERT
Definition: lk201.h:99
KBD_F4
#define KBD_F4
Definition: lk201.h:80
KBD_KP_ENTER
#define KBD_KP_ENTER
Definition: lk201.h:105
KBD_F20
#define KBD_F20
Definition: lk201.h:96
KBD_RET
#define KBD_RET
Definition: lk201.h:68
KBD_CONTROL
#define KBD_CONTROL
Definition: lk201.h:115
KBD_SELECT
#define KBD_SELECT
Definition: lk201.h:101
KBD_HELP
#define KBD_HELP
Definition: lk201.h:91
KBD_TAB
#define KBD_TAB
Definition: lk201.h:66
KBD_KP_F1
#define KBD_KP_F1
Definition: lk201.h:106
KBD_F9
#define KBD_F9
Definition: lk201.h:85
KBD_F10
#define KBD_F10
Definition: lk201.h:86
KBD_F17
#define KBD_F17
Definition: lk201.h:93
KBD_NEXT
#define KBD_NEXT
Definition: lk201.h:103
KBD_DOWN
#define KBD_DOWN
Definition: lk201.h:112
KBD_DEL
#define KBD_DEL
Definition: lk201.h:67
KBD_NOKEY
#define KBD_NOKEY
Definition: lk201.h:75
KBD_F18
#define KBD_F18
Definition: lk201.h:94
KBD_F7
#define KBD_F7
Definition: lk201.h:83
KBD_F3
#define KBD_F3
Definition: lk201.h:79
KBD_RIGHT
#define KBD_RIGHT
Definition: lk201.h:111
KBD_UP
#define KBD_UP
Definition: lk201.h:113
KBD_ALTERNATE
#define KBD_ALTERNATE
Definition: lk201.h:118
KBD_F12
#define KBD_F12
Definition: lk201.h:88
KBD_F14
#define KBD_F14
Definition: lk201.h:90
KBD_F8
#define KBD_F8
Definition: lk201.h:84
KBD_F13
#define KBD_F13
Definition: lk201.h:89
KBD_FIND
#define KBD_FIND
Definition: lk201.h:98
KBD_REMOVE
#define KBD_REMOVE
Definition: lk201.h:100
KBD_PREVIOUS
#define KBD_PREVIOUS
Definition: lk201.h:102
KBD_DO
#define KBD_DO
Definition: lk201.h:92
KBD_CAPSLOCK
#define KBD_CAPSLOCK
Definition: lk201.h:117
KBD_F6
#define KBD_F6
Definition: lk201.h:82
KBD_KP_F2
#define KBD_KP_F2
Definition: lk201.h:107
KBD_F5
#define KBD_F5
Definition: lk201.h:81
KBD_F1
#define KBD_F1
Definition: lk201.h:77
__P
#define __P(x)
Definition: dec_prom.h:6
KBD_KP_F3
#define KBD_KP_F3
Definition: lk201.h:108
KBD_KP_F4
#define KBD_KP_F4
Definition: lk201.h:109
KBD_SHIFT
#define KBD_SHIFT
Definition: lk201.h:116

Generated on Tue Aug 25 2020 19:25:06 for GXemul by doxygen 1.8.18