Programme de test pour lcd ITDB02

Fork of TFTLCD by Todor Todorov

Files at this revision

API Documentation at this revision

Comitter:
ttodorov
Date:
Sun Dec 02 00:12:43 2012 +0000
Parent:
1:14bef43daf6f
Child:
3:64a5b67d5b51
Commit message:
- Fixed capitalization of functions

Changed in this revision

lcd_base.cpp Show annotated file Show diff for this revision Revisions of this file
lcd_base.h Show annotated file Show diff for this revision Revisions of this file
ssd.cpp Show annotated file Show diff for this revision Revisions of this file
ssd.h Show annotated file Show diff for this revision Revisions of this file
--- a/lcd_base.cpp	Sat Dec 01 23:49:10 2012 +0000
+++ b/lcd_base.cpp	Sun Dec 02 00:12:43 2012 +0000
@@ -68,10 +68,10 @@
 {
     unsigned short rgb = color == -1 ? _background : color == -2 ? _foreground : ( unsigned short ) color;
     _lcd_pin_cs = LOW;
-    clearXY();
+    ClearXY();
     _lcd_pin_rs = HIGH;
     for ( int i = 0; i < ( ( _disp_width ) * ( _disp_height ) ); i++ )
-        writeData( rgb );
+        WriteData( rgb );
     _lcd_pin_cs = HIGH;
 }
 
@@ -84,11 +84,11 @@
 void LCD::DrawPixel( unsigned short x, unsigned short y, int color )
 {
     _lcd_pin_cs = LOW;
-    setXY( x, y, x, y );
-    writeData( color == -1 ? _background :
+    SetXY( x, y, x, y );
+    WriteData( color == -1 ? _background :
                     color == -2 ? _foreground : color );
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
 void LCD::DrawLine( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, int color )
@@ -111,13 +111,13 @@
     {
         if ( x1 > x2 )
             swap( ushort, x1, x2 )
-        drawHLine( x1, y1, x2 - x1, color );
+        DrawHLine( x1, y1, x2 - x1, color );
     }
     else if ( x1 == x2 )
     {
         if ( y1 > y2 )
             swap( ushort, y1, y2 )
-        drawVLine( x1, y1, y2 - y1, color );
+        DrawVLine( x1, y1, y2 - y1, color );
     }
     else if ( abs( x2 - x1 ) > abs( y2 - y1 ) )
     {
@@ -129,8 +129,8 @@
         {
             for ( int i = x1; i >= x2; i-- )
             {
-                setXY( i, int( ty + 0.5 ), i, int( ty + 0.5 ) );
-                writeData( usedColor );
+                SetXY( i, int( ty + 0.5 ), i, int( ty + 0.5 ) );
+                WriteData( usedColor );
                 ty = ty - delta;
             }
         }
@@ -138,8 +138,8 @@
         {
             for ( int i = x1; i <= x2; i++ )
             {
-                setXY( i, int( ty + 0.5 ), i, int( ty + 0.5 ) );
-                writeData( usedColor );
+                SetXY( i, int( ty + 0.5 ), i, int( ty + 0.5 ) );
+                WriteData( usedColor );
                 ty = ty + delta;
             }
         }
@@ -155,8 +155,8 @@
         {
             for ( int i = y2 + 1; i > y1; i-- )
             {
-                setXY( int( tx + 0.5 ), i, int( tx + 0.5 ), i );
-                writeData( usedColor );
+                SetXY( int( tx + 0.5 ), i, int( tx + 0.5 ), i );
+                WriteData( usedColor );
                 tx = tx + delta;
             }
         }
@@ -164,15 +164,15 @@
         {
             for ( int i = y1; i < y2 + 1; i++ )
             {
-                setXY( int( tx + 0.5 ), i, int( tx + 0.5 ), i );
-                writeData( usedColor );
+                SetXY( int( tx + 0.5 ), i, int( tx + 0.5 ), i );
+                WriteData( usedColor );
                 tx = tx + delta;
             }
         }
         _lcd_pin_cs = HIGH;
     }
 
-    clearXY();
+    ClearXY();
 }
 
 void LCD::DrawRect( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, int color )
@@ -180,10 +180,10 @@
     if ( x1 > x2 ) swap( ushort, x1, x2 )
     if ( y1 > y2 ) swap( ushort, y1, y2 )
 
-    drawHLine( x1, y1, x2 - x1, color );
-    drawHLine( x1, y2, x2 - x1, color );
-    drawVLine( x1, y1, y2 - y1, color );
-    drawVLine( x2, y1, y2 - y1, color );
+    DrawHLine( x1, y1, x2 - x1, color );
+    DrawHLine( x1, y2, x2 - x1, color );
+    DrawVLine( x1, y1, y2 - y1, color );
+    DrawVLine( x2, y1, y2 - y1, color );
 }
 
 void LCD::DrawRoundRect( unsigned short x1, unsigned short y1, unsigned short x2, unsigned short y2, int color )
