acidportal

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

ILI9163_Rotation.h (1002B)

      1 
      2 // This is the command sequence that rotates the ILI9163 driver coordinate frame
      3 
      4   rotation = m % 4;
      5 
      6   writecommand(TFT_MADCTL);
      7   switch (rotation) {
      8     case 0:
      9       writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
     10       _width  = _init_width;
     11       _height = _init_height;
     12 	  #ifdef CGRAM_OFFSET
     13         colstart = 0;
     14         rowstart = 0;
     15 	  #endif
     16       break;
     17     case 1:
     18       writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR);
     19       _width  = _init_height;
     20       _height = _init_width;
     21 	  #ifdef CGRAM_OFFSET
     22         colstart = 0;
     23         rowstart = 0;
     24 	  #endif
     25       break;
     26     case 2:
     27       writedata(TFT_MAD_BGR);
     28       _width  = _init_width;
     29       _height = _init_height;
     30 	  #ifdef CGRAM_OFFSET
     31         colstart = 0;
     32         rowstart = 32;
     33 	  #endif
     34       break;
     35     case 3:
     36       writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR);
     37       _width  = _init_height;
     38       _height = _init_width;
     39 	  #ifdef CGRAM_OFFSET
     40         colstart = 32;
     41         rowstart = 0;
     42 	  #endif
     43       break;
     44   }