A TextDisplay driver that supports graphical displays using on of the SED133x conrtrolers. Allows stdout and stderr output to be redirected to the display.

Revision:
2:8596e06f241f
Parent:
1:18c56f038905
Child:
3:c84bc6d1dc52
--- a/TextDisplay.h	Sat Jan 15 16:02:56 2011 +0000
+++ b/TextDisplay.h	Wed Jan 26 21:56:12 2011 +0000
@@ -9,7 +9,7 @@
  * Everything else (locate, printf, putc, cls) will come for free
  *
  * The model is the display will wrap at the right and bottom, so you can
- * keep writing and will always get valid characters. The location is 
+ * keep writing and will always get valid characters. The location is
  * maintained internally to the class to make this easy
  */
 
@@ -22,19 +22,57 @@
 public:
 
     // functions needing implementation in derived implementation class
+
+    /** Create a TextDisplay interface
+     *
+     * @param name The name used in the path to access the strean through the filesystem
+     */
+
     TextDisplay(const char *name = NULL);
+
+    /** output a character at the given position
+     *
+     * @param column column where charater must be written
+     * @param  row where character must be written
+     * @parm c the character to be written to the TextDisplay
+     */
+
     virtual void character(uint16_t column, uint16_t row, int c) = 0;
+
+    /** return number if rows on TextDisplay
+     * @result number of rows
+     */
     virtual uint16_t rows() = 0;
+    /** return number if columns on TextDisplay
+    * @result number of rows
+    */
+
     virtual uint16_t columns() = 0;
-    
+
     // functions that come for free, but can be overwritten
+    /** redirect output from a stream (stoud, sterr) to  display
+    * @param stream that shall be redirected to the TextDisplay
+    */
+    virtual bool claim (FILE *stream);
+    /** clear screen
+    */
     virtual void cls();
+    /** locate cursor on given position
+    * @param column horizontal position
+    * @paran row vertical positon
+    */
     virtual void locate(uint16_t column, uint16_t row);
+     /** set foreground colour
+     * @param colour
+     */
     virtual void foreground(uint32_t colour);
+     /** set background colour
+     * @param colour
+     */
     virtual void background(uint32_t colour);
     // putc (from Stream)
     // printf (from Stream)
-    
+
 protected:
 
     virtual int _putc(int value);
@@ -47,6 +85,7 @@
     // colours
     uint32_t _foreground;
     uint32_t _background;
+    char *_path;
 };
 
 #endif