@@ -197,10 +197,10 @@
         DrawPixel( x2 - 1, y1 + 1, color );
         DrawPixel( x1 + 1, y2 - 1, color );
         DrawPixel( x2 - 1, y2 - 1, color );
-        drawHLine( x1 + 2, y1, x2 - x1 - 4, color );
-        drawHLine( x1 + 2, y2, x2 - x1 - 4, color );
-        drawVLine( x1, y1 + 2, y2 - y1 - 4, color );
-        drawVLine( x2, y1 + 2, y2 - y1 - 4, color );
+        DrawHLine( x1 + 2, y1, x2 - x1 - 4, color );
+        DrawHLine( x1 + 2, y2, x2 - x1 - 4, color );
+        DrawVLine( x1, y1 + 2, y2 - y1 - 4, color );
+        DrawVLine( x2, y1 + 2, y2 - y1 - 4, color );
     }
 }
 
@@ -213,16 +213,16 @@
     {
         for ( int i = 0; i < ( ( y2 - y1 ) / 2 ) + 1; i++ )
         {
-            drawHLine( x1, y1 + i, x2 - x1, color );
-            drawHLine( x1, y2 - i, x2 - x1, color );
+            DrawHLine( x1, y1 + i, x2 - x1, color );
+            DrawHLine( x1, y2 - i, x2 - x1, color );
         }
     }
     else
     {
         for ( int i = 0; i < ( ( x2 - x1 ) / 2 ) + 1; i++ )
         {
-            drawVLine( x1 + i, y1, y2 - y1, color );
-            drawVLine( x2 - i, y1, y2 - y1, color );
+            DrawVLine( x1 + i, y1, y2 - y1, color );
+            DrawVLine( x2 - i, y1, y2 - y1, color );
         }
     }
 }
@@ -239,18 +239,18 @@
             switch ( i )
             {
                 case 0:
-                    drawHLine( x1 + 2, y1 + i, x2 - x1 - 4, color );
-                    drawHLine( x1 + 2, y2 - i, x2 - x1 - 4, color );
+                    DrawHLine( x1 + 2, y1 + i, x2 - x1 - 4, color );
+                    DrawHLine( x1 + 2, y2 - i, x2 - x1 - 4, color );
                     break;
 
                 case 1:
-                    drawHLine( x1 + 1, y1 + i, x2 - x1 - 2, color );
-                    drawHLine( x1 + 1, y2 - i, x2 - x1 - 2, color );
+                    DrawHLine( x1 + 1, y1 + i, x2 - x1 - 2, color );
+                    DrawHLine( x1 + 1, y2 - i, x2 - x1 - 2, color );
                     break;
 
                 default:
-                    drawHLine( x1, y1 + i, x2 - x1, color );
-                    drawHLine( x1, y2 - i, x2 - x1, color );
+                    DrawHLine( x1, y1 + i, x2 - x1, color );
+                    DrawHLine( x1, y2 - i, x2 - x1, color );
                     break;
             }
         }
@@ -267,14 +267,14 @@
     unsigned short usedColor = color == -1 ? _background : color == -2 ? _foreground : ( unsigned short ) color;
 
     _lcd_pin_cs = LOW;
