Skip to content

Commit 1d74559

Browse files
committed
docs/library/machine.UART: Remove some conditionals.
1 parent e322b2a commit 1d74559

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

docs/library/machine.UART.rst

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ UART objects can be created and initialised using::
1515
uart = UART(1, 9600) # init with given baudrate
1616
uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
1717

18-
.. only:: port_machineoard
18+
Supported paramters differ on a board:
1919

20-
Bits can be 7, 8 or 9. Parity can be None, 0 (even) or 1 (odd). Stop can be 1 or 2.
21-
22-
*Note:* with parity=None, only 8 and 9 bits are supported. With parity enabled,
23-
only 7 and 8 bits are supported.
24-
25-
.. only:: port_wipy
26-
27-
Bits can be 5, 6, 7, 8. Parity can be ``None``, ``UART.EVEN`` or ``UART.ODD``. Stop can be 1 or 2.
20+
Pyboard: Bits can be 7, 8 or 9. Stop can be 1 or 2. With `parity=None`,
21+
only 8 and 9 bits are supported. With parity enabled, only 7 and 8 bits
22+
are supported.
2823

24+
WiPy/CC3200: Bits can be 5, 6, 7, 8. Stop can be 1 or 2.
2925

3026
A UART object acts like a stream object and reading and writing is done
3127
using the standard stream methods::
@@ -47,22 +43,12 @@ using the standard stream methods::
4743

4844
uart.any() # returns True if any characters waiting
4945

50-
.. only:: port_wipy
51-
52-
To check if there is anything to be read, use::
53-
54-
uart.any() # returns the number of characters available for reading
55-
5646
Constructors
5747
------------
5848

59-
.. only:: port_wipy
49+
.. class:: UART(id, ...)
6050

61-
.. class:: UART(bus, ...)
62-
63-
Construct a UART object on the given bus. ``bus`` can be 0 or 1.
64-
If the bus is not given, the default one will be selected (0) or the selection
65-
will be made based on the given pins.
51+
Construct a UART object of the given id.
6652

6753
Methods
6854
-------
@@ -75,7 +61,7 @@ Methods
7561

7662
- ``baudrate`` is the clock rate.
7763
- ``bits`` is the number of bits per character, 7, 8 or 9.
78-
- ``parity`` is the parity, ``None``, ``UART.EVEN`` or ``UART.ODD``.
64+
- ``parity`` is the parity, ``None``, 0 (even) or 1 (odd).
7965
- ``stop`` is the number of stop bits, 1 or 2.
8066
- ``pins`` is a 4 or 2 item list indicating the TX, RX, RTS and CTS pins (in that order).
8167
Any of the pins can be None if one wants the UART to operate with limited functionality.
@@ -159,11 +145,6 @@ Methods
159145
Constants
160146
---------
161147

162-
.. data:: UART.EVEN
163-
.. data:: UART.ODD
164-
165-
parity types (along with ``None``)
166-
167148
.. data:: UART.RX_ANY
168149

169150
IRQ trigger sources

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy