Skip to content

Commit aa5db62

Browse files
authored
Merge branch 'next' into feat/#3215_modbus_controller_courtesy_response
2 parents c5a9faa + 2662d24 commit aa5db62

37 files changed

+1116
-158
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ESPHOME_PATH = ../esphome
2-
ESPHOME_REF = 2025.7.4
2+
ESPHOME_REF = dev
33
PAGEFIND_VERSION=1.1.1
44
PAGEFIND=pagefind
55
NET_PAGEFIND=../pagefindbin/pagefind

_static/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025.7.4
1+
2025.8.0-dev

components/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ Configuration variables:
9898
WiFi performance with many rapidly-changing sensors. Only use this setting when necessary.
9999

100100
- **custom_services** (*Optional*, boolean): Enable compilation of custom API services for external components that use the C++ ``CustomAPIDevice`` class. Only needed when external components register their own services via the native API. Defaults to ``false``.
101+
- **homeassistant_services** (*Optional*, boolean): Enable compilation of Home Assistant service call support for external components that use the C++ ``CustomAPIDevice::call_homeassistant_service()`` or ``CustomAPIDevice::fire_homeassistant_event()`` methods. This is automatically enabled when using ``homeassistant.service`` or ``homeassistant.event`` actions, or the ``homeassistant`` platform for number or switch components. Only needs to be manually set when external components call Home Assistant services without using the built-in actions. Defaults to ``false``.
102+
- **homeassistant_states** (*Optional*, boolean): Enable compilation of Home Assistant state subscription support for external components that use the C++ ``CustomAPIDevice::subscribe_homeassistant_state()`` method. This is automatically enabled when using any ``homeassistant`` platform components (sensor, binary_sensor, text_sensor, switch, or number). Only needs to be manually set when external components subscribe to Home Assistant states without using the built-in components. Defaults to ``false``.
101103
- **reboot_timeout** (*Optional*, :ref:`config-time`): The amount of time to wait before rebooting when no
102104
client connects to the API. This is needed because sometimes the low level ESP functions report that
103105
the ESP is connected to the network, when in fact it is not - only a full reboot fixes it.

components/binary_sensor/packet_transport.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ It requires a ``packet_transport`` component to be configured.
2727
- platform: ...
2828
2929
30-
Configuration variables
31-
-----------------------
30+
Configuration variables:
31+
------------------------
3232

3333
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
3434
- **provider** (**Required**, string): The name of the provider node.

components/button/factory_reset.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Configuration variables:
4040
See Also
4141
--------
4242

43+
- :doc:`/components/factory_reset`
4344
- :doc:`shutdown`
4445
- :doc:`restart`
4546
- :doc:`safe_mode`

components/display/ili9xxx.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ ILI9341 (`datasheet <https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf>`__) a
4141
displays from the same chip family with ESPHome. As this is a somewhat higher resolution display and requires additional pins
4242
beyond the basic SPI connections, and a reasonable amount of RAM, it is not well suited for the ESP8266.
4343

44+
.. warning::
45+
46+
This component has been made redundant since this class of displays is now supported by the :ref:`mipi_spi`.
47+
This component may be removed in a future release.
48+
4449
.. note::
4550

4651
PSRAM is not automatically enabled on the ESP32 (this changed with the 2025.2 release.) If PSRAM is available, you