-    setXY( x, y + radius, x, y + radius );
-    writeData( usedColor );
-    setXY( x, y - radius, x, y - radius );
-    writeData( usedColor );
-    setXY( x + radius, y, x + radius, y );
-    writeData( usedColor );
-    setXY( x - radius, y, x - radius, y );
-    writeData( usedColor );
+    SetXY( x, y + radius, x, y + radius );
+    WriteData( usedColor );
+    SetXY( x, y - radius, x, y - radius );
+    WriteData( usedColor );
+    SetXY( x + radius, y, x + radius, y );
+    WriteData( usedColor );
+    SetXY( x - radius, y, x - radius, y );
+    WriteData( usedColor );
 
     while ( x1 < y1 )
     {
@@ -287,25 +287,25 @@
         x1++;
         ddF_x += 2;
         f += ddF_x;
-        setXY( x + x1, y + y1, x + x1, y + y1 );
-        writeData( usedColor );
-        setXY( x - x1, y + y1, x - x1, y + y1 );
-        writeData( usedColor );
-        setXY( x + x1, y - y1, x + x1, y - y1 );
-        writeData( usedColor );
-        setXY( x - x1, y - y1, x - x1, y - y1 );
-        writeData( usedColor );
-        setXY( x + y1, y + x1, x + y1, y + x1 );
-        writeData( usedColor );
-        setXY( x - y1, y + x1, x - y1, y + x1 );
-        writeData( usedColor );
-        setXY( x + y1, y - x1, x + y1, y - x1 );
-        writeData( usedColor );
-        setXY( x - y1, y - x1, x - y1, y - x1 );
-        writeData( usedColor );
+        SetXY( x + x1, y + y1, x + x1, y + y1 );
+        WriteData( usedColor );
+        SetXY( x - x1, y + y1, x - x1, y + y1 );
+        WriteData( usedColor );
+        SetXY( x + x1, y - y1, x + x1, y - y1 );
+        WriteData( usedColor );
+        SetXY( x - x1, y - y1, x - x1, y - y1 );
+        WriteData( usedColor );
+        SetXY( x + y1, y + x1, x + y1, y + x1 );
+        WriteData( usedColor );
+        SetXY( x - y1, y + x1, x - y1, y + x1 );
+        WriteData( usedColor );
+        SetXY( x + y1, y - x1, x + y1, y - x1 );
+        WriteData( usedColor );
+        SetXY( x - y1, y - x1, x - y1, y - x1 );
+        WriteData( usedColor );
     }
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
 void LCD::FillCircle( unsigned short x, unsigned short y, unsigned short radius, int color )
@@ -316,11 +316,11 @@
         for ( int x1 = -radius; x1 <= radius; x1++ )
             if ( x1 * x1 + y1 * y1 <= radius * radius )
             {
-                setXY( x + x1, y + y1, x + x1, y + y1 );
-                writeData( usedColor );
+                SetXY( x + x1, y + y1, x + x1, y + y1 );
+                WriteData( usedColor );
             }
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
 void LCD::Print( const char *str, unsigned short x, unsigned short y, int fgColor, int bgColor, unsigned short deg )
@@ -346,9 +346,9 @@
 
     for ( i = 0; i < stl; i++ )
         if ( deg == 0 )
-            printChar( *str++, x + ( i * ( _font.width ) ), y, fgColor, bgColor );
+            PrintChar( *str++, x + ( i * ( _font.width ) ), y, fgColor, bgColor );
         else
-            rotateChar( *str++, x, y, i, fgColor, bgColor, deg );
+            RotateChar( *str++, x, y, i, fgColor, bgColor, deg );
 }
 
 void LCD::DrawBitmap( unsigned short x, unsigned short y, unsigned short sx, unsigned short sy, bitmap_t data, unsigned char scale )
@@ -360,9 +360,9 @@
         if ( _orientation == PORTRAIT )
         {
             _lcd_pin_cs = LOW;
-            setXY( x, y, x + sx - 1, y + sy - 1 );
+            SetXY( x, y, x + sx - 1, y + sy - 1 );
             for ( tc = 0; tc < ( sx * sy ); tc++ )
-                writeData( data[ tc ] );
+                WriteData( data[ tc ] );
             _lcd_pin_cs = HIGH;
         }
         else
