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:
190:3132b7dfad82
Parent:
163:17526689a3ed
Child:
197:853d08e2fb53
--- a/Bitmap.h	Thu Sep 19 21:45:18 2019 +0000
+++ b/Bitmap.h	Sat Sep 21 17:30:00 2019 +0000
@@ -20,8 +20,14 @@
 //
 // must align to 2-byte boundaries so it doesn't alter the memory image when 
 // bytes are read from the file system into this footprint.
+#ifdef __GNUC__
+#pragma pack(push, 1)
+#define ALIGNMENT
+#else
+#define ALIGNMENT
 #pragma push
 #pragma pack(2)
+#endif
 
 /// Bitmap file header
 typedef struct                    /**** BMP file header structure ****/
@@ -31,7 +37,10 @@
     uint16_t    bfReserved1;      ///< reserved placeholder for the structure footprint
     uint16_t    bfReserved2;      ///< reserved placeholder for the structure footprint
     uint32_t    bfOffBits;        ///< Offset to bitmap data 
-    } BITMAPFILEHEADER;           // Size: 14B
+    } BITMAPFILEHEADER ALIGNMENT;           // Size: 14B
+#ifdef WIN32
+static_assert(sizeof(BITMAPFILEHEADER) == 14, "Alignment Error");
+#endif
 
 /// Bitmap information header
 typedef struct                    /**** BMP file info structure ****/
@@ -47,8 +56,13 @@
     int32_t     biYPelsPerMeter;  ///< Y pixels per meter 
     uint32_t    biClrUsed;        ///< Number of colors used 
     uint32_t    biClrImportant;   ///< Number of important colors 
-    } BITMAPINFOHEADER;           // Size: 40B
+    } BITMAPINFOHEADER ALIGNMENT;           // Size: 40B
+#ifdef __GNUC__
+#pragma pack(pop)
+#undef ALIGNMENT
+#else
 #pragma pop
+#endif
 
 #define BF_TYPE 0x4D42            /* "MB" */
 
@@ -76,9 +90,13 @@
 //    RGBQUAD          bmiColors[256]; /* Image colormap */
 //    } BITMAPINFO;
 
-
+#ifdef __GNUC__
+#pragma pack(push, 1)
+#define ALIGNMENT
+#else
 #pragma push
 #pragma pack(2)
+#endif
 
 /// Icon file type file header.
 typedef struct                  /**** ICO file header structure ****/
@@ -100,7 +118,12 @@
     uint32_t    biSizeImage;    ///< Size of image data 
     uint32_t    bfOffBits;      ///< Offset into file for the bitmap data 
     } ICODIRENTRY;
+#ifdef __GNUC__
+#pragma pack(pop)
+#undef ALIGNMENT
+#else
 #pragma pop
+#endif
 
 #define IC_TYPE 0x0001            /* 1 = ICO (icon), 2 = CUR (cursor) */