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 209:08fc22dea762, committed 2021-04-04
- Comitter:
- WiredHome
- Date:
- Sun Apr 04 20:14:06 2021 +0000
- Parent:
- 208:c610b031388d
- Commit message:
- Fix a long-standing defect in the FT5206 where it reported 'touch' code even for hold and release events.
Changed in this revision
diff -r c610b031388d -r 08fc22dea762 RA8875.cpp --- a/RA8875.cpp Sun Apr 04 17:15:57 2021 +0000 +++ b/RA8875.cpp Sun Apr 04 20:14:06 2021 +0000 @@ -2458,6 +2458,18 @@ } +RetCode_t RA8875::ellipse(point_t p, dim_t radius1, dim_t radius2, color_t color, fill_t fillit) +{ + return ellipse(p.x, p.y, radius1, radius2, color, fillit); +} + + +RetCode_t RA8875::fillellipse(point_t p, dim_t radius1, dim_t radius2, color_t color, fill_t fillit) +{ + return fillellipse(p.x, p.y, radius1, radius2, color, fillit); +} + + RetCode_t RA8875::ellipse(loc_t x, loc_t y, dim_t radius1, dim_t radius2, color_t color, fill_t fillit) { foreground(color);
diff -r c610b031388d -r 08fc22dea762 RA8875.h --- a/RA8875.h Sun Apr 04 17:15:57 2021 +0000 +++ b/RA8875.h Sun Apr 04 20:14:06 2021 +0000 @@ -2896,6 +2896,31 @@ RetCode_t ellipse(loc_t x, loc_t y, dim_t radius1, dim_t radius2, fill_t fillit = NOFILL); + /// Draw an Ellipse + /// + /// Draws it using the foreground color setting. + /// + /// @param[in] p is point for the center of the ellipse. + /// @param[in] radius1 defines the horizontal radius of the ellipse. + /// @param[in] radius2 defines the vertical radius of the ellipse. + /// @param[in] fillit defines whether the circle is filled or not. + /// @returns @ref RetCode_t value. + /// + RetCode_t ellipse(point_t p, dim_t radius1, dim_t radius2, color_t color, fill_t fillit = NOFILL); + + + /// Draw an filled Ellipse + /// + /// Draws it using the foreground color setting. + /// + /// @param[in] p is point for the center of the ellipse. + /// @param[in] radius1 defines the horizontal radius of the ellipse. + /// @param[in] radius2 defines the vertical radius of the ellipse. + /// @param[in] fillit defines whether the circle is filled or not. + /// @returns @ref RetCode_t value. + /// + RetCode_t fillellipse(point_t p, dim_t radius1, dim_t radius2, color_t color, fill_t fillit = FILL); + /// Block Move ///
diff -r c610b031388d -r 08fc22dea762 RA8875_Touch.cpp --- a/RA8875_Touch.cpp Sun Apr 04 17:15:57 2021 +0000 +++ b/RA8875_Touch.cpp Sun Apr 04 20:14:06 2021 +0000 @@ -263,6 +263,7 @@ if (TouchPoint) { *TouchPoint = touchInfo[0].coordinates; ts = touchInfo[0].touchCode; + INFO("ts %d", ts); #ifdef DEBUG static TouchCode_t lastTS = no_touch; if (lastTS != ts) @@ -271,7 +272,8 @@ lastTS = ts; #endif } else { - ts = touch; + ts = touchInfo[0].touchCode; + INFO("ts %d", ts); } } return ts;
diff -r c610b031388d -r 08fc22dea762 RA8875_Touch_FT5206.cpp --- a/RA8875_Touch_FT5206.cpp Sun Apr 04 17:15:57 2021 +0000 +++ b/RA8875_Touch_FT5206.cpp Sun Apr 04 20:14:06 2021 +0000 @@ -88,7 +88,7 @@ valXH = FT5206_ReadRegU8(FT5206_TOUCH5_XH); valYH = FT5206_ReadRegU8(FT5206_TOUCH5_YH); touchInfo[4].touchCode = FT5206_EventFlagToTouchCode[valXH >> 6]; - INFO(" touchID %d", touchInfo[4].touchCode); + INFO(" touchCode %d", touchInfo[4].touchCode); touchInfo[4].touchID = (valYH >> 4); touchInfo[4].coordinates = TranslateOrientation( (valXH & 0x0f)*256 + FT5206_ReadRegU8(FT5206_TOUCH5_XL), @@ -98,7 +98,7 @@ valXH = FT5206_ReadRegU8(FT5206_TOUCH4_XH); valYH = FT5206_ReadRegU8(FT5206_TOUCH4_YH); touchInfo[3].touchCode = FT5206_EventFlagToTouchCode[valXH >> 6]; - INFO(" touchID %d", touchInfo[3].touchCode); + INFO(" touchCode %d", touchInfo[3].touchCode); touchInfo[3].touchID = (valYH >> 4); touchInfo[3].coordinates = TranslateOrientation( (valXH & 0x0f)*256 + FT5206_ReadRegU8(FT5206_TOUCH4_XL), @@ -108,7 +108,7 @@ valXH = FT5206_ReadRegU8(FT5206_TOUCH3_XH); valYH = FT5206_ReadRegU8(FT5206_TOUCH3_YH); touchInfo[2].touchCode = FT5206_EventFlagToTouchCode[valXH >> 6]; - INFO(" touchID %d", touchInfo[2].touchCode); + INFO(" touchCode %d", touchInfo[2].touchCode); touchInfo[2].touchID = (valYH >> 4); touchInfo[2].coordinates = TranslateOrientation( (valXH & 0x0f)*256 + FT5206_ReadRegU8(FT5206_TOUCH3_XL), @@ -118,7 +118,7 @@ valXH = FT5206_ReadRegU8(FT5206_TOUCH2_XH); valYH = FT5206_ReadRegU8(FT5206_TOUCH2_YH); touchInfo[1].touchCode = FT5206_EventFlagToTouchCode[valXH >> 6]; - INFO(" touchID %d", touchInfo[1].touchCode); + INFO(" touchCode %d", touchInfo[1].touchCode); touchInfo[1].touchID = (valYH >> 4); touchInfo[1].coordinates = TranslateOrientation( (valXH & 0x0f)*256 + FT5206_ReadRegU8(FT5206_TOUCH2_XL), @@ -128,7 +128,7 @@ valXH = FT5206_ReadRegU8(FT5206_TOUCH1_XH); valYH = FT5206_ReadRegU8(FT5206_TOUCH1_YH); touchInfo[0].touchCode = FT5206_EventFlagToTouchCode[valXH >> 6]; - INFO(" touchID %d", touchInfo[0].touchCode); + INFO(" touchCode %d", touchInfo[0].touchCode); touchInfo[0].touchID = (valYH >> 4); touchInfo[0].coordinates = TranslateOrientation( (valXH & 0x0f)*256 + FT5206_ReadRegU8(FT5206_TOUCH1_XL),