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

Revision:
7:ffdd4e75b366
Parent:
3:fb4d62b5ffb3
--- a/Mini-DK/TouchADS7843/Touch.h	Thu Jan 03 21:24:05 2013 +0000
+++ b/Mini-DK/TouchADS7843/Touch.h	Fri Jan 04 09:52:16 2013 +0000
@@ -1,3 +1,13 @@
+/******************************************************************
+ *****                                                        *****
+ *****  Name: Touch.h                                         *****
+ *****  Ver.: 1.0                                             *****
+ *****  Date: 04/01/2013                                      *****
+ *****  Auth: Frank Vannieuwkerke                             *****
+ *****        Erik Olieman                                    *****
+ *****  Func: Touch driver for use with ADS7843               *****
+ *****                                                        *****
+ ******************************************************************/
 
 #ifndef MBED_Touch_H
 #define MBED_Touch_H
@@ -38,9 +48,43 @@
     */
     TouchScreenADS7843(PinName tp_mosi, PinName tp_miso, PinName tp_sclk, PinName tp_cs, PinName tp_irq, SPI_TFT *_LCD);
 
+    /*
+    * Draw a 2 by 2 dot on the LCD screen
+    *
+    * @param x (horizontal position)
+    * @param y (vertical position)
+    * @param color (16 bit pixel color)
+    *
+    */
     void TP_DrawPoint(unsigned int Xpos,unsigned int Ypos,unsigned int color);
+    
+    /*
+    * Obtain averaged data from ADS7846
+    * does 9 consecutive reads and only stores averaged data
+    * when the 9 points are within the treshold limits.
+    *
+    * @param screenPTR (pointer to store data)
+    * @returns 1 on success
+    * @returns 0 on failure
+    *
+    * If called with screenPTR = NULL - 'screen' variable is used, otherwise (parameter) is used.
+    *
+    */
     unsigned char Read_Ads7846(Coordinate * screenPtr = NULL);
+
+    /*
+    * Calibrate the touch panel.
+    * Three crosshairs are drawn and need to be touched in sequence.  
+    * A calibration matrix is set accordingly.
+    *
+    */
     void TouchPanel_Calibrate(void);
+    
+    /*
+    * Obtain real x,y coordinates
+    * The x,y coordinates are calculated using the calibration matrix.
+    *
+    */
     unsigned char getDisplayPoint(void);
 
     SPI_TFT    *LCD;
@@ -58,9 +102,45 @@
     Coordinate ScreenSample[3];
     Matrix matrix;
 
+    /*
+    * Obtain raw x,y data from ADS7846
+    *
+    * @param pointer to raw x and y coordinates (pointer to store data)
+    * @returns x (horizontal position)
+    * @returns y (vertical position)
+    *
+    */
     void TP_GetAdXY(int *x,int *y);
+    
+    /*
+    * Obtain raw single channel data from ADS7846 (Called by TP_GetADXY)
+    *
+    * @param channel to be read (CHX or CHY)
+    * @returns raw scaled down value (return value range must be between 0 and 1024)
+    *
+    */
     int Read_XY(unsigned char XY);
+    
+    /*
+    * Draw a calibration crosshair on the LCD screen
+    *
+    * @param x (horizontal position)
+    * @param y (vertical position)
+    *
+    */
     void DrawCross(unsigned int Xpos,unsigned int Ypos);
+    
+    /*
+    * Set the calibration matrix
+    *
+    * @param displayPTR (pointer to display data)
+    * @param screenPTR  (pointer to screen data)
+    * @param matrixPTR  (pointer to calibration matrix)
+    *
+    * @returns 0 when matrix.divider != 0
+    * @returns 1 when matrix.divider = 0
+    *
+    */
     unsigned char setCalibrationMatrix( Coordinate * displayPtr,Coordinate * screenPtr,Matrix * matrixPtr);
 
 };