refactor: extract shared panel.yaml (RGB panel, touch, IO expander) from display.yaml
This commit is contained in:
parent
976410e0b0
commit
2097779949
3 changed files with 40 additions and 40 deletions
|
|
@ -1,43 +1,3 @@
|
|||
i2c:
|
||||
- id: i2c_bus
|
||||
sda: GPIO8
|
||||
scl: GPIO9
|
||||
scan: true
|
||||
|
||||
ch422g:
|
||||
- id: io_expander
|
||||
i2c_id: i2c_bus
|
||||
|
||||
touchscreen:
|
||||
- platform: gt911
|
||||
id: touch_gt911
|
||||
i2c_id: i2c_bus
|
||||
address: 0x5D # confirmed via Waveshare's documented I2C address map
|
||||
interrupt_pin: GPIO4
|
||||
reset_pin:
|
||||
ch422g: io_expander
|
||||
number: 1 # EXIO1 = TP_RST, per Waveshare pinout
|
||||
display: lcd_display
|
||||
|
||||
display:
|
||||
- platform: mipi_rgb
|
||||
id: lcd_display
|
||||
model: WAVESHARE-5-1024X600 # ESPHome's closest built-in preset: same ST7701 chip, data pins,
|
||||
# and CH422G reset/enable wiring as this board's 1024x600 panel
|
||||
dimensions:
|
||||
width: 1024
|
||||
height: 600
|
||||
pad_width: 0 # the preset's default width/height (1024x600) don't match its inherited
|
||||
pad_height: 0 # native_width/native_height (800x480 from the base 4.3" model), which makes
|
||||
# ESPHome's offset math go negative unless pad is forced explicitly here
|
||||
enable_pin:
|
||||
- ch422g: io_expander
|
||||
number: 2 # EXIO2 = DISP (backlight enable) — inherited from the base preset
|
||||
- ch422g: io_expander
|
||||
number: 6 # EXIO6 = LCD_VDD_EN (VCOM enable) — the built-in preset doesn't set
|
||||
# this, but the Waveshare wiki confirms VCOM must be driven high on
|
||||
# this board or the panel won't display correctly. Added explicitly.
|
||||
|
||||
lvgl:
|
||||
id: lvgl_comp
|
||||
displays:
|
||||
|
|
|
|||
39
firmware/components/panel.yaml
Normal file
39
firmware/components/panel.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
i2c:
|
||||
- id: i2c_bus
|
||||
sda: GPIO8
|
||||
scl: GPIO9
|
||||
scan: true
|
||||
|
||||
ch422g:
|
||||
- id: io_expander
|
||||
i2c_id: i2c_bus
|
||||
|
||||
touchscreen:
|
||||
- platform: gt911
|
||||
id: touch_gt911
|
||||
i2c_id: i2c_bus
|
||||
address: 0x5D # confirmed via Waveshare's documented I2C address map
|
||||
interrupt_pin: GPIO4
|
||||
reset_pin:
|
||||
ch422g: io_expander
|
||||
number: 1 # EXIO1 = TP_RST, per Waveshare pinout
|
||||
display: lcd_display
|
||||
|
||||
display:
|
||||
- platform: mipi_rgb
|
||||
id: lcd_display
|
||||
model: WAVESHARE-5-1024X600 # ESPHome's closest built-in preset: same ST7701 chip, data pins,
|
||||
# and CH422G reset/enable wiring as this board's 1024x600 panel
|
||||
dimensions:
|
||||
width: 1024
|
||||
height: 600
|
||||
pad_width: 0 # the preset's default width/height (1024x600) don't match its inherited
|
||||
pad_height: 0 # native_width/native_height (800x480 from the base 4.3" model), which makes
|
||||
# ESPHome's offset math go negative unless pad is forced explicitly here
|
||||
enable_pin:
|
||||
- ch422g: io_expander
|
||||
number: 2 # EXIO2 = DISP (backlight enable) — inherited from the base preset
|
||||
- ch422g: io_expander
|
||||
number: 6 # EXIO6 = LCD_VDD_EN (VCOM enable) — the built-in preset doesn't set
|
||||
# this, but the Waveshare wiki confirms VCOM must be driven high on
|
||||
# this board or the panel won't display correctly. Added explicitly.
|
||||
|
|
@ -44,6 +44,7 @@ logger:
|
|||
# a different physical port, which is why logs went silent
|
||||
|
||||
packages:
|
||||
panel: !include components/panel.yaml
|
||||
display: !include components/display.yaml
|
||||
sensors: !include components/sensors.yaml
|
||||
relays: !include components/relays.yaml
|
||||
|
|
|
|||
Loading…
Reference in a new issue