@@ -370,9 +370,9 @@
             _lcd_pin_cs = LOW;
             for ( ty = 0; ty < sy; ty++ )
             {
-                setXY( x, y + ty, x + sx - 1, y + ty );
+                SetXY( x, y + ty, x + sx - 1, y + ty );
                 for ( tx = sx; tx >= 0; tx-- )
-                    writeData( data[ ( ty * sx ) + tx ] );
+                    WriteData( data[ ( ty * sx ) + tx ] );
             }
             _lcd_pin_cs = HIGH;
         }
@@ -384,11 +384,11 @@
             _lcd_pin_cs = LOW;
             for ( ty = 0; ty < sy; ty++ )
             {
-                setXY( x, y + ( ty * scale ), x + ( ( sx * scale ) - 1 ), y + ( ty * scale ) + scale );
+                SetXY( x, y + ( ty * scale ), x + ( ( sx * scale ) - 1 ), y + ( ty * scale ) + scale );
                 for ( tsy = 0; tsy < scale; tsy++ )
                     for ( tx = 0; tx < sx; tx++ )
                         for ( tsx = 0; tsx < scale; tsx++ )
-                            writeData( data[ ( ty * sx ) + tx ] );
+                            WriteData( data[ ( ty * sx ) + tx ] );
             }
             _lcd_pin_cs = HIGH;
         }
@@ -399,16 +399,16 @@
             {
                 for ( tsy = 0; tsy < scale; tsy++ )
                 {
-                    setXY( x, y + ( ty * scale ) + tsy, x + ( ( sx * scale ) - 1 ), y + ( ty * scale ) + tsy );
+                    SetXY( x, y + ( ty * scale ) + tsy, x + ( ( sx * scale ) - 1 ), y + ( ty * scale ) + tsy );
                     for ( tx = sx; tx >= 0; tx-- )
                         for ( tsx = 0; tsx < scale; tsx++ )
-                            writeData( data[ ( ty * sx ) + tx ] );
+                            WriteData( data[ ( ty * sx ) + tx ] );
                 }
             }
             _lcd_pin_cs = HIGH;
         }
     }
-    clearXY();
+    ClearXY();
 }
 
 void LCD::DrawBitmap( unsigned short x, unsigned short y, unsigned short sx, unsigned short sy, bitmap_t data, unsigned short deg, unsigned short rox, unsigned short roy )
@@ -428,12 +428,12 @@
                 newx = x + rox + ( ( ( tx - rox ) * cos( radian ) ) - ( ( ty - roy ) * sin( radian ) ) );
                 newy = y + roy + ( ( ( ty - roy ) * cos( radian ) ) + ( ( tx - rox ) * sin( radian ) ) );
 
-                setXY( newx, newy, newx, newy );
-                writeData( data[ ( ty * sx ) + tx ] );
+                SetXY( newx, newy, newx, newy );
+                WriteData( data[ ( ty * sx ) + tx ] );
             }
         _lcd_pin_cs = HIGH;
     }
-    clearXY();
+    ClearXY();
 }
 
 /*
@@ -459,10 +459,10 @@
 */
 
 inline
-void LCD::writeCmdData( unsigned short cmd, unsigned short data )
+void LCD::WriteCmdData( unsigned short cmd, unsigned short data )
 {
-    writeCmd( cmd );
-    writeData( data );
+    WriteCmd( cmd );
+    WriteData( data );
 }
 
 /*
@@ -486,39 +486,39 @@
 }
 */
 
-void LCD::clearXY()
+void LCD::ClearXY()
 {
     if ( _orientation == PORTRAIT )
-        setXY( 0, 0, _disp_width - 1, _disp_height - 1 );
+        SetXY( 0, 0, _disp_width - 1, _disp_height - 1 );
     else
-        setXY( 0, 0, _disp_height - 1, _disp_width - 1 );
+        SetXY( 0, 0, _disp_height - 1, _disp_width - 1 );
 }
 
