# Hardware configuration file
esphome:
min_version: 2025.4.0
platformio_options:
build_flags: "-DBOARD_HAS_PSRAM"
board_build.esp-idf.memory_type: qio_opi
board_build.flash_mode: dio
board_upload.maximum_ram_size: 524288
esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
flash_size: 16MB
framework:
type: esp-idf
sdkconfig_options:
COMPILER_OPTIMIZATION_SIZE: y
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: y
CONFIG_ESP32S3_DATA_CACHE_64KB: y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B: y
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
CONFIG_SPIRAM_RODATA: y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB: y # fix warning about 2mb found
preferences:
flash_write_interval: 5min
psram:
mode: octal
speed: 80MHz
i2c:
- sda: 19
scl: 20
scan: true
# sensor:
# - platform: adc
# pin: 34
# name: "Brightness"
# update_interval: 60s
#-------------------------------------------
# Backlight
#-------------------------------------------
output:
- platform: ledc
pin: 2
frequency: 1220
id: gpio_backlight_pwm
light:
- platform: monochromatic # Define a monochromatic, dimmable light for the backlight
output: gpio_backlight_pwm
name: Display Backlight
id: display_backlight
restore_mode: ALWAYS_ON
spi:
- id: touch
clk_pin: 12
mosi_pin: 11
miso_pin: 13
touchscreen:
- id: my_touchscreen
platform: xpt2046
spi_id: touch
cs_pin: 38 #33
interrupt_pin: 18 #36
update_interval: 100ms
threshold: 400
calibration:
x_min: 300 #1
x_max: 3700 #4095
y_min: 300 #1
y_max: 3700 #4095
transform:
swap_xy: true
mirror_x: false
mirror_y: true
#para prender el display unavez que se apago por no haber sido activado por XXX segundos
on_release:
- if:
condition: lvgl.is_paused
then:
- logger.log: "LVGL resuming"
- lvgl.resume:
- lvgl.widget.redraw:
- light.turn_on: display_backlight
- lambda: |-
ESP_LOGI("ON_RELEASE", "ON_RELEASE");
#############################
on_touch:
- lambda: |-
ESP_LOGI("ON_TOUCH", "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: rpi_dpi_rgb
dimensions:
width: 480 # 480
height: 280 # yes, 280 works. I tried with 270,271,272 and they show gargage
rotation: 90
color_order: RGB
de_pin: 40
hsync_pin: 39
vsync_pin: 41
pclk_pin: 42
pclk_inverted: true
pclk_frequency: 14MHz #9MHz #original was 14MHz # unsure about this
hsync_front_porch: 8
hsync_pulse_width: 4
hsync_back_porch: 43
vsync_front_porch: 8
vsync_pulse_width: 4
vsync_back_porch: 12
data_pins:
red: [45, 48, 47, 21, 14]
green: [5, 6, 7, 15, 16, 4]
blue: [8, 3, 46, 9, 1]
update_interval: never
auto_clear_enabled: false
lvgl:
buffer_size: 25%
Ryan
I implemented 4827s043r
Here you have my definitions in case that you want to add it tou your library