Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# vt100.c

Go to the documentation of this file.

    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   : any
    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 #include "global.h"
    00023 #include "rprintf.h"
    00024 #include "vt100.h"
    00025
    00026 // Program ROM constants
    00027
    00028 // Global variables
    00029
    00030 // Functions
    00031 void vt100Init(void)
    00032 {
    00033     // initializes terminal to "power-on" settings
    00034     // ESC c
    00035     rprintfProgStrM("\x1B\x63");
    00036 }
    00037
    00038 void vt100ClearScreen(void)
    00039 {
    00040     // ESC [ 2 J
    00041     rprintfProgStrM("\x1B[2J");
    00042 }
    00043
    00044 void vt100SetAttr(u08 attr)
    00045 {
    00046     // ESC [ Ps m
    00047     rprintf("\x1B[%dm",attr);
    00048 }
    00049
    00050 void vt100SetCursorMode(u08 visible)
    00051 {
    00052     if(visible)
    00053         // ESC [ ? 25 h
    00054         rprintf("\x1B[?25h");
    00055     else
    00056         // ESC [ ? 25 l
    00057         rprintf("\x1B[?25l");
    00058 }
    00059
    00060 void vt100SetCursorPos(u08 line, u08 col)
    00061 {
    00062     // ESC [ Pl ; Pc H
    00063     rprintf("\x1B[%d;%dH",line,col);
    00064 }
    00065