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:
127:db7f2c704693
Parent:
124:1690a7ae871c
Child:
128:3c74ba4533dc
--- a/RA8875_Touch.cpp	Sat Aug 06 15:09:34 2016 +0000
+++ b/RA8875_Touch.cpp	Sat Aug 06 20:04:23 2016 +0000
@@ -248,19 +248,15 @@
             numberOfTouchPoints = 1;
 
             if (tpMatrix.Divider != 0) {
-
                 /* Operation order is important since we are doing integer */
                 /*  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.Bn * a2dY) + tpMatrix.Cn
                                 ) / tpMatrix.Divider ;
-
                 touchInfo[0].coordinates.y = ( (tpMatrix.Dn * a2dX) +
-                                  (tpMatrix.En * a2dY) +
-                                  tpMatrix.Fn
+                                  (tpMatrix.En * a2dY) + tpMatrix.Fn
                                 ) / tpMatrix.Divider ;
             } else {
                 ts = no_cal;
@@ -275,8 +271,9 @@
         if (TouchPoint) {
             *TouchPoint = touchInfo[0].coordinates;
             ts = touchInfo[0].touchCode;
+        } else {
+            ts = touch;
         }
-        ts = touch;
     }
     return ts;
 }