66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
---
|
|
light:
|
|
# Backlight
|
|
- platform: monochromatic
|
|
output: backlight_output
|
|
name: Backlight
|
|
id: display_backlight
|
|
restore_mode: ALWAYS_ON
|
|
on_turn_on:
|
|
- if:
|
|
condition: lvgl.is_paused
|
|
then:
|
|
- logger.log: "LVGL resuming by backlight on"
|
|
- lvgl.resume:
|
|
- lvgl.widget.redraw:
|
|
on_turn_off:
|
|
- if:
|
|
condition:
|
|
lambda: 'return id(display_timeout_number).state >= 0;'
|
|
then:
|
|
- logger.log: "Backlight off, pausing LVGL"
|
|
- lvgl.pause:
|
|
|
|
output:
|
|
# Backlight LED
|
|
- platform: ledc
|
|
pin: ${pin_lcd_bl}
|
|
id: backlight_output
|
|
frequency: 100Hz
|
|
|
|
esp_ldo:
|
|
- channel: 3
|
|
voltage: 2.5V
|
|
|
|
psram:
|
|
speed: 200MHz
|
|
|
|
display:
|
|
- platform: mipi_dsi
|
|
model: JC8012P4A1
|
|
id: my_display
|
|
update_interval: 1s
|
|
reset_pin: ${pin_lcd_reset}
|
|
|
|
i2c:
|
|
- id: i2c_bus
|
|
sda: ${pin_touch_sda}
|
|
scl: ${pin_touch_scl}
|
|
frequency: 400kHz
|
|
|
|
touchscreen:
|
|
- platform: gsl3680
|
|
id: touchscreen_
|
|
reset_pin: ${pin_touch_rst}
|
|
interrupt_pin: ${pin_touch_irq}
|
|
transform:
|
|
swap_xy: false
|
|
mirror_y: false
|
|
on_release:
|
|
- if:
|
|
condition: lvgl.is_paused
|
|
then:
|
|
- logger.log: "LVGL resuming"
|
|
- lvgl.resume:
|
|
- lvgl.widget.redraw:
|
|
- light.turn_on: display_backlight |