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:
197:853d08e2fb53
--- a/RA8875_Touch_GSL1680.cpp	Sun Mar 29 18:12:24 2020 +0000
+++ b/RA8875_Touch_GSL1680.cpp	Thu Apr 30 13:51:32 2020 +0000
@@ -105,19 +105,6 @@
 #define HexDump(a, b, c)
 #endif
 
-
-#if 0
-// Translate from GSL1680 Event Flag to Touch Code to API-match the
-// alternate resistive touch screen driver common in the RA8875
-// displays.
-static const TouchCode_t GSL1680_EventFlagToTouchCode[4] = {
-    touch,      // 00b Put Down
-    release,    // 01b Put Up
-    held,       // 10b Contact
-    no_touch    // 11b Reserved
-};
-#endif
-
 RetCode_t RA8875::GSL1680_Init() {
     RetCode_t r = noerror;
     uint8_t buf[5] = { 0 };   // addr + up to 4 Bytes data
@@ -242,8 +229,7 @@
             uint16_t fingerAndY, AndX;
             fingerAndY = (uint16_t)(touch_data[dNdx - 0]) << 8 | (uint16_t)touch_data[dNdx - 1];
             AndX = (uint16_t)(touch_data[dNdx - 2]) << 8 | (uint16_t)touch_data[dNdx - 3];
-            touchInfo[tNdx].coordinates.y = fingerAndY & 0x0FFF;
-            touchInfo[tNdx].coordinates.x = AndX & 0x0FFFF;
+            touchInfo[tNdx].coordinates = TranslateOrientation( AndX & 0x0FFFF, fingerAndY & 0x0FFF );
             touchInfo[tNdx].touchID = (fingerAndY >> 12);
             touchInfo[tNdx].touchCode = (numberOfTouchPoints > tNdx) ? touch : no_touch;
             //INFO("  Code %d, Finger %d, xy (%4d,%4d)",