Waveshare 7" Trying to turn screen 90 deg

I have for the life of me not been able to turn the screen 90 deg. Here is the yaml I am using. Can anyone point me in the correct direction?


substitutions:
  device_internal_name: esphome19
  device_wifi_name: esphome-19
  device_friendly_name: Test tab
  device_ip_address: 192.168.1.19

esphome:
  name: wave-7
  friendly_name: ${device_friendly_name}
  platformio_options:
    build_unflags: -Werror=all
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    #    platform_version: 6.8.1
    #    version: 5.3.0
    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
      CONFIG_SPIRAM_RODATA: y

api:
  reboot_timeout: 0s
  encryption:
    key: !secret api_encryption_key

logger:
  hardware_uart: UART0

wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password

switch:
  - platform: homeassistant
    name: "Shed Switch 1"
    id: shed_switch_1
    entity_id: switch.shed_switch_1
  - platform: homeassistant
    name: "Shed Switch 2"
    id: shed_switch_2
    entity_id: switch.shed_switch_2
  - platform: homeassistant
    name: "Shed Switch 3"
    id: shed_switch_3
    entity_id: switch.shed_switch_3_2
  - platform: homeassistant
    name: "Shed Switch 4"
    id: shed_switch_4
    entity_id: switch.shed_switch_4_3
ota:
  platform: esphome
  password: !secret ota_password

ch422g:

psram:
  mode: octal
  speed: 80MHz

output:
  - platform: ledc
    id: backlight_output
    pin: 13
    frequency: 1220Hz
    inverted: true

# Note: this requires a hardware modification to work - GPIO 13 must be connected to the backlight PWM pad.

light:
  - platform: monochromatic
    output: backlight_output
    name: LCD Backlight
    id: lcd_backlight
    restore_mode: ALWAYS_ON
    default_transition_length: 0s
    gamma_correct: 1.8
    effects:
      - pulse:

i2c:
  sda: 8
  scl: 9
  frequency: 400kHz
  scan: false
  id: bus_a

button:
  - platform: safe_mode
    name: Safe Mode Boot
    entity_category: diagnostic

touchscreen:
  - platform: gt911
    address: 0x5D
    id: my_touchscreen
    interrupt_pin: 4
    reset_pin:
      ch422g:
      number: 1

display:
  - platform: rpi_dpi_rgb
    id: rpi_disp
    rotation: 90            # <--- set rotation here
    auto_clear_enabled: false
    color_order: RGB
    pclk_frequency: 16MHz
    dimensions:
      width: 480
      height: 800
    de_pin: 5
    hsync_pin: 46
    vsync_pin: 3
    pclk_pin: 7
    pclk_inverted: true
    data_pins:
      red:   [1, 2, 42, 41, 40]
      green: [39, 0, 45, 48, 47, 21]
      blue:  [14, 38, 18, 17, 10]


# display:
#   - platform: rpi_dpi_rgb
#     id: rpi_disp
#     update_interval: never
#     #rotation: 90
#     auto_clear_enabled: false
#     color_order: RGB
#     pclk_frequency: 16MHz
#     dimensions:
#       width: 480
#       height: 800
    reset_pin:
      ch422g:
      number: 3
    enable_pin:
      ch422g:
      number: 2
#     de_pin:
#       number: 5
#     hsync_pin:
#       number: 46
#       ignore_strapping_warning: true
#     vsync_pin:
#       number: 3
#       ignore_strapping_warning: true
#     pclk_pin: 7
#     pclk_inverted: true
#     # 7" 800x480 params
#     hsync_back_porch: 8
#     hsync_front_porch: 8
#     hsync_pulse_width: 4
#     vsync_back_porch: 16
#     vsync_front_porch: 16
#     vsync_pulse_width: 4
#     # 5" 1024x600 params
#     #    hsync_back_porch: 188
#     #    hsync_front_porch: 44
#     #    hsync_pulse_width: 88
#     #    vsync_back_porch: 16
#     #    vsync_front_porch: 3
#     #    vsync_pulse_width: 6
#     # 4.3" 800x480 params
#     #    hsync_back_porch: 8
#     #    hsync_front_porch: 8
#     #    hsync_pulse_width: 4
#     #    vsync_back_porch: 16
#     #    vsync_front_porch: 16
#     #    vsync_pulse_width: 4

#     data_pins:
#       red:
#         - 1 #r3
#         - 2 #r4
#         - 42 #r5
#         - 41 #r6
#         - 40 #r7
#       blue:
#         - 14 #b3
#         - 38 #b4
#         - 18 #b5
#         - 17 #b6
#         - 10 #b7
#       green:
#         - 39 #g2
#         - 0 #g3
#         - 45 #g4
#         - 48 #g5
#         - 47 #g6
#         - 21 #g7



#lvgl:
#  widgets:
#    - label:
#        align: CENTER
#        text: 'Hello World!'

# 

lvgl:
  displays: rpi_disp

  pages:
    - id: main_page
      widgets:
        - obj:
            # Use the rotated display dimensions here
            width: 480
            height: 800
            layout:
              type: FLEX
              flex_flow: COLUMN
              flex_align_main: SPACE_EVENLY
              flex_align_cross: CENTER

            widgets:
              # Row 1 (top half)
              - obj:
                  width: 100%
                  height: 50%
                  layout:
                    type: FLEX
                    flex_flow: ROW
                    flex_align_main: SPACE_EVENLY
                    flex_align_cross: CENTER
                  widgets:
                    - button:
                        width: 45%
                        height: 100%
                        on_click:
                          - homeassistant.service:
                              service: cover.toggle
                              data:
                                entity_id: cover.shed_door_1_4
                        widgets:
                          - label:
                              text: "Shed Door"
                              align: CENTER

                    - button:
                        width: 45%
                        height: 100%
                        on_click:
                          - homeassistant.service:
                              service: switch.toggle
                              data:
                                entity_id: switch.shed_switch_2
                        widgets:
                          - label:
                              text: "Shed 2"
                              align: CENTER

              # Row 2 (bottom half)
              - obj:
                  width: 100%
                  height: 50%
                  layout:
                    type: FLEX
                    flex_flow: ROW
                    flex_align_main: SPACE_EVENLY
                    flex_align_cross: CENTER
                  widgets:
                    - button:
                        width: 45%
                        height: 100%
                        on_click:
                          - homeassistant.service:
                              service: switch.toggle
                              data:
                                entity_id: switch.shed_switch_3_2
                        widgets:
                          - label:
                              text: "Shed 3"
                              align: CENTER

                    - button:
                        width: 45%
                        height: 100%
                        on_click:
                          - homeassistant.service:
                              service: switch.toggle
                              data:
                                entity_id: switch.shed_switch_4_3
                        widgets:
                          - label:
                              text: "Shed 4"
                              align: CENTER

Might be it’s not even possible. Did you find any examples with 90 rotation?

Use the mipi_rgb driver - there is a canned configuration for your screen, and rotation will work.

Can you point me to the canned version example?

Thanks

It’s in the docs.

See the example configuration and replace the model name with ESP32-S3-TOUCH-LCD-7-800X480 as per the table of supported boards.