Skip to content

Commit d3705c6

Browse files
gijsiopeter-pycom
authored andcommitted
correct uart rx buffer size and max timeout chars
1 parent 3b1143c commit d3705c6

File tree

1 file changed

+4
-6
lines changed
  • content/firmwareapi/pycom/machine

1 file changed

+4
-6
lines changed

content/firmwareapi/pycom/machine/uart.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,21 @@ uart.read(5) # read up to 5 bytes
7676

7777
Construct a UART object on the given `bus`. `bus` can be `0, 1 or 2`. If the `bus` is not given, the default one will be selected (`0`) or the selection will be made based on the given pins.
7878

79-
{{% hint style="danger" %}}
80-
On the GPy/FiPy UART2 is unavailable because it is used to communicate with the cellular radio.
81-
{{% /hint %}}
79+
> On the GPy/FiPy UART2 is unavailable because it is used to communicate with the cellular radio.
8280
8381
## Methods
8482

85-
### uart.init([baudrate=9600, bits=8, parity=None, stop=1, timeout_chars=2, pins=(TXD, RXD, RTS, CTS), rx_buffer_size=512])
83+
### uart.init([baudrate=9600, bits=8, parity=None, stop=1, timeout_chars=2, pins=(TXD, RXD, RTS, CTS), rx_buffer_size=4096])
8684

8785
Initialise the UART bus with the given parameters:
8886

8987
* `baudrate` is the clock rate.
9088
* `bits` is the number of bits per character. Can be `5, 6, 7 or 8`.
9189
* `parity` is the parity, `None`, UART.EVEN or UART.ODD.
9290
* `stop` is the number of stop bits, `1 or 2`.
93-
* `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`.
91+
* `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`. The maximum value is 255
9492
* `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.
95-
* `rx_buffer_size` is the size of the buffer used for storing the RX packets. By default is is 512 bytes.
93+
* `rx_buffer_size` is the size of the buffer used for storing the RX packets. By default is is 4096 bytes (characters). The minimum buffer size is 128 bytes.
9694

9795
### uart.deinit()
9896

0 commit comments

Comments
 (0)