From d3705c66d05379b0d13bbaced5adbd92a3ef1c0e Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 19 Jul 2021 12:06:42 +0200 Subject: [PATCH] correct uart rx buffer size and max timeout chars --- content/firmwareapi/pycom/machine/uart.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/content/firmwareapi/pycom/machine/uart.md b/content/firmwareapi/pycom/machine/uart.md index b0d85f0..78e67b8 100644 --- a/content/firmwareapi/pycom/machine/uart.md +++ b/content/firmwareapi/pycom/machine/uart.md @@ -76,13 +76,11 @@ uart.read(5) # read up to 5 bytes 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. -{{% hint style="danger" %}} -On the GPy/FiPy UART2 is unavailable because it is used to communicate with the cellular radio. -{{% /hint %}} +> On the GPy/FiPy UART2 is unavailable because it is used to communicate with the cellular radio. ## Methods -### uart.init([baudrate=9600, bits=8, parity=None, stop=1, timeout_chars=2, pins=(TXD, RXD, RTS, CTS), rx_buffer_size=512]) +### uart.init([baudrate=9600, bits=8, parity=None, stop=1, timeout_chars=2, pins=(TXD, RXD, RTS, CTS), rx_buffer_size=4096]) Initialise the UART bus with the given parameters: @@ -90,9 +88,9 @@ Initialise the UART bus with the given parameters: * `bits` is the number of bits per character. Can be `5, 6, 7 or 8`. * `parity` is the parity, `None`, UART.EVEN or UART.ODD. * `stop` is the number of stop bits, `1 or 2`. -* `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`. +* `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 * `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. -* `rx_buffer_size` is the size of the buffer used for storing the RX packets. By default is is 512 bytes. +* `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. ### uart.deinit()