root / proj / libs / kbc / include / keyboard.h @ 298
History | View | Annotate | Download (2.01 KB)
1 |
/**
|
---|---|
2 |
* This file concerns everything related to the keyboard
|
3 |
*/
|
4 |
|
5 |
#ifndef KEYBOARD_H_INCLUDED
|
6 |
#define KEYBOARD_H_INCLUDED
|
7 |
|
8 |
#include "kbc.h" |
9 |
|
10 |
#define W_MAKE_CODE 0x11 /** @brief W Make Code */ |
11 |
#define W_BREAK_CODE 0x91 /** @brief W Break Code */ |
12 |
#define A_MAKE_CODE 0x1E /** @brief A Make Code */ |
13 |
#define A_BREAK_CODE 0x9E /** @brief A Break Code */ |
14 |
#define S_MAKE_CODE 0x1F /** @brief S Make Code */ |
15 |
#define S_BREAK_CODE 0x9F /** @brief S Break Code */ |
16 |
#define D_MAKE_CODE 0x20 /** @brief D Make Code */ |
17 |
#define D_BREAK_CODE 0xA0 /** @brief D Break Code */ |
18 |
#define CTRL_MAKE_CODE 0x1D /** @brief CTRL Make Code */ |
19 |
#define CTRL_BREAK_CODE 0x9D /** @brief CTRL Break Code */ |
20 |
#define PLUS_MAKE_CODE 0x1A /** @brief Plus (+) Make Code */ |
21 |
#define PLUS_BREAK_CODE 0x9A /** @brief Plus (+) Break Code */ |
22 |
#define MINUS_MAKE_CODE 0x35 /** @brief Minus (-) Make Code */ |
23 |
#define MINUS_BREAK_CODE 0xB5 /** @brief Minus (-) Break Code */ |
24 |
#define ENTER_MAKE_CODE 0x1C |
25 |
#define ENTER_BREAK_CODE 0x9C |
26 |
#define BACKSPACE_MAKE_CODE 0x0E |
27 |
#define BACKSPACE_BREAK_CODE 0x8E |
28 |
|
29 |
#define ESC_MAKE_CODE 0x01 /** @brief ESC Make Code */ |
30 |
#define ESC_BREAK_CODE 0x81 /** @brief ESC Break Code */ |
31 |
|
32 |
/**
|
33 |
* @brief Subscribes Keyboard Interrupts and disables Minix Default IH
|
34 |
* @param interrupt_bit Bit of Interrupt Vector that will be set when Keyboard Interrupt is pending
|
35 |
* @param interrupt_id Keyboard Interrupt ID to specify the Keyboard Interrupt in other calls
|
36 |
* @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
37 |
* @see {_ERRORS_H_::errors}
|
38 |
*/
|
39 |
int (subscribe_kbc_interrupt)(uint8_t interrupt_bit, int *interrupt_id); |
40 |
|
41 |
uint8_t scancode[2];
|
42 |
int done;
|
43 |
int sz;
|
44 |
int got_error_keyboard;
|
45 |
|
46 |
void (kbc_ih)(void); |
47 |
|
48 |
int (keyboard_poll)(uint8_t bytes[], uint8_t *size);
|
49 |
|
50 |
#endif //KEYBOARD_H_INCLUDED |