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.
Dependents: dm_bubbles dm_calc dm_paint dm_sdcard_with_adapter ... more
DmTouchCalibration.h
00001 /********************************************************************************************** 00002 Copyright (c) 2014 DisplayModule. All rights reserved. 00003 00004 Redistribution and use of this source code, part of this source code or any compiled binary 00005 based on this source code is permitted as long as the above copyright notice and following 00006 disclaimer is retained. 00007 00008 DISCLAIMER: 00009 THIS SOFTWARE IS SUPPLIED "AS IS" WITHOUT ANY WARRANTIES AND SUPPORT. DISPLAYMODULE ASSUMES 00010 NO RESPONSIBILITY OR LIABILITY FOR THE USE OF THE SOFTWARE. 00011 ********************************************************************************************/ 00012 00013 #ifndef DM_TOUCHCALIBRATION_h 00014 #define DM_TOUCHCALIBRATION_h 00015 00016 #include "dm_platform.h" 00017 #include "DmTouch.h" 00018 #include "DmTftBase.h" 00019 00020 typedef struct point { 00021 uint16_t x, y; 00022 } Point; 00023 00024 class DmTouchCalibration 00025 { 00026 public: 00027 DmTouchCalibration(DmTftBase *tftBase, DmTouch *touch); 00028 bool getTouchReferencePoints(Point displayRefPoint[], Point touchRefPoint[], uint16_t tftWidth, uint16_t tftHeight); 00029 CalibrationMatrix calculateCalibrationMatrix(Point displayRefPoint[], Point touchRefPoint[]); 00030 static CalibrationMatrix getDefaultCalibrationData(DmTouch::Display disp); 00031 void drawCalibPoint(uint16_t x, uint16_t y) const; 00032 void drawCalibration(CalibrationMatrix calibrationMatrix); 00033 void printCalibration(CalibrationMatrix calibrationMatrix) const; 00034 private: 00035 DmTftBase* _tft; 00036 DmTouch* _touch; 00037 uint16_t _textRow; 00038 void printHeadline(char* text); 00039 void printNumber(int32_t number) const ; 00040 void releaseTouch(uint16_t x, uint16_t y) const; 00041 bool getRawTouch(uint16_t& x, uint16_t& y) const; 00042 }; 00043 #endif
Generated on Wed Jul 13 2022 04:21:40 by
1.7.2
DisplayModule 1.8" TFT with SPI Interface
DisplayModule 2.2" TFT with 8-bit interface
DisplayModule 2.8" 240x320 Touch TFT with 8-bit Interface
DisplayModule 2.4" 240x320 Touch TFT with 8-bit Interface
DisplayModule 2.8" 240x320 TFT LCD With Resistive Touch - SPI, 4MB Flash
DisplayModule 3.5" 320x240 TFT LCD With Resistive Touch - SPI, 4MB Flash
DisplayModule 4.3" 480x272 Arduino TFT Shield With Touch And SPI Interface
DisplayModule 5.0" 800x480 Arduino TFT Shield With Touch And SPI Interface
DisplayModule 2.8" 240x320 TFT With Capacitive Touch