diff --git a/components/display/ili9xxx.rst b/components/display/ili9xxx.rst index 1e9f4024f..7b729c2b8 100644 --- a/components/display/ili9xxx.rst +++ b/components/display/ili9xxx.rst @@ -60,14 +60,14 @@ beyond the basic SPI connections, and a reasonable amount of RAM, it is not well - platform: ili9xxx model: ili9341 dc_pin: GPIOXX - reset_pin: GPIOXX - lambda: |- - it.fill(COLOR_BLACK); - it.print(0, 0, id(my_font), id(my_red), TextAlign::TOP_LEFT, "Hello World!"); + show_test_card: true + Configuration variables: ************************ +All :ref:`graphical display configuration` options are available, plus the following. + - **model** (**Required**): The model of the display. Options are: - ``M5STACK``, ``TFT 2.4``, ``TFT 2.4R``, ``S3BOX``, ``S3BOX_LITE``, ``WSPICOLCD`` @@ -79,13 +79,15 @@ Configuration variables: - **dc_pin** (**Required**, :ref:`Pin Schema `): The DC pin. - **reset_pin** (*Optional*, :ref:`Pin Schema `): The RESET pin. -- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. - See :ref:`display-engine` for more information. -- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``. -- **auto_clear_enabled** (*Optional*, boolean): Whether to automatically clear the display in each loop (''true'', default), - or to keep the existing display content (must overwrite explicitly, e.g., only on data change). -- **pages** (*Optional*, list): Show pages instead of a single lambda. See :ref:`display-pages`. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- **cs_pin** (*Optional*, :ref:`Pin Schema `): The CS pin. + + +.. note:: + + A DC pin is always required, the CS pin and RESET pin will only be needed if the specific board has those + pins wired to GPIOs. + + - **color_palette** (*Optional*): The type of color pallet that will be used in the ESP's internal 8-bits-per-pixel buffer. This can be used to improve color depth quality of the image. For example if you know that the display will only be showing grayscale images, the clarity of the display can be improved by targeting the available colors to monochrome only. Options are: - ``NONE`` (default) diff --git a/components/display/index.rst b/components/display/index.rst index 5d5c02af1..6be87e1ee 100644 --- a/components/display/index.rst +++ b/components/display/index.rst @@ -11,15 +11,34 @@ engine. Fundamentally, there are these types of displays: - Character displays like :doc:`7-Segment displays ` or :doc:`LCD displays `. - Serial displays like :doc:`nextion` that have their own processors for graphics rendering. -- Graphical binary displays which can toggle ON/OFF any pixel, like :doc:`E-Paper `, - +- Graphical displays with fully addressable pixels, like :doc:`E-Paper `, :doc:`OLED ` or :doc:`TFT ` displays. -For graphical displays, which offer the greatest flexibility, there are two options: +For graphical displays, which offer the greatest flexibility, there are two options for displaying content: - ESPHome's :ref:`own rendering engine ` - :doc:`LVGL ` - Light and Versatile Graphics Library +.. _display-configuration: + +Configuration variables: +************************ + +All display components inherit these configuration variables. + +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. Required if there are multiple displays. +- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``1s``. +- **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. + See :ref:`display-engine` for more information. + +All *graphical* displays also inherit these configuration variables. + +- **auto_clear_enabled** (*Optional*, boolean): If the display should be cleared before each update. Defaults to ``true``. +- **show_test_card** (*Optional*, boolean): If the display should show a test card. Defaults to ``false``. If set, any code in the ``lambda`` config option will be ignored. +- **rotation** (*Optional*, integer): The rotation of the display in degrees, one of 0, 90, 180 or 270. Defaults to ``0``. +- **pages** (*Optional*, list): Pages configuration - see below. + + .. _display-engine: Display Rendering Engine diff --git a/components/display/st7701s.rst b/components/display/st7701s.rst index ec217ad31..f098b2d35 100644 --- a/components/display/st7701s.rst +++ b/components/display/st7701s.rst @@ -37,12 +37,12 @@ ESP-IDF. PSRAM is a requirement due to the size of the display buffer. dimensions: width: 480 height: 480 - cs_pin: REPLACE_ME - reset_pin: REPLACE_ME - de_pin: REPLACE_ME - hsync_pin: REPLACE_ME - vsync_pin: REPLACE_ME - pclk_pin: REPLACE_ME + cs_pin: GPIOXX + reset_pin: GPIOXX + de_pin: GPIOXX + hsync_pin: GPIOXX + vsync_pin: GPIOXX + pclk_pin: GPIOXX # Replace XX with the correct pin number data_pins: @@ -109,18 +109,13 @@ Configuration variables: - **rotation** (*Optional*): Rotate the display presentation in software. Choose one of ``0°``, ``90°``, ``180°``, or ``270°``. This option cannot be used with ``transform``. - **transform** (*Optional*): Transform the display presentation using hardware. All defaults are ``false``. This option cannot be used with ``rotation``. - - **swap_xy** (*Optional*, boolean): If true, exchange the x and y axes. - **mirror_x** (*Optional*, boolean): If true, mirror the x axis. - **mirror_y** (*Optional*, boolean): If true, mirror the y axis. - **lambda** (*Optional*, :ref:`lambda `): The lambda to use for rendering the content on the display. See :ref:`display-engine` for more information. -**Note:** To rotate the display in hardware use one of the following combinations: - - - 90 degrees - use ``swap_xy`` with ``mirror_x`` - - 180 degrees - use ``mirror_x`` with ``mirror_y`` - - 270 degrees - use ``swap_xy`` with ``mirror_y`` +**Note:** To rotate the display in hardware by 180 degrees set both ``mirror_x`` and ``mirror_y`` to ``true``. The st7701s does not support hardware rotation by 90 or 270. The horizontal and vertical ``pulse_width``, ``front_porch`` and ``back_porch`` values are optional, but may require changing for a specific display. Refer to the manufacturer's sample code for suitable values. These specify timing