Is it possible to program some chip that can switch between USB host and slave mode over an single micro USB cable talking to an Android device?
It would be OK if there was a slight pause between the switch if we have to reconfigure the chip to reconnect to the Android.
I don't need to be connected in both modes at the same time.
Background:
I have a Android device that supports USB file transfer mode so I can pull files from my GNU/Linux laptop, so you connected to it from the PC where the android device is in slave mode. And you can attach to it with an OTG cable and the device is in master mode so I can attach a external keyboard. I can switch between it by pulling out the cable and switching between them.
Even better would be to able to have both master and slave connected at the same time via the same cable. Ideally I could connect to a RasPI or some other programmable micro controller like Arduino. But I am not sure exactly.
Possible Solution
I found this note that uses a FTDI Vinculum II controller https://www.ftdichip.com/Support/Documents/AppNotes/AN_323_VNC2_Host_to_Android_Open_Accessory_and_FT232.pdf but I don't understand it all yet. Does this look like a possible solution?
Any simple devices like rasberry pi that could be used?