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 |
RM68120_Rotation.h (766B)
1 2 // This is the command sequence that rotates the RM68120 driver coordinate frame 3 4 rotation = m % 4; // Limit the range of values to 0-3 5 uint8_t reg = 0; 6 7 switch (rotation) { 8 case 0: 9 reg = TFT_MAD_COLOR_ORDER; 10 _width = _init_width; 11 _height = _init_height; 12 break; 13 case 1: 14 reg = TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_COLOR_ORDER; 15 _width = _init_height; 16 _height = _init_width; 17 break; 18 case 2: 19 reg = TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER; 20 _width = _init_width; 21 _height = _init_height; 22 break; 23 case 3: 24 reg = TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER; 25 _width = _init_height; 26 _height = _init_width; 27 break; 28 } 29 writeRegister16(TFT_MADCTL, reg);