mirror of
https://github.com/esphome/esphome.git
synced 2025-10-01 01:22:20 +01:00
[mipi_spi] Fix t-display-amoled (#10922)
This commit is contained in:
committed by
Jesse Hills
parent
127058e700
commit
345fc0b6ca
@@ -401,6 +401,12 @@ class DriverChip:
|
|||||||
sequence.append((MADCTL, madctl))
|
sequence.append((MADCTL, madctl))
|
||||||
return 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]:
|
def get_sequence(self, config) -> tuple[tuple[int, ...], int]:
|
||||||
"""
|
"""
|
||||||
Create the init sequence for the display.
|
Create the init sequence for the display.
|
||||||
@@ -432,7 +438,9 @@ class DriverChip:
|
|||||||
sequence.append((INVOFF,))
|
sequence.append((INVOFF,))
|
||||||
if brightness := config.get(CONF_BRIGHTNESS, self.get_default(CONF_BRIGHTNESS)):
|
if brightness := config.get(CONF_BRIGHTNESS, self.get_default(CONF_BRIGHTNESS)):
|
||||||
sequence.append((BRIGHTNESS, 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,))
|
sequence.append((DISPON,))
|
||||||
|
|
||||||
# Flatten the sequence into a list of bytes, with the length of each command
|
# Flatten the sequence into a list of bytes, with the length of each command
|
||||||
|
@@ -27,7 +27,8 @@ DriverChip(
|
|||||||
bus_mode=TYPE_QUAD,
|
bus_mode=TYPE_QUAD,
|
||||||
brightness=0xD0,
|
brightness=0xD0,
|
||||||
color_order=MODE_RGB,
|
color_order=MODE_RGB,
|
||||||
initsequence=(SLPOUT,), # Requires early SLPOUT
|
no_slpout=True, # SLPOUT is in the init sequence, early
|
||||||
|
initsequence=(SLPOUT,),
|
||||||
)
|
)
|
||||||
|
|
||||||
DriverChip(
|
DriverChip(
|
||||||
@@ -95,6 +96,7 @@ CO5300 = DriverChip(
|
|||||||
brightness=0xD0,
|
brightness=0xD0,
|
||||||
color_order=MODE_RGB,
|
color_order=MODE_RGB,
|
||||||
bus_mode=TYPE_QUAD,
|
bus_mode=TYPE_QUAD,
|
||||||
|
no_slpout=True,
|
||||||
initsequence=(
|
initsequence=(
|
||||||
(SLPOUT,), # Requires early SLPOUT
|
(SLPOUT,), # Requires early SLPOUT
|
||||||
(PAGESEL, 0x00),
|
(PAGESEL, 0x00),
|
||||||
|
Reference in New Issue
Block a user