主权项 |
1. A method of operating a peripheral interface of a media-capable device, the method comprising:
connecting a first device to a connector of the peripheral interface; detecting a power signal on a power conductor of the connector, the power conductor being associated with a Universal Serial Bus (USB) data interface; based on the detection of the presence of the power signal, entering, by the peripheral interface, a peripheral mode, and receiving charging power on the power conductor from the first connected device; connecting a second device to a connector of the peripheral interface; detecting an absence of a power signal on the power conductor of the connector; and based on detecting the absence of the power signal, entering, by the peripheral interface, a host mode, and providing charging power on the power conductor to the second connected device, the method further comprising: when the first device is connected and after detecting the power signal, determining values of first and second signals on respective first and second conductors of the connector, the first and second conductors being associated with the USB data interface; and based on the determined values of the first and second signals, classifying the first connected device by ascertaining whether the first connected device is a power supply device and ascertaining whether the first connected device is a USB host device, wherein the determining the values of signals on the first and second conductors associated with the USB data interface comprises evaluating both a Single Ended 0 (SE0) condition and a Single Ended 1 (SE1) condition on a pair of differential (D+/D−) conductors of the USB interface, and wherein classifying the first connected device by ascertaining whether the first connected device is a power supply device and ascertaining whether the first connected device is a USB host device further comprises classifying the first connected device as a Type 1 power supply device when the SE1 condition is detected, classifying the first connected device as a Type 2 power supply device when the SE0 condition is detected, and classifying the first connected device as a USB host device when neither the SE0 nor the SE1 conditions are detected. |