Initial revision
[reactos.git] / reactos / drivers / dd / keyboard / keyboard.h
1 /*
2 * Some defines
3 */
4
5 #define KEYBOARD_IRQ 1
6 #define KBD_BUFFER_SIZE 32
7 #define KBD_WRAP_MASK 0x1F
8
9 #define disable() __asm__("cli\n\t")
10 #define enable() __asm__("sti\n\t")
11
12 #define ALT_PRESSED (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)
13 #define CTRL_PRESSED (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
14
15
16 /*
17 * Keyboard controller ports
18 */
19
20 #define KBD_DATA_PORT 0x60
21 #define KBD_CTRL_PORT 0x64
22
23
24 /*
25 * Controller commands
26 */
27
28 #define KBD_READ_MODE 0x20
29 #define KBD_WRITE_MODE 0x60
30 #define KBD_SELF_TEST 0xAA
31 #define KBD_LINE_TEST 0xAB
32 #define KBD_CTRL_ENABLE 0xAE
33
34 /*
35 * Keyboard commands
36 */
37
38 #define KBD_ENABLE 0xF4
39 #define KBD_DISABLE 0xF5
40 #define KBD_RESET 0xFF
41
42
43 /*
44 * Keyboard responces
45 */
46
47 #define KBD_ACK 0xFA
48 #define KBD_BATCC 0xAA
49
50
51 /*
52 * Controller status register bits
53 */
54
55 #define KBD_OBF 0x01
56 #define KBD_IBF 0x02
57 #define KBD_GTO 0x40
58 #define KBD_PERR 0x80
59
60
61 /*
62 * LED bits
63 */
64
65 #define KBD_LED_SCROLL 0x01
66 #define KBD_LED_NUM 0x02
67 #define KBD_LED_CAPS 0x04