I plug an unknown USB-C cable into my computer.
Theoretically, could a program read information about that cable? In particular:
- What version of USB it supports: 2.0, 3.1, etc.
- Whether it supports Thunderbolt, etc.
- Whether it supports Power Delivery, Quick Charge, VOOC, SuperCharge, Pump Express, Super FlashCharge, etc.
- Up to what speed it can transfer data.
- Up to what wattage/amperage it can charge a high-spec device.
- I am on Linux, but answers for other OSes are fine too.
- Let’s say nothing is connected at the other end of the cable. But if really necessary, we can say a recent rooted Android phone is connected and can run whatever code is needed.
All answers of what Type-C connector can do and can’t are given in its specifications.
In brief, Type-C cable specs are nearly independent from USB data and USB Power Delivery (Type-C can support anything).
By specs, Type-C connector/cable provides two methods of self-identification.
First one is by combination of resistor pulls-up and pulls-down on both sides of CC wires. Since there are two CC pins in Type-C connectors, and several analog levels, many combinations are available. Other than connect function itself and basic determination of source-sink roles and power capacity, several “alternate” functions are defined, as Display Port, Audio, and Debug mode.
The second amendment to Type-C is the mandatory embedding of e-markers into every C-C cable. The information in e-marker contains name of manufacturer and current carrying capability of particular cable.
The state of CC1/CC2 pins is usually acquired by a special CC-controller chip. The CC-controller communicates with main system by I2C interface. The register-based interface is standardized in Intel document USB Type-C Connector System Software Interface Specification
So, partial answer your set of questions can be found in the following EE article. #1 and #5 is supported. #4 is the same as #1. Regarding #3, Type-C connector supports only one “charging signature”, which is Power Delivery specification. Regarding the second part of your notes, if nothing is connected on the other end of CC cable, I am not sure if presence of Ra alone will trigger any detection of the cable, need to check on this.