![]() |
The virtual terminal driver allows to use a LC or VF display for standard I/O. It supports VT52 control codes.
Data Structures | |
struct | _WINSIZE |
struct | _TERMDCB |
Terminal device control block structure. More... | |
struct | _TERMDCB |
Terminal device control block structure. More... | |
Defines | |
#define | LCD_CMDBYTE 0x0401 |
#define | LCD_CMDWORD16 0x0402 |
#define | LCD_CMDWORD32 0x0403 |
#define | LCD_DATABYTE 0x0405 |
#define | LCD_DATAWORD16 0x0406 |
#define | LCD_DATAWORD32 0x0407 |
#define | LCD_SETCOOKEDMODE 0x0413 |
Set raw mode. | |
#define | LCD_GETCOOKEDMODE 0x0414 |
Query raw mode. | |
#define | TIOCGWINSZ 0x0501 |
#define | TIOCSWINSZ 0x0502 |
#define | LCD_MF_CURSORON 0x00000001UL |
Cursor on flag. | |
#define | LCD_MF_COOKEDMODE 0x00020000UL |
Control character interpretation on flag. | |
#define | ESC_CHAR "\x1B" |
#define | ESC_POS ESC_CHAR "Y" |
#define | ESC_UP ESC_CHAR "A" |
#define | ESC_DOWN ESC_CHAR "B" |
#define | ESC_RIGHT ESC_CHAR "C" |
#define | ESC_LEFT ESC_CHAR "D" |
#define | ESC_CLRHOME ESC_CHAR "H" |
#define | ESC_CLR ESC_CHAR "E" |
#define | ESC_CLREND ESC_CHAR "J" |
#define | ESC_CLREOL ESC_CHAR "K" |
#define | ESC_CLRSTART ESC_CHAR "d" |
#define | ESC_CLRSOL ESC_CHAR "o" |
#define | ESC_INSCHAR ESC_CHAR "@" |
#define | ESC_INSLINE ESC_CHAR "L" |
#define | ESC_DELCHAR ESC_CHAR "P" |
#define | ESC_DELLINE ESC_CHAR "M" |
#define | ESC_RLF ESC_CHAR "I" |
#define | ESC_CURSORON ESC_CHAR "e" |
#define | ESC_CURSOROFF ESC_CHAR "f" |
#define | ESC_SPECIALSET ESC_CHAR "F" |
#define | ESC_DEFAULTSET ESC_CHAR "G" |
#define | ESC_ACTIVE ESC_CHAR "R" |
#define | ESC_SLEEP ESC_CHAR "S" |
Typedefs | |
typedef struct _WINSIZE | WINSIZE |
typedef struct _TERMDCB | TERMDCB |
Functions | |
void | TermRefresh (TERMDCB *dcb) |
int | TermIOCtl (NUTDEVICE *dev, int req, void *conf) |
Perform special LCD control functions. | |
int | TermInit (NUTDEVICE *dev) |
Initialize the terminal device. | |
int | TermWrite (NUTFILE *fp, CONST void *buffer, int len) |
Write data to a terminal device. | |
int | TermWrite_P (NUTFILE *fp, PGM_P buffer, int len) |
Write data from program space to a terminal device. | |
NUTFILE * | TermOpen (NUTDEVICE *dev, CONST char *name, int mode, int acc) |
Open a terminal device. | |
int | TermClose (NUTFILE *fp) |
Close a device or file. |
#define LCD_CMDBYTE 0x0401 |
#define LCD_CMDWORD16 0x0402 |
#define LCD_CMDWORD32 0x0403 |
#define LCD_DATABYTE 0x0405 |
#define LCD_DATAWORD16 0x0406 |
#define LCD_DATAWORD32 0x0407 |
#define LCD_SETCOOKEDMODE 0x0413 |
#define LCD_GETCOOKEDMODE 0x0414 |
#define TIOCGWINSZ 0x0501 |
#define LCD_MF_COOKEDMODE 0x00020000UL |
Control character interpretation on flag.
Definition at line 68 of file term.h.
Referenced by TermIOCtl(), and TermOpen().
#define ESC_POS ESC_CHAR "Y" |
#define ESC_CLREOL ESC_CHAR "K" |
#define ESC_CURSOROFF ESC_CHAR "f" |
void TermRefresh | ( | TERMDCB * | dcb | ) |
Definition at line 113 of file term.c.
References _TERMDCB::dcb_col, _TERMDCB::dcb_ncols, _TERMDCB::dcb_nrows, _TERMDCB::dcb_row, and _TERMDCB::dss_set_cursor.
int TermIOCtl | ( | NUTDEVICE * | dev, | |
int | req, | |||
void * | conf | |||
) |
Perform special LCD control functions.
dev | Identifies the device that receives the device-control function. | |
req | Requested control function. May be set to one of the following constants:
| |
conf | Points to a buffer that contains any data required for the given control function or receives data from that function. |
Definition at line 314 of file term.c.
References _TERMDCB::dcb_modeflags, _TERMDCB::dcb_nrows, _TERMDCB::dcb_vcols, _NUTDEVICE::dev_dcb, _TERMDCB::dss_command, _TERMDCB::dss_write, LCD_CMDBYTE, LCD_CMDWORD16, LCD_CMDWORD32, LCD_DATABYTE, LCD_DATAWORD16, LCD_DATAWORD32, LCD_GETCOOKEDMODE, LCD_MF_COOKEDMODE, LCD_SETCOOKEDMODE, TIOCGWINSZ, _WINSIZE::ws_col, _WINSIZE::ws_row, _WINSIZE::ws_xpixel, and _WINSIZE::ws_ypixel.
int TermInit | ( | NUTDEVICE * | dev | ) |
Initialize the terminal device.
Prepares the device for subsequent writing.
Application should not call this function directly, but use the stdio interface.
dev | Identifies the device to initialize. |
Definition at line 388 of file term.c.
References _TERMDCB::dcb_nrows, _TERMDCB::dcb_smem, _TERMDCB::dcb_vcols, _NUTDEVICE::dev_dcb, _TERMDCB::dss_init, and malloc.
int TermWrite | ( | NUTFILE * | fp, | |
CONST void * | buffer, | |||
int | len | |||
) |
Write data to a terminal device.
Application should not call this function directly, but use the stdio interface.
The data may contain special character sequences, which are interpreted by the terminal device to control specific display functions:
In addition a superset of VT52 control sequences are interpreted. Each sequence starts with an ESC character (ASCII 27):
(*) Not a VT52 command.
fp | File pointer to a previously opened device. | |
buffer | Pointer to the data bytes to be written. | |
len | Number of bytes to write. |
Definition at line 681 of file term.c.
References _NUTFILE::nf_dev.
int TermWrite_P | ( | NUTFILE * | fp, | |
PGM_P | buffer, | |||
int | len | |||
) |
Write data from program space to a terminal device.
Similar to TermWrite() except that the data is located in program memory.
Application should not call this function directly, but use the stdio interface.
fp | File pointer to a previously opened device. | |
buffer | Pointer to the data bytes in program space to be written. | |
len | Number of bytes to write. |
Definition at line 701 of file term.c.
References CONST, and _NUTFILE::nf_dev.
Open a terminal device.
Application should not call this function directly, but use the stdio interface.
dev | Pointer to device information structure. | |
name | Filename. Not used with terminal devices. | |
mode | Operation mode. May be any of the following:
| |
acc | Access mode. Not used with terminal devices. |
Definition at line 724 of file term.c.
References _O_BINARY, _TERMDCB::dcb_modeflags, _NUTDEVICE::dev_dcb, LCD_MF_COOKEDMODE, malloc, _NUTFILE::nf_dev, _NUTFILE::nf_fcb, _NUTFILE::nf_next, and NUTFILE_EOF.
int TermClose | ( | NUTFILE * | fp | ) |
Close a device or file.
Application should not call this function directly, but use the stdio interface.
fp | Pointer to a previously opened NUTFILE structure. |
Definition at line 753 of file term.c.
References free, and NUTFILE_EOF.