-void LCD::drawHLine( unsigned short x, unsigned short y, unsigned short len, int color )
+void LCD::DrawHLine( unsigned short x, unsigned short y, unsigned short len, int color )
 {
     unsigned short usedColor = color == -1 ? _background : color == -2 ? _foreground : ( unsigned short ) color;
     
     _lcd_pin_cs = LOW;
-    setXY( x, y, x + len, y );
+    SetXY( x, y, x + len, y );
     for ( int i = 0; i < len + 1; i++ )
-        writeData( usedColor );
+        WriteData( usedColor );
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
-void LCD::drawVLine( unsigned short x, unsigned short y, unsigned short len, int color )
+void LCD::DrawVLine( unsigned short x, unsigned short y, unsigned short len, int color )
 {
     unsigned short usedColor = color == -1 ? _background : color == -2 ? _foreground : ( unsigned short ) color;
     
     _lcd_pin_cs = LOW;
-    setXY( x, y, x, y + len );
+    SetXY( x, y, x, y + len );
     for ( int i = 0; i < len; i++ )
-        writeData( usedColor );
+        WriteData( usedColor );
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
-void LCD::printChar( char c, unsigned short x, unsigned short y, int fgColor, int bgColor )
+void LCD::PrintChar( char c, unsigned short x, unsigned short y, int fgColor, int bgColor )
 {
     uint8_t i, ch;
     uint16_t j;
@@ -530,7 +530,7 @@
 
     if ( _orientation == PORTRAIT )
     {
-        setXY( x, y, x + _font.width - 1, y + _font.height - 1 );
+        SetXY( x, y, x + _font.width - 1, y + _font.height - 1 );
 
         temp = ( ( c - _font.offset ) * ( ( _font.width / 8 ) * _font.height ) ) + 4;
         for ( j = 0; j < ( ( _font.width / 8 ) * _font.height ); j++ )
@@ -539,9 +539,9 @@
             for ( i = 0; i < 8; i++ )
             {
                 if ( ( ch & ( 1 << ( 7 - i ) ) ) != 0 )
-                    writeData( usedColorFG );
+                    WriteData( usedColorFG );
                 else
-                    writeData( usedColorBG );
+                    WriteData( usedColorBG );
             }
             temp++;
         }
@@ -552,26 +552,26 @@
 
         for ( j = 0; j < ( ( _font.width / 8 ) * _font.height ); j += ( _font.width / 8 ) )
         {
-            setXY( x, y + ( j / ( _font.width / 8 ) ), x + _font.width - 1, y + ( j / ( _font.width / 8 ) ) );
+            SetXY( x, y + ( j / ( _font.width / 8 ) ), x + _font.width - 1, y + ( j / ( _font.width / 8 ) ) );
             for ( int zz = ( _font.width / 8 ) - 1; zz >= 0; zz-- )
             {
                 ch = _font.font[ temp + zz ];
                 for ( i = 0; i < 8; i++ )
                 {
                     if ( ( ch & ( 1 << i ) ) != 0 )
-                        writeData( usedColorFG );
+                        WriteData( usedColorFG );
                     else
-                        writeData( usedColorBG );
+                        WriteData( usedColorBG );
                 }
             }
             temp += ( _font.width / 8 );
         }
     }
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
 
-void LCD::rotateChar( char c, unsigned short x, unsigned short y, int pos, int fgColor, int bgColor, unsigned short deg )
+void LCD::RotateChar( char c, unsigned short x, unsigned short y, int pos, int fgColor, int bgColor, unsigned short deg )
 {
     uint8_t i, j, ch;
     uint16_t temp;
@@ -595,16 +595,16 @@
                 newx = x + ( ( ( i + ( zz * 8 ) + ( pos * _font.width ) ) * cos( radian ) ) - ( ( j ) * sin( radian ) ) );
                 newy = y + ( ( ( j ) * cos( radian ) ) + ( ( i + ( zz * 8 ) + ( pos * _font.width ) ) * sin( radian ) ) );
 
-                setXY( newx, newy, newx + 1, newy + 1 );
+                SetXY( newx, newy, newx + 1, newy + 1 );
 
                 if ( ( ch & ( 1 << ( 7 - i ) ) ) != 0 )
-                    writeData( usedColorFG );
+                    WriteData( usedColorFG );
                 else
-                    writeData( usedColorBG );
+                    WriteData( usedColorBG );
             }
         }
         temp += ( _font.width / 8 );
     }
     _lcd_pin_cs = HIGH;
-    clearXY();
+    ClearXY();
 }
