Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
# ============================================================================
# ESPHome YAML - Generated by ESPHome Designer
# ============================================================================
# TARGET DEVICE: Guition 2432S028R 240x320 ESP32 2.8-inch LCD resistor touch
# - ESP32: Sparkleiot XH-32S
# - Display Platform: 2.8-inch color TFT display screen with ILI9341 driver chip
# - PSRAM: None
# - Touchscreen: XPT2046
# - Framework: ESP-IDF
# Name: Guition 2432S028R 240x320 ESP32 2.8-inch LCD resistor touch
# Resolution: 240x320
# Shape: rectangle
# ============================================================================
#
# BASED ON: https://randomnerdtutorials.com/esp32-cheap-yellow-display-cyd-pinout-esp32-2432s028r/
# Hardware configuration adapted for ESPHome Designer.
#
# ============================================================================
#
# SETUP INSTRUCTIONS:
#
# STEP 1: Copy the Material Design Icons font file
# - From this repo: resources/fonts/materialdesignicons-webfont.ttf
# - To ESPHome: /config/esphome/fonts/materialdesignicons-webfont.ttf
# (Create the fonts folder if it doesn't exist)
#
# STEP 2: Create a new device in ESPHome
# - Click "New Device"
# - Name: your-device-name
# - Select: ESP32
# - Framework: ESP-IDF (Required for this device)
#
# STEP 3: PASTE this snippet into your device YAML
# - Paste this snippet at the end of your configuration.
# - System sections (esphome, esp32, psram, etc.) are auto-commented
# to avoid conflicts with your existing setup.
#
# ============================================================================

substitutions:
name: "guiton-2432s028r-esp32"
friendly_name: 'Guition 2432S028R ESP32-2.8" '
device_description: "Guition 2432S028R ESP32-2.8-inch resistor touch 240x320"
project_name: "karl-petter.ESPHomeDesigner_Guition_2432S028R_240x320"
project_version: "1.0.0"
#GPIO pins for the LCD screen
misopin: GPIO12
mosipin: GPIO13
sclkpin: GPIO14
cspin: GPIO15
dcpin: GPIO2
blpin: GPIO21
# GPIO pins for Touchpanel
tp_irqpin: GPIO36
tp_mosipin: GPIO32
tp_misopin: GPIO39
tp_clkpin: GPIO25
tp_cspin: GPIO33
# GPIO pins for RGB LED
led_rpin: GPIO4
led_gpin: GPIO16
led_bpin: GPIO17
# GPIO LDR
ldr_pin: GPIO34
# GPIO pins for i2c
sdapin: GPIO27
sclpin: GPIO22
# SD Card
sd_cs_pin: GPIO4
logger: DEBUG

esphome:
friendly_name: $friendly_name
name: $name
project:
name: "${project_name}"
version: "${project_version}"

esp32:
board: esp32dev
framework:
type: esp-idf

spi:
- id: tft
clk_pin: $sclkpin
mosi_pin: $mosipin
miso_pin:
number: $misopin
ignore_strapping_warning: true
- id: touch
clk_pin: $tp_clkpin
mosi_pin: $tp_mosipin
miso_pin: $tp_misopin

i2c:
sda: $sdapin
scl: $sclpin

output:
- platform: ledc
pin: $blpin
frequency: 1000hz
id: gpio_backlight_pwm
- id: output_red
platform: ledc
pin: $led_rpin
inverted: true
- id: output_green
platform: ledc
pin: $led_gpin
inverted: true
- id: output_blue
platform: ledc
pin: $led_bpin
inverted: true

light:
- platform: monochromatic # Define a monochromatic, dimmable light for the backlight
output: gpio_backlight_pwm
name: Display Backlight
icon: mdi:lightbulb-on
id: display_backlight
restore_mode: ALWAYS_ON
- platform: rgb # RGB Led on backside
id: rgb_led
name: RGB LED
red: output_red
green: output_green
blue: output_blue
restore_mode: ALWAYS_OFF

sensor:
# Board LDR
- platform: adc
pin: $ldr_pin
name: "board_ldr"
update_interval: 1500ms

touchscreen:
- id: my_touchscreen
platform: xpt2046
spi_id: touch
cs_pin: $tp_cspin
interrupt_pin: $tp_irqpin
threshold: 400
calibration:
x_min: 280
x_max: 3860
y_min: 340
y_max: 3860
transform:
mirror_x: true
on_touch:
- lambda: |-
ESP_LOGI("cal", "x=%d, y=%d, x_raw=%d, y_raw=%0d",
touch.x,
touch.y,
touch.x_raw,
touch.y_raw
);

display:
- id: my_display
platform: ili9xxx
model: ILI9341
spi_id: tft
cs_pin:
number: $cspin
ignore_strapping_warning: true
dc_pin:
number: $dcpin
ignore_strapping_warning: true
invert_colors: false
auto_clear_enabled: false
color_order: BGR
color_palette: 8BIT
dimensions:
width: 240
height: 320
lambda: |-
# __LAMBDA_PLACEHOLDER__