Pi Pico allows to assign different pins for UART0 and UART1.
I have a project where PICO would be communicating with several serial devices (more than 2), but where it is not so important if a data packet is lost.
Question: If I wire different devices to different pins GP0, GP12, GP16 for transmitting, would something like this work:
Not sure if Serial.end waits for the data in buffer to be sent, or one has to time Serial.end (), i.e. calculate how long it takes to send the data and then execute Serial.end?
The same thing can be done for RX? Obviously understaning that some data packets will be lost.
If I understand your question correctly, this statement might help. It is for Micropython but should apply for C++ as well.
It is possible to call init() multiple times on the same object in order to reconfigure UART on the fly. That allows using single UART peripheral to serve different devices attached to different GPIO pins. Only one device can be served at a time in that case. Also do not call deinit() as it will prevent calling init() again.