--- a/lcd_base.h	Sat Dec 01 23:49:10 2012 +0000
+++ b/lcd_base.h	Sun Dec 02 00:12:43 2012 +0000
@@ -33,9 +33,18 @@
 #include "mbed.h"
 #include "fonts.h"
 
+/** \def HIGH
+ *  \brief User-friendly high pin level designation.
+ */
 #define HIGH        1
+/** \def LOW
+ *  \brief User-friendly low pin level designation.
+ */
 #define LOW         0
 
+/** \def swap( type, a, b )
+ *  \brief Convenience macro to swap two values.
+ */
 #define swap( type, a, b )      { type tmp = ( a ); ( a ) = ( b ); ( b ) = tmp; }
 
 /** \def RGB(r,g,b)
@@ -326,7 +335,7 @@
      * \remarks Commands are controller-specific and this function needs to
      *          be implemented separately for each available controller.
      */
-    virtual void writeCmd( unsigned short cmd ) = 0;
+    virtual void WriteCmd( unsigned short cmd ) = 0;
     
     /** Sends pixel data to the display.
      *
@@ -334,7 +343,7 @@
      * \remarks Sendin data is controller-specific and this function needs to
      *          be implemented separately for each available controller.
      */
-    virtual void writeData( unsigned short data ) = 0;
+    virtual void WriteData( unsigned short data ) = 0;
     
     /** Sends both command and data to the display controller.
      *
@@ -344,7 +353,7 @@
      * \param cmd The display command.
      * \param data The display pixel data.
      */
-    virtual void writeCmdData( unsigned short cmd, unsigned short data );
+    virtual void WriteCmdData( unsigned short cmd, unsigned short data );
     
     /** Assigns a chunk of the display memory to receive data.
      *
@@ -362,16 +371,63 @@
      * \remarks Addressing commands are controller-specific and this function needs to be
      *          implemented separately for each available controller.
      */
-    virtual void setXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) = 0;
+    virtual void SetXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) = 0;
     
     /** Resets the memory address for the next display write operation to the screen origins (0,0).
      */
-    virtual void clearXY( void );
+    virtual void ClearXY( void );
+    
+    /** Draws a horizontal line.
+     *
+     * This is a utility function to draw horizontal-only lines
+     * for reduced code complexity and faster execution.
+     *
+     * \param x X coordinate of the starting point of the line.
+     * \param y Y coordinate of the starting point of the line.
+     * \param len Length of the line.
+     * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ),
+     *              -1 switches to the default background color, or any other RGB-565 color can be used.
+     */
+    virtual void DrawHLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 );
     
-    virtual void drawHLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 );
-    virtual void drawVLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 );
-    virtual void printChar( char c, unsigned short x, unsigned short y, int fgColor = -2, int bgColor = -1 );
-    virtual void rotateChar( char c, unsigned short x, unsigned short y, int pos, int fgColor = -2, int bgColor = -1, unsigned short deg = 0 );
+    /** Draws a vertical line.
+     *
+     * This is a utility function to draw vertical-only lines
+     * for reduced code complexity and faster execution.
+     *
+     * \param x X coordinate of the starting point of the line.
+     * \param y Y coordinate of the starting point of the line.
+     * \param len Height of the line.
+     * \param color The color to use to draw the line. By default the global foreground color is used ( -2 ),
+     *              -1 switches to the default background color, or any other RGB-565 color can be used.
+     */
+    virtual void DrawVLine( unsigned short x, unsigned short y, unsigned short len, int color = -2 );
+    
+    /** Prints a character at the given position and using the given color.
+     *
+     * \param c The character.
+     * \param x X coordinate of the character position.
+     * \param y Y coordinate of the character position.
+     * \param fgColor Foreground color for drawing. By default the global foreground color is used ( -2 ),
+     *                -1 switches to the default background color, or any other RGB-565 color can be used.
+     * \param bgColor Background color for drawing. By default the global background color is used ( -1 ),
+     *                -2 switches to the default foreground color, or any other RGB-565 color can be used.
+     */
+    virtual void PrintChar( char c, unsigned short x, unsigned short y, int fgColor = -2, int bgColor = -1 );
+    
+    /** Prints a character at the given position and using the given color and with the given rotation.
+     *
+     * \param c The character.
+     * \param x X coordinate of the character position.
+     * \param y Y coordinate of the character position.
+     * \param pos Position of the character in the string from which it originates (used to rotate a whole string).
+     * \param fgColor Foreground color for drawing. By default the global foreground color is used ( -2 ),
+     *                -1 switches to the default background color, or any other RGB-565 color can be used.
+     * \param bgColor Background color for drawing. By default the global background color is used ( -1 ),
+     *                -2 switches to the default foreground color, or any other RGB-565 color can be used.
+     * \param deg The angle at which to rotate. 
+     */
+    virtual void RotateChar( char c, unsigned short x, unsigned short y, int pos, int fgColor = -2, int bgColor = -1, unsigned short deg = 0 );
 
 protected:
     unsigned short _disp_width, _disp_height;
--- a/ssd.cpp	Sat Dec 01 23:49:10 2012 +0000
+++ b/ssd.cpp	Sun Dec 02 00:12:43 2012 +0000
@@ -54,51 +54,51 @@
     wait_ms( 15 );
     
     
-    writeCmdData( 0x00, 0x0001 ); wait_ms( 1 );
-    writeCmdData( 0x03, 0xA8A4 ); wait_ms( 1 );
-    writeCmdData( 0x0C, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x0D, 0x080C ); wait_ms( 1 );
-    writeCmdData( 0x0E, 0x2B00 ); wait_ms( 1 );
-    writeCmdData( 0x1E, 0x00B7 ); wait_ms( 1 );
-    writeCmdData( 0x01, 0x2B3F ); wait_ms( 1 );
-    writeCmdData( 0x02, 0x0600 ); wait_ms( 1 );
-    writeCmdData( 0x10, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x11, 0x6070 ); wait_ms( 1 );
-    writeCmdData( 0x05, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x06, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x16, 0xEF1C ); wait_ms( 1 );
-    writeCmdData( 0x17, 0x0003 ); wait_ms( 1 );
-    writeCmdData( 0x07, 0x0233 ); wait_ms( 1 );
-    writeCmdData( 0x0B, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x0F, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x41, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x42, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x48, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x49, 0x013F ); wait_ms( 1 );
-    writeCmdData( 0x4A, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x4B, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x44, 0xEF00 ); wait_ms( 1 );
-    writeCmdData( 0x45, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x46, 0x013F ); wait_ms( 1 );
-    writeCmdData( 0x30, 0x0707 ); wait_ms( 1 );
-    writeCmdData( 0x31, 0x0204 ); wait_ms( 1 );
-    writeCmdData( 0x32, 0x0204 ); wait_ms( 1 );
-    writeCmdData( 0x33, 0x0502 ); wait_ms( 1 );
-    writeCmdData( 0x34, 0x0507 ); wait_ms( 1 );
-    writeCmdData( 0x35, 0x0204 ); wait_ms( 1 );
-    writeCmdData( 0x36, 0x0204 ); wait_ms( 1 );
-    writeCmdData( 0x37, 0x0502 ); wait_ms( 1 );
-    writeCmdData( 0x3A, 0x0302 ); wait_ms( 1 );
-    writeCmdData( 0x3B, 0x0302 ); wait_ms( 1 );
-    writeCmdData( 0x23, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x24, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x25, 0x8000 ); wait_ms( 1 );
-    writeCmdData( 0x4f, 0x0000 ); wait_ms( 1 );
-    writeCmdData( 0x4e, 0x0000 ); wait_ms( 1 );
-    writeCmd( 0x22 );
+    WriteCmdData( 0x00, 0x0001 ); wait_ms( 1 );
+    WriteCmdData( 0x03, 0xA8A4 ); wait_ms( 1 );
+    WriteCmdData( 0x0C, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x0D, 0x080C ); wait_ms( 1 );
+    WriteCmdData( 0x0E, 0x2B00 ); wait_ms( 1 );
+    WriteCmdData( 0x1E, 0x00B7 ); wait_ms( 1 );
+    WriteCmdData( 0x01, 0x2B3F ); wait_ms( 1 );
+    WriteCmdData( 0x02, 0x0600 ); wait_ms( 1 );
+    WriteCmdData( 0x10, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x11, 0x6070 ); wait_ms( 1 );
+    WriteCmdData( 0x05, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x06, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x16, 0xEF1C ); wait_ms( 1 );
+    WriteCmdData( 0x17, 0x0003 ); wait_ms( 1 );
+    WriteCmdData( 0x07, 0x0233 ); wait_ms( 1 );
+    WriteCmdData( 0x0B, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x0F, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x41, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x42, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x48, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x49, 0x013F ); wait_ms( 1 );
+    WriteCmdData( 0x4A, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x4B, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x44, 0xEF00 ); wait_ms( 1 );
+    WriteCmdData( 0x45, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x46, 0x013F ); wait_ms( 1 );
+    WriteCmdData( 0x30, 0x0707 ); wait_ms( 1 );
+    WriteCmdData( 0x31, 0x0204 ); wait_ms( 1 );
+    WriteCmdData( 0x32, 0x0204 ); wait_ms( 1 );
+    WriteCmdData( 0x33, 0x0502 ); wait_ms( 1 );
+    WriteCmdData( 0x34, 0x0507 ); wait_ms( 1 );
+    WriteCmdData( 0x35, 0x0204 ); wait_ms( 1 );
+    WriteCmdData( 0x36, 0x0204 ); wait_ms( 1 );
+    WriteCmdData( 0x37, 0x0502 ); wait_ms( 1 );
+    WriteCmdData( 0x3A, 0x0302 ); wait_ms( 1 );
+    WriteCmdData( 0x3B, 0x0302 ); wait_ms( 1 );
+    WriteCmdData( 0x23, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x24, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x25, 0x8000 ); wait_ms( 1 );
+    WriteCmdData( 0x4f, 0x0000 ); wait_ms( 1 );
+    WriteCmdData( 0x4e, 0x0000 ); wait_ms( 1 );
+    WriteCmd( 0x22 );
 }
 
