Project

General

Profile

Statistics
| Revision:

root / lab4 / kbc.h @ 368

History | View | Annotate | Download (2.06 KB)

1 58 up20180642
/**
2 68 up20180642
 * This file concerns everything related to the KBC (KeyBoard Controller, which
3
 * actually also manages the mouse)
4 58 up20180642
 */
5 53 up20180655
6 68 up20180642
#ifndef KBC_H_INCLUDED
7
#define KBC_H_INCLUDED
8
9 58 up20180642
/**
10
 * @brief Unsubcribes Interrupts
11
 * @param interrupt_id Interrupt ID, value via arguments on subscription of the interrupt_id
12
 * @see subscribe_kbc_interrupt, subscribe_timer_interrupt
13
 * @return Whether operation was sucessful or not
14
 */
15
int (unsubscribe_interrupt)(int *interrupt_id);
16 53 up20180655
17 58 up20180642
/**
18
 * @brief High-level function that reads the command byte of the KBC
19
 * @param cmd Pointer to variable where command byte read from KBC will be stored
20
 * @return 0 if operation was successful, 1 otherwise
21
 */
22
int (kbc_read_cmd)(uint8_t *cmd);
23 53 up20180655
24 58 up20180642
/**
25
 * @brief High-level function that changes the command byte of the KBC
26
 * @param cmd New value for command byte of KBC
27
 * @return 0 if operation was successful, 1 otherwise
28
 */
29
int (kbc_change_cmd)(uint8_t cmd);
30 53 up20180655
31 58 up20180642
/**
32
 * @brief High-level function that restores KBC to normal state
33
 * High-level function that restores KBC to normal state, because lcf_start
34
 * changes the command byte of KBC. If this function is not used, there is a
35
 * chance that the keyboard and keyboard interrupts remain disabled.
36 90 up20180655
 * @return 0 if operation was successful, 1 otherwise
37 58 up20180642
 */
38 68 up20180642
int (kbc_restore_keyboard)();
39 53 up20180655
40 58 up20180642
/**
41
 * @brief Low-level function to issue a command to keyboard
42
 * @param cmd command to be issued
43
 * @return 0 if operation was successful, 1 otherwise
44
 */
45
int (kbc_issue_cmd)(uint8_t cmd);
46 53 up20180655
47 58 up20180642
/**
48 68 up20180642
 * @brief Low-level function to issue an argument of a command
49
 * @param cmd argument to be issued
50
 * @return 0 if operation was successful, 1 otherwise
51
 */
52
int (kbc_issue_arg)(uint8_t arg);
53
54
/**
55 58 up20180642
 * @brief Low-level function for reading byte from keyboard
56
 * Low-level function for reading byte from keyboard. Waits until output buffer
57
 * is full
58
 * @param value Pointer to variable where byte read from keyboard will be stored
59
 * @return 0 if operation was successful, 1 otherwise
60
 */
61
int (kbc_read_byte)(uint8_t *byte);
62 53 up20180655
63 68 up20180642
#endif //KBC_H_INCLUDED