LPC1768 Mini-DK board with 2.8" SPI TFT and SPI touch

Dependencies:   Mini-DK mbed SDFileSystem

WARNING: filetoflash (SD to CPU flash)

The SPI_TFT library called from Mini-DK.lib contains an option to copy an image from the SD card to the CPU flash memory. This allows you to use an image as background without speed loss when writing other text and graphics.

By default, this option is enabled.

It can be disabled by uncommenting the #define mentioned below in Mini_DK.h:

#define NO_FLASH_BUFFER

Since the flash memory has limited write endurance, DO NOT use this feature when you intend to read multiple images from the SD card (eg: when used as a photo frame).

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Thu Jan 03 20:04:38 2013 +0000
Parent:
4:067633a7dfa5
Child:
6:b547fb6c1095
Commit message:
Removed warnings, added SD card definitions/macros

Changed in this revision

Mini-DK/Mini_DK.h Show annotated file Show diff for this revision Revisions of this file
Mini-DK/SPI_TFT/SPI_TFT.cpp Show annotated file Show diff for this revision Revisions of this file
Mini-DK/SPI_TFT/SPI_TFT.h Show annotated file Show diff for this revision Revisions of this file
Mini-DK/TouchADS7843/Touch.cpp Show annotated file Show diff for this revision Revisions of this file
modifs.h Show annotated file Show diff for this revision Revisions of this file
--- a/Mini-DK/Mini_DK.h	Thu Jan 03 16:28:16 2013 +0000
+++ b/Mini-DK/Mini_DK.h	Thu Jan 03 20:04:38 2013 +0000
@@ -22,3 +22,12 @@
 #define TP_SCK      P0_7
 #define TP_SDO      P0_8
 #define TP_SDI      P0_9
+
+#define SD_SDO      P1_23
+#define SD_SDI      P1_24
+#define SD_SCK      P1_20
+#define SD_CS       P1_21
+#define SD_CD       P1_25
+
+#define DISABLE_LCD_MISO    (LPC_PINCON->PINSEL1) &= ~(0x02<<2);
+#define ENABLE_LCD_MISO     (LPC_PINCON->PINSEL1) |=  (0x02<<2);
\ No newline at end of file
--- a/Mini-DK/SPI_TFT/SPI_TFT.cpp	Thu Jan 03 16:28:16 2013 +0000
+++ b/Mini-DK/SPI_TFT/SPI_TFT.cpp	Thu Jan 03 20:04:38 2013 +0000
@@ -14,7 +14,7 @@
 
 
 SPI_TFT::SPI_TFT(PinName mosi, PinName miso, PinName sclk, PinName cs, const char *name)
-    : _spi(mosi, miso, sclk), _cs(cs), GraphicsDisplay(name)
+    : GraphicsDisplay(name), _spi(mosi, miso, sclk), _cs(cs)
 {
     char_x = 0;
     tft_reset();
@@ -236,7 +236,7 @@
 }
 
 
-void SPI_TFT::window(unsigned int x, unsigned int y, unsigned int w, unsigned int h)
+void SPI_TFT::window(int x, int y, int w, int h)
 {
     unsigned int xw1, yh1;
     xw1 = x + w - 1;
--- a/Mini-DK/SPI_TFT/SPI_TFT.h	Thu Jan 03 16:28:16 2013 +0000
+++ b/Mini-DK/SPI_TFT/SPI_TFT.h	Thu Jan 03 20:04:38 2013 +0000
@@ -277,7 +277,7 @@
    * @param w window width in pixel
    * @param h window height in pixels
    */
-  void window (unsigned int x, unsigned int y, unsigned int w, unsigned int h);
+  virtual void window (int x, int y, int w, int h);
 
   /** Init the ILI9320 controller
    *
--- a/Mini-DK/TouchADS7843/Touch.cpp	Thu Jan 03 16:28:16 2013 +0000
+++ b/Mini-DK/TouchADS7843/Touch.cpp	Thu Jan 03 20:04:38 2013 +0000
@@ -19,7 +19,7 @@
 #define THRESHOLD 2
 
 TouchScreenADS7843::TouchScreenADS7843(PinName tp_mosi, PinName tp_miso, PinName tp_sclk, PinName tp_cs, PinName tp_irq, SPI_TFT *_LCD)
-        : _tp_spi(tp_mosi, tp_miso, tp_sclk), _tp_cs(tp_cs), _tp_irq(tp_irq), LCD(_LCD)
+        : LCD(_LCD), _tp_spi(tp_mosi, tp_miso, tp_sclk), _tp_cs(tp_cs), _tp_irq(tp_irq)
         {
             DisplaySample[0].x=45;
             DisplaySample[0].y=45;
--- a/modifs.h	Thu Jan 03 16:28:16 2013 +0000
+++ b/modifs.h	Thu Jan 03 20:04:38 2013 +0000
@@ -50,6 +50,18 @@
                     in Touch.h - unsigned char Read_Ads7846(Coordinate * screenPtr); replaced with
                                  unsigned char Read_Ads7846(Coordinate * screenPtr = NULL);
                     in Touch.cpp - if (screenPtr == NULL) screenPtr = &screen; added.
+      
+      
+      
+      General cleaning:
+      SPI_TFT::window function changed to use ints instead of unsigned ints, and made virtual to remove warnings.
+      In SPI_TFT.cpp GraphicsDiplay initialization moved to front to remove warnings
+      In Touch.cpp TFT pointer initialization moved to front to remove warnings
+      
+      In Mini_DK.h
+      ------------
+      Added SD card pins
+      Added two macros to enable/disable the LCD MISO pin, allowing use of both SD card and LCD
 
 
 General notes