Library to control a QVGA TFT connected to SPI. You can use printf to print text The lib can handle different fonts, draw lines, circles, rect and bmp

Revision:
12:b2dd49f04d5d
Parent:
8:e1f5232d93a0
Child:
13:d525819cb601
--- a/SPI_TFT.h	Sun Jan 01 23:38:13 2012 +0000
+++ b/SPI_TFT.h	Sat Apr 07 16:05:39 2012 +0000
@@ -51,6 +51,17 @@
 #define GreenYellow     0xAFE5      /* 173, 255,  47 */
 
 
+// some defines for the DMA use
+#define DMA_CHANNEL_ENABLE      1
+#define DMA_TRANSFER_TYPE_M2P   (1UL << 11)   
+#define DMA_CHANNEL_TCIE        (1UL << 31)
+#define DMA_CHANNEL_SRC_INC     (1UL << 26)
+#define DMA_MASK_IE             (1UL << 14)
+#define DMA_MASK_ITC            (1UL << 15)
+#define DMA_SSP1_TX             (1UL << 2)
+#define DMA_SSP0_TX             (0) 
+
+
 /** Display control class, based on GraphicsDisplay and TextDisplay
  *
  * Example:
@@ -118,7 +129,7 @@
    * @param y vertical position
    * @param color 16 bit pixel color
    */    
-  virtual void pixel(int x, int y, int colour);
+  virtual void pixel(int x, int y,int colour);
     
   /** draw a circle
    *
@@ -280,7 +291,7 @@
   void set_orientation(unsigned int o);
     
   SPI _spi;
-  DigitalOut _cs;
+  // DigitalOut _cs; we use SSEL0/1
   DigitalOut _reset;
   unsigned char* font;
   
@@ -335,24 +346,25 @@
    * @param dat data written to LCD controller
    * 
    */   
-  void wr_dat(int value);
+  //void wr_dat(unsigned int value);
+  void wr_dat(unsigned char value);
     
   /** Write a command the LCD controller 
    *
    * @param cmd: command to be written   
    *
    */   
-  void wr_cmd(int value);
+  void wr_cmd(unsigned char value);
     
    /** Start data sequence to the LCD controller
    * 
    */   
-  void wr_dat_start();
+  //void wr_dat_start();
     
   /** Stop of data writing to the LCD controller
    *   
    */  
-  void wr_dat_stop();
+  //void wr_dat_stop();
     
   /** write data to the LCD controller
    *
@@ -373,7 +385,7 @@
    * @param reg register to be written
    * @param val data to be written
    */   
-  void wr_reg (unsigned char reg, unsigned short val);
+  void wr_reg (unsigned char reg, unsigned char val);
     
   /** Read a LCD register
    *
@@ -382,6 +394,7 @@
    */    
   unsigned short rd_reg (unsigned char reg);
     
+  unsigned char spi_port; 
   unsigned int orientation;
   unsigned int char_x;
   unsigned int char_y;