Skip to content

Commit 90ab93e

Browse files
committed
feat(serial_uart): improves Serial documentation
1 parent da4f4cd commit 90ab93e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

docs/en/api/serial.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,15 @@ ESP32-P4 5 1
4545
* HP (High-Performance) UARTs are the standard UART peripherals
4646
* LP (Low-Power) UARTs are available on some SoCs for ultra-low power applications
4747
* UART0 is typically used for programming and debug output (Serial Monitor)
48-
* Additional UARTs (Serial1, Serial2, etc.) are available for general-purpose communication
48+
* Additional UARTs (Serial1, Serial2, etc.) are available for general-purpose communication, including LP UARTs when available. The ESP32 Arduino Core automatically creates HardwareSerial objects for all available UARTs:
49+
50+
* ``Serial0`` (or ``Serial``) - UART0 (HP UART, typically used for programming and debug output)
51+
* ``Serial1``, ``Serial2``, etc. - Additional HP UARTs (numbered sequentially)
52+
* Additional Serial objects - LP UARTs, when available (numbered after HP UARTs)
53+
54+
**Example:** The ESP32-C6 has 2 HP UARTs and 1 LP UART. The Arduino Core creates ``Serial0`` and ``Serial1`` (HP UARTs) plus ``Serial2`` (LP UART) HardwareSerial objects.
55+
56+
**Important:** LP UARTs can be used as regular UART ports, but they have fixed GPIO pins for RX, TX, CTS, and RTS. It is not possible to change the pins for LP UARTs using ``setPins()``.
4957

5058
Arduino-ESP32 Serial API
5159
------------------------
@@ -61,8 +69,7 @@ Initializes the Serial port with the specified baud rate and configuration.
6169
6270
* ``baud`` - Baud rate (bits per second). Common values: 9600, 115200, 230400, etc.
6371

64-
**Special value:** ``0`` enables baud rate detection (ESP32, ESP32-S2 only). The function will attempt to detect the baud rate for up to ``timeout_ms`` milliseconds.
65-
72+
**Special value:** ``0`` enables baud rate detection (ESP32, ESP32-S2 only). The function will attempt to detect the baud rate for up to ``timeout_ms`` milliseconds. See the :ref:`Baud Rate Detection Example <baud-rate-detection-example>` for usage details.
6673
* ``config`` - Serial configuration (data bits, parity, stop bits):
6774

6875
* ``SERIAL_8N1`` - 8 data bits, no parity, 1 stop bit (default)
@@ -640,8 +647,10 @@ Where:
640647
Example Applications
641648
********************
642649

643-
Baud Rate Detection Example:
644-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
650+
.. _baud-rate-detection-example:
651+
652+
Baud Rate Detection Example
653+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
645654

646655
.. literalinclude:: ../../../libraries/ESP32/examples/Serial/BaudRateDetect_Demo/BaudRateDetect_Demo.ino
647656
:language: arduino

0 commit comments

Comments
 (0)