1
2
3
4
5
6
7
8
9#ifndef _I8042_H_
10#define _I8042_H_
11
12
13
14#define I8042_DATA_REG 0x60
15#define I8042_STS_REG 0x64
16#define I8042_CMD_REG 0x64
17
18
19#define STATUS_OBF (1 << 0)
20#define STATUS_IBF (1 << 1)
21
22
23#define CONFIG_KIRQ_EN (1 << 0)
24#define CONFIG_MIRQ_EN (1 << 1)
25#define CONFIG_SET_BIST (1 << 2)
26#define CONFIG_KCLK_DIS (1 << 4)
27#define CONFIG_MCLK_DIS (1 << 5)
28#define CONFIG_AT_TRANS (1 << 6)
29
30
31#define CMD_RD_CONFIG 0x20
32#define CMD_WR_CONFIG 0x60
33#define CMD_SELF_TEST 0xaa
34#define CMD_KBD_DIS 0xad
35#define CMD_KBD_EN 0xae
36#define CMD_SET_KBD_LED 0xed
37#define CMD_DRAIN_OUTPUT 0xf4
38#define CMD_RESET_KBD 0xff
39
40
41#define KBC_TEST_OK 0x55
42#define KBD_ACK 0xfa
43#define KBD_POR 0xaa
44
45
46
47#define KBD_US 0
48#define KBD_GER 1
49
50#define KBD_TIMEOUT 1000
51#define KBD_RESET_TRIES 3
52
53#define AS 0
54#define SH 1
55#define CN 2
56#define NM 3
57#define AK 4
58#define CP 5
59#define ST 6
60#define EX 7
61#define ES 8
62
63#define NORMAL 0x0000
64#define STP 0x0001
65#define NUM 0x0002
66#define CAPS 0x0004
67#define SHIFT 0x0008
68#define CTRL 0x0010
69#define EXT 0x0020
70#define ESC 0x0040
71#define E1 0x0080
72#define BRK 0x0100
73#define ALT 0x0200
74
75#endif
76