CN111949107B - Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment - Google Patents

Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment Download PDF

Info

Publication number
CN111949107B
CN111949107B CN201910408054.4A CN201910408054A CN111949107B CN 111949107 B CN111949107 B CN 111949107B CN 201910408054 A CN201910408054 A CN 201910408054A CN 111949107 B CN111949107 B CN 111949107B
Authority
CN
China
Prior art keywords
usb type
voltage
interface
port
mode
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910408054.4A
Other languages
Chinese (zh)
Other versions
CN111949107A (en
Inventor
陈建立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201910408054.4A priority Critical patent/CN111949107B/en
Publication of CN111949107A publication Critical patent/CN111949107A/en
Application granted granted Critical
Publication of CN111949107B publication Critical patent/CN111949107B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The disclosure relates to a method and a device for controlling electronic equipment comprising an USB Type-C interface and the electronic equipment. A method of controlling an electronic device including a USB Type-C interface, comprising: monitoring the USB Type-C interface to determine whether USB Type-C external equipment is inserted; and controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result. It can be seen that, in this embodiment, by adjusting the operation mode of the designated port, the output voltage of the designated port can be adjusted. For example, when no USB Type-C external device is inserted, the designated port may be adjusted to the UFP mode, that is, the output voltage of the designated port is 0V, so that the voltage difference between the designated port and the adjacent port may be reduced, and the USB Type-C interface is prevented from having a micro battery phenomenon, which is favorable for reducing the power consumption of the electronic device and the success rate of identifying the external device.

Description

Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment
Technical Field
The disclosure relates to the technical field of control, and in particular relates to a method and a device for controlling electronic equipment comprising an USB Type-C interface and the electronic equipment.
Background
At present, the USB Type-C data line has the advantages of no need of considering front and back sides, high charging voltage, high charging current, high transmission speed and the like, and is increasingly applied to the aspect of mobile terminals. When charging the mobile terminal, if sweat in the hand of a user or a charging environment is moist, a water film can be formed on the metal surface of the USB Type-C interface, carbon dioxide, sulfur dioxide and/or nitrogen dioxide and the like in the air can be dissolved in the water film to form electrolyte solution, and a micro battery can be formed on the USB Type-C interface by adding pins of the USB Type-C interface. And (3) performing an oxidation reaction on the anode of the micro battery to dissolve the anode and form metal corrosion, and finally enabling adjacent pins on the USB Type-C interface to be micro-shorted.
After the USB Type-C interface is micro-shorted, the interface function of the mobile terminal may be abnormal, for example, OTG (On The GO) devices and USB Type-C interface chips supporting PD (Power Device) cannot be identified, which causes problems of higher Power consumption and shorter standby time of the mobile terminal.
Disclosure of Invention
The disclosure provides a method and a device for controlling electronic equipment comprising a USB Type-C interface, and the electronic equipment, so as to solve the defects of the related technology.
According to a first aspect of embodiments of the present disclosure, there is provided a method of controlling an electronic device including a USB Type-C interface, including:
monitoring the USB Type-C interface to determine whether USB Type-C external equipment is inserted;
and controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result.
Optionally, monitoring the USB Type-C interface to determine whether a USB Type-C external device is plugged in includes:
monitoring the voltage of any public pin in the USB Type-C interface;
if the voltage of the common pin is high voltage, determining that the monitoring result is that no USB Type-C external equipment is inserted; and if the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
Optionally, controlling the working mode of the designated port in the USB Type-C interface according to the monitoring result includes:
if the monitoring result shows that no USB Type-C external equipment is inserted, determining that the working mode of the designated port is a first mode so as to reduce the voltage difference between the output voltages of the designated port and the adjacent ports; or,
and if the monitoring result indicates that the USB Type-C external device is inserted, determining that the working mode of the designated port is a second mode so as to detect the Type of the USB Type-C external device.
Optionally, the designated port includes a CC port.
Optionally, when the first mode is an upstream port UFP mode, the CC port output voltage is 0V; and when the second mode is a dual-role port DRP mode, the waveform of the CC port output voltage is a square wave.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for controlling an electronic device including an USB Type-C interface, including:
the interface monitoring module is used for monitoring the USB Type-C interface to determine whether USB Type-C external equipment is inserted;
and the working mode determining module is used for controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result.
Optionally, the interface monitoring module includes:
the voltage monitoring unit is used for monitoring the voltage of any common pin in the USB Type-C interface;
the peripheral equipment insertion determining unit is used for determining that the USB Type-C external equipment is not inserted when the voltage of the common pin is high; and when the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
Optionally, the operation mode determining module includes:
the first mode determining unit is used for determining that the working mode of the designated port is a first mode when the monitoring result indicates that no USB Type-C external equipment is inserted, so as to reduce the voltage difference between the designated port and the voltages output by the adjacent ports; or,
and the second mode determining unit is used for determining that the working mode of the appointed port is a second mode when the monitoring result shows that the USB Type-C external device is inserted, so as to detect the Type of the USB Type-C external device.
Optionally, the designated port includes a CC port.
Optionally, when the first mode is an upstream port UFP mode, the CC port output voltage is 0V; and when the second mode is a dual-role port DRP mode, the waveform of the CC port output voltage is a square wave.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device including a power management unit and a plug detection circuit; the plug detection circuit is respectively connected with a detection pin of the power management unit and a common pin in the USB Type-C interface and is used for adjusting the voltage of the detection pin according to the voltage of the common pin; the voltage of the common pin is related to whether USB Type-C external equipment is plugged in or not;
common pins in the USB Type-C interface are not shorted with other common pins.
Optionally, the plug detection circuit comprises a voltage division circuit, a first inverter and a second inverter which are sequentially connected in series; the voltage dividing circuit is used for outputting a first voltage according to the common pin; the first inverter is used for inverting the first voltage to obtain a second voltage; the second inverter is used for inverting the second voltage to obtain a first voltage.
Optionally, the voltage dividing circuit includes a first resistor, a second resistor and a zener diode; the first end of the first resistor is connected with a power supply, and the second end of the first resistor and the first end of the second resistor are connected with the output end of the voltage dividing circuit; the second end of the second resistor and the cathode of the zener diode are connected to the input end of the voltage dividing circuit, and the anode of the zener diode is grounded.
Optionally, the first inverter includes a first transistor and a second transistor; the control electrode of the first transistor and the control electrode of the second transistor are connected to the input end of the first inverter; a first pole of the first transistor is connected with a power supply, and a second pole of the first transistor and a first pole of the second transistor are connected with an output end of the first inverter; a second pole of the second transistor is grounded; the first transistor is an N-type transistor, and the second transistor is a P-type transistor.
Optionally, the second inverter includes a third transistor and a third resistor; the first end of the third resistor is connected with a power supply, and the second end of the third resistor and the first electrode of the third transistor are connected with the output end of the second inverter; the second electrode of the third transistor is grounded, and the control electrode of the third transistor is connected with the input end of the second inverter.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
as can be seen from the above embodiments, in the embodiments of the present disclosure, by monitoring the USB Type-C interface, whether an USB Type-C external device is plugged in is determined; and controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result. It can be seen that, in this embodiment, by adjusting the operation mode of the designated port, the output voltage of the designated port can be adjusted. For example, when no USB Type-C external device is inserted, the designated port may be adjusted to the UFP mode, that is, the output voltage of the designated port is 0V, so that the voltage difference between the designated port and the adjacent port may be reduced, and the USB Type-C interface is prevented from generating a micro battery phenomenon or slowing down the micro battery phenomenon, which is beneficial to reducing the power consumption of the electronic device and the success rate of identifying the external device.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a pin diagram of ports of a USB Type-C interface shown in the related art;
FIG. 2 is a circuit diagram illustrating a configuration channel in accordance with an exemplary embodiment;
FIG. 3 is a waveform diagram illustrating configuration channel output voltages according to an exemplary embodiment;
FIG. 4 is a block diagram of an electronic device, shown in accordance with an exemplary embodiment;
FIG. 5 is a functional block diagram of a plug detection circuit, according to an example embodiment;
FIG. 6 is a flowchart illustrating a method of controlling an electronic device that includes a USB Type-C interface, according to an example embodiment;
FIG. 7 is a flowchart illustrating another method of controlling an electronic device that includes a USB Type-C interface, according to an example embodiment;
FIG. 8 is a block diagram illustrating an apparatus for controlling an electronic device including a USB Type-C interface, according to an exemplary embodiment;
FIG. 9 is a block diagram illustrating another apparatus for controlling an electronic device including a USB Type-C interface, according to an example embodiment;
fig. 10 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus consistent with some aspects of the disclosure as detailed in the accompanying claims.
At present, the USB Type-C data line has the advantages of no need of considering front and back sides, high charging voltage, high charging current, high transmission speed and the like, and is increasingly applied to the aspect of mobile terminals. When charging the mobile terminal, if sweat in the hand of a user or a charging environment is moist, a water film can be formed on the metal surface of the USB Type-C interface, carbon dioxide, sulfur dioxide and/or nitrogen dioxide and the like in the air can be dissolved in the water film to form electrolyte solution, and a micro battery can be formed on the USB Type-C interface by adding pins of the USB Type-C interface. And (3) performing an oxidation reaction on the anode of the micro battery to dissolve the anode and form metal corrosion, and finally enabling adjacent pins on the USB Type-C interface to be micro-shorted.
Fig. 1 is a pin diagram of each port of an USB Type-C interface shown in the related art, fig. 2 is a circuit diagram of a configuration channel according to an exemplary embodiment, fig. 3 is a waveform diagram of an output voltage of the configuration channel according to an exemplary embodiment, referring to fig. 1, fig. 2 and fig. 3, when an USB Type-C external device is plugged in, a processor CPU in an electronic device needs to determine whether the USB Type-C external device is a master device or a slave device by closing or opening a switch K1 and a switch K2 because it cannot determine whether the USB Type-C external device is the master device or the slave device. When the CPU turns on the switch K1 and turns off the switch K2, the pin CC (Configuration Channel, configuration channel pin) is pulled up to the power supply VDD, the pin CC output voltage becomes high level, in which case the slave can be accessed; when the CPU turns on switch K2 and turns off switch K1, pin CC is pulled down to ground, pin CC output voltage becomes 0, in which case the master can be switched on. The processor can thus determine the Type of USB Type-C external device by controlling switches K1 and K2. The above process is also called that the Port CC is in DRP operation mode (Dual Role Port), the waveforms of the output voltages of the pins CC1 and CC2 are Toggle square waves, and the output voltages of the other pins of the USB Type-C interface are all 0V (or common voltage). Wherein port CC and pin CC are references to pin CC in the USB Type-C interface from different angles, wherein port CC describes pin CC from the perspective of the electronic device, and pin CC describes pin CC from the perspective of the USB Type-C interface.
When the micro battery phenomenon occurs in the USB Type C interface, namely electrochemical corrosion occurs, micro short circuit can occur between the pin CC and the adjacent pins Vbus and between the pin CC and the adjacent pin D+. Since pin Vbus connects uF-level capacitance, when pin CC and Vbus are micro-shorted, rising and falling delays of toggle square wave will be slowed down.
The TCPC protocol specifies that the rise time (rising time) and (falling time) of the Toggle square wave of USB Type C cannot exceed a set threshold, e.g., 500us or 130us. If the set threshold is exceeded, the power transmission PD chip can report an interrupt continuously to wake up the CPU, so that the power consumption of the electronic equipment is higher and the standby time is shorter.
In addition, after the USB Type-C interface is micro-shorted, the mobile terminal may also cause a USB Type-C interface chip that cannot identify OTG (On The GO) devices and cannot support PD (Power Device).
For this reason, the embodiments of the present disclosure provide a method and apparatus for controlling an electronic device including an USB Type-C interface, and further provide an electronic device, where the inventive concept is to reduce an average voltage of a pin CC when the USB Type-C interface of the USB Type-C device is not inserted into an USB Type-C external device, thereby reducing a voltage difference between the pin CC and an adjacent pin, avoiding or alleviating a micro battery phenomenon, and slowing down a rate of electrochemical corrosion.
To implement a method for controlling an electronic device including a USB Type-C interface, in an embodiment of the present disclosure, a plug detection circuit is added to the electronic device, and fig. 4 is a block diagram of an electronic device, which is shown in accordance with an exemplary embodiment, see fig. 4, and includes a power management unit, a common pin, and a plug detection circuit. The plug detection circuit is arranged between the power management unit and the common pin, is respectively connected with the detection pin of the power management unit and the common pin in the USB Type-C interface, and is used for adjusting the voltage of the detection pin according to the voltage of the common pin.
The voltage of the common pin is related to whether the USB Type-C external device is plugged in or not. For example, when the USB Type-C external device is not plugged in, the common pin GND-DET is suspended, the voltage on the common pin GND-DET may be regarded as a high voltage, and the voltage on the detection pin GPIO on the power management unit may also be a high voltage through adjustment of the plug detection circuit. The power management unit can report the high voltage of the detection pin GPIO to the processor CPU, so that the processor CPU can determine that no USB Type-C external device is inserted into the USB Type-C interface.
For another example, when the USB Type-C external device is plugged into the USB Type-C interface, the common pin GND-DET is changed from suspended to grounded, the upper voltage of the common pin GND-DET is changed into low voltage, and the upper voltage of the detection pin GPIO on the power management unit can also be low voltage through the adjustment of the plug detection circuit, and the power management unit can report the low voltage of the detection pin GPIO to the processor CPU, so that the processor CPU can determine that the USB Type-C external device is plugged into the USB Type-C interface.
It should be noted that the power management unit (Power Management Unit, PMU) may be implemented by a power management unit in the related art, and the circuit implementation and the working principle thereof may refer to the related art, which is not described herein.
In this embodiment, the common pin GND-DET is any one of four common pins GND in the USB Type-C interface, such as pins A1, a12, B1, or B12 in fig. 1. In practical application, common pin in USB Type-C interface can inside short circuit, also can not short circuit. In this embodiment, the common pins GND-DET are not shorted with other common pins GND, so as to achieve the effect of effectively detecting the plugging of the external device.
In view of the voltage relationship between the common pin GND-DET and the pin GPIO of the power management unit, in this embodiment, the plug detection circuit may include different functional units, and fig. 5 is a functional block diagram of a plug detection circuit according to an exemplary embodiment, and referring to fig. 5, a plug detection circuit includes a voltage division circuit 10, a first inverter 20, and a second inverter 30 connected in series in this order. The voltage dividing circuit 10 is configured to output a first voltage according to a voltage of the common pin GND-DET, wherein the voltage of the common pin GND-DET may include a high voltage when floating and a low voltage when grounded, and the high voltage and the low voltage refer to logic levels. The first voltage refers to a voltage at the node P1, and may include a high voltage and a low voltage. The first inverter 20 is configured to invert a first voltage to obtain a second voltage, which is a voltage at the node P2 and may include a high voltage and a low voltage. The second inverter 30 is configured to invert the second voltage to obtain the first voltage.
With continued reference to fig. 5, the voltage divider circuit 10 includes a first resistor R1, a second resistor R2, and a zener diode Dz. The first end (the upper end of R1 shown in fig. 5) of the first resistor R1 is connected to the power supply VDD, and the second end (the lower end of R2 shown in fig. 5) of the first resistor R2 and the first end (the upper end of R2 shown in fig. 5) of the second resistor R2 are connected to the node P1 which is the output end of the voltage divider circuit. The second end (lower end of R2 shown in fig. 5) of the second resistor R2 and the cathode (upper end of Dz shown in fig. 5) of the zener diode Dz are connected to the input end of the voltage divider circuit, and the anode (lower end of Dz shown in fig. 5) of the zener diode is grounded GND.
In some embodiments, the first resistor R1 may be set to a resistance value of 1 mohm and the second resistor R2 may be set to a resistance value of 1 kohm so that the node P1 may be pulled up or pulled up to a suitable voltage. To ensure that the common pin GND-DET is high during floating, a zener diode Dz is provided in this embodiment. The voltage value of the zener diode Dz may be set according to the threshold voltage of the first inverter 20, and the content of the threshold voltage may refer to the related art, which is not described herein.
The operating principle of the voltage dividing circuit 10 includes:
when the common pin GND-DET is suspended, i.e. the voltage is high, the USB Type-C external device is not plugged into the USB Type-C interface, and the voltage at the node P1 is pulled up to the voltage of the power supply VDD, i.e. the voltage at the node P1 is high.
When the common pin GND-DET is grounded, i.e. the voltage is low, the USB Type-C external device is plugged into the USB Type-C interface, and the voltage at the node P1 is pulled down to the common voltage (0V), i.e. the voltage at the node P1 is low.
With continued reference to fig. 5, the first inverter 20 includes a first transistor M1 and a second transistor M2. The first transistor M1 is an N-type transistor, such as an NMOS transistor, and the second transistor M2 is a P-type transistor, such as a PMOS transistor. The gate of the first transistor M1 (the end on the left side of M1 in fig. 5) and the gate of the second transistor M2 (the end on the left side of M2 in fig. 5) are connected to the input terminal (node P1) of the first inverter 20. A first pole of the first transistor M1 (an upper end on the right side of M1 shown in fig. 5) is connected to the power supply VDD, and a second pole (a lower end on the right side of M1 shown in fig. 5) of the first transistor M1 and a first pole of the second transistor M2 (an upper end on the right side of M2 shown in fig. 5) are connected to an output terminal (which may be understood as a node P2) of the first inverter 20; the second pole of the second transistor M2 (the lower end on the right side of M2 shown in fig. 5) is grounded GND.
The operating principle of the first inverter 20 includes:
when the voltage at the node P1 is high, i.e. the input terminal of the first inverter 20 inputs high voltage, the second transistor M2 is turned on and the first transistor M1 is turned off, and the node P2 is grounded, i.e. the voltage at the node P2 is low.
When the voltage at the node P1 is low, i.e. the input terminal of the first inverter 20 inputs low voltage, the second transistor M2 is turned off and the first transistor M1 is turned on, and the node P2 is pulled up to the power supply VDD, i.e. the voltage at the node P2 is high.
In other words, the first inverter 20 inverts the input first voltage to obtain the second voltage.
With continued reference to fig. 5, the second inverter 30 includes a third transistor M3 and a third resistor R3. The third transistor M3 is a P-type transistor, such as a PMOS transistor. The first end (the upper end of R3 shown in fig. 5) of the third resistor R3 is connected to the power supply VDD, the second end (the lower end of R3 shown in fig. 5) of the third resistor R3 and the first pole (the upper end on the right side of M3 shown in fig. 5) of the third transistor M3 are connected to the output end (node P3) of the second inverter 20; the second pole (the lower end on the right side of M3 in fig. 5) of the third transistor M3 is grounded GND, and the control pole (the end on the left side of M3 in fig. 5) thereof is connected to the input end (which can be understood as node P2) of the second inverter 30.
The second inverter 30 operates on the principle that:
when the voltage at the node P2 is high, i.e., the input terminal of the second inverter 30 inputs high voltage, the third transistor M3 is turned on, and the node P3 is grounded, i.e., the voltage at the node P3 is pulled down to low voltage.
When the voltage at the node P2 is low, i.e., the input terminal of the second inverter 30 inputs a low voltage, the third transistor M3 is turned off, and the node P3 is pulled up to the power supply VDD, i.e., the voltage at the node P3 is high.
In other words, the second inverter 30 inverts the input second voltage to obtain the first voltage.
It should be noted that, in the present embodiment, the second inverter 30 may also have the same circuit structure as the first inverter 20, and the corresponding circuit falls within the protection scope of the present application when the voltage of the first inverter 20 can be adjusted.
Based on the above electronic device including the plug detection circuit, the embodiment of the disclosure further provides a method for controlling an electronic device including a USB Type-C interface, which may be applied to an electronic device provided with a USB Type-C interface, where the electronic device includes a processor and a memory in addition to a power management unit and the plug detection circuit, and the processor reads executable instructions from the memory to implement a method for controlling an electronic device including a USB Type-C interface shown in fig. 6. Referring to fig. 6, a method of controlling an electronic device including a USB Type-C interface includes steps 601 and 602, wherein:
in step 601, the USB Type-C interface is monitored to determine if any USB Type-C external devices are plugged in.
In this embodiment, the processor may monitor the USB Type-C interface in the electronic device, including the following ways:
in one mode, the electronic device includes a power management unit PMU, which may be configured to detect a voltage at a pin GPIO connected to the plug detection circuit. The processor can communicate with the power management unit PMU to acquire the voltage at the GPIO of the detection pin reported by the power management unit PMU, and then whether the USB Type-C external device is inserted is determined according to the voltage at the GPIO of the detection pin reported by the power management unit PMU.
Because the detection pin GPIO is connected with any public pin in the USB Type-C interface through the plug detection circuit, the power management unit PMU detects the voltage of any public pin GND-DET in the USB Type-C interface while detecting the voltage of the detection pin GPIO.
Finally, whether the USB Type-C external device is plugged into the interface can be determined based on the voltage of the USB Type-C interface. For example, if the voltage of the common pin is high, determining that the monitoring result is that no USB Type-C external device is inserted; and if the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
In a second manner, referring to fig. 7, the processor may be connected to the common pin GND-DET of the USB Type-C interface and monitor the voltage of the common pin GND-DET of the USB Type-C interface (corresponding to step 701).
And then determining whether the USB Type-C external device is inserted into the interface according to the voltage of the common pin GND-DET. If the voltage of the common pin is high voltage, determining that the monitoring result is that no USB Type-C external equipment is inserted; if the voltage of the common pin is low, it is determined that the monitoring result is that USB Type-C external device is inserted (corresponding to step 702).
In step 602, the working mode of the designated port in the USB Type-C interface is controlled according to the monitoring result.
In this embodiment, when the monitoring result indicates that no USB Type-C external device is plugged into the interface, the processor may determine that the operation mode of the designated port is the first mode, so as to reduce the voltage difference between the voltages output by the designated port and the adjacent ports. For example, the designated port in this embodiment may include a port CC, such as pin CC1 or pin CC2 shown in fig. 1. The first mode is to set the port CC to UFP mode (Upstream Facing Port, upstream port) to have the port CC output voltage at or near 0V, thereby reducing the voltage difference between the port CC and the adjacent port (Vbus or d+). The principle of which can be referred to the inventive concept described above and will not be described in detail here. In this mode, a typical example of an electronic device may be a USB flash drive or a removable hard drive, both of which are read data and powered from VBUS.
Or,
when the monitoring result is that the USB Type-C external device is inserted, the processor determines that the working mode of the appointed port is a second mode so as to detect the Type of the USB Type-C external device. For example, the second mode of the port CC may include a DRP mode, i.e., the port CC outputs a toggle square wave to detect whether the Type of USB Type-C external device is a master or a slave. In this mode, a typical example of the electronic device may be a computer, i.e., a host that can be a USB or a charged device.
Since the embodiments of the present disclosure have described the operation processes of the power management unit PMU, the plug detection circuit, and the processor in detail in the embodiments describing the plug detection circuit, the scheme of an embodiment of a method for controlling an electronic device including an USB Type-C interface may also refer to the content of the embodiments shown in fig. 4 and 5, which are not described herein again.
So far, in the embodiment of the present disclosure, by monitoring the USB Type-C interface, it is determined whether an USB Type-C external device is inserted; and controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result. It can be seen that, in this embodiment, by adjusting the operation mode of the designated port, the output voltage of the designated port can be adjusted. For example, when no USB Type-C external device is inserted, the designated port may be adjusted to the UFP mode, that is, the output voltage of the designated port is 0V, so that the voltage difference between the designated port and the adjacent port may be reduced, and the USB Type-C interface is prevented from generating a micro battery phenomenon or slowing down the micro battery phenomenon, which is beneficial to reducing the power consumption of the electronic device and the success rate of identifying the external device.
On the basis of the method for controlling the electronic device including the USB Type-C interface provided in the embodiments of the present disclosure, the embodiments of the present disclosure further provide an apparatus for controlling the electronic device including the USB Type-C interface, and fig. 8 is a block diagram illustrating an apparatus for controlling the electronic device including the USB Type-C interface according to an exemplary embodiment. Referring to fig. 8, an apparatus for controlling an electronic device including an USB Type-C interface, includes:
the interface monitoring module 801 is configured to monitor the USB Type-C interface to determine whether an USB Type-C external device is inserted;
the working mode determining module 802 is configured to control a working mode of a designated port in the USB Type-C interface according to a monitoring result.
FIG. 9 is a block diagram illustrating another apparatus for controlling an electronic device including a USB Type-C interface, according to an example embodiment. In an apparatus for controlling an electronic device including an USB Type-C interface shown in fig. 8, referring to fig. 9, an interface monitoring module 801 includes:
the voltage monitoring unit 901 is configured to monitor a voltage of any common pin in the USB Type-C interface;
a peripheral insertion determining unit 902, configured to determine that the monitoring result is that no USB Type-C external device is inserted when the voltage of the common pin is a high voltage; and when the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
In one embodiment, the operation mode determination module 802 includes:
the first mode determining unit is used for determining that the working mode of the designated port is a first mode when the monitoring result indicates that no USB Type-C external equipment is inserted, so as to reduce the voltage difference between the designated port and the voltages output by the adjacent ports; or,
and the second mode determining unit is used for determining that the working mode of the appointed port is a second mode when the monitoring result shows that the USB Type-C external device is inserted, so as to detect the Type of the USB Type-C external device.
It can be understood that the apparatus for controlling an electronic device including an USB Type-C interface provided in the embodiments of the present application corresponds to the above method for controlling an electronic device including an USB Type-C interface, and specific content may refer to content of each embodiment of the method, which is not described herein again.
Fig. 10 is a block diagram of an electronic device 1000, shown in accordance with an exemplary embodiment. For example, the electronic device 1000 may be an electronic device such as a cell phone, tablet computer, electronic book reader, multimedia playing device, wearable device, vehicle-mounted terminal, etc.
Referring to fig. 10, an electronic device 1000 may include one or more of the following components: a processing component 1002, a memory 1004, a power component 1006, a multimedia component 1008, an audio component 1010, an input/output (I/O) interface 1012, a sensor component 1014, and a communications component 1016. The input/output (I/O) interface 1012 may include an USB Type-C interface, in which the plug detection circuit shown in fig. 4 and 5 may be disposed, and the specific content may refer to the content of the embodiment shown in fig. 4 and 5.
The processing component 1002 generally controls overall operation of the electronic device 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1002 can include one or more processors 1020 for executing instructions to perform the steps of one method of controlling an electronic device including a USB Type-C interface as shown in fig. 6 and 7. Further, the processing component 1002 can include one or more modules that facilitate interaction between the processing component 1002 and other components. For example, the processing component 1002 can include a multimedia module to facilitate interaction between the multimedia component 1008 and the processing component 1002.
The memory 1004 is configured to store various types of data to support operations at the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1004 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 1006 provides power to the various components of the electronic device 1000. The power components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1000.
The multimedia component 1008 includes a display screen between the electronic device 1000 and the user that provides an output interface. In some embodiments, the multimedia assembly 1008 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1000 is in an operational mode, such as a shooting mode or a video mode, the front-facing camera and/or the rear-facing camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1010 is configured to output and/or input audio signals. For example, the audio component 1010 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in memory 1004 or transmitted via communication component 1016. In some embodiments, the audio component 1010 further comprises a speaker for outputting audio signals.
The I/O interface 1012 provides an interface between the processing assembly 1002 and peripheral interface modules, which may be a keyboard, click wheel, buttons, and the like. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1014 includes one or more sensors for providing status assessment of various aspects of the electronic device 1000. For example, the sensor assembly 1014 may detect an on/off state of the electronic device 1000, a relative positioning of components such as a display and keypad of the electronic device 1000, the sensor assembly 1014 may also detect a change in position of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of a user's contact with the electronic device 1000, an orientation or acceleration/deceleration of the electronic device 1000, and a change in temperature of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 can also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1016 is configured to facilitate communication between the electronic device 1000 and other devices, either wired or wireless. The electronic device 1000 may access a wireless network based on a communication standard, such as Wi-Fi,2G,3G,4G, or 5G, or a combination thereof. In one exemplary embodiment, the communication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory machine-readable storage medium is also provided, such as memory 1004, including instructions executable by processor 1020 of electronic device 1000 to perform the above-described message processing method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (13)

1. A method of controlling an electronic device including a USB Type-C interface, comprising:
monitoring the USB Type-C interface to determine whether USB Type-C external equipment is inserted;
controlling the working mode of a designated port in the USB Type-C interface according to the monitoring result;
the control of the working mode of the appointed port in the USB Type-C interface according to the monitoring result comprises the following steps:
if the monitoring result shows that no USB Type-C external equipment is inserted, determining that the working mode of the designated port is a first mode so as to reduce the voltage difference between the output voltages of the designated port and the adjacent ports;
the monitoring the USB Type-C interface to determine whether a USB Type-C external device is plugged in includes:
monitoring the voltage of any public pin in the USB Type-C interface;
if the voltage of the common pin is high voltage, determining that the monitoring result is that no USB Type-C external equipment is inserted; and if the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
2. The method of claim 1, wherein controlling the operation mode of the designated port in the USB Type-C interface according to the monitoring result further comprises:
and if the monitoring result indicates that the USB Type-C external device is inserted, determining that the working mode of the designated port is a second mode so as to detect the Type of the USB Type-C external device.
3. The method of claim 1 or 2, wherein the designated port comprises a CC port.
4. The method of claim 2, wherein the designated port is a CC port, and wherein the CC port output voltage is 0V when the first mode is an upstream port UFP mode; and when the second mode is a dual-role port DRP mode, the waveform of the CC port output voltage is a square wave.
5. An apparatus for controlling an electronic device including a USB Type-C interface, comprising:
the interface monitoring module is used for monitoring the USB Type-C interface to determine whether USB Type-C external equipment is inserted;
the working mode determining module is used for controlling the working mode of the appointed port in the USB Type-C interface according to the monitoring result;
wherein, the working mode determining module comprises:
the first mode determining unit is used for determining that the working mode of the designated port is a first mode when the monitoring result indicates that no USB Type-C external equipment is inserted, so as to reduce the voltage difference between the designated port and the voltages output by the adjacent ports;
the interface monitoring module comprises:
the voltage monitoring unit is used for monitoring the voltage of any common pin in the USB Type-C interface;
the peripheral equipment insertion determining unit is used for determining that the USB Type-C external equipment is not inserted when the voltage of the common pin is high; and when the voltage of the common pin is low, determining that the monitoring result is that USB Type-C external equipment is inserted.
6. The apparatus of claim 5, wherein the operating mode determining module further comprises:
and the second mode determining unit is used for determining that the working mode of the appointed port is a second mode when the monitoring result shows that the USB Type-C external device is inserted, so as to detect the Type of the USB Type-C external device.
7. The apparatus of claim 5 or 6, wherein the designated port comprises a CC port.
8. The apparatus of claim 6, wherein the designated port is a CC port and the CC port output voltage is 0V when the first mode is an upstream port UFP mode; and when the second mode is a dual-role port DRP mode, the waveform of the CC port output voltage is a square wave.
9. The electronic equipment is characterized by comprising a power management unit, a plug detection circuit and a USB Type-C interface; the plug detection circuit is respectively connected with a detection pin of the power management unit and a common pin in the USB Type-C interface and is used for adjusting the voltage of the detection pin according to the voltage of the common pin; the voltage of the common pin is related to whether USB Type-C external equipment is plugged in or not;
common pins in the USB Type-C interface are not shorted with other common pins.
10. The electronic device of claim 9, wherein the plug detection circuit comprises a voltage divider circuit, a first inverter, and a second inverter connected in series; the voltage dividing circuit is used for outputting a first voltage according to the common pin; the first inverter is used for inverting the first voltage to obtain a second voltage; the second inverter is used for inverting the second voltage to obtain a first voltage.
11. The electronic device of claim 10, wherein the voltage divider circuit comprises a first resistor, a second resistor, and a zener diode; the first end of the first resistor is connected with a power supply, and the second end of the first resistor and the first end of the second resistor are connected with the output end of the voltage dividing circuit; the second end of the second resistor and the cathode of the zener diode are connected to the input end of the voltage dividing circuit, and the anode of the zener diode is grounded.
12. The electronic device of claim 10, wherein the first inverter comprises a first transistor and a second transistor; the control electrode of the first transistor and the control electrode of the second transistor are connected to the input end of the first inverter; a first pole of the first transistor is connected with a power supply, and a second pole of the first transistor and a first pole of the second transistor are connected with an output end of the first inverter; a second pole of the second transistor is grounded; the first transistor is an N-type transistor, and the second transistor is a P-type transistor.
13. The electronic device of claim 10, wherein the second inverter comprises a third transistor and a third resistor; the first end of the third resistor is connected with a power supply, and the second end of the third resistor and the first electrode of the third transistor are connected with the output end of the second inverter; the second electrode of the third transistor is grounded, and the control electrode of the third transistor is connected with the input end of the second inverter.
CN201910408054.4A 2019-05-15 2019-05-15 Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment Active CN111949107B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910408054.4A CN111949107B (en) 2019-05-15 2019-05-15 Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910408054.4A CN111949107B (en) 2019-05-15 2019-05-15 Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment

Publications (2)

Publication Number Publication Date
CN111949107A CN111949107A (en) 2020-11-17
CN111949107B true CN111949107B (en) 2023-11-07

Family

ID=73335669

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910408054.4A Active CN111949107B (en) 2019-05-15 2019-05-15 Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment

Country Status (1)

Country Link
CN (1) CN111949107B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113030794B (en) * 2021-03-02 2022-07-15 Oppo广东移动通信有限公司 Device detection method and device, computer readable medium and electronic device
CN114116546B (en) * 2021-11-19 2024-07-23 Oppo广东移动通信有限公司 Equipment pull-out reporting method and device, computer readable medium and electronic equipment
CN116133013B (en) * 2023-04-17 2023-06-27 深圳市谨讯科技有限公司 Communication mode setting method, device, terminal equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105867593A (en) * 2016-05-17 2016-08-17 深圳慧能泰半导体科技有限公司 USB Type-C interface circuit and control device thereof
CN205692122U (en) * 2016-05-17 2016-11-16 深圳慧能泰半导体科技有限公司 A kind of USB Type C interface circuit and control device thereof
CN108134273A (en) * 2017-12-08 2018-06-08 刘冰冰 The safety electric outlet circuit of low pressure detection control
US10009029B1 (en) * 2017-03-22 2018-06-26 Hong Fu Jin Precision Industry (Wuhan) Co., Ltd. Interface control circuit to match voltage levels between USB devices upon connection
CN108829553A (en) * 2018-06-20 2018-11-16 维沃移动通信有限公司 Universal serial bus c-type interface detection circuit, detection method and electronic equipment
CN109193888A (en) * 2018-10-23 2019-01-11 珠海市微半导体有限公司 A kind of the wireless charging power-supply system and charging method of Type-c interface
WO2019061538A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Electronic device having type c usb interface, control method for type c usb interface, and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018032981A (en) * 2016-08-24 2018-03-01 株式会社東芝 Semiconductor integrated circuit
WO2019037018A1 (en) * 2017-08-24 2019-02-28 深圳市利达成科技有限公司 Adapter
KR102358562B1 (en) * 2017-09-12 2022-02-04 삼성전자주식회사 Device and method for detecting conditions generating leakage current in usb interface

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105867593A (en) * 2016-05-17 2016-08-17 深圳慧能泰半导体科技有限公司 USB Type-C interface circuit and control device thereof
CN205692122U (en) * 2016-05-17 2016-11-16 深圳慧能泰半导体科技有限公司 A kind of USB Type C interface circuit and control device thereof
US10009029B1 (en) * 2017-03-22 2018-06-26 Hong Fu Jin Precision Industry (Wuhan) Co., Ltd. Interface control circuit to match voltage levels between USB devices upon connection
WO2019061538A1 (en) * 2017-09-30 2019-04-04 华为技术有限公司 Electronic device having type c usb interface, control method for type c usb interface, and storage medium
CN108134273A (en) * 2017-12-08 2018-06-08 刘冰冰 The safety electric outlet circuit of low pressure detection control
CN108829553A (en) * 2018-06-20 2018-11-16 维沃移动通信有限公司 Universal serial bus c-type interface detection circuit, detection method and electronic equipment
CN109193888A (en) * 2018-10-23 2019-01-11 珠海市微半导体有限公司 A kind of the wireless charging power-supply system and charging method of Type-c interface

Also Published As

Publication number Publication date
CN111949107A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN108964182B (en) Reverse charging equipment, and method and device for adjusting reverse charging current
CN111949107B (en) Method and device for controlling electronic equipment comprising USB Type-C interface and electronic equipment
CN108631401B (en) Charging circuit, method, electronic device, and storage medium
CN112928787B (en) Charging circuit, electronic device, charging control method and device
US11411422B2 (en) Battery charging method, battery charging apparatus and storage medium
CN107681727B (en) Control method and device of electronic equipment
CN108091808B (en) Battery, equipment, charging control method and device
CN111752362B (en) Method, device and storage medium for preventing interface from being corroded
CN210983385U (en) USBType-C interface module and electronic equipment
CN107329520B (en) USB interface connection method, device and system of mobile terminal
US20200067336A1 (en) Charging processing method, terminal device and storage medium
CN110941321A (en) Power supply method and device for electronic equipment and intelligent equipment
CN104822018A (en) Flash lamp control method of photographing device
CN106877451B (en) Charging port short-circuit protection method and device
CN111026684B (en) Interface control method, interface control device and storage medium
CN109586125B (en) Type-C adapter, terminal and electronic equipment
CN112929485A (en) Electronic device, interface module protection method, protection device and storage medium
CN104917238A (en) Intelligent equipment, and method and device for controlling power supply of equipment
CN106658674B (en) Mobile terminal and method for outputting conducted power
CN111294685B (en) Method, device, terminal and storage medium for reducing earphone insertion noise
CN106776424B (en) Connector, control method and control device thereof, and electronic equipment
CN105449784A (en) Power supply device applied to mobile terminal and power supply method for power supply device
CN204886223U (en) Device and smart machine of controlgear power supply
CN111509789A (en) Charging method and device
CN219477638U (en) Screen driving chip power supply system and terminal equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant