Library to control a Graphics TFT connected to 4-wire SPI - revised for the Raio RA8875 Display Controller.

Dependents:   FRDM_RA8875_mPaint RA8875_Demo RA8875_KeyPadDemo SignalGenerator ... more

Fork of SPI_TFT by Peter Drescher

See Components - RA8875 Based Display

Enhanced touch-screen support - where it previous supported both the Resistive Touch and Capacitive Touch based on the FT5206 Touch Controller, now it also has support for the GSL1680 Touch Controller.

Offline Help Manual (Windows chm)

/media/uploads/WiredHome/ra8875.zip.bin (download, rename to .zip and unzip)

Revision:
29:422616aa04bd
Parent:
19:3f82c1161fd2
Child:
31:c72e12cd5c67
--- a/GraphicsDisplay.h	Fri Jan 17 17:24:05 2014 +0000
+++ b/GraphicsDisplay.h	Sun Jan 19 04:24:16 2014 +0000
@@ -31,15 +31,43 @@
     
     virtual RetCode_t cls();
     virtual void fill(int x, int y, int w, int h, int colour);
-    virtual void blit(int x, int y, int w, int h, const int *colour);    
-    virtual void blitbit(int x, int y, int w, int h, const char* colour);
+    virtual void blit(int x, int y, int w, int h, const int * colour);    
+    
+    virtual int blitbit(int x, int y, int w, int h, const char * colour);
     
-    virtual void character(int column, int row, int value);
+    /// This method transfers one character from the external font data
+    /// to the screen.
+    ///
+    /// @note the font data is in a special format as generate by
+    ///         the mikroe font creator. \\
+    ///         See http://www.mikroe.com/glcd-font-creator/
+    ///
+    /// @param x is the horizontal pixel coordinate
+    /// @param y is the vertical pixel coordinate
+    /// @param fontTable is the base of the table which has the metrics
+    /// @param fontChar is the start of that record in the table for the char (e.g. 'A' - 'Z')
+    /// @returns how far the cursor should advance to the right in pixels
+    ///
+    virtual int fontblit(int x, int y, const unsigned char * fontTable, const unsigned char * fontChar);
+    
+    /// prints one character at the specified coordinates.
+    ///
+    /// This will print the character at the specified pixel coordinates.
+    ///
+    /// @param x is the horizontal offset in pixels.
+    /// @param y is the vertical offset in pixels.
+    /// @param value is the character to print.
+    /// @returns number of pixels to index to the right if a character was printed, 0 otherwise.
+    ///
+    virtual int character(int x, int y, int value);
+    
     virtual int columns();
     virtual int rows();
+    virtual RetCode_t set_font(const unsigned char * font = NULL);
     
 protected:
-
+    const unsigned char * font;     ///< reference to an external font somewhere in memory
+    
     // pixel location
     short _x;
     short _y;
@@ -49,7 +77,6 @@
     short _x2;
     short _y1;
     short _y2;
-
 };
 
 #endif