Imayan chan / S6D0151

Dependents:   FRDM_tocos_x2_FIXED

Files at this revision

API Documentation at this revision

Comitter:
king33jp
Date:
Sun Aug 30 07:21:48 2015 +0000
Parent:
1:a3651128e297
Child:
3:f6feda54df80
Commit message:
added image reverse command

Changed in this revision

S6D0151_TFT.cpp Show annotated file Show diff for this revision Revisions of this file
S6D0151_TFT.h Show annotated file Show diff for this revision Revisions of this file
--- a/S6D0151_TFT.cpp	Wed Aug 26 14:58:55 2015 +0000
+++ b/S6D0151_TFT.cpp	Sun Aug 30 07:21:48 2015 +0000
@@ -68,9 +68,20 @@
     regwr( 0x0021 , addr );
 }
 
+void S6D0151_TFT::reverse(int rev){
+    if(rev == TFT_REVERSE_ON){
+        regwr(0x0007,0x0033); //DISPLAY CONTROL (R07h)
+    } else {
+        regwr(0x0007,0x0037); //DISPLAY CONTROL (R07h)
+    }
+    // X X X PT1 PT0 X X SPT X X GON DTE CL REV D1 D0
+    //GON=1,DTE=1 VGH/VGL Normal operation
+    //Rev bit mean Color reverse.
+    //REV=1 Displays all character and graphics display sections with Reverse
+    //D[1:0]=11 Display is RAM data
+}
 
 /**
-* 
 */
 void S6D0151_TFT::regwr(unsigned short reg,unsigned short dat){
     int data;
--- a/S6D0151_TFT.h	Wed Aug 26 14:58:55 2015 +0000
+++ b/S6D0151_TFT.h	Sun Aug 30 07:21:48 2015 +0000
@@ -31,6 +31,9 @@
 #define Orange          0xFD20      /* 255, 165,   0 */
 #define GreenYellow     0xAFE5      /* 173, 255,  47 */
 
+#define TFT_REVERSE_ON  0
+#define TFT_REVERSE_OFF 1
+
 class S6D0151_TFT : public GraphicsDisplay {
  public:
 
@@ -213,7 +216,13 @@
    *
    */  
   void set_orientation(unsigned int o);
-    
+  
+  /** set TFT display image reverse
+   * @param rev  TFT_REVERSE_ON , TFT_REVERSE_OFF
+   * for daylight,maybe you need reverse on.
+   */
+  void reverse(int rev);
+  
   SPI _spi;
   DigitalOut _cs;
   DigitalOut _reset;