Basic calculator example to show the LPC4088 Experiment Base Board with a touch LCD from DisplayModule

Dependencies:   DmTftLibrary mbed

Fork of dm_calc by Display Module

Revision:
4:71588a1e3618
Parent:
2:b17b19212e5a
Child:
5:d2802a0c5af2
--- a/main.cpp	Mon Sep 01 10:40:40 2014 +0000
+++ b/main.cpp	Wed Sep 10 12:48:14 2014 +0000
@@ -43,22 +43,15 @@
 
 #define NUM_BUTTONS  (sizeof(captions)/sizeof(captions[0]))
 
-#if 1
-  /* Displays without adapter */
-  #define DM_PIN_SPI_MOSI   D11
-  #define DM_PIN_SPI_MISO   D12
-  #define DM_PIN_SPI_SCLK   D13
+#if 0
+  /* Displays without adapter (DM_TFT28_105 & DM_TFT35_107) */
   #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
+  /* Displays with adapter (all other displays) */
+  #define DM_PIN_CS_TFT     D4
   #define DM_PIN_CS_SDCARD  D10
 #endif
 
@@ -68,18 +61,18 @@
  * Local variables
  *****************************************************************************/
 
-//DmTftIli9325 tft;  /* DM_TFT28_103 and DM_TFT24_104 */
-DmTftIli9341 tft;  /* DM_TFT28_105 */
-//DmTftSsd2119 tft;   /* DM_TFT35_107 */
+DmTftIli9325 tft;   /* DM_TFT28_103 and DM_TFT24_104 with adapter in arduino J1 contact */
+//DmTftIli9341 tft;   /* DM_TFT28_105 directly in arduino J1 contact (no adapter) */
+//DmTftSsd2119 tft;   /* DM_TFT35_107 directly in arduino J1 contact (no adapter) */
 
-//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_TFT28_103, DmTouch::Software);
+DmTouch touch(DmTouch::DM_TFT24_104, DmTouch::Software);
+//DmTouch touch(DmTouch::DM_TFT28_105);
 //DmTouch touch(DmTouch::DM_TFT35_107);
 
-DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1);
+#ifdef DM_PIN_CS_TOUCH
+  DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1);
+#endif
 DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1);
 DigitalInOut csSDCard(DM_PIN_CS_SDCARD, PIN_OUTPUT, PullUp, 1);
 #ifdef DM_PIN_CS_FLASH
@@ -215,6 +208,26 @@
  * Main
  *****************************************************************************/
 
+/*
+ Hardware Setup:
+ 
+ - Jumpers JP1..JP6 should be in position 1-2
+ - Jumpers in J14 should NOT be inserted
+ - Jumper J7 should be inserted
+ - Display in arduino socket J1 depending on display
+*/
+
+/*
+ Test Comments:
+ 
+ - This example cannot be used with the DM-TFT18-101 or DM-TFT22-102 displays
+   as they don't have touch support.
+ - The DM-TFT22-102, DM-TFT28-103 and DM-TFT24-104 must all be used on top
+   of the DM-ADTAU-001 board in the arduino J1 socket.
+ - The DM-TFT28-105 and DM-TFT35-107 displays have direct arduino pinning and
+   can be inserted directly in the J1 socket.
+*/
+
 int main() { 
   uint16_t x = 0;
   uint16_t y = 0;