mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-04 05:04:42 +02:00
Merge branch 'master' of https://github.com/Bodmer/TFT_eSPI
This commit is contained in:
@@ -1,47 +1,26 @@
|
|||||||
// This is the command sequence that rotates the HX8357D driver coordinate frame
|
// This is the command sequence that rotates the HX8357D driver coordinate frame
|
||||||
|
|
||||||
writecommand(TFT_MADCTL);
|
writecommand(TFT_MADCTL);
|
||||||
rotation = m % 8;
|
rotation = m % 4;
|
||||||
switch (rotation)
|
switch (rotation) {
|
||||||
{
|
|
||||||
case 0: // Portrait
|
case 0: // Portrait
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MX);
|
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB);
|
||||||
_width = _init_width;
|
_width = TFT_WIDTH;
|
||||||
_height = _init_height;
|
_height = TFT_HEIGHT;
|
||||||
break;
|
break;
|
||||||
case 1: // Landscape (Portrait + 90)
|
case 1: // Landscape (Portrait + 90)
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MV);
|
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB);
|
||||||
_width = _init_height;
|
_width = TFT_HEIGHT;
|
||||||
_height = _init_width;
|
_height = TFT_WIDTH;
|
||||||
break;
|
break;
|
||||||
case 2: // Inverter portrait
|
case 2: // Inverter portrait
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MY);
|
writedata(TFT_MAD_RGB);
|
||||||
_width = _init_width;
|
_width = TFT_WIDTH;
|
||||||
_height = _init_height;
|
_height = TFT_HEIGHT;
|
||||||
break;
|
break;
|
||||||
case 3: // Inverted landscape
|
case 3: // Inverted landscape
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY);
|
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB);
|
||||||
_width = _init_height;
|
_width = TFT_HEIGHT;
|
||||||
_height = _init_width;
|
_height = TFT_WIDTH;
|
||||||
break;
|
|
||||||
case 4: // Portrait
|
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MX | TFT_MAD_MY);
|
|
||||||
_width = _init_width;
|
|
||||||
_height = _init_height;
|
|
||||||
break;
|
|
||||||
case 5: // Landscape (Portrait + 90)
|
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX);
|
|
||||||
_width = _init_height;
|
|
||||||
_height = _init_width;
|
|
||||||
break;
|
|
||||||
case 6: // Inverter portrait
|
|
||||||
writedata(TFT_MAD_BGR);
|
|
||||||
_width = _init_width;
|
|
||||||
_height = _init_height;
|
|
||||||
break;
|
|
||||||
case 7: // Inverted landscape
|
|
||||||
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MY);
|
|
||||||
_width = _init_height;
|
|
||||||
_height = _init_width;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user