00001 /*! \file vt100.c \brief VT100 terminal function library. */ 00002 //***************************************************************************** 00003 // 00004 // File Name : 'vt100.c' 00005 // Title : VT100 terminal function library 00006 // Author : Pascal Stang - Copyright (C) 2002 00007 // Created : 2002.08.27 00008 // Revised : 2002.08.27 00009 // Version : 0.1 00010 // Target MCU : Atmel AVR Series 00011 // Editor Tabs : 4 00012 // 00013 // NOTE: This code is currently below version 1.0, and therefore is considered 00014 // to be lacking in some functionality or documentation, or may not be fully 00015 // tested. Nonetheless, you can expect most functions to work. 00016 // 00017 // This code is distributed under the GNU Public License 00018 // which can be found at http://www.gnu.org/licenses/gpl.txt 00019 // 00020 //***************************************************************************** 00021 00022 #ifndef WIN32 00023 #include <avr/io.h> 00024 #include <avr/signal.h> 00025 #include <avr/interrupt.h> 00026 #include <avr/pgmspace.h> 00027 #endif 00028 00029 #include "global.h" 00030 #include "rprintf.h" 00031 #include "vt100.h" 00032 00033 // Program ROM constants 00034 00035 // Global variables 00036 00037 // Functions 00038 void vt100Init(void) 00039 { 00040 // initializes terminal to "power-on" settings 00041 // ESC c 00042 rprintfProgStrM("\x1B\x63"); 00043 } 00044 00045 void vt100ClearScreen(void) 00046 { 00047 // ESC [ 2 J 00048 rprintfProgStrM("\x1B[2J"); 00049 } 00050 00051 void vt100SetAttr(u08 attr) 00052 { 00053 // ESC [ Ps m 00054 rprintf("\x1B[%dm",attr); 00055 } 00056 00057 void vt100SetCursorMode(u08 visible) 00058 { 00059 if(visible) 00060 // ESC [ ? 25 h 00061 rprintf("\x1B[?25h"); 00062 else 00063 // ESC [ ? 25 l 00064 rprintf("\x1B[?25l"); 00065 } 00066 00067 void vt100SetCursorPos(u08 line, u08 col) 00068 { 00069 // ESC [ Pl ; Pc H 00070 rprintf("\x1B[%d;%dH",line,col); 00071 } 00072