
KL25Z driving an ILI9320 LCD board with touch panel (HY28A-LCDB SPI)
Dependencies: SPI_TFT_ILI9320 mbed
Diff: TouchADS7843/Touch.cpp
- Revision:
- 1:76f92f6b3737
- Parent:
- 0:ff976ad09b2f
--- a/TouchADS7843/Touch.cpp Tue Mar 18 19:36:05 2014 +0000 +++ b/TouchADS7843/Touch.cpp Sun Mar 23 19:45:33 2014 +0000 @@ -260,3 +260,29 @@ LCD->cls(); } +void TouchScreenADS7843::GetCalibration(Matrix * matrixPtr, Coordinate * screenPtr) +{ + uint8_t i; + Matrix * mp1; + mp1 = &matrix; + *matrixPtr = *mp1; + for(i=0;i<3;i++) + { + screenPtr[i].x = ScreenSample[i].x; + screenPtr[i].y = ScreenSample[i].y; + } +} + +void TouchScreenADS7843::SetCalibration(Matrix * matrixPtr, Coordinate * screenPtr) +{ + uint8_t i; + Matrix * mp1; + mp1 = &matrix; + *mp1 = *matrixPtr; + for(i=0;i<3;i++) + { + ScreenSample[i].x = screenPtr[i].x; + ScreenSample[i].y = screenPtr[i].y; + } + setCalibrationMatrix( &DisplaySample[0],&ScreenSample[0],&matrix) ; +}