Shows how to use a display and the onboard SD Card. Requires a display module with an adapter

Dependencies:   DmTftLibrary SDFileSystem mbed

Revision:
1:64173e1ae223
Parent:
0:ee27d4c12433
Child:
2:bb52a280861b
--- a/main.cpp	Tue May 20 15:42:31 2014 +0000
+++ b/main.cpp	Fri Jul 04 10:37:38 2014 +0000
@@ -29,13 +29,22 @@
  * Typedefs and defines
  *****************************************************************************/
 
-#define log(...) printf(__VA_ARGS__)
-//#define log(...)
+/* 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 DM_PIN_SPI_MOSI   A0
 #define DM_PIN_SPI_MISO   D9
 #define DM_PIN_SPI_SCLK   A1
 
+#define DM_PIN_SD_SPI_MOSI   D11
+#define DM_PIN_SD_SPI_MISO   D12
+#define DM_PIN_SD_SPI_SCLK   D13
+
 #define DM_PIN_CS_TOUCH   D8
 #define DM_PIN_CS_TFT     A3
 #define DM_PIN_CS_SDCARD  D10
@@ -44,18 +53,12 @@
  * Local variables
  *****************************************************************************/
 
-DmTftHX8353C tft;  /* DM_TFT18_101 */
-//DmTftS6D0164 tft;  /* DM_TFT22_102 */
+//DmTftHX8353C tft;  /* DM_TFT18_101 */
+DmTftS6D0164 tft;  /* DM_TFT22_102 */
 //DmTftIli9325 tft;  /* DM_TFT28_103 and DM_TFT24_104 */
 //DmTftSsd2119 tft;   /* DM_TFT35_107 */
 
-//DmTouch touch(DmTouch::DM_TFT28_103, false); /* For LPC4088 QuickStart Board */
-//DmTouch touch(DmTouch::DM_TFT28_103);
-//DmTouch touch(DmTouch::DM_TFT24_104);
-//DmTouch touch(DmTouch::DM_TFT24_104, false); /* For LPC4088 QuickStart Board */
-//DmTouch touch(DmTouch::DM_TFT35_107);
-
-SDFileSystem sd(DM_PIN_SPI_MOSI, DM_PIN_SPI_MISO, DM_PIN_SPI_SCLK, DM_PIN_CS_SDCARD, "sd"); // mosi,miso,clk,cs
+SDFileSystem sd(DM_PIN_SD_SPI_MOSI, DM_PIN_SD_SPI_MISO, DM_PIN_SD_SPI_SCLK, DM_PIN_CS_SDCARD, "sd"); // mosi,miso,clk,cs
 
 DigitalInOut csTouch(DM_PIN_CS_TOUCH, PIN_OUTPUT, PullUp, 1);
 DigitalInOut csDisplay(DM_PIN_CS_TFT, PIN_OUTPUT, PullUp, 1);