root / proj / include / kbc.h @ 192
History | View | Annotate | Download (1.77 KB)
1 | 145 | up20180655 | /**
|
---|---|---|---|
2 | * This file concerns everything related to the KBC (KeyBoard Controller, which
|
||
3 | * actually also manages the mouse)
|
||
4 | */
|
||
5 | |||
6 | #ifndef KBC_H_INCLUDED
|
||
7 | #define KBC_H_INCLUDED
|
||
8 | |||
9 | /**
|
||
10 | * @brief High-level function that reads the command byte of the KBC
|
||
11 | * @param cmd Pointer to variable where command byte read from KBC will be stored
|
||
12 | * @return 0 if operation was successful, 1 otherwise
|
||
13 | */
|
||
14 | int (kbc_read_cmd)(uint8_t *cmd);
|
||
15 | |||
16 | /**
|
||
17 | * @brief High-level function that changes the command byte of the KBC
|
||
18 | * @param cmd New value for command byte of KBC
|
||
19 | * @return 0 if operation was successful, 1 otherwise
|
||
20 | */
|
||
21 | int (kbc_change_cmd)(uint8_t cmd);
|
||
22 | |||
23 | /**
|
||
24 | * @brief High-level function that restores KBC to normal state
|
||
25 | * High-level function that restores KBC to normal state, because lcf_start
|
||
26 | * changes the command byte of KBC. If this function is not used, there is a
|
||
27 | * chance that the keyboard and keyboard interrupts remain disabled.
|
||
28 | * @return 0 if operation was successful, 1 otherwise
|
||
29 | */
|
||
30 | int (kbc_restore_keyboard)();
|
||
31 | |||
32 | /**
|
||
33 | * @brief Low-level function to issue a command to keyboard
|
||
34 | * @param cmd command to be issued
|
||
35 | * @return 0 if operation was successful, 1 otherwise
|
||
36 | */
|
||
37 | int (kbc_issue_cmd)(uint8_t cmd);
|
||
38 | |||
39 | /**
|
||
40 | * @brief Low-level function to issue an argument of a command
|
||
41 | * @param cmd argument to be issued
|
||
42 | * @return 0 if operation was successful, 1 otherwise
|
||
43 | */
|
||
44 | int (kbc_issue_arg)(uint8_t arg);
|
||
45 | |||
46 | /**
|
||
47 | * @brief Low-level function for reading byte from keyboard
|
||
48 | * Low-level function for reading byte from keyboard. Waits until output buffer
|
||
49 | * is full
|
||
50 | * @param value Pointer to variable where byte read from keyboard will be stored
|
||
51 | * @return 0 if operation was successful, 1 otherwise
|
||
52 | */
|
||
53 | int (kbc_read_byte)(uint8_t *byte);
|
||
54 | |||
55 | #endif //KBC_H_INCLUDED |