Skip to content

Commit 602f9db

Browse files
cederomdpgeorge
authored andcommitted
docs/library/machine.UART: Add notes about UART init and deinit.
* `init()` can be called multiple times to reconfigure UART. * After `deinit()` it is impossible to call `init()` again. Signed-off-by: Tomasz 'CeDeROM' CEDRO <[email protected]>
1 parent 769262e commit 602f9db

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/library/machine.UART.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,22 @@ Methods
8787
When no pins are given, then the default set of TX and RX pins is taken, and hardware
8888
flow control will be disabled. If *pins* is ``None``, no pin assignment will be made.
8989

90+
.. note::
91+
It is possible to call ``init()`` multiple times on the same object in
92+
order to reconfigure UART on the fly. That allows using single UART
93+
peripheral to serve different devices attached to different GPIO pins.
94+
Only one device can be served at a time in that case.
95+
Also do not call ``deinit()`` as it will prevent calling ``init()``
96+
again.
97+
9098
.. method:: UART.deinit()
9199

92100
Turn off the UART bus.
93101

102+
.. note::
103+
You will not be able to call ``init()`` on the object after ``deinit()``.
104+
A new instance needs to be created in that case.
105+
94106
.. method:: UART.any()
95107

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

0 commit comments

Comments
 (0)