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:
61:8f3153bf0baa
Parent:
60:2dfd574f63bd
Child:
62:ba5d33438fda
--- a/RA8875.cpp	Sat Aug 16 19:26:17 2014 +0000
+++ b/RA8875.cpp	Sun Aug 17 13:46:06 2014 +0000
@@ -71,6 +71,10 @@
 //{
 //}
 
+uint16_t RA8875::GetDrawingLayer(void)
+{
+    return (ReadCommand(0x41) & 0x01);
+}
 
 RetCode_t RA8875::SelectDrawingLayer(uint16_t layer)
 {
@@ -694,13 +698,30 @@
 }
 
 
-RetCode_t RA8875::cls(void)
+RetCode_t RA8875::cls(uint16_t layers)
 {
+    RetCode_t ret;
+    
     PERFORMANCE_RESET;
-    clsw(FULLWINDOW);
-    SetTextCursor(0,0);
+    if (layers == 0) {
+        ret = clsw(FULLWINDOW);
+        ret = SetTextCursor(0,0);
+    } else if (layers > 3) {
+        ret = bad_parameter;
+    } else {
+        uint16_t prevLayer = GetDrawingLayer();
+        if (layers & 1) {
+            SelectDrawingLayer(0);
+            clsw(FULLWINDOW);
+        }
+        if (layers & 2) {
+            SelectDrawingLayer(1);
+            clsw(FULLWINDOW);
+        }
+        ret = SelectDrawingLayer(prevLayer);
+    }
     REGISTERPERFORMANCE(PRF_CLS);
-    return noerror;
+    return ret;
 }