You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
2f4adfcace
https://unphone.net/ What worked: - hx8357d Display and XPT2046 touch screen works - Turn display backlight on/off via TCA9555 chip - Buttons TODOs: - Use LEDs - LoRa - IR `.../lib/drivers/display/hx8357d/` is a not modified copy from https://github.com/lvgl-micropython/lvgl_micropython/tree/main/api_drivers/common_api_drivers/display/hx8357d `.../lib/drivers/indev/xpt2046.py` based on https://github.com/lvgl-micropython/lvgl_micropython/blob/main/api_drivers/common_api_drivers/indev/xpt2046.py but is modified: Because of the shared SPI bus for SPI for hx8357d display and xpt2046 touch controller. For this i add the management of `CS` pins for reading the touch controller. Let's discuss how to add this to upstream in https://github.com/lvgl-micropython/lvgl_micropython/issues/536
27 lines
798 B
Python
27 lines
798 B
Python
import sys
|
|
from . import hx8357d
|
|
from . import _hx8357d_init
|
|
|
|
# Register _hx8357d_init in sys.modules so __import__('_hx8357d_init') can find it
|
|
# This is needed because display_driver_framework.py uses __import__('_hx8357d_init')
|
|
# expecting a top-level module, but _hx8357d_init is in the hx8357d package subdirectory
|
|
sys.modules['_hx8357d_init'] = _hx8357d_init
|
|
|
|
# Explicitly define __all__ and re-export public symbols from hx8357d module
|
|
__all__ = [
|
|
'HX8357D',
|
|
'STATE_HIGH',
|
|
'STATE_LOW',
|
|
'STATE_PWM',
|
|
'BYTE_ORDER_RGB',
|
|
'BYTE_ORDER_BGR',
|
|
]
|
|
|
|
# Re-export the public symbols
|
|
HX8357D = hx8357d.HX8357D
|
|
STATE_HIGH = hx8357d.STATE_HIGH
|
|
STATE_LOW = hx8357d.STATE_LOW
|
|
STATE_PWM = hx8357d.STATE_PWM
|
|
BYTE_ORDER_RGB = hx8357d.BYTE_ORDER_RGB
|
|
BYTE_ORDER_BGR = hx8357d.BYTE_ORDER_BGR
|