Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cederom doc uart update 20220818 #9067

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/esp32/quickref.rst
Expand Up @@ -216,9 +216,10 @@ They each have default GPIO assigned to them, however depending on your
ESP32 variant and board, these pins may conflict with embedded flash,
onboard PSRAM or peripherals.

Any GPIO can be used for hardware UARTs using the GPIO matrix, so to avoid
conflicts simply provide ``tx`` and ``rx`` pins when constructing. The default
pins listed below.
Any GPIO can be used for hardware UARTs using the GPIO matrix, except for
input-only pins 34-39 that can be used as ``rx``. To avoid conflicts simply
provide ``tx`` and ``rx`` pins when constructing. The default pins listed
below.

===== ===== ===== =====
\ UART0 UART1 UART2
Expand Down
12 changes: 12 additions & 0 deletions docs/library/machine.UART.rst
Expand Up @@ -87,10 +87,22 @@ Methods
When no pins are given, then the default set of TX and RX pins is taken, and hardware
flow control will be disabled. If *pins* is ``None``, no pin assignment will be made.

.. note::
It is possible to call ``init()`` multiple times on the same object in
order to reconfigure UART on the fly. That allows using single UART
peripheral to serve different devices attached to different GPIO pins.
Only one device can be served at a time in that case.
Also do not call ``deinit()`` as it will prevent calling ``init()``
again. Tested on ESP32.

.. method:: UART.deinit()

Turn off the UART bus.

.. note::
You will not be able to call ``init()`` on the object after ``deinit()``.
A new instance needs to be created in that case.

.. method:: UART.any()

Returns an integer counting the number of characters that can be read without
Expand Down