diff options
author | Damien George <damien.p.george@gmail.com> | 2017-05-17 17:24:59 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-05-19 15:48:22 +1000 |
commit | 436d97b3f9230b882fd152f36433a26832a0634b (patch) | |
tree | 5bef423e81baa4cce3718a167a0fd3e11bcbde8e /docs/library/machine.UART.rst | |
parent | aca898eeb0d85a8efbea9abea79c420118521ee9 (diff) | |
download | micropython-436d97b3f9230b882fd152f36433a26832a0634b.tar.gz micropython-436d97b3f9230b882fd152f36433a26832a0634b.zip |
docs/library/machine.UART: Update and improve uart.any() docs.
Diffstat (limited to 'docs/library/machine.UART.rst')
-rw-r--r-- | docs/library/machine.UART.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/library/machine.UART.rst b/docs/library/machine.UART.rst index 0b2ebbd0b5..f9c8efef78 100644 --- a/docs/library/machine.UART.rst +++ b/docs/library/machine.UART.rst @@ -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]) |