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.
TouchPanel.h
- Committer:
- vcraciun
- Date:
- 2013-09-14
- Revision:
- 0:55a3f0eda74d
- Child:
- 1:e7ae315a1ceb
File content as of revision 0:55a3f0eda74d:
#ifndef __TOUCH_PANEL__ #define __TOUCH_PANEL__ #include "mbed.h" #include "ssd1289.h" #ifdef __cplusplus extern "C" { #endif typedef struct POINT { uint16_t x; uint16_t y; }Coordinate; typedef struct Matrix { 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 THRESHOLD 2 class Touch { 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); void TouchPanel_Calibrate(void); private: SPI *_spi; DigitalOut *_cs; DigitalIn *_irq; SSD1289_LCD *_lcd; }; #ifdef __cplusplus } #endif #endif