-void SSD1289LCD::writeCmd( unsigned short cmd )
+void SSD1289LCD::WriteCmd( unsigned short cmd )
 {
     _lcd_pin_rs = LOW;
     _lcd_pin_cs = LOW;
@@ -107,7 +107,7 @@
     _lcd_pin_cs = HIGH;
 }
 
-void SSD1289LCD::writeData( unsigned short data )
+void SSD1289LCD::WriteData( unsigned short data )
 {
     _lcd_pin_rs = HIGH;
     _lcd_pin_cs = LOW;
@@ -116,7 +116,7 @@
     _lcd_pin_cs = HIGH;
 }
 
-void SSD1289LCD::setXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 )
+void SSD1289LCD::SetXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 )
 {
     if ( _orientation == LANDSCAPE )
     {
@@ -127,10 +127,10 @@
         swap( uint16_t, y1, y2 )
     }
 
-    writeCmdData( 0x44, ( x2 << 8 ) + x1 );
-    writeCmdData( 0x45, y1 );
-    writeCmdData( 0x46, y2 );
-    writeCmdData( 0x4e, x1 );
-    writeCmdData( 0x4f, y1 );
-    writeCmd( 0x22 );
+    WriteCmdData( 0x44, ( x2 << 8 ) + x1 );
+    WriteCmdData( 0x45, y1 );
+    WriteCmdData( 0x46, y2 );
+    WriteCmdData( 0x4e, x1 );
+    WriteCmdData( 0x4f, y1 );
+    WriteCmd( 0x22 );
 }
--- a/ssd.h	Sat Dec 01 23:49:10 2012 +0000
+++ b/ssd.h	Sun Dec 02 00:12:43 2012 +0000
@@ -62,9 +62,9 @@
     virtual void Initialize( orientation_t orientation = LANDSCAPE );
     
 protected:
-    virtual void writeCmd( unsigned short cmd );
-    virtual void writeData( unsigned short data );
-    virtual void setXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 );
+    virtual void WriteCmd( unsigned short cmd );
+    virtual void WriteData( unsigned short data );
+    virtual void SetXY( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 );
     
 private:
     DigitalOut _lcd_pin_reset, _lcd_pin_wr;