Commit ec504067 authored by Bodmer's avatar Bodmer

Merge branch 'master' of https://github.com/Bodmer/TFT_eSPI

parents b6708b65 d50b7f6c
// 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_MX | TFT_MAD_MY | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MX); _width = TFT_WIDTH;
_width = _init_width; _height = TFT_HEIGHT;
_height = _init_height; break;
break; case 1: // Landscape (Portrait + 90)
case 1: // Landscape (Portrait + 90) writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MV); _width = TFT_HEIGHT;
_width = _init_height; _height = TFT_WIDTH;
_height = _init_width; break;
break; case 2: // Inverter portrait
case 2: // Inverter portrait writedata(TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MY); _width = TFT_WIDTH;
_width = _init_width; _height = TFT_HEIGHT;
_height = _init_height; break;
break; case 3: // Inverted landscape
case 3: // Inverted landscape writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_RGB);
writedata(TFT_MAD_BGR | TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY); _width = TFT_HEIGHT;
_width = _init_height; _height = TFT_WIDTH;
_height = _init_width; break;
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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment