diff options
| author | Tomasz 'CeDeROM' CEDRO <tomek@cedro.info> | 2022-08-18 06:02:53 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-08-26 15:13:45 +1000 |
| commit | 602f9db2f35924a687f8ded2170b2a0b0e13979a (patch) | |
| tree | 3211b2fedf1a12717a0280dac41e1c848bedfbe8 /docs | |
| parent | 769262ef03b4e7198759bcc72c87c7ca5fc7de29 (diff) | |
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 <tomek@cedro.info>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/library/machine.UART.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/library/machine.UART.rst b/docs/library/machine.UART.rst index e23952573..1d54174c9 100644 --- a/docs/library/machine.UART.rst +++ b/docs/library/machine.UART.rst @@ -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. + .. 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 |
