Skip to content

Commit 76020bc

Browse files
committed
define ili9xxx rotations in terms of st77xx
1 parent 591e390 commit 76020bc

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

driver/generic/ili9xxx-test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import time
2+
13
from machine import SPI, Pin
24

35
from ili9xxx import Ili9341_hw

driver/generic/ili9xxx.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"""
1111
from micropython import const
1212

13-
from st77xx import St77xx_hw, St77xx_lvgl
13+
import st77xx
1414

1515
# Command constants from ILI9341 datasheet
1616
_NOP = const(0x00) # No-op
@@ -87,13 +87,13 @@
8787
const(_MADCTL_MX | _MADCTL_MY | _MADCTL_MV), # 3 = inverted landscape
8888
)
8989

90-
ILI9XXX_PORTRAIT = const(0)
91-
ILI9XXX_LANDSCAPE = const(1)
92-
ILI9XXX_INV_PORTRAIT = const(2)
93-
ILI9XXX_INV_LANDSCAPE = const(3)
90+
ILI9XXX_PORTRAIT = st77xx.ST77XX_PORTRAIT
91+
ILI9XXX_LANDSCAPE = st77xx.ST77XX_LANDSCAPE
92+
ILI9XXX_INV_PORTRAIT = st77xx.ST77XX_INV_PORTRAIT
93+
ILI9XXX_INV_LANDSCAPE = st77xx.ST77XX_INV_LANDSCAPE
9494

9595

96-
class Ili9341_hw(St77xx_hw):
96+
class Ili9341_hw(st77xx.St77xx_hw):
9797
def __init__(self, **kw):
9898
"""ILI9341 TFT Display Driver.
9999
@@ -156,12 +156,12 @@ def apply_rotation(self, rot):
156156
)
157157

158158

159-
class Ili9341(Ili9341_hw, St77xx_lvgl):
159+
class Ili9341(Ili9341_hw, st77xx.St77xx_lvgl):
160160
def __init__(self, doublebuffer=True, factor=4, **kw):
161161
"""See :obj:`Ili9341_hw` for the meaning of the parameters."""
162162
import lvgl as lv
163163

164164
Ili9341_hw.__init__(self, **kw)
165-
St77xx_lvgl.__init__(self, doublebuffer, factor)
165+
st77xx.St77xx_lvgl.__init__(self, doublebuffer, factor)
166166
self.disp_drv.color_format = lv.COLOR_FORMAT.NATIVE_REVERSE
167167
self.disp_drv.register()

0 commit comments

Comments
 (0)