Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: TouchPanel.h
- Revision:
- 1:e7ae315a1ceb
- Parent:
- 0:55a3f0eda74d
- Child:
- 2:a31069f27cd5
diff -r 55a3f0eda74d -r e7ae315a1ceb TouchPanel.h --- a/TouchPanel.h Sat Sep 14 11:40:09 2013 +0000 +++ b/TouchPanel.h Sat Sep 14 11:48:46 2013 +0000 @@ -19,16 +19,13 @@ long double An,Bn,Cn,Dn,En,Fn,Divider; } Matrix ; -/* Private variables ---------------------------------------------------------*/ extern Coordinate ScreenSample[3]; extern Coordinate DisplaySample[3]; extern Matrix matrix ; extern Coordinate display ; -/* Private define ------------------------------------------------------------*/ - -#define CHX 0x90 -#define CHY 0xD0 +#define CHX 144 +#define CHY 208 #define THRESHOLD 2 @@ -37,17 +34,18 @@ public: Touch(SSD1289_LCD *lcd,SPI *spi, DigitalOut *cs, DigitalIn *irq); void InitializeTouch(); - int RD_AD(void); - int Read_X(void); - int Read_Y(void); - void TP_GetAdXY(int *x,int *y); - void TP_DrawPoint(int Xpos,int Ypos); - void DrawCross(int Xpos,int Ypos); - Coordinate *Read_Ads7846(void); - bool setCalibrationMatrix( Coordinate * displayPtr, Coordinate * screenPtr, Matrix * matrixPtr); + Coordinate *ReadAds7846(void); void TouchPanel_Calibrate(void); - + protected: + int RDAD(void); + int ReadX(void); + int ReadY(void); + void GetAdXY(int *x,int *y); + void DrawPoint(int Xpos,int Ypos); + void DrawCross(int Xpos,int Ypos); + bool setCalibrationMatrix( Coordinate * displayPtr, Coordinate * screenPtr, Matrix * matrixPtr); + private: SPI *_spi; DigitalOut *_cs;