1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-01 09:32:21 +01:00

[mipi_spi] Fix t-display-amoled (#10922)

This commit is contained in:
Clyde Stubbs
2025-09-29 09:12:06 +10:00
committed by Jesse Hills
parent 127058e700
commit 345fc0b6ca
2 changed files with 12 additions and 2 deletions

View File

@@ -401,6 +401,12 @@ class DriverChip:
sequence.append((MADCTL, madctl))
return madctl
def skip_command(self, command: str):
"""
Allow suppressing a standard command in the init sequence.
"""
return self.get_default(f"no_{command.lower()}", False)
def get_sequence(self, config) -> tuple[tuple[int, ...], int]:
"""
Create the init sequence for the display.
@@ -432,7 +438,9 @@ class DriverChip:
sequence.append((INVOFF,))
if brightness := config.get(CONF_BRIGHTNESS, self.get_default(CONF_BRIGHTNESS)):
sequence.append((BRIGHTNESS, brightness))
sequence.append((SLPOUT,))
# Add a SLPOUT command if required.
if not self.skip_command("SLPOUT"):
sequence.append((SLPOUT,))
sequence.append((DISPON,))
# Flatten the sequence into a list of bytes, with the length of each command

View File

@@ -27,7 +27,8 @@ DriverChip(
bus_mode=TYPE_QUAD,
brightness=0xD0,
color_order=MODE_RGB,
initsequence=(SLPOUT,), # Requires early SLPOUT
no_slpout=True, # SLPOUT is in the init sequence, early
initsequence=(SLPOUT,),
)
DriverChip(
@@ -95,6 +96,7 @@ CO5300 = DriverChip(
brightness=0xD0,
color_order=MODE_RGB,
bus_mode=TYPE_QUAD,
no_slpout=True,
initsequence=(
(SLPOUT,), # Requires early SLPOUT
(PAGESEL, 0x00),