xref: /minix3/minix/drivers/hid/pckbd/pckbd.h (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #ifndef _DRIVERS_PCKBD_H
2 #define _DRIVERS_PCKBD_H
3 
4 /* Standard and AT keyboard.  (PS/2 MCA implies AT throughout.) */
5 #define KEYBD		0x60	/* I/O port for keyboard data */
6 
7 /* AT keyboard. */
8 #define KB_COMMAND	0x64	/* I/O port for commands on AT */
9 #define KB_STATUS	0x64	/* I/O port for status on AT */
10 #define KB_ACK		0xFA	/* keyboard ack response */
11 #define KB_AUX_BYTE	0x20	/* Auxiliary Device Output Buffer Full */
12 #define KB_OUT_FULL	0x01	/* status bit set when keypress char pending */
13 #define KB_IN_FULL	0x02	/* status bit set when not ready to receive */
14 #define KBC_RD_RAM_CCB	0x20	/* Read controller command byte */
15 #define KBC_WR_RAM_CCB	0x60	/* Write controller command byte */
16 #define KBC_DI_AUX	0xA7	/* Disable Auxiliary Device */
17 #define KBC_EN_AUX	0xA8	/* Enable Auxiliary Device */
18 #define KBC_DI_KBD	0xAD	/* Disable Keybard Interface */
19 #define KBC_EN_KBD	0xAE	/* Enable Keybard Interface */
20 #define LED_CODE	0xED	/* command to keyboard to set LEDs */
21 
22 #define KBC_WAIT_TIME	100000	/* wait this many usecs for a status update */
23 #define KBC_READ_TIME	1000000	/* wait this many usecs for a result byte */
24 
25 #define KBC_IN_DELAY	7	/* wait 7 microseconds when polling */
26 
27 #define KBD_OUT_BUFSZ	16	/* Output buffer for data to the keyboard. */
28 
29 #define KBD_SCAN_CODES	0x80
30 
31 #define SCAN_RELEASE	0x80
32 #define SCAN_CTRL	0x1D
33 #define SCAN_NUMLOCK	0x45
34 #define SCAN_EXT0	0xE0
35 #define SCAN_EXT1	0xE1
36 
37 #define LED_SCROLL_LOCK	0x01
38 #define LED_NUM_LOCK	0x02
39 #define LED_CAPS_LOCK	0x04
40 
41 struct scanmap {
42 	unsigned short page;
43 	unsigned short code;
44 };
45 
46 extern const struct scanmap scanmap_normal[KBD_SCAN_CODES];
47 extern const struct scanmap scanmap_escaped[KBD_SCAN_CODES];
48 
49 #endif /* !_DRIVERS_PCKBD_H */
50