components/display/mipi_dsi.rst

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
.. seo::
2+
:description: Details for the MIPI DSI display driver component in ESPHome
3+
:image: tab5.jpg
4+
5+
.. _mipi_dsi:
6+
7+
MIPI DSI Display Driver
8+
=======================
9+
10+
Introduction
11+
------------
12+
13+
This driver is for displays that use the MIPI DSI display interface available in the ESP32-P4.
14+
15+
.. figure:: /images/tab5.jpg
16+
:align: center
17+
:width: 75.0%
18+
19+
M5STACK-TAB5 with ESP32-P4
20+
21+
Background
22+
----------
23+
24+
The MIPI (Mobile Industry Processor Interface) Alliance publishes various hardware and software interface specifications
25+
including the Display Serial Interface (DSI), which transfers pixel data over a high-speed serial bus to an LCD display.
26+
27+
The display panels controlled by the driver may be of various types, including TFT, IPS, and others. Each driver
28+
chip and panel combination requires a specific set of initialisation commands, and standard initialisation sequences are provided for many common
29+
boards and chips, but the driver is also designed to be customisable in YAML for other displays.
30+
31+
Supported boards and driver chips
32+
---------------------------------
33+
34+
There are specific configurations for several ESP32 boards with integrated displays. For those boards
35+
the predefined configuration will set the correct pins and dimensions for the display.
36+
37+
For custom displays, the driver can be configured with the correct pins and dimensions, and the driver chip can be
38+
specified, or a custom init sequence can be provided.
39+
40+
Driver chips
41+
^^^^^^^^^^^^
42+
43+
.. csv-table::
44+
:header: "Driver Chip", "Typical Dimensions"
45+
:widths: 15, 20
46+
47+
"CUSTOM", "Customisable"
48+
49+
Boards with integrated displays
50+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51+
52+
.. csv-table::
53+
:header: "Model", "Manufacturer", "Product Description"
54+
:widths: 30, 20, 30
55+
56+
"JC1060P470", "Guition", "https://aliexpress.com/item/1005008328088576.html"
57+
"M5STACK-TAB5", "M5Stack", "https://shop.m5stack.com/products/m5stack-tab5-iot-development-kit-esp32-p4"
58+
"WAVESHARE-P4-NANO-10.1", "Waveshare", "https://www.waveshare.com/esp32-p4-nano.htm?sku=29031"
59+
"WAVESHARE-P4-86-PANEL", "Waveshare", "https://www.waveshare.com/esp32-p4-wifi6-touch-lcd-4b.htm?sku=31570"
60+
61+
62+
Configuration
63+
-------------
64+
65+
.. code-block:: yaml
66+
67+
# Example minimal configuration entry
68+
display:
69+
- platform: mipi_dsi
70+
model: WAVESHARE-P4-NANO-10.1
71+
72+
Configuration options
73+
^^^^^^^^^^^^^^^^^^^^^
74+
75+
All :ref:`graphical display configuration<display-configuration>` options are available, plus the following. For integrated display boards
76+
most of the configuration will be set by default, but can be overridden if needed.
77+
78+
- **model** (**Required**): Chosen from the lists of supported chips and models above, or ``CUSTOM`` for custom displays.
79+
- **reset_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The RESET pin, if required.
80+
- **enable_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): An optional pin to enable the display, if required. A list of pins can be provided for displays that require multiple enable pins. A full pin configuration may be provided
81+
to set the pin mode and inverted property. By default the pin will be driven high to enable the display.
82+
- **color_order** (*Optional*): Should be one of ``bgr`` (default) or ``rgb``. This specifies the order of the color channels in the display panel. The default is ``bgr`` for most displays, but some displays may require ``rgb``. It does not affect the color order of the display buffer, which is always RGB.
83+
- **dimensions** (*Optional*): Dimensions of the screen, specified either as *width* **x** *height* (e.g ``320x240``) or with separate config keys. If not provided the dimensions will be determined by the model selected. This is required for the ``CUSTOM`` model, and is optional for other models. The dimensions are specified in pixels, and the width and height must be greater than 0. The following keys are available:
84+
85+
- **height** (**Required**, int): Specifies height of display in pixels.
86+
- **width** (**Required**, int): Specifies width of display.
87+
- **offset_width** (*Optional*, int): Specify an offset for the x-direction of the display, typically used when an LCD is smaller than the maximum supported by the driver chip. Default is 0
88+
- **offset_height** (*Optional*, int): Specify an offset for the y-direction of the display. Default is 0.
89+
90+
- **invert_colors** (*Optional*, boolean): Specifies whether the display colors should be inverted. Options are ``true`` or ``false``. Defaults to ``false``.
91+
- **rotation** (*Optional*): Rotate the display presentation in software. Choose one of ````, ``90°``, ``180°``, or ``270°``. If the driver chip supports hardware rotation for the given orientation this will be translated to the appropriate hardware command. If hardware rotation is not supported, the display will be rotated in software.
92+
- **transform** (*Optional*): If ``rotation`` is not sufficient, use this to transform the display. If this option is specified, then the ``dimensions`` option must also be provided. Options are:
93+
94+
- **swap_xy** (**Required**, boolean): If true, exchange the x and y axes.
95+
- **mirror_x** (**Required**, boolean): If true, mirror the x axis.
96+
- **mirror_y** (**Required**, boolean): If true, mirror the y axis.
97+
98+
- **hsync_pulse_width** (*Optional*, int): The horizontal sync pulse width.
99+
- **hsync_front_porch** (*Optional*, int): The horizontal front porch length.
100+
- **hsync_back_porch** (*Optional*, int): The horizontal back porch length.
101+
- **vsync_pulse_width** (*Optional*, int): The vertical sync pulse width.
102+
- **vsync_front_porch** (*Optional*, int): The vertical front porch length.
103+
- **vsync_back_porch** (*Optional*, int): The vertical back porch length.
104+
- **pclk_frequency** (*Optional*): Set the pixel clock speed. Default is 40MHz.
105+
- **pclk_inverted** (*Optional*, bool): If the pclk is active negative (default is True)
106+
- **lanes** (*Optional*, int): Number of serial data lanes to use - 1 or 2. Default is 2.
107+
- **lane_bit_rate** (*Optional*, int): The bit rate of the serial data lanes. No default unless a non-custom model is selected.
108+
109+
Advanced options
110+
^^^^^^^^^^^^^^^^
111+
112+
- **init_sequence** (*Optional*): Allows custom initialisation sequences to be added. See below for more information.
113+
- **pixel_mode** (*Optional*): Select the interface mode for the display driver. Options are ``16bit`` (default) and ``24bit``.
114+
- **color_depth** (*Optional*): The color depth of the display buffer, expressed in bits. Options are ``16`` (default) and ``24``. Preferably should be the same as the ``pixel_mode`` option.
115+
- **draw_rounding** (*Optional*): The rounding factor for drawing operations. Defaults to 2. Some chips require a higher value to avoid display artifacts. Must be a power of 2.
116+
- **use_axis_flips** (*Optional*): If true, the driver will use alternate bits in the MADCTL register to implement x and y mirroring. Defaults to false.
117+
- **byte_order** (*Optional*): The byte order of the display buffer. Options are ``big_endian`` and ``little_endian`` (default). This affects the byte order for the buffer when
118+
using 16 bit color depth. The default is appropriate for the majority of displays.
119+
120+
121+
Additional initialisation sequences
122+
-----------------------------------
123+
124+
The ``init_sequence`` option allows additional configuration of the driver chip. Provided commands will be sent to the
125+
driver chip in addition to, and after the chosen model's pre-defined commands. It requires a list of byte sequences:
126+
127+
.. code-block:: yaml
128+
129+
init_sequence:
130+
- [ 0xD0, 0x07, 0x42, 0x18]
131+
- delay 10ms
132+
- [ 0xD1, 0x00, 0x07, 0x10]
133+
134+
Each entry represents a single-byte command followed by zero or more data bytes. Delays can be inserted with the ``delay`` keyword followed by a time in milliseconds. The delay is not precise, but will be at least the specified time.
135+
If converting from other code, make sure the length byte, if present, is not copied as the length of each command sequence is determined by the number of bytes in the list.
136+
137+
CUSTOM model
138+
------------
139+
140+
The ``CUSTOM`` model selection is provided for otherwise unsupported displays, and requires both ``dimensions:`` and ``init_sequence:`` to be specified. There is no pre-defined init sequence.
141+
142+
Using the ``transform`` options
143+
-------------------------------
144+
145+
In most cases, the ``rotation`` option will be sufficient to orient the display correctly. However, some displays may require additional transformations. The ``transform`` option allows for these transformations to be applied in any of 8 different
146+
combinations. It may be necessary to experiment with different combinations to achieve the desired result. When using the ``transform`` option, the ``rotation`` option should not be set unless the display does not support axis-swapping.
147+
If the ``swap_xy`` option is set, then the ``dimensions`` option is required, and the ``width`` and ``height`` values should be set to reflect the final screen dimensions after rotation.
148+
149+
.. code-block:: yaml
150+
151+
transform:
152+
swap_xy: true
153+
mirror_x: true
154+
mirror_y: false
155+
dimensions:
156+
height: 480
157+
width: 320
158+
159+
160+
LCD Backlights
161+
--------------
162+
163+
Many displays have an integrated backlight, which may need to be turned on for the display to show. This backlight is not controlled
164+
by the driver, but can be controlled by a separate GPIO pin. Depending on the display, the backlight may be active high or active low, and may
165+
be able to be dimmed using a :doc:`/components/light/monochromatic` with a :doc:`/components/output/ledc`.
166+
167+
Touchscreens
168+
------------
169+
170+
A touchscreen, if present, must be configured separately. See the :doc:`/components/touchscreen/index` documentation for more information.
171+
172+
See Also
173+
--------
174+
175+
- :doc:`index`
176+
- :doc:`/components/lvgl/index`
177+
- :apiref:`mipi_dsi/mipi_dsi.h`
178+
- :ghedit:`Edit`

