Project

General

Profile

Statistics
| Revision:

root / lab3 / kbc.h @ 195

History | View | Annotate | Download (2.06 KB)

1
/**
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 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

    
17
/**
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

    
24
/**
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

    
31
/**
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
 * @return 1 if operation was successful, 1 otherwise
37
 */
38
int (kbc_restore_keyboard)();
39

    
40
/**
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

    
47
/**
48
 * @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
 * @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

    
63
#endif //KBC_H_INCLUDED