Go to the documentation of this file.00001 #ifndef _DEV_TERM_H_
00002 #define _DEV_TERM_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include <sys/device.h>
00037
00047
00048
00049
00050
00051 #define LCD_CMDBYTE 0x0401
00052 #define LCD_CMDWORD16 0x0402
00053 #define LCD_CMDWORD32 0x0403
00054 #define LCD_DATABYTE 0x0405
00055 #define LCD_DATAWORD16 0x0406
00056 #define LCD_DATAWORD32 0x0407
00057 #define LCD_SETCOOKEDMODE 0x0413
00058 #define LCD_GETCOOKEDMODE 0x0414
00059 #define LCD_SET_AUTOLF 0x0415
00060 #define LCD_GET_AUTOLF 0x0416
00061
00062 #ifndef TIOCGWINSZ
00063 #define TIOCGWINSZ 0x0501
00064 #endif
00065 #ifndef TIOCSWINSZ
00066 #define TIOCSWINSZ 0x0502
00067 #endif
00068
00069 #define LCD_MF_CURSORON 0x00000001UL
00070 #define LCD_MF_COOKEDMODE 0x00020000UL
00071 #define LCD_MF_AUTOLF 0x00040000UL
00072 #define LCD_MF_AUTOSCROLL 0x00080000UL
00073 #define LCD_MF_INVERTED 0x10000000UL
00075 #ifndef ESC_CHAR
00076 #define ESC_CHAR "\x1B"
00077 #endif
00078
00079 #define ESC_POS ESC_CHAR "Y"
00080 #define ESC_UP ESC_CHAR "A"
00081 #define ESC_DOWN ESC_CHAR "B"
00082 #define ESC_RIGHT ESC_CHAR "C"
00083 #define ESC_LEFT ESC_CHAR "D"
00084 #define ESC_CLRHOME ESC_CHAR "E"
00085
00086 #define ESC_HOME ESC_CHAR "H"
00087 #define ESC_CLREND ESC_CHAR "J"
00088 #define ESC_CLREOL ESC_CHAR "K"
00089 #define ESC_CLRSTART ESC_CHAR "d"
00090 #define ESC_CLRSOL ESC_CHAR "o"
00091
00092 #define ESC_INSCHAR ESC_CHAR "@"
00093 #define ESC_INSLINE ESC_CHAR "L"
00094 #define ESC_DELCHAR ESC_CHAR "P"
00095 #define ESC_DELLINE ESC_CHAR "M"
00096 #define ESC_RLF ESC_CHAR "I"
00097
00098 #define ESC_CURSORON ESC_CHAR "e"
00099 #define ESC_CURSOROFF ESC_CHAR "f"
00100 #define ESC_INVERTON ESC_CHAR "i"
00101 #define ESC_INVERTOFF ESC_CHAR "n"
00102 #define ESC_SPECIALSET ESC_CHAR "F"
00103 #define ESC_DEFAULTSET ESC_CHAR "G"
00104 #define ESC_ACTIVE ESC_CHAR "R"
00105 #define ESC_SLEEP ESC_CHAR "S"
00106
00111 #define ESC_CLR ESC_CLRHOME
00112
00113
00114
00115
00116 typedef struct _WINSIZE WINSIZE;
00117
00118 struct _WINSIZE {
00119 uint16_t ws_row;
00120 uint16_t ws_col;
00121 uint16_t ws_xpixel;
00122 uint16_t ws_ypixel;
00123 };
00124
00128 typedef struct _TERMDCB TERMDCB;
00129
00134 struct _TERMDCB {
00135
00138 int (*dss_init)(NUTDEVICE *);
00139
00142 void (*dss_write)(uint8_t);
00143
00146 void (*dss_command)(uint8_t, uint8_t);
00147
00150 void (*dss_clear)(void);
00151
00154 void (*dss_set_cursor)(uint8_t);
00155
00158 void (*dss_cursor_home)(void);
00159
00162 void (*dss_cursor_left)(void);
00163
00166 void (*dss_cursor_right)(void);
00167
00170 void (*dss_cursor_mode)(uint8_t);
00171
00174 uint32_t dcb_modeflags;
00175
00178 uint8_t dcb_ctlseq;
00179
00183 uint8_t dcb_nrows;
00184
00188 uint8_t dcb_ncols;
00189
00193 uint8_t dcb_vcols;
00194
00197 uint8_t dcb_row;
00198
00201 uint8_t dcb_col;
00202
00205 uint8_t *dcb_smem;
00206
00209 uint8_t *dcb_sptr;
00210 };
00211
00214 extern int TermInit(NUTDEVICE * dev);
00215 extern int TermIOCtl(NUTDEVICE * dev, int req, void *conf);
00216 extern int TermWrite(NUTFILE * fp, CONST void *buffer, int len);
00217 #ifdef __HARVARD_ARCH__
00218 extern int TermWrite_P(NUTFILE * fp, PGM_P buffer, int len);
00219 #endif
00220 extern NUTFILE *TermOpen(NUTDEVICE * dev, CONST char *name, int mode, int acc);
00221 extern int TermClose(NUTFILE * fp);
00222
00223 #endif