components/display/mipi_spi.rst

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
MIPI SPI Display Driver
2-
=======================
3-
41
.. seo::
52
:description: Details for the MIPI SPI display driver component in ESPHome
63
:image: ili9341.jpg
74

85
.. _mipi_spi:
96

7+
MIPI SPI Display Driver
8+
=======================
9+
1010
Introduction
1111
------------
1212

@@ -65,6 +65,8 @@ Boards with integrated displays
6565
:header: "Model", "Manufacturer", "Product Description"
6666
:widths: 30, 20, 30
6767

68+
"ADAFRUIT-S2-TFT-FEATHER", "Adafruit", "https://www.adafruit.com/product/6312"
69+
"ADAFRUIT-FUNHOUSE", "Adafruit", "https://www.adafruit.com/product/4985"
6870
"M5CORE", "M5Stack", "https://docs.m5stack.com/en/core/BASIC%20v2.6"
6971
"S3BOX", "Espressif", "https://www.espressif.com/en/products/devkits/esp32-s3-box"
7072
"S3BOXLITE", "Espressif", "https://www.espressif.com/en/products/devkits/esp32-s3-box-lite"
@@ -138,6 +140,8 @@ most of the configuration will be set by default, but can be overridden if neede
138140
- **mirror_y** (**Required**, boolean): If true, mirror the y axis.
139141

