mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2026-03-13 09:30:32 +08:00
Update ILI9488_Rotation.h (#3814)
Add support for mirrored rotation (4-7) in ILI9488 driver. To allow mirroring to be corrected in some rogue ILI9488 boards. Use rotation 4 to 7 instead of 0 to 3.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// This is the command sequence that rotates the ILI9488 driver coordinate frame
|
||||
|
||||
writecommand(TFT_MADCTL);
|
||||
rotation = m % 4;
|
||||
rotation = m % 8;
|
||||
switch (rotation) {
|
||||
case 0: // Portrait
|
||||
writedata(TFT_MAD_MX | TFT_MAD_BGR);
|
||||
@@ -23,5 +23,25 @@
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
case 4: // Portrait mirrored
|
||||
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_BGR);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 5: // Landscape (Portrait + 90) mirrored
|
||||
writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_BGR);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
case 6: // Inverter portrait mirrored
|
||||
writedata(TFT_MAD_BGR);
|
||||
_width = TFT_WIDTH;
|
||||
_height = TFT_HEIGHT;
|
||||
break;
|
||||
case 7: // Inverted landscape mirrored
|
||||
writedata(TFT_MAD_MY | TFT_MAD_MV | TFT_MAD_BGR);
|
||||
_width = TFT_HEIGHT;
|
||||
_height = TFT_WIDTH;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user