Files
esphome-configs/mcu-lvgl-eworkbench.yaml
T
randy bb76912023 Set framework.advanced.flash_chip on ESP32 devices to save IRAM
Values come from ESPHome's own hint in the log of each online device
("Set flash_chip: ... to save IRAM"). Devices that were off got the value of
an identical board (ESP32-PICO-D4 ATOM/Stamp Pico: gd, JC3248W535: generic,
POW Elite: gd), marked as not read from the device.
2026-09-30 11:57:30 +02:00

160 lines
3.5 KiB
YAML

---
# Hardware: Guition JC3248W535
# Pinout:
# GPIO1 -> main_backlight (power_supply)
# GPIO4 -> touchscreen_bus (i2c sda)
# GPIO8 -> touchscreen_bus (i2c scl)
# GPIO21 -> display_qspi (spi data_pins)
# GPIO39 -> display_qspi (spi data_pins)
# GPIO40 -> display_qspi (spi data_pins)
# GPIO45 -> main_display (display mipi_spi cs_pin)
# GPIO47 -> display_qspi (spi clk_pin)
# GPIO48 -> display_qspi (spi data_pins)
# I2C:
# 0x3B main_touch (touchscreen axs15231)
substitutions:
device: lvgl-eworkbench
name: Electronics Workbench Display
area: Office R
comment: Electronics Workbench
esphome:
name: mcu-${device}
friendly_name: ${name}
area: ${area}
comment: ${comment}
esp32:
variant: esp32s3
flash_size: 16MB
toolchain: esp-idf
framework:
advanced:
flash_chip: generic # same board as lvgl-trainer (not read from the device)
type: esp-idf
packages:
common: !include common/common.yaml
# external_components:
i2c:
sda: 4
scl: 8
id: touchscreen_bus
psram:
mode: octal
speed: 40MHz
spi:
id: display_qspi
type: quad
clk_pin: 47
data_pins: [21, 48, 40, 39]
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_orange
red: 100%
green: 50%
blue: 0%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_teal
red: 0%
green: 100%
blue: 100%
- id: my_gray
red: 70%
green: 70%
blue: 70%
- id: my_white
red: 100%
green: 100%
blue: 100%
font:
- file: "gfonts://Roboto"
id: Roboto_48
size: 48
- file: "gfonts://Roboto"
id: Roboto_36
size: 36
- file: "gfonts://Roboto"
id: Roboto_24
size: 24
- file: "gfonts://Roboto"
id: Roboto_12
size: 12
- file: "gfonts://Roboto"
id: font_std
size: 40
glyphs: "!\"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz/\\[]|&@#'"
- file: "gfonts://Roboto@700"
id: font_title
size: 40
glyphs: "!\"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz/\\[]|&@#'"
globals:
- id: bgcolor
type: Color
initial_value: "Color::random_color()"
power_supply:
id: main_backlight
pin: 1
enable_on_boot: true
display:
- platform: mipi_spi
model: AXS15231
data_rate: 40MHz #20mhz is default
#spi_mode: MODE2
id: main_display
spi_id: display_qspi
dimensions:
height: 480
width: 320
cs_pin: 45
rotation: 90
auto_clear_enabled: false
show_test_card: true
lambda: |-
it.fill(id(bgcolor));
it.print(it.get_width()/2, it.get_height()/2-20, id(font_title), TextAlign::CENTER, "ESPHome");
it.print(it.get_width()/2, it.get_height()/2+20, id(font_std), TextAlign::CENTER, "@UTBDK");
touchscreen:
- platform: axs15231
id: main_touch
display: main_display
i2c_id: touchscreen_bus
transform:
swap_xy: true
on_touch:
- lambda: |-
Color newColor;
do { newColor = Color::random_color(); } while (newColor == id(bgcolor));
id(bgcolor) = newColor;
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);