140142
- **color_depth** (*Optional*): The color depth of the display buffer, expressed in bits. Options are ``16`` (default) and ``8``. 8 bit depth will result in only 256 possible colors and should be used only if the microcontroller has limited memory. The driver will convert the 8 bit color to the display chip's required format.
143+
- **buffer_size** (*Optional*): The percentage of screen size to allocate buffer memory. The default is ``100%`` when PSRAM is configured, and otherwise will be calculated to
144+
achieve a buffer size less than 20K bytes. See the discussion below about buffer sizes.
141145

142146
Advanced options
143147
^^^^^^^^^^^^^^^^
@@ -148,13 +152,35 @@ Advanced options
148152
- **data_rate** (*Optional*): The SPI data rate. Defaults to 10MHz but board presets may override this.
149153
- **spi_mode** (*Optional*): The SPI mode. Options are ``MODE0``, ``MODE1``, ``MODE2``, and ``MODE3``. Defaults to ``MODE0`` for single bit SPI and ``MODE3`` for octal SPI (parallel bus.)
150154
- **draw_rounding** (*Optional*): The rounding factor for drawing operations. Defaults to 2. Some chips require a higher value to avoid display artifacts. Must be a power of 2.
151-
- **draw_from_origin** (*Optional*): If true, drawing operations will always start from the origin (0,0) of the display. Defaults to false.
152155
- **use_axis_flips** (*Optional*): If true, the driver will use alternate bits in the MADCTL register to implement x and y mirroring. Defaults to false.
156+
- **byte_order** (*Optional*): The byte order of the display buffer. Options are ``big_endian`` (default) and ``little_endian``. This affects the byte order for the buffer when
157+
using 16 bit color depth. The default is appropriate for the majority of displays.
153158

