Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __TERMINAL_H__
00024 #define __TERMINAL_H__
00025
00026 #include <plat_cpu.h>
00027 #include "device.h"
00028 #include "lock.h"
00029
00030 #if __CONFIG_COMPILE_TERMINAL
00031
00032
00033
00034
00035 struct __terminalTag;
00036
00055 typedef __VOID (__TERMINALRXCMD)(struct __terminalTag* term, __PSTRING cmd, __PSTRING params);
00056
00069 #define __TERMINAL_DEF_LINELEN 64
00070
00079 #define __TERMINAL_ECHO_ENABLED 0x01
00080 #define __TERMINAL_DEBUG_COMMANDS 0x02
00081 #define __TERMINAL_STARTED 0x04
00082
00095 typedef struct __terminalCommandTag
00096 {
00097 __PSTRING cmd;
00098 __TERMINALRXCMD* func;
00099 struct __terminalCommandTag* next;
00100
00101 } __TERMINALCMD, *__PTERMINALCMD;
00102
00103 typedef struct __terminalTag
00104 {
00105 __PSTRING name;
00106 __PDEVICE dv_in;
00107 __PDEVICE dv_out;
00108 __PSTRING tx_line;
00109 __PSTRING rx_line;
00110 __PSTRING prompt;
00111 u16 linelen;
00112 u16 rxoffs;
00113 u16 cursor;
00114 __PLOCK lock;
00115 u8 flags;
00116 __PTERMINALCMD cmds;
00117 } __TERMINAL, *__PTERMINAL;
00118
00123 __PTERMINAL __terminalCreate(__PSTRING name, __PDEVICE in, __PDEVICE out, u16 linelen, __PSTRING prompt, u8 flags);
00124 __BOOL __terminalStart(__PTERMINAL term);
00125 __VOID __terminalWrite(__PTERMINAL term, __CONST __PSTRING str, ...);
00126 __VOID __terminalWriteLine(__PTERMINAL term, __CONST __PSTRING str, ...);
00127 __VOID __terminalOut(__PTERMINAL term, __BOOL crlf, __CONST __PSTRING str, __PSTRING args);
00128 __VOID __terminalAddCommand(__PTERMINAL term, __PTERMINALCMD cmd, u8 count);
00129 __VOID __terminalCreateCommand(__PTERMINAL term, __PSTRING cmd, __TERMINALRXCMD* func);
00130
00135 #endif
00136
00137 #endif