@@ -15,17 +15,13 @@ UART objects can be created and initialised using::
15
15
uart = UART(1, 9600) # init with given baudrate
16
16
uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
17
17
18
- .. only :: port_machineoard
18
+ Supported paramters differ on a board:
19
19
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.
28
23
24
+ WiPy/CC3200: Bits can be 5, 6, 7, 8. Stop can be 1 or 2.
29
25
30
26
A UART object acts like a stream object and reading and writing is done
31
27
using the standard stream methods::
@@ -47,22 +43,12 @@ using the standard stream methods::
47
43
48
44
uart.any() # returns True if any characters waiting
49
45
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
-
56
46
Constructors
57
47
------------
58
48
59
- .. only :: port_wipy
49
+ .. class :: UART(id, ...)
60
50
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.
66
52
67
53
Methods
68
54
-------
@@ -75,7 +61,7 @@ Methods
75
61
76
62
- ``baudrate `` is the clock rate.
77
63
- ``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) .
79
65
- ``stop `` is the number of stop bits, 1 or 2.
80
66
- ``pins `` is a 4 or 2 item list indicating the TX, RX, RTS and CTS pins (in that order).
81
67
Any of the pins can be None if one wants the UART to operate with limited functionality.
@@ -159,11 +145,6 @@ Methods
159
145
Constants
160
146
---------
161
147
162
- .. data :: UART.EVEN
163
- .. data :: UART.ODD
164
-
165
- parity types (along with ``None ``)
166
-
167
148
.. data :: UART.RX_ANY
168
149
169
150
IRQ trigger sources
0 commit comments