I am currently making a keyboard for a phone. It connects to the phone using USB-C.

I'd like to be able to charge the phone while the keyboard is connected, so I need some kind of pass-through charging option.

How do I signal the USB port that it should receive current instead of supplying it?

  • 2
    \$\begingroup\$ Op is designing a keyboard and needs information on usb c power designs, someone votes to close as a use question. Why do we even bother... \$\endgroup\$
    – Passerby
    May 10, 2022 at 16:10

1 Answer 1


USB pass through charging is done with power delivery communications. You would need to have a dual role port facing towards your phone. What happens, depends on what your device is doing at the moment.

Your device has no external power supply and connects as an upstream facing device

You wait for the phone to send its PD profiles and pick the 5V profile with the current your device requires. If extra associates are connected, you increase the current requested, and sending a capabilities mismatch if you need more power. (after which the phone asks you how much you really need)

Your device has external power and the initial port negotiates in an downstream facing configuration

In this case, you first read the able properties, then send a power delivery profile based on your power from the upstream power supply. You also request PD fast role swap, so you can quickly swap power if the power supply gets unplugged. (this will typically cause the other device to take over vcon power) Then the last step is sending a data role swap packet.

Your device has external power and the initial port negotiates in an upstream facing configuration

After the phone has send its source power delivery protocols, you request the first one at 0A current. You then ask for a vcon swap, and once accepted, you start powering vcon. You can then read the SOP' marker to se if the cable is 5A capable and EPR capable. Now that you know this, you can request a power role swap, an after that, you send your source power delivery packets, while also indicating you want to use PD fast role swap. The other device typically takes over vcon in response.

You are providing power to the other device and your own power fails

You directly send the PD fast role swap signal over the cable (typically via a dedicated chip instead of a slow microcontroller) The other side act fasts an provides VBUS once it drops to 5V, at the current you earlier indicated in your earlier request.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.