Shows how to use a display and the touch controller. Will display the X and Y coordinates of the current touch event.
Dependencies: DmTftLibrary mbed
Revision 5:cf0097e3a18c, committed 2015-01-21
- Comitter:
- displaymodule
- Date:
- Wed Jan 21 13:57:06 2015 +0000
- Parent:
- 4:c5fc54bb73bf
- Child:
- 6:d28b8be6e90a
- Commit message:
- add DM_TFT43_108, DM_TFT50_111 based on new lib drv: DmTftRa8875
Changed in this revision
DmTftLibrary.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/DmTftLibrary.lib Mon Sep 01 11:09:15 2014 +0000 +++ b/DmTftLibrary.lib Wed Jan 21 13:57:06 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/displaymodule/code/DmTftLibrary/#d263094e666d +http://mbed.org/users/displaymodule/code/DmTftLibrary/#264e19992620
--- a/main.cpp Mon Sep 01 11:09:15 2014 +0000 +++ b/main.cpp Wed Jan 21 13:57:06 2015 +0000 @@ -21,6 +21,7 @@ #include "DmTftIli9325.h" #include "DmTftIli9341.h" #include "DmTftSsd2119.h" +#include "DmTftRa8875.h" #include "DmTouch.h" /****************************************************************************** @@ -60,14 +61,17 @@ //DmTftIli9325 tft; /* DM_TFT28_103 and DM_TFT24_104 */ //DmTftIli9341 tft; /* DM_TFT28_105 */ -DmTftSsd2119 tft; /* DM_TFT35_107 */ +//DmTftSsd2119 tft; /* DM_TFT35_107 */ +DmTftRa8875 tft; /* DM_TFT43_108 and DM_TFT50_111 */ //DmTouch touch(DmTouch::DM_TFT28_103, DmTouch::Software); /* For LPC4088 QuickStart Board */ //DmTouch touch(DmTouch::DM_TFT28_103); //DmTouch touch(DmTouch::DM_TFT24_104, DmTouch::Software); /* For LPC4088 QuickStart Board */ //DmTouch touch(DmTouch::DM_TFT24_104); //DmTouch touch(DmTouch::DM_TFT28_105); -DmTouch touch(DmTouch::DM_TFT35_107); +//DmTouch touch(DmTouch::DM_TFT35_107); +//DmTouch touch(DmTouch::DM_TFT43_108); // For DmTftRa8875 driver, The panel resolution should be config in DmTftRa8875::init() function on the DmTftRa8875.cpp file. +DmTouch touch(DmTouch::DM_TFT50_111); DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1); DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1); @@ -92,7 +96,7 @@ int main() { log("init tft \r\n"); tft.init(); - + uint16_t x = 0; uint16_t y = 0; uint16_t w = tft.width();