MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
keyboard.h
Go to the documentation of this file.
1
10#ifndef KEYBOARD_H
11#define KEYBOARD_H
12#define SCANCODE_ARRAY_SIZE (84) // There are 84 keys
13#define KEYBOARD_PORT (0x60) //
14#define KEYBOARD_BUF_SIZE (128) // 128 characters per line
15
16#define LSHIFT_PRESSED (0x2A)
17#define LSHIFT_RELEASED (0xAA)
18#define RSHIFT_PRESSED (0x36)
19#define RSHIFT_RELEASED (0xB6)
20
21// Both left and right ctrl share the same codes
22#define CTRL_PRESSED (0x1D)
23#define CTRL_RELEASED (0x9D)
24
25#define ALT_PRESSED (0x38)
26#define ALT_RELEASED (0xB8)
27
28#define F1_PRESSED (0x3B)
29#define F2_PRESSED (0x3C)
30#define F3_PRESSED (0x3D)
31
32#define TAB_SIZE (4)
33
34#include "terminal.h" // For access to MAX_NUM_TERMINALS constant to know how many keyboard buffers to make
35 // And also access to activeTerminal
36
37// Status variables for keyboard
40
46
51void keyboardInit();
52
63
73int populateKeyboardBuffer(char c);
74
80
90void transferKeyboardBuffer(char* buf, int32_t nbytes);
91
99void checkTerminalSwap(unsigned char i);
100
101#endif // KEYBOARD_H
102
int enterPressed[MAX_NUM_TERMINALS]
Definition: keyboard.h:39
void transferKeyboardBuffer(char *buf, int32_t nbytes)
Transfer nbytes of the active terminal's keyboard buffer into the provided buf.
Definition: keyboard.c:588
int populateKeyboardBuffer(char c)
Add the input character c into the keyboard buffer.
Definition: keyboard.c:552
void keyboardInit()
Initializes the keyboard by enabling its interrupts to the PIC.
Definition: keyboard.c:406
void checkTerminalSwap(unsigned char i)
Checks keyboard inputs to see if terminal swap command issued.
Definition: keyboard.c:612
void keyboardInterrupt()
Handler for keyboard interrupt.
Definition: keyboard.c:428
#define KEYBOARD_BUF_SIZE
Definition: keyboard.h:14
void clearKeyboardBuffer()
Wipe the keyboard buffer.
Definition: keyboard.c:572
int keyboardBufIndex[MAX_NUM_TERMINALS]
Definition: keyboard.h:38
char keyboardBuf[MAX_NUM_TERMINALS][KEYBOARD_BUF_SIZE]
Buffers of keys typed for terminal to interpret.
Definition: keyboard.h:45
Header files for terminal.c.
#define MAX_NUM_TERMINALS
Definition: terminal.h:13
int int32_t
Definition: types.h:18