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
Diff: DmTouch.cpp
- Revision:
- 10:d263094e666d
- Parent:
- 9:bac5439e3c1c
- Child:
- 11:264e19992620
diff -r bac5439e3c1c -r d263094e666d DmTouch.cpp
--- a/DmTouch.cpp Mon Jul 07 13:30:33 2014 +0000
+++ b/DmTouch.cpp Wed Jul 09 08:31:34 2014 +0000
@@ -28,6 +28,7 @@
DmTouch::DmTouch(Display disp, SpiMode spiMode)
#endif
{
+ _disp = disp;
switch (disp) {
// Display with 40-pin connector on top of adapter board
case DmTouch::DM_TFT28_103:
@@ -37,6 +38,8 @@
_clk = A1;
_mosi = A0;
_miso = D9;
+ _width = 240;
+ _height = 320;
_hardwareSpi = false;
break;
@@ -46,6 +49,8 @@
_clk = D13;
_mosi = D11;
_miso = D12;
+ _width = 240;
+ _height = 320;
_hardwareSpi = true;
break;
@@ -56,6 +61,8 @@
_clk = D13;
_mosi = D11;
_miso = D12;
+ _width = 320;
+ _height = 240;
_hardwareSpi = true;
break;
}
@@ -250,7 +257,7 @@
#if defined (DM_TOOLCHAIN_ARDUINO)
touching = isTouched();
#elif defined (DM_TOOLCHAIN_MBED)
- touching = (posX < 4096 && posY < 4096);
+ touching = (posX < _width && posY < _height);
#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