00001 /*! \file vt100.h \brief VT100 terminal function library. */ 00002 //***************************************************************************** 00003 // 00004 // File Name : 'vt100.h' 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 /// \ingroup general 00018 /// \defgroup vt100 VT100 Terminal Function Library (vt100.c) 00019 /// \code #include "vt100.h" \endcode 00020 /// \par Overview 00021 /// This library provides functions for sending VT100 escape codes to 00022 /// control a connected VT100 or ANSI terminal. Commonly useful functions 00023 /// include setting the cursor position, clearing the screen, setting the text 00024 /// attributes (bold, inverse, blink, etc), and setting the text color. This 00025 /// library will slowly be expanded to include support for codes as needed and 00026 /// may eventually receive VT100 escape codes too. 00027 // 00028 // This code is distributed under the GNU Public License 00029 // which can be found at http://www.gnu.org/licenses/gpl.txt 00030 // 00031 //***************************************************************************** 00032 00033 #ifndef VT100_H 00034 #define VT100_H 00035 00036 #include "global.h" 00037 00038 // constants/macros/typdefs 00039 // text attributes 00040 #define VT100_ATTR_OFF 0 00041 #define VT100_BOLD 1 00042 #define VT100_USCORE 4 00043 #define VT100_BLINK 5 00044 #define VT100_REVERSE 7 00045 #define VT100_BOLD_OFF 21 00046 #define VT100_USCORE_OFF 24 00047 #define VT100_BLINK_OFF 25 00048 #define VT100_REVERSE_OFF 27 00049 00050 // functions 00051 00052 //! vt100Init() initializes terminal and vt100 library 00053 /// Run this init routine once before using any other vt100 function. 00054 void vt100Init(void); 00055 00056 //! vt100ClearScreen() clears the terminal screen 00057 void vt100ClearScreen(void); 00058 00059 //! vt100SetAttr() sets the text attributes like BOLD or REVERSE 00060 /// Text written to the terminal after this function is called will have 00061 /// the desired attribuutes. 00062 void vt100SetAttr(u08 attr); 00063 00064 //! vt100SetCursorMode() sets the cursor to visible or invisible 00065 void vt100SetCursorMode(u08 visible); 00066 00067 //! vt100SetCursorPos() sets the cursor position 00068 /// All text which is written to the terminal after a SetCursorPos command 00069 /// will begin at the new location of the cursor. 00070 void vt100SetCursorPos(u08 line, u08 col); 00071 00072 #endif