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
Initialise the UART bus with the given parameters:
89
89
90
90
*`baudrate` is the clock rate.
91
91
*`bits` is the number of bits per character. Can be `5, 6, 7 or 8`.
92
-
*`parity` is the parity, `None`, UART.EVEN or UART.ODD.
92
+
*`parity` is the parity, `None`, `UART.EVEN` or `UART.ODD`.
93
93
*`stop` is the number of stop bits, `1 or 2`.
94
94
*`timeout_chars` Rx timeout defined in number of characters. The value given here will be multiplied by the time a characters takes to be transmitted at the configured `baudrate`.
95
95
*`pins` is a 4 or 2 item list indicating the TXD, RXD, RTS and CTS pins (in that order). Any of the pins can be `None` if one wants the UART to operate with limited functionality. If the RTS pin is given the the RX pin must be given as well. The same applies to CTS. When no pins are given, then the default set of TXD (P1) and RXD (P0) pins is taken, and hardware flow control will be disabled. If `pins=None`, no pin assignment will be made.
96
-
*`rx_buffer_size` is the size of the buffer used for storing the RX packets. By default is is 512 bytes.
96
+
*`invert` is the desired pin to be in inverse mode, by default none of the pins are inverted. Possible values are:
97
+
*`UART.INV_RX` inverts Receiver dataline.
98
+
*`UART.INV_TX` inverts Transmitter dataline.
99
+
*`UART.INV_CTS` inverts Clear To Send dataline.
100
+
*`UART.INV_RTS` inverts Request To Send dataline.
101
+
102
+
The values can be OR-ed together, for instance `invert=UART.INV_RX | UART.INV_TX`
103
+
*`rx_buffer_size` is the size of the buffer used for storing the RX packets. By default it is 512 bytes.
97
104
98
105
#### uart.deinit()
99
106
@@ -145,4 +152,5 @@ Waits at most `timeout_ms` for the last Tx transaction to complete. Returns `Tru
145
152
146
153
* Parity types (along with `None`): `UART.EVEN`, `UART.ODD`
0 commit comments