[mipi_spi] Add LCDwiki ES3C35P model (ST77922 QSPI) (#19011)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
Jamie Meredith
2026-10-12 00:48:47 +00:00
committed by GitHub
co-authored by Claude Opus 5 J. Nick Koston J. Nick Koston
parent e50a0d902e
commit 59d31505e9
2 changed files with 109 additions and 0 deletions
@@ -8,8 +8,11 @@ from esphome.components.mipi import (
BRIGHTNESS,
CONF_INVERT_COLORS,
CONF_PIXEL_MODE,
SLPOUT,
SWRESET,
DriverChip,
)
from esphome.components.mipi_spi.display import MODELS
from esphome.const import CONF_BRIGHTNESS
# A minimal config with no reset pin: enough for get_sequence(add_madctl=False) to run
@@ -96,3 +99,23 @@ def test_get_sequence_omits_brightness_when_not_set() -> None:
sequence = chip.get_sequence(_BASE_CONFIG, add_madctl=False)
assert not any(_has_brightness_command(sequence, v) for v in range(256))
def _count_subsequence(sequence: tuple[int, ...], part: tuple[int, ...]) -> int:
return sum(
sequence[i : i + len(part)] == part
for i in range(len(sequence) - len(part) + 1)
)
def test_es3c35p_waits_after_reset_and_issues_its_own_slpout() -> None:
"""The ES3C35P settles 120ms after reset and sends SLPOUT itself with a 120ms wait."""
sequence = MODELS["ES3C35P"].get_sequence(
_BASE_CONFIG, add_madctl=False, add_reset=True
)
assert sequence[:4] == (SWRESET, 0, 120, 255)
# Exactly one SLPOUT, followed by the panel's 120ms settle, and none appended by the framework
assert _count_subsequence(sequence, (SLPOUT, 0, 120, 255)) == 1
assert _count_subsequence(sequence, (SLPOUT, 0, 10, 255)) == 0
assert "ES3C35P-NS" in MODELS