VT100 Emulator for LCD

VT100 Emulator for 1.8" TFT LCD Display video demo:

This project uses the same hardware used for the 8bit CPU TCP/IP project <https://sites.google.com/site/eyalabraham/8bit-cpu-tcp-ip-stack-and-web-server>. The intent was to enable use of the LCD display with full range of cursor and color control using the VT100 command set.

VT100 defines a set of Escape Sequences that are commands embedded in the character stream being printed. More on VT100 commands can be found here <http://www.termsys.demon.co.uk/vtansi.htm>.

The emulator code is part of this project <https://github.com/eyalabraham/webserver8bit> on my GIT repository. Included in files: vt100lcd.c and vt100lcd.h. Auxiliary files used as LCD driver are st7735.c and st7735.h (based on the Adafruit drivers), and xprintf.c and xprintf.h used as a specialized printf with character streaming. The last two files are not needed, and can be replaced with your own printf driver.

The VT100 commands supported by the vt100lcd.c module are (a '+' signe notes an implemented command, <ESC> is an escape character 0x1B):

/*
 * + Enable Line Wrap    <ESC>[7h                Text wraps to next line if longer than the length of the display area.
 * + Disable Line Wrap   <ESC>[7l                Disables line wrapping.
 * + Cursor Home         <ESC>[{ROW};{COLUMN}H   Sets the cursor position where subsequent text will begin.
 *                                               If no row/column parameters are provided (ie. <ESC>[H),
 *                                               the cursor will move to the home position, at the upper left of the screen.
 * + Cursor Up           <ESC>[{COUNT}A          Moves the cursor up by COUNT rows; the default count is 1.
 * + Cursor Down         <ESC>[{COUNT}B          Moves the cursor down by COUNT rows; the default count is 1.
 * + Cursor Forward      <ESC>[{COUNT}C          Moves the cursor forward by COUNT columns; the default count is 1.
 * + Cursor Backward     <ESC>[{COUNT}D          Moves the cursor backward by COUNT columns; the default count is 1.
 * + Set Cursor Position <ESC>[{ROW};{COL}f      Identical to Cursor Home.
 * + Save Cursor         <ESC>[s                 Save current cursor position.
 * + Un-save Cursor      <ESC>[u                 Restores cursor position after a Save Cursor.
 * + Erase End of Line   <ESC>[K                 Erases from the current cursor position to the end of the current line.
 * + Erase Start of Line <ESC>[1K                Erases from the current cursor position to the start of the current line.
 * + Erase Line          <ESC>[2K                Erases the entire current line.
 *   Erase Down          <ESC>[J                 Erases the screen from the current line down to the bottom of the screen.
 *   Erase Up            <ESC>[1J                Erases the screen from the current line up to the top of the screen.
 * + Erase Screen        <ESC>[2J                Erases the screen with the background color and moves the cursor to home.
 * + Set Attribute Mode  <ESC>[{Fg};{Bg}m        Sets multiple foreground and background color attribute (reduced functionality)
 *
 *          Foreground Colors
 *      30  Black
 *      31  Red
 *      32  Green
 *      33  Yellow
 *      34  Blue
 *      35  Magenta
 *      36  Cyan
 *      37  White
 *
 *          Background Colors
 *      40  Black
 *      41  Red
 *      42  Green
 *      43  Yellow
 *      44  Blue
 *      45  Magenta
 *      46  Cyan
 *      47  White
 */