From 2dfcd1ed841fb32f4bc31bd27d6fec09a408b369 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Fri, 13 Feb 2026 21:44:06 +0100 Subject: [PATCH] Fix st7789 --- .../lib/drivers/display/st7789/__init__.py | 8 ++++++++ internal_filesystem/lib/drivers/display/st7789/st7789.py | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 internal_filesystem/lib/drivers/display/st7789/__init__.py diff --git a/internal_filesystem/lib/drivers/display/st7789/__init__.py b/internal_filesystem/lib/drivers/display/st7789/__init__.py new file mode 100644 index 00000000..7c336086 --- /dev/null +++ b/internal_filesystem/lib/drivers/display/st7789/__init__.py @@ -0,0 +1,8 @@ +import sys +from .st7789 import * +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 diff --git a/internal_filesystem/lib/drivers/display/st7789/st7789.py b/internal_filesystem/lib/drivers/display/st7789/st7789.py index 26b9b3a5..7287d238 100644 --- a/internal_filesystem/lib/drivers/display/st7789/st7789.py +++ b/internal_filesystem/lib/drivers/display/st7789/st7789.py @@ -13,6 +13,15 @@ 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