154159
**Note:** The maximum achievable data rate will depend on the chip type (e.g. ESP32 vs ESP32-S3) the pins used (on ESP32 using the default SPI pins allows higher rates) and the connection type (on-board connections will support higher rates than long cables or DuPont wires.) If in doubt, start with a low speed and test higher rates to find what works. A MISO pin should preferably not be specified, as this will limit the maximum rate in some circumstances, and is not required if the SPI bus is used only for the display.
155160

161+
162+
Buffer Size
163+
------------
164+
165+
The display driver writes data from a buffer to the display chip. When using :doc:`/components/lvgl/index` no buffer is required in the display driver itself, as LVGL will
166+
allocate and use its own buffer.
167+
When instead using a lambda function to update the display (and not LVGL), a buffer is required to be allocated by the display driver.
168+
The size of this buffer is determined by the ``buffer_size`` option. The default is ``100%`` when PSRAM is configured, and otherwise will be calculated to
169+
achieve a buffer size less than 20K bytes. For example a display of size 320x240 will have a buffer size of ``320 * 240 * 2`` bytes (for RGB565) = ``153600`` bytes.
170+
If the buffer size is set to ``50%``, then the buffer would occupy ``76800`` bytes. If 8 bit color depth is used, then each pixel occupies only 1 byte.
171+
172+
Effect on Drawing Performance
173+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174+
175+
The buffer size is a trade-off between the size of the buffer and the performance of the display driver. A larger buffer size will provide better performance,
176+
but on boards with limited memory, a smaller buffer size may be required to avoid running out of memory. When using a buffer less than 100%, the driver will
177+
call the drawing lambda multiple times to draw each chunk of the display. For example, with a 25% buffer size, the driver will call the drawing lambda four times to draw the display.
178+
This has an effect on performance, and should be considered when setting the buffer size, but it is also important that the drawing lambda does not have
179+
side effects - this should be avoided in any case, but becomes more critical when using a buffer less than 100%.
180+
181+
156182
Additional inititialisation sequences
157-
*************************************
183+
--------------------------------------
158184

159185
The ``init_sequence`` option allows additional configuration of the driver chip. Provided commands will be sent to the
160186
driver chip in addition to, and after the chosen model's pre-defined commands. It requires a list of byte sequences:
@@ -170,12 +196,12 @@ Each entry represents a single-byte command followed by zero or more data bytes.
170196
If converting from other code, make sure the length byte, if present, is not copied as the length of each command sequence is determined by the number of bytes in the list.
171197

172198
CUSTOM model
173-
************
199+
------------
174200

175201
The ``CUSTOM`` model selection is provided for otherwise unsupported displays, and requires both ``dimensions:`` and ``init_sequence:`` to be specfied. There is no pre-defined init sequence.
176202

177203
Using the ``transform`` options
178-
*******************************
204+
-------------------------------
179205

180206
In most cases, the ``rotation`` option will be sufficient to orient the display correctly. However, some displays may require additional transformations. The ``transform`` option allows for these transformations to be applied in any of 8 different
181207
combinations. It may be necessary to experiment with different combinations to achieve the desired result. When using the ``transform`` option, the ``rotation`` option should not be set unless the display does not support axis-swapping.
@@ -209,5 +235,6 @@ See Also
209235
--------
210236

211237
- :doc:`index`
238+
- :doc:`/components/lvgl/index`
212239
- :apiref:`mipi_spi/mipi_spi.h`
213240
- :ghedit:`Edit`

0 commit comments

Comments
 (0)