Is it possible to set the UART TX buffer length? Is it possible to set it to 0 for an RX-only UART serial port?
The following works for setting the RX buffer length:
from pyb import UART
uart = UART(6)
uart.init(115200, rxbuf=64) # also accepts "read_buf_len" instead of "rxbuf"
but adding "txbuf=64" causes an "extra keyword argument" error.
I came across a Github discussion in 2018 between damien george and peter hinch that both "rxbuf" and "txbuf" were going to be added.
Thanks
UART TX buffer length
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: UART TX buffer length
Looking at the source I'm not sure if there is a txbuf. I've not got time to study it in detail but it looks as if it gets data bytes from the source array. This assumes that the source is unchanged until the blocking write is complete.
For what it's worth I'm not sure there's a need for a txbuf: uasyncio handles nonblocking UART I/O very effectively.
For what it's worth I'm not sure there's a need for a txbuf: uasyncio handles nonblocking UART I/O very effectively.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.