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 55:dfbabef7003e, committed 2014-03-30
- Comitter:
- WiredHome
- Date:
- Sun Mar 30 23:37:41 2014 +0000
- Parent:
- 54:e117ad10fba6
- Child:
- 56:7a85d226ad0d
- Child:
- 64:5479dc0c8738
- Commit message:
- Cursor locate method corrected to use 8 pixels as the font width, not 16.; Renamed putp to _putp to suggest it is special.; Migrated _StartGraphicsStream, _putp, _EndGraphicsStream from private to public for faster pixel based screen updates.
Changed in this revision
--- a/GraphicsDisplay.cpp Sun Mar 23 17:35:14 2014 +0000 +++ b/GraphicsDisplay.cpp Sun Mar 30 23:37:41 2014 +0000 @@ -233,7 +233,7 @@ window(0,0, width(),height()); } -RetCode_t GraphicsDisplay::putp(color_t color) +RetCode_t GraphicsDisplay::_putp(color_t color) { pixel(_x, _y, color); // update pixel location based on window settings @@ -264,7 +264,7 @@ window(x, y, w, h); _StartGraphicsStream(); for (int i=0; i<w*h; i++) { - putp(color[i]); + _putp(color[i]); } _EndGraphicsStream(); WindowMax(); @@ -287,7 +287,7 @@ if (offset == 0) INFO(" %2d = %02X", i>>3, byte); int c = ((byte << offset) & 0x80) ? _foreground : _background; - putp(c); + _putp(c); } _EndGraphicsStream(); WindowMax(); @@ -320,7 +320,7 @@ color_t c = (byte & bitmask) ? _foreground : _background; //INFO("(%2d,%2d) %02X & %02X => %04X [%04X,%04X]", px, py, byte, bitmask, c, _foreground, _background); //pixel(x+px, y+py, c); - putp(c); + _putp(c); } } _EndGraphicsStream(); @@ -542,13 +542,13 @@ dPix >>= 4; dPix &= 0x0F; pixelBuffer[i] = RGBQuadToRGB16(colorPalette, dPix); - //putp(RGBQuadToRGB16(colorPalette, dPix)); + //_putp(RGBQuadToRGB16(colorPalette, dPix)); } else if (BPP_t == 8) { pixelBuffer[i] = RGBQuadToRGB16(colorPalette, lineBuffer[i]); - //putp(RGBQuadToRGB16(colorPalette, lineBuffer[i])); + //_putp(RGBQuadToRGB16(colorPalette, lineBuffer[i])); } else if (BPP_t == 16) { pixelBuffer[i] = lineBuffer[i]; - //putp(lineBuffer[i]); + //_putp(lineBuffer[i]); } else if (BPP_t == 24) { color_t color; color = RGB(lineBuffer[i*3+2], lineBuffer[i*3+1], lineBuffer[i*3+0]);
--- a/GraphicsDisplay.h Sun Mar 23 17:35:14 2014 +0000 +++ b/GraphicsDisplay.h Sun Mar 30 23:37:41 2014 +0000 @@ -174,7 +174,7 @@ /// @param pixel is a color value to be put on the screen. /// @returns error code. /// - virtual RetCode_t putp(color_t pixel); + virtual RetCode_t _putp(color_t pixel); virtual void fill(int x, int y, int w, int h, color_t color);
--- a/RA8875.cpp Sun Mar 23 17:35:14 2014 +0000 +++ b/RA8875.cpp Sun Mar 30 23:37:41 2014 +0000 @@ -361,7 +361,7 @@ dim_t RA8875::fontwidth(void) { if (font == NULL) - return (((ReadCommand(0x22) >> 2) & 0x3) + 1) * 16; + return (((ReadCommand(0x22) >> 2) & 0x3) + 1) * 8; else return font[1]; } @@ -618,7 +618,7 @@ } -RetCode_t RA8875::putp(color_t pixel) +RetCode_t RA8875::_putp(color_t pixel) { WriteDataW((pixel>>8) | (pixel<<8)); return noerror;
--- a/RA8875.h Sun Mar 23 17:35:14 2014 +0000 +++ b/RA8875.h Sun Mar 30 23:37:41 2014 +0000 @@ -1016,6 +1016,44 @@ /// const char * DOSColorNames(int i); + /// Advanced method indicating the start of a graphics stream. + /// + /// This is called prior to a stream of pixel data being sent. + /// This may cause register configuration changes in the derived + /// class in order to prepare the hardware to accept the streaming + /// data. + /// + /// Following this command, a series of @see _putp() commands can + /// be used to send individual pixels to the screen. + /// + /// To conclude the graphics stream, @see _EndGraphicsStream should + /// be callled. + /// + /// @returns error code. + /// + virtual RetCode_t _StartGraphicsStream(void); + + /// Advanced method to put a single color pixel to the screen. + /// + /// This method may be called as many times as necessary after + /// @see _StartGraphicsStream() is called, and it should be followed + /// by _EndGraphicsStream. + /// + /// @param pixel is a color value to be put on the screen. + /// @returns error code. + /// + virtual RetCode_t _putp(color_t pixel); + + /// Advanced method indicating the end of a graphics stream. + /// + /// This is called to conclude a stream of pixel data that was sent. + /// This may cause register configuration changes in the derived + /// class in order to stop the hardware from accept the streaming + /// data. + /// + /// @returns error code. + /// + virtual RetCode_t _EndGraphicsStream(void); #ifdef PERF_METRICS /// Clear the performance metrics to zero. @@ -1133,45 +1171,6 @@ /// RetCode_t init(int width, int height, int color_bpp); - /// method indicating the start of a graphics stream. - /// - /// This is called prior to a stream of pixel data being sent. - /// This may cause register configuration changes in the derived - /// class in order to prepare the hardware to accept the streaming - /// data. - /// - /// Following this command, a series of @see putp() commands can - /// be used to send individual pixels to the screen. - /// - /// To conclude the graphics stream, @see _EndGraphicsStream should - /// be callled. - /// - /// @returns error code. - /// - virtual RetCode_t _StartGraphicsStream(void); - - /// method to put a single color pixel to the screen. - /// - /// This method may be called as many times as necessary after - /// @see _StartGraphicsStream() is called, and it should be followed - /// by _EndGraphicsStream. - /// - /// @param pixel is a color value to be put on the screen. - /// @returns error code. - /// - virtual RetCode_t putp(color_t pixel); - - /// method indicating the end of a graphics stream. - /// - /// This is called to conclude a stream of pixel data that was sent. - /// This may cause register configuration changes in the derived - /// class in order to stop the hardware from accept the streaming - /// data. - /// - /// @returns error code. - /// - virtual RetCode_t _EndGraphicsStream(void); - /// Internal function to put a character using the built-in (internal) font engine /// /// @param is the character to put to the screen.