docs/library/machine.UART.rst: Detail timeout behaviour of read methods.
Also document existence of "invert" argument to constructor.
This commit is contained in:
parent
99ed431d28
commit
5ef3b6b2d9
|
@ -58,6 +58,9 @@ Methods
|
||||||
- *rx* specifies the RX pin to use.
|
- *rx* specifies the RX pin to use.
|
||||||
- *txbuf* specifies the length in characters of the TX buffer.
|
- *txbuf* specifies the length in characters of the TX buffer.
|
||||||
- *rxbuf* specifies the length in characters of the RX buffer.
|
- *rxbuf* specifies the length in characters of the RX buffer.
|
||||||
|
- *timeout* specifies the time to wait for the first character (in ms).
|
||||||
|
- *timeout_char* specifies the time to wait between characters (in ms).
|
||||||
|
- *invert* specifies which lines to invert.
|
||||||
|
|
||||||
On the WiPy only the following keyword-only parameter is supported:
|
On the WiPy only the following keyword-only parameter is supported:
|
||||||
|
|
||||||
|
@ -87,7 +90,8 @@ Methods
|
||||||
.. method:: UART.read([nbytes])
|
.. method:: UART.read([nbytes])
|
||||||
|
|
||||||
Read characters. If ``nbytes`` is specified then read at most that many bytes,
|
Read characters. If ``nbytes`` is specified then read at most that many bytes,
|
||||||
otherwise read as much data as possible.
|
otherwise read as much data as possible. It may return sooner if a timeout
|
||||||
|
is reached. The timeout is configurable in the constructor.
|
||||||
|
|
||||||
Return value: a bytes object containing the bytes read in. Returns ``None``
|
Return value: a bytes object containing the bytes read in. Returns ``None``
|
||||||
on timeout.
|
on timeout.
|
||||||
|
@ -95,14 +99,16 @@ Methods
|
||||||
.. method:: UART.readinto(buf[, nbytes])
|
.. method:: UART.readinto(buf[, nbytes])
|
||||||
|
|
||||||
Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
|
Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
|
||||||
that many bytes. Otherwise, read at most ``len(buf)`` bytes.
|
that many bytes. Otherwise, read at most ``len(buf)`` bytes. It may return sooner if a timeout
|
||||||
|
is reached. The timeout is configurable in the constructor.
|
||||||
|
|
||||||
Return value: number of bytes read and stored into ``buf`` or ``None`` on
|
Return value: number of bytes read and stored into ``buf`` or ``None`` on
|
||||||
timeout.
|
timeout.
|
||||||
|
|
||||||
.. method:: UART.readline()
|
.. method:: UART.readline()
|
||||||
|
|
||||||
Read a line, ending in a newline character.
|
Read a line, ending in a newline character. It may return sooner if a timeout
|
||||||
|
is reached. The timeout is configurable in the constructor.
|
||||||
|
|
||||||
Return value: the line read or ``None`` on timeout.
|
Return value: the line read or ``None`` on timeout.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue