You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
751 B

9 months ago
  1. // This is the command sequence that rotates the ILI9481 driver coordinate frame
  2. writecommand(TFT_MADCTL);
  3. rotation = m % 4;
  4. switch (rotation) {
  5. case 0: // Portrait
  6. writedata(TFT_MAD_BGR | TFT_MAD_SS);
  7. _width = TFT_WIDTH;
  8. _height = TFT_HEIGHT;
  9. break;
  10. case 1: // Landscape (Portrait + 90)
  11. writedata(TFT_MAD_MV | TFT_MAD_BGR);
  12. _width = TFT_HEIGHT;
  13. _height = TFT_WIDTH;
  14. break;
  15. case 2: // Inverter portrait
  16. writedata(TFT_MAD_BGR | TFT_MAD_GS);
  17. _width = TFT_WIDTH;
  18. _height = TFT_HEIGHT;
  19. break;
  20. case 3: // Inverted landscape
  21. writedata(TFT_MAD_MV | TFT_MAD_BGR | TFT_MAD_SS | TFT_MAD_GS);
  22. _width = TFT_HEIGHT;
  23. _height = TFT_WIDTH;
  24. break;
  25. }