Project

General

Profile

Statistics
| Revision:

root / lab3 / i8042.h @ 9

History | View | Annotate | Download (1.14 KB)

1 9 up20180645
#ifndef _LCOM_I8042_H_
2
#define _LCOM_I8042_H_
3
4
#include <lcom/lcf.h>
5
6
/** @defgroup i8042 i8042
7
 * @{
8
 *
9
 * Constants for programming the i8042 Keyboard.
10
 */
11
12
#define KEYBOARD_IRQ 0x09 /* Keyboard IRQ address */
13
14
#define BIT(n) (0x01<<(n))
15
16
#define DELAY_US        20000
17
18
#define STAT_REG_PAR                  BIT(7)  /* Parity Error */
19
#define STAT_REG_TIMEOUT        BIT(6)  /* Timeout Error */
20
#define STAT_REG_AUX                  BIT(5)  /* Mouse Data */
21
#define STAT_REG_INH                  BIT(4)  /* Inhibit Flag */
22
#define STAT_REG_A2       BIT(3)  /* A2 Input Line */
23
#define STAT_REG_SYS                  BIT(2)  /* System Flag */
24
#define STAT_REG_IBF                   BIT(1)  /* Input Buffer Full */
25
#define STAT_REG_OBF                  BIT(0)  /* Output Buffer Full */
26
27
#define OUTPUT_BUF         0x60    /* Output Buffer */
28
#define INPUT_BUF          0x60    /* Input Buffer */
29
#define STATUS_REG        0x64    /* Status Register */
30
#define KBC_CMD_REG     0x64    /* Command Register */
31
#define KBC_CMD_ARG     0x60    /* Command Arguments Adress */
32
33
#define ESC_BREAK      0x81
34
#define TWO_BYTE_SCANCODE   0xE0  /* Two-byte long scancodes use 0xE0 as their first byte */
35
#define MAKE_CODE            BIT(7)
36
37
#endif /* _LCOM_I8042_H */