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:
Fri Oct 11 20:53:08 2019 +0000
Parent:
190:3132b7dfad82
Child:
192:cc14d391b412
Commit message:
Added a method to get the screen 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	Sat Sep 21 17:30:00 2019 +0000
+++ b/RA8875.cpp	Fri Oct 11 20:53:08 2019 +0000
@@ -1161,6 +1161,23 @@
     }
 }
 
+RA8875::orientation_t RA8875::GetOrientation()
+{
+    uint8_t dpcrVal = ReadCommand(0x20);
+
+    dpcrVal &= 0x0C;       // keep the scan direction bits
+    switch (dpcrVal) {
+        default:
+        case 0x00:
+            return rotate_0;
+        case 0x08:
+            return rotate_90;
+        case 0x0C:
+            return rotate_180;
+        case 0x04:
+            return rotate_270;
+    }
+}
 
 RetCode_t RA8875::SetOrientation(RA8875::orientation_t angle)
 {
--- a/RA8875.h	Sat Sep 21 17:30:00 2019 +0000
+++ b/RA8875.h	Fri Oct 11 20:53:08 2019 +0000
@@ -1805,6 +1805,12 @@
     RetCode_t SetTextFont(font_t font = ISO8859_1);
 
 
+    /// Gets the display orientation
+    /// 
+    /// @returns the basic display orientationas an @ref orientation_t value.
+    ///
+    orientation_t GetOrientation();
+
     /// Sets the display orientation.
     ///
     /// @note This command does not let you "merge" text onto an existing
@@ -1815,6 +1821,10 @@
     ///
     /// @note This command only operates on the RA8875 internal fonts.
     ///
+    /// @note more sophisticated control of drawings with rotated text may
+    ///       be achieved by direct control of the registers. See the RA8875
+    ///       datasheet.
+    ///
     /// @code
     ///     lcd.cls();
     ///     lcd.SetOrientation(RA8875::normal);