IC Switch Dual Throw

I have an application where I need to use a single CH340G IC to interface with a ATMEGA2560 and a ESP32.
So I have to switch the TX, RX,DTR, VCC, V3 lines between the 2560 and the ESP32.
The initial thought was to use a DIP. But it is bulkier and not efficient. Then I searched for a 5PDT SMD Switches they are either unavailable or does not come in 5 poles. So I thought if using a “Switching IC” to accomplish this task.

What is the IC you recommend to use?

EDIT-
I would like an IC that would work like this. Just one control signal provided by a single switch. And the control signal would cause to switch all the connections between two poles.
It is just like a 5 pole dual throw switch. But an IC. Hope this clarifies.
The image shows my idea. I won’t mind separate control signals for each switch. I can tie all together. Just this is my idea.

Thank you very much.

Why?

Manual or electronically controllable?

What are your space limitations?

Why not use two CH340G and switch USB?

Maybe just switch DTR.

Why?

Manual or electronically controllable?

Doesn't matter. Anyhow I am hoping to provide the control signal with one simple SMD toggle switch. It should cause the 5 connections to switch between the two poles of each switch. I have modified my post please check I have uploaded a simple sketch of the requirement.

What are your space limitations?

An SMD package is better

Why not use two CH340G and switch USB?

This idea did not occur to me actually. Thank you. But I am doing this for learning purpose. So I would like that switching thing.

Maybe just switch DTR.

Switching the DTR only won't work I think. Because the 2560 is 5V and the ESP32 is 3.3V. So the TX, RX lines too should switch. Or do you thing using a level shifter 5v to 3.3v with the TX and RX of the ESP32 would suffice?

Thank you very much for taking your time to help me out

MAX4948 might work, TQFN package.

Switching the power lines will be tricky though.

Better give this a lot more thought.

sahirudilan:
This idea did not occur to me actually. Thank you. But I am doing this for learning purpose. So I would like that switching thing.

It would definitely be a "learning purpose" to understand that there are proper ways to do things - in this case, use two USB interface chips and let the PC decide which to use - and bad ways to do things, such as what you described.

For the reasons given, notably the complications of switching the power and logic levels.