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
- Committer:
- displaymodule
- Date:
- 2014-07-04
- Revision:
- 7:6cd8c36cbdb3
File content as of revision 7:6cd8c36cbdb3:
/**********************************************************************************************
Copyright (c) 2014 DisplayModule. All rights reserved.
Redistribution and use of this source code, part of this source code or any compiled binary
based on this source code is permitted as long as the above copyright notice and following
disclaimer is retained.
DISCLAIMER:
THIS SOFTWARE IS SUPPLIED "AS IS" WITHOUT ANY WARRANTIES AND SUPPORT. DISPLAYMODULE ASSUMES
NO RESPONSIBILITY OR LIABILITY FOR THE USE OF THE SOFTWARE.
********************************************************************************************/
#ifndef DM_TOUCHCALIBRATION_h
#define DM_TOUCHCALIBRATION_h
#include "dm_platform.h"
#include "DmTouch.h"
#include "DmTftBase.h"
typedef struct point {
uint16_t x, y;
} Point;
class DmTouchCalibration
{
public:
DmTouchCalibration(DmTftBase *tftBase, DmTouch *touch);
bool getTouchReferencePoints(Point displayRefPoint[], Point touchRefPoint[], uint16_t tftWidth, uint16_t tftHeight);
CalibrationMatrix calculateCalibrationMatrix(Point displayRefPoint[], Point touchRefPoint[]);
static CalibrationMatrix getDefaultCalibrationData(DmTouch::Display disp);
void drawCalibPoint(uint16_t x, uint16_t y) const;
void drawCalibration(CalibrationMatrix calibrationMatrix);
void printCalibration(CalibrationMatrix calibrationMatrix) const;
private:
DmTftBase* _tft;
DmTouch* _touch;
uint16_t _textRow;
void printHeadline(char* text);
void printNumber(int32_t number) const ;
void releaseTouch(uint16_t x, uint16_t y) const;
bool getRawTouch(uint16_t& x, uint16_t& y) const;
};
#endif
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