Some classes and macros to enable quick single line trace and watch facilities. Three macros DBUG_INIT, TRACE & WATCH are used to implement all functions. DBUG_INIT is used to allocate the maximum number of watch items that are to be displayed at any time. The remainder of the VT100 emulation screen will be dedicated to the scrolling trace function. The use of macros means that they will be ignored by the compiler when the debug declaration is removed. To assist in formatting the string output I have implemented a caret field that is interpreted as a screen attribute eg ^R reverse video on ^r reverse video off. Look at the VT100 class for further details. This was completed for a rush project about 10 minutes ago so expect a few issues to become apparent.

Dependencies:   mbed

VT100.h

Committer:
ChrisHatfield
Date:
2010-01-04
Revision:
0:0c4137d26c2e

File content as of revision 0:0c4137d26c2e:

#pragma once
#include <stdarg.h>
#include "mbed.h"

class CVT100
{
public:
    CVT100(void);
    ~CVT100(void);
    enum {Rows = 24, Columns = 80};
//Attributes
Serial* m_pVT100;

//Interface
void printf(const char *lpszFormat, ...);
void printf(unsigned char nCol, unsigned char nRow, const char *lpszFormat, ...);
void vprintf(const char *lpszFormat, va_list);
void vprintf(unsigned char nCol, unsigned char nRow, const char *lpszFormat, va_list);
void ClearScreen(void);
void SaveCursor(void);
void CursorOff(bool bOff = true);
void RestoreCursor(void);
void MoveXY(unsigned char nCol, unsigned char nRow);
void SetScroll(unsigned char nStart, unsigned char nEnd);
void PutString(const char *lpszOutput);
char* FormatString(const char *lpszFormat);
};