Project

General

Profile

Statistics
| Revision:

root / proj / libs / kbc / include / keyboard.h @ 321

History | View | Annotate | Download (2.07 KB)

1 145 up20180655
/**
2
 * This file concerns everything related to the keyboard
3
 */
4
5
#ifndef KEYBOARD_H_INCLUDED
6
#define KEYBOARD_H_INCLUDED
7
8 257 up20180642
#include "kbc.h"
9
10 298 up20180642
#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 153 up20180655
/**
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 145 up20180655
int (subscribe_kbc_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
40
41
42 321 up20180642
const uint8_t* keyboard_get_scancode(void);
43
int keyboard_get_done(void);
44
int keyboard_get_size(void);
45
int keyboard_get_error(void);
46
47 145 up20180655
void (kbc_ih)(void);
48
49
int (keyboard_poll)(uint8_t bytes[], uint8_t *size);
50
51
#endif //KEYBOARD_H_INCLUDED