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: RA8875_Touch.cpp
- Revision:
- 103:7e0464ca6c5c
- Parent:
- 88:bfddef6ec836
- Child:
- 108:7415c405ee08
diff -r fc60bfa0199f -r 7e0464ca6c5c RA8875_Touch.cpp --- a/RA8875_Touch.cpp Sat Jan 23 16:58:54 2016 +0000 +++ b/RA8875_Touch.cpp Sun Feb 07 23:18:01 2016 +0000 @@ -178,20 +178,22 @@ TouchCode_t ts = TouchPanelA2DFiltered(&a2dX, &a2dY); if (ts != no_touch) { - if (tpMatrix.Divider != 0 && TouchPoint) { - /* Operation order is important since we are doing integer */ - /* math. Make sure you add all terms together before */ - /* dividing, so that the remainder is not rounded off */ - /* prematurely. */ - TouchPoint->x = ( (tpMatrix.An * a2dX) + - (tpMatrix.Bn * a2dY) + - tpMatrix.Cn - ) / tpMatrix.Divider ; + if (tpMatrix.Divider != 0) { + if (TouchPoint) { + /* Operation order is important since we are doing integer */ + /* math. Make sure you add all terms together before */ + /* dividing, so that the remainder is not rounded off */ + /* prematurely. */ + TouchPoint->x = ( (tpMatrix.An * a2dX) + + (tpMatrix.Bn * a2dY) + + tpMatrix.Cn + ) / tpMatrix.Divider ; - TouchPoint->y = ( (tpMatrix.Dn * a2dX) + - (tpMatrix.En * a2dY) + - tpMatrix.Fn - ) / tpMatrix.Divider ; + TouchPoint->y = ( (tpMatrix.Dn * a2dX) + + (tpMatrix.En * a2dY) + + tpMatrix.Fn + ) / tpMatrix.Divider ; + } } else { ts = no_cal; }