
Shows how to use a display and the touch controller. A very basic paint program.
Dependencies: DmTftLibrary mbed
Revision 1:c5ef2d3261d3, committed 2014-07-04
- Comitter:
- displaymodule
- Date:
- Fri Jul 04 10:35:27 2014 +0000
- Parent:
- 0:2ee293544fc1
- Child:
- 2:de14389741d5
- Commit message:
- Misc bugfixes
Changed in this revision
--- a/DmTftLibrary.lib Tue May 20 15:39:09 2014 +0000 +++ b/DmTftLibrary.lib Fri Jul 04 10:35:27 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/displaymodule/code/DmTftLibrary/#59be7fca4581 +http://mbed.org/users/displaymodule/code/DmTftLibrary/#6cd8c36cbdb3
--- a/main.cpp Tue May 20 15:39:09 2014 +0000 +++ b/main.cpp Fri Jul 04 10:35:27 2014 +0000 @@ -40,8 +40,13 @@ Canvas* canvas; } colorButton_t; +/* Note that there are restrictions on which platforms that can use printf + in combinations with the DmTftLibrary. Some platforms (e.g. LPC1549 LPCXpresso) + use the same pins for USBRX/USBTX and display control. Printing will + cause the display to not work. Read more about this on the display's notebook + page. */ +//#define log(...) printf(__VA_ARGS__) #define log(...) -//#define log(...) printf(__VA_ARGS__) #define MARGIN 5 #define BOX_W 30 @@ -50,23 +55,23 @@ #define NUM_BUTTONS (sizeof(buttons)/sizeof(buttons[0])) -#if 1 /* Displays without adapter */ -#define DM_PIN_SPI_MOSI D11 -#define DM_PIN_SPI_MISO D12 -#define DM_PIN_SPI_SCLK D13 - -#define DM_PIN_CS_TOUCH D4 -#define DM_PIN_CS_TFT D10 -#define DM_PIN_CS_SDCARD D8 -#define DM_PIN_CS_FLASH D6 -#else /* Displays with adapter */ -#define DM_PIN_SPI_MOSI A0 -#define DM_PIN_SPI_MISO D9 -#define DM_PIN_SPI_SCLK A1 - -#define DM_PIN_CS_TOUCH D8 -#define DM_PIN_CS_TFT A3 -#define DM_PIN_CS_SDCARD D10 +#if 1 + /* Displays without adapter */ + #define DM_PIN_SPI_MOSI D11 + #define DM_PIN_SPI_MISO D12 + #define DM_PIN_SPI_SCLK D13 + #define DM_PIN_CS_TOUCH D4 + #define DM_PIN_CS_TFT D10 + #define DM_PIN_CS_SDCARD D8 + #define DM_PIN_CS_FLASH D6 +#else + /* Displays with adapter */ + #define DM_PIN_SPI_MOSI A0 + #define DM_PIN_SPI_MISO D9 + #define DM_PIN_SPI_SCLK A1 + #define DM_PIN_CS_TOUCH D8 + #define DM_PIN_CS_TFT A3 + #define DM_PIN_CS_SDCARD D10 #endif /****************************************************************************** @@ -76,15 +81,15 @@ //DmTftHX8353C tft; /* DM_TFT18_101 */ //DmTftS6D0164 tft; /* DM_TFT22_102 */ //DmTftIli9325 tft; /* DM_TFT28_103 and DM_TFT24_104 */ -DmTftIli9341 tft; /* DM_TFT28_105 */ -//DmTftSsd2119 tft; /* DM_TFT35_107 */ +//DmTftIli9341 tft; /* DM_TFT28_105 */ +DmTftSsd2119 tft; /* DM_TFT35_107 */ -//DmTouch touch(DmTouch::DM_TFT28_103, false); /* For LPC4088 QuickStart Board */ +//DmTouch touch(DmTouch::DM_TFT28_103, DmTouch::Software); /* For LPC4088 QuickStart Board */ //DmTouch touch(DmTouch::DM_TFT28_103); -//DmTouch touch(DmTouch::DM_TFT24_104, false); /* For LPC4088 QuickStart Board */ +//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_TFT28_105); +DmTouch touch(DmTouch::DM_TFT35_107); DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1); DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1);
--- a/mbed-src.lib Tue May 20 15:39:09 2014 +0000 +++ b/mbed-src.lib Fri Jul 04 10:35:27 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/displaymodule/code/mbed-src/#3306e8fd8143 +http://mbed.org/users/displaymodule/code/mbed-src/#920c1b531860