Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / lcom / lab3.h @ 13

History | View | Annotate | Download (1.75 KB)

1
#pragma once
2

    
3
#include <stdbool.h>
4
#include <stdint.h>
5

    
6
/** @defgroup lab3 lab3
7
 * @{
8
 *
9
 * Functions for testing the kbd code
10
 */
11

    
12
/** 
13
 * @brief To test reading of scancodes via KBD interrupts 
14
 * 
15
 * Displays the scancodes received from the keyboard
16
 * Exits upon release of the ESC key
17
 * 
18
 * @return Return 0 upon success and non-zero otherwise
19
 */
20
int (kbd_test_scan)();
21

    
22
/**
23
 * @brief To test reading of scancodes via polling
24
 * 
25
 * Displays the scancodes received from the keyboard
26
 * Exits upon release of the ESC key
27
 * 
28
 * @return Return 0 upon success and non-zero otherwise
29
 */
30
int (kbd_test_poll)();
31

    
32
/** 
33
 * @brief To test handling of more than one interrupt
34
 * 
35
 *  Similar to kbd_test_scan() except that it 
36
 *  should terminate also if no scancodes are received for n seconds
37
 * 
38
 * @param n Number of seconds without scancodes before exiting
39
 * 
40
 * @return Return 0 upon success and non-zero otherwise
41
 */
42
int (kbd_test_timed_scan)(uint8_t n);
43

    
44
/** 
45
 * @brief Interrupt handler to read scancodes in C.
46
 */
47
void (kbc_ih)(void);
48

    
49
/**
50
 * @brief To print the scancodes
51
 * 
52
 * Prints the scancodes via printf
53
 * Provided via the LCF -- no need to implement it
54
 * 
55
 * @param make Whether this is a make or a break code
56
 * @param size Size in bytes of the scancode
57
 * @param bytes Array with size elements, with the scancode bytes
58
 * 
59
 * @return Return 0 upon success and non-zero otherwise
60
 */
61
int (kbd_print_scancode)(bool make, uint8_t size, uint8_t *bytes);
62

    
63
/**
64
 * @brief To print the no of sys_inb() calls
65
 * 
66
 * Prints the no of sys_inb() calls via printf
67
 * Provided via the LCF -- no need to implement it
68
 * 
69
 * @param no_calls Number of sys_inb() calls via printf
70
 * 
71
 * @return Return 0 upon success and non-zero otherwise
72
 */
73
int (kbd_print_no_sysinb)(uint32_t cnt);