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 11 18:33:44 2020 +0000
Parent:
194:53c18f0e7922
Child:
196:56820026701b
Commit message:
Working on orientation.

Changed in this revision

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/RA8875.cpp	Tue Feb 11 15:35:02 2020 +0000
+++ b/RA8875.cpp	Tue Feb 11 18:33:44 2020 +0000
@@ -18,7 +18,7 @@
 #define swFree free
 #endif
 
-//#define DEBUG "RAIO"
+#define DEBUG "RAIO"
 // ...
 // INFO("Stuff to show %d", var); // new-line is automatically appended
 //
@@ -1163,6 +1163,9 @@
 
 RA8875::orientation_t RA8875::GetOrientation()
 {
+    #if 1
+    return screen_orientation;
+    #else
     uint8_t dpcrVal = ReadCommand(RA8875_DPCR);
 
     dpcrVal &= 0x0C;       // keep the scan direction bits
@@ -1177,6 +1180,7 @@
         case 0x04:
             return rotate_270;
     }
+    #endif
 }
 
 RetCode_t RA8875::SetOrientation(RA8875::orientation_t angle)
@@ -1215,7 +1219,8 @@
         default:
             return bad_parameter;
     }
-    INFO("Orientation: %d, %d", angle, portraitmode);
+    screen_orientation = angle;
+    INFO("Orientation: %d, %s", angle * 90, portraitmode ? "portrait" : "landscape");
     WriteCommand(RA8875_MWCR0, mwcr0);
     WriteCommand(RA8875_FNCR1, fncr1Val);
     return WriteCommand(RA8875_DPCR, dpcrVal);
@@ -1577,7 +1582,7 @@
 
 RetCode_t RA8875::clsw(RA8875::Region_t region)
 {
-    INFO("clsw()");
+    INFO("clsw(%d)", region);
     PERFORMANCE_RESET;
     WriteCommand(RA8875_MCLR, (region == ACTIVEWINDOW) ? 0xC0 : 0x80);
     if (!_WaitWhileReg(0x8E, 0x80)) {
--- a/RA8875.h	Tue Feb 11 15:35:02 2020 +0000
+++ b/RA8875.h	Tue Feb 11 18:33:44 2020 +0000
@@ -508,6 +508,8 @@
 /// @todo Add high level objects - x-y graph, meter, others... but these will
 ///     probably be best served in another class, since they may not
 ///     be needed for many uses.
+/// @todo Move the global enums into the class (e.g. NOFILL becomes RA8875::NOFILL) to
+///     avoid namespace clashes.
 ///
 class RA8875 : public GraphicsDisplay
 {