MP3 1.0
This is the Doxygen document for ECE391 MP3.
Loading...
Searching...
No Matches
terminal.h
Go to the documentation of this file.
1
10#ifndef TERMINAL_H
11#define TERMINAL_H
12
13#define MAX_NUM_TERMINALS (3)
14#define X_POS (0)
15#define Y_POS (1)
16
17#include "types.h"
18#include "keyboard.h"
19#include "lib.h"
20
34int terminalRead(int32_t fd, void* buf, int32_t nbytes);
35
45int terminalWrite(int32_t fd, const void* buf, int32_t nbytes);
46
55int terminalOpen(const uint8_t* filename);
56
66
82void swapTerminal(uint8_t terminalNum);
83
94void initTerminal();
95
101
107
112int volatile activeTerminal;
113
120
121
122#endif // TERMINAL_H
Header file for keyboard.c.
#define KEYBOARD_BUF_SIZE
Definition: keyboard.h:14
Header file for lib.c and helper macros.
int terminalRead(int32_t fd, void *buf, int32_t nbytes)
Start recording key presses. Ends when enter is pressed.
Definition: terminal.c:52
char cursorPos[MAX_NUM_TERMINALS][2]
2D array holding the cursor position for each terminal.
Definition: terminal.h:106
int volatile activeTerminal
ID of the active (currently displayed) terminal.
Definition: terminal.h:112
#define MAX_NUM_TERMINALS
Definition: terminal.h:13
void swapTerminal(uint8_t terminalNum)
Swaps the active terminal to the specified terminal number.
Definition: terminal.c:125
int terminalWrite(int32_t fd, const void *buf, int32_t nbytes)
Write output arg buffer to the screen.
Definition: terminal.c:26
int terminalClose(int32_t fd)
Close terminal.
Definition: terminal.c:105
void initTerminal()
Initializes the terminal.
Definition: terminal.c:202
int terminalOpen(const uint8_t *filename)
Open Terminal.
Definition: terminal.c:92
int8_t terminalPIDArray[MAX_NUM_TERMINALS]
Definition: terminal.h:119
int executingTerminalID
Terminal ID for the current active process.
Definition: terminal.h:118
char terminalBuf[MAX_NUM_TERMINALS][KEYBOARD_BUF_SIZE]
2D array so each terminal has their own buffer
Definition: terminal.h:100
Defines to use the familiar explicitly-sized types in this OS.
int int32_t
Definition: types.h:18
unsigned char uint8_t
Definition: types.h:25
char int8_t
Definition: types.h:24