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:
Sebastian Lang
2026-02-13 01:33:50 +01:00
committed by GitHub
parent 9a532ca817
commit 57cc6b208c

View File

@@ -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;
}