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:
143:e872d65a710d
Parent:
142:6e9bff59878a
Child:
144:ba002c4b21b3
--- a/RA8875.cpp	Sun Mar 19 21:41:24 2017 +0000
+++ b/RA8875.cpp	Sun Mar 19 22:11:04 2017 +0000
@@ -281,10 +281,12 @@
 }
 
 
-uint16_t RA8875::SelectDrawingLayer(uint16_t layer)
+RetCode_t RA8875::SelectDrawingLayer(uint16_t layer, uint16_t * prevLayer)
 {
     unsigned char mwcr1 = ReadCommand(0x41); // retain all but the currently selected layer
-    uint16_t prevlayer = mwcr1 & 1;
+    
+    if (prevLayer)
+        *prevLayer = mwcr1 & 1;
     
     mwcr1 &= ~0x01; // remove the current layer
     if (screenwidth >= 800 && screenheight >= 480 && screenbpp > 8) {
@@ -292,8 +294,7 @@
     } else if (layer > 1) {
         layer = 0;
     }
-    WriteCommand(0x41, mwcr1 | layer);
-    return prevlayer;
+    return WriteCommand(0x41, mwcr1 | layer);
 }