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)
Revision 59:fb40aad4efd4, committed 2014-07-24
- Comitter:
- WiredHome
- Date:
- Thu Jul 24 00:41:37 2014 +0000
- Parent:
- 58:26658a56112a
- Child:
- 60:2dfd574f63bd
- Commit message:
- Nearly insignificant changes to the test code.
Changed in this revision
GraphicsDisplay.cpp | Show annotated file Show diff for this revision Revisions of this file |
RA8875.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/GraphicsDisplay.cpp Sat Jul 05 15:59:55 2014 +0000 +++ b/GraphicsDisplay.cpp Thu Jul 24 00:41:37 2014 +0000 @@ -455,13 +455,15 @@ uint8_t * lineBuffer = NULL; uint16_t BPP_t; uint32_t PixelWidth, PixelHeight; - //uint32_t start_data; unsigned int i, offset; int padd,j; + #ifdef DEBUG + uint32_t start_data; + #endif // Now, Read the bitmap info header fread(&BMP_Info, 1, sizeof(BMP_Info), Image); - //HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info)); + HexDump("BMP_Info", (uint8_t *)&BMP_Info, sizeof(BMP_Info)); BPP_t = BMP_Info.biBitCount; INFO("biBitCount %04X", BPP_t); if (BPP_t != 4 && BPP_t != 8 && BPP_t != 16 && BPP_t != 24) { // Support 4, 8, 16, 24-bits per pixel @@ -487,11 +489,11 @@ return(not_enough_ram); } fread(colorPalette, 1, paletteSize, Image); - //HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize); + HexDump("Color Palette", (uint8_t *)colorPalette, paletteSize); } int lineBufSize = ((BPP_t * PixelWidth + 7)/8); - //INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize); + INFO("BPP_t %d, PixelWidth %d, lineBufSize %d", BPP_t, PixelWidth, lineBufSize); lineBuffer = (uint8_t *)malloc(lineBufSize); if (lineBuffer == NULL) { free(colorPalette); @@ -528,13 +530,13 @@ _StartGraphicsStream(); //start_data = BMP_Header.bfOffBits; - //HexDump("Raw Data", (uint8_t *)&start_data, 32); - //INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd); + HexDump("Raw Data", (uint8_t *)&start_data, 32); + INFO("(%d,%d) (%d,%d), [%d,%d]", x,y, PixelWidth,PixelHeight, lineBufSize, padd); for (j = PixelHeight - 1; j >= 0; j--) { //Lines bottom up offset = fileOffset + j * (lineBufSize + padd); // start of line fseek(Image, offset, SEEK_SET); fread(lineBuffer, 1, lineBufSize, Image); // read a line - slow ! - //INFO("offset: %6X", offset); + INFO("offset: %6X", offset); for (i = 0; i < PixelWidth; i++) { // copy pixel data to TFT if (BPP_t == 4) { uint8_t dPix = lineBuffer[i/2]; @@ -589,7 +591,7 @@ fread(&BMP_Header, 1, sizeof(BMP_Header), Image); // get the BMP Header INFO("bfType %04X", BMP_Header.bfType); - //HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header)); + HexDump("BMP_Header", (uint8_t *)&BMP_Header, sizeof(BMP_Header)); if (BMP_Header.bfType != BF_TYPE) { fclose(Image); return(not_bmp_format);
--- a/RA8875.cpp Sat Jul 05 15:59:55 2014 +0000 +++ b/RA8875.cpp Thu Jul 24 00:41:37 2014 +0000 @@ -1486,13 +1486,19 @@ display.foreground(Blue); display.window(0,0, display.width(), display.height()); display.cls(); - display.puts(0,0, "Web Color Test\r\n"); - display.SetTextFontSize(1,2); + display.SetTextFontSize(1,1); + display.puts(200,0, "Web Color Test"); + display.SetTextCursor(0,0); + display.puts(" "); + for (int i=0; i<16; i++) + display.printf("%X", i&0xF); + display.puts("\r\n0 "); for (int i=0; i<sizeof(WebColors)/sizeof(WebColors[0]); i++) { display.background(WebColors[i]); display.puts(" "); - if (i % 36 == 35) - display.puts("\r\n"); + if (i % 16 == 15 && i < 255) { + display.printf("\r\n%X ", ((i+1)/16)); + } } display.SetTextFontSize(1,1); } @@ -1784,6 +1790,8 @@ wait(3); int r = display.RenderBitmapFile(0,0, "/local/TestPat.bmp"); + if (!SuppressSlowStuff) + pc.printf(" returned %d\r\n", r); }