docs/library/machine.UART: Update and improve uart.any() docs.

pull/3098/head
Damien George 2017-05-17 17:24:59 +10:00
rodzic aca898eeb0
commit 436d97b3f9
1 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -65,8 +65,16 @@ Methods
.. method:: UART.any()
Return true value if there're characters available for reading. On some
boards, the number of available characters is returned.
Returns an integer counting the number of characters that can be read without
blocking. It will return 0 if there are no characters available and a positive
number if there are characters. The method may return 1 even if there is more
than one character available for reading.
For more sophisticated querying of available characters use select.poll::
poll = select.poll()
poll.register(uart, select.POLLIN)
poll.poll(timeout)
.. method:: UART.read([nbytes])