Forked from Peter Drescher lib, using always 16bit spi, init values for chinese red pcb, added read cmds and some mess here and there

Fork of SPI_TFT_ILI9341 by Peter Drescher

Revision:
8:a9d849c3dad0
Parent:
6:fe07ae8329f7
Child:
11:365aa15eaa0f
--- a/SPI_TFT_ILI9341.h	Sun Jan 26 20:54:21 2014 +0000
+++ b/SPI_TFT_ILI9341.h	Wed Apr 23 18:20:33 2014 +0000
@@ -272,12 +272,37 @@
   void set_orientation(unsigned int o);
   
   
-  /** read out the manufacturer ID of the LCD
+  /** read out the manufacturer ID1,ID2,ID3 of the LCD
    *  can used for checking the connection to the display
-   *  @returns ID
+   *  @returns ID123
    */ 
-  int Read_ID(void);
+  int Read_ID123(void);
+  
+  // ID4 is mfg id, 009341
+  int Read_ID4(void);
+  
+  // diff way to read ID4
+  int Read_ID4ext(void);
+  
+  // read display status, 00610000 at poweron
+  int Read_STS(void);
+  
   
+  /** Reset the ILI9341 controller 
+   *
+   */    
+  void tft_reset();
+  
+  /** Init the ILI9341 controller 
+   *
+   */    
+  void tft_init();
+  
+  /** Init the ILI9341 controller on chinese red pcb
+   *
+   */    
+  void tft_init_redPCB();
+  void tft_init_redPCBtm22();
   
     
   SPI _spi;
@@ -327,18 +352,18 @@
     
  
     
-  /** Init the ILI9341 controller 
-   *
-   */    
-  void tft_reset();
+  
     
    /** Write data to the LCD controller
    *
    * @param dat data written to LCD controller
    * 
    */   
-  //void wr_dat(unsigned int value);
-  void wr_dat(unsigned char value);
+  //void wr_8(unsigned int value);
+  void wr_8(unsigned char value);
+  
+  void wr_16(unsigned int value);
+  
     
   /** Write a command the LCD controller 
    *
@@ -370,10 +395,13 @@
    * @returns data from LCD controller
    *  
    */    
-   char rd_byte(unsigned char cmd);
+   char wr_cmd_rd8(unsigned char cmd);
     
+  int wr_cmd_rd24(unsigned char cmd);
+  int wr_cmd_rd32(unsigned char cmd);  
   
-  int rd_32(unsigned char cmd);  
+  // vendor custom cmd to access registers?!?!?
+  char Read_Register(char Addr, char xParameter);
     
     
   /** Write a value to the to a LCD register