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).

modifs.h

Committer:
Sissors
Date:
2013-01-03
Revision:
6:b547fb6c1095
Parent:
5:781a72d380a1

File content as of revision 6:b547fb6c1095:

/*
Date    : 31.12.12
Authors : Erik Olieman/Frank Vannieuwkerke
-----------------------------------------
      Code readability and speed
        1. created separate structure for mini-DK (base for library)
        2. Removed wr_dat_only routine (uses 8 bit transfer = slow) in SPI_TFT
           Replaced each wr_dat_only with
             _spi.format(16,3);
             .....
             _spi.write(...);
             .....
             _spi.format(8,3);
        3. Creation of Mini-DK.h with all declarations specific to the mini-DK board.


      Removed reset pin from SPI_TFT (not needed - pin is connected to main reset).

      Separated SPI_TFT from TouchADS7843
      
      In main.cpp
      ----------- 

      TouchScreenADS7843 initialisation: pointer to SPI_TFT needed for calibration, drawcross and drawpoint routines.
      
      Moved following global touch var declarations from main.cpp back to touch.cpp/.h
        Matrix      matrix;
        Coordinate  display;
        Coordinate  screen;
        NOTE : i did not create a class with var readback, just used plain C notation.
               These vars can be accessed from other code through <classname>.<varname>
               example : TP.display.x
               Only drawback : Each element of these vars needs to be initialised separately.
                               (initialisation of these vars is not possible with array notation).

      In Touch.cpp/.h
      ---------------
      TouchScreenADS7843 constructor: added pointer to SPI_TFT - needed for calibration, drawcross and drawpoint routines.
                                      If LCD calls are not needed, initialise TouchScreenADS7843 with NULL pointer for LCD.

      Removed TP_Init - moved TP_init code to constructor.

      Variables in call to TouchPanel_Calibrate, Read_Ads7846, getDisplayPoint are no longer needed.
      Modified these routines accordingly in touch.cpp/.h (pointers no longer needed)
      *** TouchPanel_Calibrate and getDisplayPoint already modified.

      Read_Ads7846: is also called in TouchPanel_Calibrate (Touch.cpp) with other var.
                    Modified Read_Ads7846 to allow call with/without (parameter).
                    If called without  (parameter) - screen variable is used, otherwise (parameter) is used.
                    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
      
      
      In SPI_TFT
      ----------
      Changed the SPI object to a BurstSPI object
      All cases where large numbers of bytes were writting (filled rect, cls, etc) have been replaced by fastWrite functions for higher speed
      mbed library updated to this century
      Removed stream name from TextDisplay (not used in current mbed version)
      Colorwheel stepsize reduced to 1 in main.cpp
      
      Known issue: claim function for stdout does not work
      


General notes
-------------
lpc1768 SPI port - problem when using SD and TFT simultaneously - solution provided by Erik Olieman
see note http://mbed.org/comments/cr/83/2654/#c4768
Even faster SPI write : http://mbed.org/users/Sissors/code/BurstSPI/docs/600eecd89a78/BurstSPI_8cpp_source.html
*/