Compare commits

...
Author SHA1 Message Date
Jesse Hills 625d81cb39 [mipi_spi] Add generic SPD2010 model and SenseCAP Watcher board
Split the SPD2010 panel settings into a generic SPD2010 model so boards
using the panel only set their own pins. The Waveshare board keeps its
expander reset, and the Seeed SenseCAP Watcher uses CS on GPIO45 with a
software reset.
2026-10-22 16:30:44 +13:00
3 changed files with 48 additions and 5 deletions

No files matched your search

+15 -5
View File
@@ -8,21 +8,18 @@ from esphome.components.spi import TYPE_QUAD
from esphome.const import CONF_MIRROR_X, CONF_MIRROR_Y
# fmt: off
DriverChip(
"WAVESHARE-ESP32-S3-TOUCH-LCD-1.46",
SPD2010 = DriverChip(
"SPD2010",
width=412,
height=412,
bus_mode=TYPE_QUAD,
spi_mode="MODE0",
data_rate="40MHz",
cs_pin=21,
reset_pin={"pca9554": None, "number": 1},
color_order=MODE_RGB,
draw_rounding=4,
transforms={CONF_MIRROR_X, CONF_MIRROR_Y},
use_axis_flips=True,
reset_delay=20,
requires={"pca9554"},
initsequence=(
delay(100),
(0xFF, 0x20, 0x10, 0x10),
@@ -416,3 +413,16 @@ DriverChip(
),
)
# fmt: on
SPD2010.extend(
"WAVESHARE-ESP32-S3-TOUCH-LCD-1.46",
cs_pin=21,
reset_pin={"pca9554": None, "number": 1},
requires={"pca9554"},
)
# The panel reset is wired to the chip reset, so only the software reset is available.
SPD2010.extend(
"SEEED-SENSECAP-WATCHER",
cs_pin={"number": 45, "ignore_strapping_warning": True},
)
@@ -0,0 +1,16 @@
esphome:
name: sensecap-watcher
esp32:
variant: esp32s3
framework:
type: esp-idf
spi:
type: quad
clk_pin: 7
data_pins: [9, 1, 14, 13]
display:
- platform: mipi_spi
model: SEEED-SENSECAP-WATCHER
@@ -414,6 +414,23 @@ def test_spd2010_expander_default_generation(
assert "mipi_spi_mipispi_id->set_reset_pin(pca9554_pca9554gpiopin_id);" in main_cpp
def test_sensecap_watcher_generation(
generate_main: Callable[[str | Path], str],
component_fixture_path: Callable[[str], Path],
) -> None:
"""The Watcher model needs no expander, sets CS 45 and resets by software."""
main_cpp = generate_main(component_fixture_path("spd2010_sensecap_watcher.yaml"))
assert "pca9554" not in main_cpp
assert "set_reset_pin" not in main_cpp
assert "set_pin(::GPIO_NUM_45);" in main_cpp
assert (
"mipi_spi_mipispi_id->set_cs_pin(esp32_esp32internalgpiopin_id_2);" in main_cpp
)
# SWRESET ({1, 0}) is prepended because there is no reset pin.
assert _init_sequence(main_cpp).startswith("{1, 0, 20, 255,")
def test_spd2010_default_reset_requires_expander() -> None:
"""A registered pin schema alone cannot satisfy the default expander reference."""
result = validate_config(