RS485 / USB / RS232 on 1 UART

Yes, but I want to keep the two spi pins (SPI0 and SPI1)

And for the second, There is not one device at a time, but only one device ...

Basically, I come to connect in USB OR RS232 OR RS485 according to the needs.

But I don't have any information on who is logged in ... So I can't select the correct one ... (with serial1 or 2 or ...)

On the other hand if I have all the modules on a single line, I speak to them all at the same time and the one connected answers me, without interference ... And so it is on this point that I want to work, how to connect the 3 without problems on the line (I had thought of putting resistors