UART(tx, rx, *, baudrate=9600, bits=8, parity=None, stop=1, timeout=1000, receiver_buffer_size=64)¶
A common bidirectional serial protocol that uses an an agreed upon speed rather than a shared clock line.
Deinitialises the UART and releases any hardware resources for reuse.
No-op used by Context Managers.
Automatically deinitializes the hardware when exiting a context. See Lifetime and ContextManagers for more info.
Read characters. If
nbytesis specified then read at most that many bytes. Otherwise, read everything that arrives until the connection times out. Providing the number of bytes expected is highly recommended because it will be faster.
Returns: Data read Return type: bytes or None
Read bytes into the
nbytesis specified then read at most that many bytes. Otherwise, read at most
Returns: number of bytes read and stored into
Return type: bytes or None
Read a line, ending in a newline character.
Returns: the line read Return type: int or None
Write the buffer of bytes to the bus.
Returns: the number of bytes written Return type: int or None
The current baudrate.
The number of bytes in the input buffer, available to be read
Discard any unread characters in the input buffer.