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)

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Tue Feb 04 02:58:06 2014 +0000
Parent:
39:805cee56872d
Child:
41:2956a0a221e5
Commit message:
Revise SetTextFontSize( ) to require only 1 parameter, and change the type from unsigned to signed to permit easier default detection.

Changed in this revision

GraphicsDisplay.cpp Show annotated file Show diff for this revision Revisions of this file
RA8875.cpp Show annotated file Show diff for this revision Revisions of this file
RA8875.h Show annotated file Show diff for this revision Revisions of this file
--- a/GraphicsDisplay.cpp	Sun Jan 26 02:02:29 2014 +0000
+++ b/GraphicsDisplay.cpp	Tue Feb 04 02:58:06 2014 +0000
@@ -20,7 +20,7 @@
 #define INFO(x, ...) std::printf("[INF %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
 #define WARN(x, ...) std::printf("[WRN %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
 #define ERR(x, ...)  std::printf("[ERR %s %3d] "x"\r\n", DEBUG, __LINE__, ##__VA_ARGS__);
-void HexDump(char * title, uint8_t * p, int count)
+static void HexDump(char * title, uint8_t * p, int count)
 {
     int i;
     char buf[100] = "0000: ";
--- a/RA8875.cpp	Sun Jan 26 02:02:29 2014 +0000
+++ b/RA8875.cpp	Tue Feb 04 02:58:06 2014 +0000
@@ -311,6 +311,8 @@
 {
     unsigned char reg = ReadCommand(0x22);
     
+    if (vScale == -1)
+        vScale = hScale;
     if (hScale >= 1 && hScale <= 4 && vScale >= 1 && vScale <= 4) {
         reg &= 0xF0;    // keep the high nibble as is.
         reg |= ((hScale - 1) << 2);
--- a/RA8875.h	Sun Jan 26 02:02:29 2014 +0000
+++ b/RA8875.h	Tue Feb 04 02:58:06 2014 +0000
@@ -103,10 +103,10 @@
     } alignment_t;    
     
     /// Scale factor - 1, 2, 3 4
-    typedef unsigned int HorizontalScale;
+    typedef int HorizontalScale;
     
     /// Scale factor - 1, 2, 3, 4
-    typedef unsigned int VerticalScale;
+    typedef int VerticalScale;
 
     /// Clear screen region
     typedef enum
@@ -334,14 +334,20 @@
     ///
     /// @param hScale defaults to 1, but can be 1, 2, 3, or 4,
     ///     and scales the font size by this amount.
-    /// @param vScale defaults to 1, but can be 1, 2, 3, or 4,
-    ///     and scales the font size by this amount.
+    /// @param vScale is an optional parameter that defaults to the hScale value, 
+    ///     but can be 1, 2, 3, or 4, and scales the font size by this amount.
+    ///
+    /// @code
+    ///     lcd.SetTextFontSize(2);     // Set the font to 2x normal size
+    ///     lcd.SetTextFontSize(2,3);   // Set the font to 2x Width and 3x Height
+    ///     lcd.SetTextFontSize();      // Restore to normal size in both dimensions
+    /// @endcode
     ///
     /// @note if either hScale or vScale is outside of its permitted range,
     ///     the command is not executed.
     /// @returns success/failure code. @see RetCode_t.
     ///
-    RetCode_t SetTextFontSize(HorizontalScale hScale = 1, VerticalScale vScale = 1);
+    RetCode_t SetTextFontSize(HorizontalScale hScale = 1, VerticalScale vScale = -1);
     
     /// put a character on the screen.
     ///