ili9341: add EnableTEOutput to be able to sync drawing with VSYNC

Many displays don't have the TE pin exposed. But those that do have the
pin (for example, the PyPortal) can use it to synchronize writing a new
image to the display. When implemented correctly, tearing can be avoided
entirely.

This commit also changes the LCD refresh direction to either
top-to-bottom or left-to-right depending on the rotation. Previously it
might refresh from right-to-left or bottom-to-top. This has little
impact on code that doesn't use the TE line, but code that does now only
needs to worry about two cases (top-to-bottom and left-to-right) instead
of four.
(Unfortunately, it appears that the hardware doesn't support changing
the major LCD refresh order so code that wants to do tear-free rendering
still needs to care about these two cases).
This commit is contained in:
Ayke van Laethem
2023-04-12 20:26:18 +02:00
committed by Ron Evans
parent 184dff93b1
commit deca190ba2
2 changed files with 19 additions and 5 deletions
+2
View File
@@ -41,6 +41,8 @@ const (
PTLAR = 0x30 ///< Partial Area
VSCRDEF = 0x33 ///< Vertical Scrolling Definition
TEOFF = 0x34 ///< TEOFF: Tearing Effect Line OFF
TEON = 0x35 ///< TEON: Tearing Effect Line ON
MADCTL = 0x36 ///< Memory Access Control
VSCRSADD = 0x37 ///< Vertical Scrolling Start Address
PIXFMT = 0x3A ///< COLMOD: Pixel Format Set