diff --git a/esphome/components/mipi/__init__.py b/esphome/components/mipi/__init__.py index b9299bb8d7..f610f160b0 100644 --- a/esphome/components/mipi/__init__.py +++ b/esphome/components/mipi/__init__.py @@ -77,6 +77,7 @@ BRIGHTNESS = 0x51 WRDISBV = 0x51 RDDISBV = 0x52 WRCTRLD = 0x53 +WCE = 0x58 SWIRE1 = 0x5A SWIRE2 = 0x5B IFMODE = 0xB0 @@ -91,6 +92,7 @@ PWCTR2 = 0xC1 PWCTR3 = 0xC2 PWCTR4 = 0xC3 PWCTR5 = 0xC4 +SPIMODESEL = 0xC4 VMCTR1 = 0xC5 IFCTR = 0xC6 VMCTR2 = 0xC7 diff --git a/esphome/components/mipi_spi/models/amoled.py b/esphome/components/mipi_spi/models/amoled.py index 6fe882b584..bc95fc7f71 100644 --- a/esphome/components/mipi_spi/models/amoled.py +++ b/esphome/components/mipi_spi/models/amoled.py @@ -5,10 +5,13 @@ from esphome.components.mipi import ( PAGESEL, PIXFMT, SLPOUT, + SPIMODESEL, SWIRE1, SWIRE2, TEON, + WCE, WRAM, + WRCTRLD, DriverChip, delay, ) @@ -87,4 +90,19 @@ T4_S3_AMOLED = RM690B0.extend( bus_mode=TYPE_QUAD, ) +CO5300 = DriverChip( + "CO5300", + brightness=0xD0, + color_order=MODE_RGB, + bus_mode=TYPE_QUAD, + initsequence=( + (SLPOUT,), # Requires early SLPOUT + (PAGESEL, 0x00), + (SPIMODESEL, 0x80), + (WRCTRLD, 0x20), + (WCE, 0x00), + ), +) + + models = {} diff --git a/esphome/components/mipi_spi/models/waveshare.py b/esphome/components/mipi_spi/models/waveshare.py index 002f81f3a6..7a55027e58 100644 --- a/esphome/components/mipi_spi/models/waveshare.py +++ b/esphome/components/mipi_spi/models/waveshare.py @@ -1,6 +1,7 @@ from esphome.components.mipi import DriverChip import esphome.config_validation as cv +from .amoled import CO5300 from .ili import ILI9488_A DriverChip( @@ -140,3 +141,14 @@ ILI9488_A.extend( data_rate="20MHz", invert_colors=True, ) + +CO5300.extend( + "WAVESHARE-ESP32-S3-TOUCH-AMOLED-1.75", + width=466, + height=466, + pixel_mode="16bit", + offset_height=0, + offset_width=6, + cs_pin=12, + reset_pin=39, +)