Fix st7789

This commit is contained in:
Thomas Farstrike
2026-02-13 21:54:59 +01:00
parent 2dfcd1ed84
commit 821073b5be
2 changed files with 19 additions and 10 deletions
@@ -1,8 +1,26 @@
import sys
from .st7789 import *
from . import st7789
from . import _st7789_init
# Register _st7789_init in sys.modules so __import__('_st7789_init') can find it
# This is needed because display_driver_framework.py uses __import__('_st7789_init')
# expecting a top-level module, but _st7789_init is in the st7789 package subdirectory
sys.modules['_st7789_init'] = _st7789_init
# Explicitly define __all__ and re-export public symbols from st7789 module
__all__ = [
'ST7789',
'STATE_HIGH',
'STATE_LOW',
'STATE_PWM',
'BYTE_ORDER_RGB',
'BYTE_ORDER_BGR',
]
# Re-export the public symbols
ST7789 = st7789.ST7789
STATE_HIGH = st7789.STATE_HIGH
STATE_LOW = st7789.STATE_LOW
STATE_PWM = st7789.STATE_PWM
BYTE_ORDER_RGB = st7789.BYTE_ORDER_RGB
BYTE_ORDER_BGR = st7789.BYTE_ORDER_BGR
@@ -13,15 +13,6 @@ STATE_PWM = display_driver_framework.STATE_PWM
BYTE_ORDER_RGB = display_driver_framework.BYTE_ORDER_RGB
BYTE_ORDER_BGR = display_driver_framework.BYTE_ORDER_BGR
__all__ = [
'ST7789',
'STATE_HIGH',
'STATE_LOW',
'STATE_PWM',
'BYTE_ORDER_RGB',
'BYTE_ORDER_BGR',
]
_MADCTL_MV = const(0x20) # 0=Normal, 1=Row/column exchange
_MADCTL_MX = const(0x40) # 0=Left to Right, 1=Right to Left
_MADCTL_MY = const(0x80) # 0=Top to Bottom, 1=Bottom to Top