You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//| A common bidirectional serial protocol that uses an an agreed upon speed
52
-
//| rather than a shared clock line.
53
-
//|
54
-
//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only.
55
-
//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only.
56
-
//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use.
57
-
//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use.
58
-
//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use.
59
-
//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin.
60
-
//| :param int baudrate: the transmit and receive speed.
61
-
//| :param int bits: the number of bits per byte, 7, 8 or 9.
62
-
//| :param Parity parity: the parity used for error checking.
63
-
//| :param int stop: the number of stop bits, 1 or 2.
64
-
//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds.
65
-
//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.)
66
-
//|
67
-
//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds.
68
-
//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.
69
-
//|
43
+
44
+
//|class UART:
45
+
//| """.. currentmodule:: busio
46
+
//|
47
+
//| :class:`UART` -- a bidirectional serial protocol
//| def __init__(self, tx: microcontroller.Pin, rx: microcontroller.Pin, *, baudrate: int = 9600, bits: int = 8, parity: Parity = None, stop: int = 1, timeout: float = 1, receiver_buffer_size: int = 64):
50
+
//| """A common bidirectional serial protocol that uses an an agreed upon speed
51
+
//| rather than a shared clock line.
52
+
//|
53
+
//| :param ~microcontroller.Pin tx: the pin to transmit with, or ``None`` if this ``UART`` is receive-only.
54
+
//| :param ~microcontroller.Pin rx: the pin to receive on, or ``None`` if this ``UART`` is transmit-only.
55
+
//| :param ~microcontroller.Pin rts: the pin for rts, or ``None`` if rts not in use.
56
+
//| :param ~microcontroller.Pin cts: the pin for cts, or ``None`` if cts not in use.
57
+
//| :param ~microcontroller.Pin rs485_dir: the pin for rs485 direction setting, or ``None`` if rs485 not in use.
58
+
//| :param bool rs485_invert: set to invert the sense of the rs485_dir pin.
59
+
//| :param int baudrate: the transmit and receive speed.
60
+
//| :param int bits: the number of bits per byte, 7, 8 or 9.
61
+
//| :param Parity parity: the parity used for error checking.
62
+
//| :param int stop: the number of stop bits, 1 or 2.
63
+
//| :param float timeout: the timeout in seconds to wait for the first character and between subsequent characters when reading. Raises ``ValueError`` if timeout >100 seconds.
64
+
//| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.)
65
+
//|
66
+
//| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds.
67
+
//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds."""
0 commit comments