Milos RTOS v0.3.4a
Real Time Operating System
terminal.c File Reference
#include "terminal.h"
#include "lock.h"
#include "heap.h"
#include <common/string.h>
#include <common/mem.h>
#include "device.h"
#include "system.h"
#include "dbgterm.h"
Include dependency graph for terminal.c:

Go to the source code of this file.

Defines

#define __SK_BASE   0x1000
#define __SK_UNKNOWN   0xFFFF
#define __SK_ESCAPE   __SK_BASE
#define __SK_UPARROW   __SK_BASE + 1
#define __SK_DOWNARROW   __SK_BASE + 2
#define __SK_RIGHTARROW   __SK_BASE + 3
#define __SK_LEFTARROW   __SK_BASE + 4
#define __SK_BREAK   __SK_BASE + 5
#define __SK_INS   __SK_BASE + 6
#define __SK_HOME   __SK_BASE + 7
#define __SK_PGUP   __SK_BASE + 8
#define __SK_DEL   __SK_BASE + 9
#define __SK_END   __SK_BASE + 10
#define __SK_PGDN   __SK_BASE + 11
#define __SK_F1   __SK_BASE + 12
#define __SK_F2   __SK_BASE + 13
#define __SK_F3   __SK_BASE + 14
#define __SK_F4   __SK_BASE + 15
#define __SK_F5   __SK_BASE + 16
#define __SK_F6   __SK_BASE + 17
#define __SK_F7   __SK_BASE + 18
#define __SK_F8   __SK_BASE + 19
#define __SK_F9   __SK_BASE + 20
#define __SK_F10   __SK_BASE + 21
#define __SK_F11   __SK_BASE + 22
#define __SK_F12   __SK_BASE + 23
#define __TERMINAL_PROMPT   "milos> "

Functions

__STATIC __VOID __terminalBack (__PTERMINAL term, u8 qty)
 Sends the cursor backwards.
__STATIC __VOID __terminalFoward (__PTERMINAL term, u8 qty)
 Sends the cursor forward.
__STATIC __VOID __terminalShowPrompt (__PTERMINAL term)
 Shows prompt.
__STATIC u16 __terminalParseEscaped (__PTERMINAL term)
 Parses escaped characters.
__STATIC __BOOL __terminalParseSpecial (__PTERMINAL term, u16 code)
 Process key codes.
__STATIC __VOID __terminalWriteChar (__PTERMINAL term, u8 c)
 Outputs a character.
__STATIC __BOOL __terminalReadLine (__PTERMINAL term)
 Reads a single line of text.
__VOID __terminalThread (__VOID)
 Terminal thread.
__BOOL __terminalStart (__PTERMINAL term)
 Terminal initialization.
__VOID __terminalWriteLine (__PTERMINAL term, __CONST __PSTRING str,...)
 Outputs a line of text.
__VOID __terminalWrite (__PTERMINAL term, __CONST __PSTRING str,...)
 Outputs a line of text.
__VOID __terminalOut (__PTERMINAL term, __BOOL crlf, __CONST __PSTRING str, __PSTRING args)
__PTERMINAL __terminalCreate (__PSTRING name, __PDEVICE in, __PDEVICE out, u16 linelen, __PSTRING prompt, u8 flags)
 Creates a terminal.
__VOID __terminalAddCommand (__PTERMINAL term, __PTERMINALCMD cmd, u8 count)
 Adds a command to the list of commands of a terminal.
__VOID __terminalCreateCommand (__PTERMINAL term, __PSTRING cmd, __TERMINALRXCMD *func)
 Creates and adds a command to the terminal command list.

Variables

__CONST __STRING __terminalESC [] = {0x1b, 0x5b}
__CONST __STRING __terminalBackspace [] = {0x1b, 0x5b, '1', 'D', 0x1b, 0x5b, '0', 'K', 0x00}
__CONST __STRING __terminalClearScreen [] = {0x1b, 0x5b, '2', 'J', 0x00}
__CONST __STRING __terminalShowCursor [] = {0x1b, 0x5b, '?', '2', '5', 'h', 0x00}
__CONST __STRING __terminalHideCursor [] = {0x1b, 0x5b, '?', '2', '5', 'l', 0x00}
__TERMINALCMD __dbgCommands []
 All Data Structures Files Functions Variables Typedefs Defines