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 176:4ab96d33a8ec, committed 2019-03-24
- Comitter:
- WiredHome
- Date:
- Sun Mar 24 14:49:49 2019 +0000
- Parent:
- 175:7be3a1fb7fc2
- Child:
- 177:d8e65c0e268a
- Commit message:
- Correct a defect recently introduced, where the resistive touch screen failed to have memory allocated to hold the touch information.
Changed in this revision
--- a/RA8875.cpp Fri Mar 15 01:39:39 2019 +0000 +++ b/RA8875.cpp Sun Mar 24 14:49:49 2019 +0000 @@ -192,8 +192,11 @@ , cs(csel) , res(reset) { - useTouchPanel = TP_NONE; - touchInfo = NULL; + touchInfo = (touchInfo_T *)malloc(RESISTIVE_TOUCH_POINTS * sizeof(touchInfo_T)); + if (touchInfo) + useTouchPanel = TP_RES; + else + useTouchPanel = TP_NONE; // unfortnately a silent failure, but unlikely tpFQFN = NULL; tpCalMessage = NULL; m_irq = NULL;
--- a/RA8875_Regs.h Fri Mar 15 01:39:39 2019 +0000 +++ b/RA8875_Regs.h Sun Mar 24 14:49:49 2019 +0000 @@ -6,7 +6,8 @@ #define RA8875_REGS_H // Touch Panel public macros - + #define RESISTIVE_TOUCH_POINTS 1 + /* Touch Panel Enable/Disable Reg TPCR0[7] */ #define TP_ENABLE ((uint8_t)(1<<7)) #define TP_DISABLE ((uint8_t)(0<<7))
--- a/RA8875_Touch.cpp Fri Mar 15 01:39:39 2019 +0000 +++ b/RA8875_Touch.cpp Sun Mar 24 14:49:49 2019 +0000 @@ -134,11 +134,11 @@ int RA8875::TouchChannels(void) { if (useTouchPanel == TP_GSL1680) { - return GSL1680_TOUCH_POINTS; // based on TP_GSL1680 firmware + return GSL1680_TOUCH_POINTS; // based on TP_GSL1680 firmware } else if (useTouchPanel == TP_FT5206) { - return 5; // based on the FT5206 hardware + return FT5206_TOUCH_POINTS; // based on the FT5206 hardware } else if (useTouchPanel == TP_RES) { - return 1; // based on the RA8875 resistive touch driver + return RESISTIVE_TOUCH_POINTS; // based on the RA8875 resistive touch driver } else { return 0; // it isn't enabled, so there are none. }