I'm designing a device, that will be connected to various Android devices with either microUSB B or USB C receptables (in order to make it futureproof) and will be exposing some irrevelant ICs to the phone via USB 2.0 OTG. The most crucial thing however is that my device should be able to charge the phone while attached. I have learned, that with microUSB B the ability to charge while connected to OTG depends heavily on the phone itself. Some phones require specific resistor on ID pin pulled to the ground (e.g. Samsung Galaxy S3, Galaxy Note 8.0 – AFAIK they jump to one of docking modes, that orders them to accept power and be USB host at the same time), some do not require any resistor, but instead attaching the power source to the OTG cable before plugging into the phone (e.g. all Xiaomi phones I tried) and some didn't work for me at all (e.g. Samsung Galaxy S5 – has anyone succeded?).
For now I think of just simply putting two receptables in my device, both microUSB B and USB C and make either of them disabling the other on connection. The idea for microUSB B is that I will use 5-wire microUSB B plug – microUSB B plug cable (possibly custom, found only 4-wired so far) to be able to manage ID line connection to ground with some digital resistor on my device (the device will be configurable).
But the real struggle begins with phones that have USB C connector. I have read some documentation and found out that the decision about setting host and slave in USB C – USB C connection is made based on CC pin pulling up/down with specific resistors. The same resistors also seem to resolve power delivery roles.
My question is: do I have to use USB Power Delivery protocol (so a specialized IC) in order to achieve a state in which the slave (my device – UFP) is powering the host (phone – DFP) or is it achievable with some pulling resistors setting/swapping?