7 * the constructor (setup the display), character (put a character |
7 * the constructor (setup the display), character (put a character |
8 * at a location), rows and columns (number of rows/cols) functions. |
8 * at a location), rows and columns (number of rows/cols) functions. |
9 * Everything else (locate, printf, putc, cls) will come for free |
9 * Everything else (locate, printf, putc, cls) will come for free |
10 * |
10 * |
11 * The model is the display will wrap at the right and bottom, so you can |
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 |
12 * keep writing and will always get valid characters. The location is |
13 * maintained internally to the class to make this easy |
13 * maintained internally to the class to make this easy |
14 */ |
14 */ |
15 |
15 |
16 #ifndef MBED_TEXTDISPLAY_H |
16 #ifndef MBED_TEXTDISPLAY_H |
17 #define MBED_TEXTDISPLAY_H |
17 #define MBED_TEXTDISPLAY_H |
18 |
18 |
19 #include "mbed.h" |
19 #include <mbed.h> |
|
20 #include <Stream.h> |
|
21 |
20 |
22 |
21 /** A common base class for Text displays |
23 /** A common base class for Text displays |
22 */ |
24 */ |
23 class TextDisplay : public Stream { |
25 class TextDisplay : public Stream { |
24 public: |
26 public: |
48 /** return number of columns on TextDisplay |
50 /** return number of columns on TextDisplay |
49 * @result number of columns |
51 * @result number of columns |
50 * @note this method must be supported in the derived class. |
52 * @note this method must be supported in the derived class. |
51 */ |
53 */ |
52 virtual int columns() = 0; |
54 virtual int columns() = 0; |
53 |
55 |
54 // functions that come for free, but can be overwritten |
56 // functions that come for free, but can be overwritten |
55 // ---------------------------------------------------- |
57 // ---------------------------------------------------- |
56 /** redirect output from a stream (stoud, sterr) to display |
58 /** redirect output from a stream (stoud, sterr) to display |
57 * @param stream stream that shall be redirected to the TextDisplay |
59 * @param stream stream that shall be redirected to the TextDisplay |
58 * @note this method may be overridden in a derived class. |
60 * @note this method may be overridden in a derived class. |