acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

RM68140_Rotation.h (1053B)

      1   // This is the command sequence that rotates the RM68140 driver coordinate frame
      2 
      3 
      4   writecommand(TFT_MADCTL);
      5   rotation = m % 4;
      6   switch (rotation) {
      7    case 0: // Portrait
      8      writedata(TFT_MAD_BGR);
      9      writecommand(0xB6);
     10      writedata(0);
     11      writedata(0x22);
     12      writedata(0x3B);
     13       _width  = TFT_WIDTH;
     14       _height = TFT_HEIGHT;
     15      break;
     16    case 1: // Landscape (Portrait + 90)
     17      writedata(TFT_MAD_MV | TFT_MAD_BGR);
     18      writecommand(0xB6);
     19      writedata(0);
     20      writedata(0x02);
     21      writedata(0x3B);
     22       _width  = TFT_HEIGHT;
     23       _height = TFT_WIDTH;
     24      break;
     25    case 2: // Inverter portrait
     26      writedata(TFT_MAD_BGR);
     27      writecommand(0xB6);
     28      writedata(0);
     29      writedata(0x42);
     30      writedata(0x3B);
     31       _width  = TFT_WIDTH;
     32       _height = TFT_HEIGHT;
     33      break;
     34    case 3: // Inverted landscape
     35      writedata(TFT_MAD_MV | TFT_MAD_BGR);
     36      writecommand(0xB6);
     37      writedata(0);
     38      writedata(0x62);
     39      writedata(0x3B);
     40       _width  = TFT_HEIGHT;
     41       _height = TFT_WIDTH;
     42      break;
     43   }
     44