]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/tests/mbed/freopen/TextDisplay.h
1 /* mbed TextDisplay Library Base Class
2 * Copyright (c) 2007-2009 sford
3 * Released under the MIT License: http://mbed.org/license/mit
5 * A common base class for Text displays
6 * To port a new display, derive from this class and implement
7 * the constructor (setup the display), character (put a character
8 * at a location), rows and columns (number of rows/cols) functions.
9 * Everything else (locate, printf, putc, cls) will come for free
11 * The model is the display will wrap at the right and bottom, so you can
12 * keep writing and will always get valid characters. The location is
13 * maintained internally to the class to make this easy
16 #ifndef MBED_TEXTDISPLAY_H
17 #define MBED_TEXTDISPLAY_H
21 class TextDisplay
: public Stream
{
24 // functions needing implementation in derived implementation class
25 TextDisplay(const char *name
= NULL
);
26 virtual void character(int column
, int row
, int c
) = 0;
27 virtual int rows() = 0;
28 virtual int columns() = 0;
30 // functions that come for free, but can be overwritten
32 virtual void locate(int column
, int row
);
33 virtual void foreground(int colour
);
34 virtual void background(int colour
);
36 // printf (from Stream)
40 virtual int _putc(int value
);