acidportal

- 😈 Worlds smallest Evil Portal on a LilyGo T-QT
git clone git://git.acid.vegas/acidportal.git
Log | Files | Refs | Archive | README | LICENSE

GC9A01_Rotation.h (1279B)

      1 
      2 // This is the command sequence that rotates the GC9A01 driver coordinate frame
      3 
      4   rotation = m % 4;
      5 
      6   writecommand(TFT_MADCTL);
      7   switch (rotation) {
      8     case 0: // Portrait
      9       writedata(TFT_MAD_COLOR_ORDER);
     10       _width  = _init_width;
     11       _height = _init_height;
     12 #ifdef CGRAM_OFFSET
     13       if (_init_width == 128)
     14       {
     15         colstart = 2;
     16         rowstart = 1;
     17       }
     18 #endif    
     19       break;
     20     case 1: // Landscape (Portrait + 90)
     21       writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
     22       _width  = _init_height;
     23       _height = _init_width;
     24 #ifdef CGRAM_OFFSET
     25       if (_init_width == 128)
     26       {
     27         colstart = 1;
     28         rowstart = 2;
     29       }
     30 #endif
     31       break;
     32     case 2: // Inverter portrait
     33       writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
     34       _width  = _init_width;
     35       _height = _init_height;
     36 #ifdef CGRAM_OFFSET
     37       if (_init_width == 128)
     38       {
     39         colstart = 2;
     40         rowstart = 1;
     41       }
     42 #endif
     43       break;
     44     case 3: // Inverted landscape
     45       writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
     46       _width  = _init_height;
     47       _height = _init_width;
     48 #ifdef CGRAM_OFFSET
     49       if (_init_width == 128)
     50       {
     51         colstart = 1;
     52         rowstart = 2;
     53       }
     54 #endif
     55       break;
     56   }