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
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)
Diff: GraphicsDisplay.cpp
- Revision:
- 93:6fbc516de05e
- Parent:
- 79:544eb4964795
- Child:
- 95:ef538bd687c0
diff -r ce1ab76e8614 -r 6fbc516de05e GraphicsDisplay.cpp --- a/GraphicsDisplay.cpp Sun Feb 01 17:07:13 2015 +0000 +++ b/GraphicsDisplay.cpp Sun Feb 01 18:50:57 2015 +0000 @@ -343,15 +343,22 @@ return c; } -/// RRRR RGGG GGGB BBBB +// RGB16 little endian +// GGGB BBBB RRRR RGGG +// swap +// RRRR RGGG GGGB BBBB +// RRRR R +// extend to BMP Color Palette is BGRx +// BBBB BBBB GGGG GGGG RRRR RRRR 0000 0000 RGBQUAD GraphicsDisplay::RGB16ToRGBQuad(color_t c) { RGBQUAD q; memset(&q, 0, sizeof(q)); + c = (c << 8) | (c >> 8); // swap q.rgbBlue = ((c & 0x001F) << 3) | (c & 0x07); /* Blue value */ - q.rgbGreen = ((c & 0x07E0) >> 3) | ((c >> 7) & 0x03); /* Green value */ - q.rgbRed = ((c & 0xF800) >> 8) | ((c >> 11) & 0x07); /* Red value */ + q.rgbGreen = ((c & 0x07E0) >> 3) | ((c >> 9) & 0x03); /* Green value */ + q.rgbRed = ((c & 0xF800) >> 8) | ((c >> 13) & 0x07); /* Red value */ q.rgbReserved = 0; return q; }