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:
207:82f336e5c021
Parent:
205:f215dc32736b
Child:
208:c610b031388d
--- a/RA8875.cpp	Mon May 25 16:08:50 2020 +0000
+++ b/RA8875.cpp	Sun Apr 04 16:50:15 2021 +0000
@@ -2767,17 +2767,17 @@
 {
     HexDump("CB", buffer, size);
     switch(cmd) {
-        case RA8875::OPEN:
+        case RA8875::filecmd_t::OPEN:
             //pc.printf("About to write %lu bytes\r\n", *(uint32_t *)buffer);
             _printFH = fopen("file.bmp", "w+b");
             if (_printFH == 0)
                 return file_not_found;
             break;
-        case RA8875::WRITE:
+        case RA8875::filecmd_t::WRITE:
             //pc.printf("  Write %4u bytes\r\n", size);
             fwrite(buffer, 1, size, _printFH);
             break;
-        case RA8875::CLOSE:
+        case RA8875::filecmd_t::CLOSE:
             //pc.printf("  close\r\n");
             fclose(_printFH);
             _printFH = 0;
@@ -2887,25 +2887,25 @@
 
         // Get the file primed...
         /// @todo check return value for possibility of a fatal error
-        privateCallback(OPEN, (uint8_t *)&BMP_Header.bfSize, 4);
+        privateCallback(filecmd_t::OPEN, (uint8_t *)&BMP_Header.bfSize, 4);
 
         // Be optimistic - don't check for errors.
         //HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header));
         //fwrite(&BMP_Header, sizeof(char), sizeof(BMP_Header), Image);
-        privateCallback(WRITE, (uint8_t *)&BMP_Header, sizeof(BMP_Header));
+        privateCallback(filecmd_t::WRITE, (uint8_t *)&BMP_Header, sizeof(BMP_Header));
 
         //HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info));
         //fwrite(&BMP_Info, sizeof(char), sizeof(BMP_Info), Image);
-        privateCallback(WRITE, (uint8_t *)&BMP_Info, sizeof(BMP_Info));
+        privateCallback(filecmd_t::WRITE, (uint8_t *)&BMP_Info, sizeof(BMP_Info));
         if (bitsPerPixel != 24) {
             //HexDump("Palette", (uint8_t *)&WebColorPalette, sizeof(WebColorPalette));
             //fwrite(&WebColorPalette, sizeof(char), sizeof(WebColorPalette), Image);
-            privateCallback(WRITE, (uint8_t *)&WebColorPalette, sizeof(WebColorPalette));
-            if (0 && sizeof(WebColorPalette) % 4) {
-                const uint8_t padd[] = { 0, 0, 0 };
-                //fwrite(&padd, sizeof(char), (sizeof(BMP_Header) + sizeof(BMP_Info) + sizeof(WebColorPalette)) % 4, Image);
-                privateCallback(WRITE, (uint8_t *)&padd, (sizeof(BMP_Header) + sizeof(BMP_Info) + sizeof(WebColorPalette)) % 4);
-            }
+            privateCallback(filecmd_t::WRITE, (uint8_t *)&WebColorPalette, sizeof(WebColorPalette));
+            //if (sizeof(WebColorPalette) % 4) {
+            //    const uint8_t padd[] = { 0, 0, 0 };
+            //    //fwrite(&padd, sizeof(char), (sizeof(BMP_Header) + sizeof(BMP_Info) + sizeof(WebColorPalette)) % 4, Image);
+            //    privateCallback(filecmd_t::WRITE, (uint8_t *)&padd, (sizeof(BMP_Header) + sizeof(BMP_Info) + sizeof(WebColorPalette)) % 4);
+            //}
         }
         //color_t transparency = GetBackgroundTransparencyColor();
         LayerMode_T ltpr0 = GetLayerMode();