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:
202:a22cbc04f332
Parent:
198:9b6851107426
Child:
203:704df2dbd3e6
--- a/RA8875_Touch.cpp	Sun Mar 29 18:12:24 2020 +0000
+++ b/RA8875_Touch.cpp	Thu Apr 30 13:51:32 2020 +0000
@@ -257,7 +257,7 @@
     if (panelTouched == true) {
         panelTouched = false;
         if (TouchPoint) {
-            *TouchPoint = TranslateOrientation(touchInfo[0].coordinates);
+            *TouchPoint = touchInfo[0].coordinates;
             ts = touchInfo[0].touchCode;
             #ifdef DEBUG
             static TouchCode_t lastTS = no_touch;
@@ -292,7 +292,7 @@
 {
     if (channel >= TouchChannels())
         channel = 0;
-    return TranslateOrientation(touchInfo[channel].coordinates);
+    return touchInfo[channel].coordinates; // TranslateOrientation(touchInfo[channel].coordinates);
 }
 
 TouchCode_t RA8875::TouchPanelGet(point_t * TouchPoint)
@@ -312,6 +312,7 @@
     return t;
 }
 
+#if 0
 point_t RA8875::TranslateOrientation(point_t rawPoint)
 {
     point_t newPoint = rawPoint;
@@ -334,7 +335,7 @@
     //INFO("Translate(%3d x %3d) => (%3d x %3d)", rawPoint.x, rawPoint.y, newPoint.x, newPoint.y);
     return newPoint;
 }
-
+#endif
 
 // Below here are primarily "helper" functions. While many are accessible
 // to the user code, they usually don't need to be called.
@@ -451,12 +452,9 @@
             /*  math. Make sure you add all terms together before      */
             /*  dividing, so that the remainder is not rounded off     */
             /*  prematurely.                                           */
-            touchInfo[0].coordinates.x = ((tpMatrix.An * a2dX) +
-                (tpMatrix.Bn * a2dY) + tpMatrix.Cn
-                ) / tpMatrix.Divider;
-            touchInfo[0].coordinates.y = ((tpMatrix.Dn * a2dX) +
-                (tpMatrix.En * a2dY) + tpMatrix.Fn
-                ) / tpMatrix.Divider;
+            touchInfo[0].coordinates = TranslateOrientation( 
+                ((tpMatrix.An * a2dX) + (tpMatrix.Bn * a2dY) + tpMatrix.Cn) / tpMatrix.Divider,
+                ((tpMatrix.Dn * a2dX) + (tpMatrix.En * a2dY) + tpMatrix.Fn) / tpMatrix.Divider );
         } else {
             ts = no_cal;
         }