CN115017075A - Configuration method of universal serial bus interface and related device - Google Patents

Configuration method of universal serial bus interface and related device Download PDF

Info

Publication number
CN115017075A
CN115017075A CN202111289687.1A CN202111289687A CN115017075A CN 115017075 A CN115017075 A CN 115017075A CN 202111289687 A CN202111289687 A CN 202111289687A CN 115017075 A CN115017075 A CN 115017075A
Authority
CN
China
Prior art keywords
usb interface
function
identification information
type
external equipment
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.)
Granted
Application number
CN202111289687.1A
Other languages
Chinese (zh)
Other versions
CN115017075B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202111289687.1A priority Critical patent/CN115017075B/en
Publication of CN115017075A publication Critical patent/CN115017075A/en
Application granted granted Critical
Publication of CN115017075B publication Critical patent/CN115017075B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • 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

Abstract

The embodiment of the application provides a configuration method and a related device of a universal serial bus interface. The method comprises the following steps: when the external equipment is connected with the USB interface of the main equipment, first identification information is obtained, and the first identification information is used for indicating whether the first function is normal or abnormal; interrupting power supply to the external equipment and controlling the USB interface to be switched from the first type to the second type; when the USB interface is in a first type, the USB interface is used for realizing a first function; after the switching of the USB interface is completed, the power supply to the external equipment is recovered; acquiring second identification information, wherein the second identification information is used for indicating that the second function is normal or abnormal; when the USB interface is in a second type, the USB interface is used for realizing a second function; and configuring the type of the USB interface based on the first identification information and the second identification information. Therefore, the identification of two functions can be realized by one-time access, and the operation is simple. And based on the twice identification information, flexible configuration of the type of the USB interface can be realized.

Description

Configuration method of universal serial bus interface and related device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a configuration method and a related apparatus for a universal serial bus interface.
Background
In electronic devices, a Universal Serial Bus (USB) interface is widely used. The electronic device (such as a notebook computer, a USB interface extender (USB Hub), etc.) can realize charging of the external device or data communication with the external device through the USB interface.
In a possible design, when the electronic device is charged quickly, the electronic device needs to be charged quickly through a quick charging protocol after the external device identifies the electronic device as a standard charger. The fast charge protocol may be super-fast charge (SCP), flash-charge (VOOC), fast charge (QC), and the like.
However, the electronic device cannot coexist with the fast charging function of the external device or the data communication function of the external device, and only one of the functions can be realized. When the user needs to change and use another function, the setting of the USB interface needs to be changed in the electronic equipment, and the external equipment is plugged and pulled manually to be reconnected and identified, so that the switching of the two functions is realized, and the operation is complex. For a user who cannot know the electronic device, even does not know that the USB interface of the electronic device can be set, the charging speed of the external device is slow or data communication between the electronic device and the external device cannot be realized.
Disclosure of Invention
The embodiment of the application provides a configuration method and a related device of a universal serial bus interface, and according to feedback of a fast charging protocol Integrated Circuit (IC) to a Micro Control Unit (MCU) and control of a USB interface to power supply of external equipment, identification and switching of two functions of the USB interface are realized. Therefore, the external equipment does not need to be plugged and unplugged manually, the switching of two functions is realized, and the operation is simple. And the two functions are prompted, so that the user who cannot know the use method of the electronic equipment can be helped, and the user experience is improved.
In a first aspect, an embodiment of the present application provides a method for configuring a universal serial bus interface, which is applied to a host device. The configuration method of the universal serial bus interface comprises the following steps: when the external equipment is accessed to the Universal Serial Bus (USB) interface of the main equipment, acquiring first identification information, wherein the first identification information is used for indicating whether the first function of the USB interface is normal or abnormal when the external equipment is accessed; interrupting power supply to the external equipment and controlling the USB interface to be switched from the first type to the second type; when the USB interface is in the first type, the USB interface is used for realizing a first function; after the USB interface is switched from the first type to the second type, the power supply to the external equipment is recovered; acquiring second identification information, wherein the second identification information is used for indicating that a second function of the USB interface is normal or abnormal when the external equipment is accessed; when the USB interface is in a second type, the USB interface is used for realizing a second function; and configuring the type of the USB interface based on the first identification information and the second identification information.
Therefore, the power supply to the external equipment is interrupted and recovered, and the USB interface types are switched, so that the identification of two functions can be realized by one-time access without manual plugging and unplugging, and the operation is simple. And the type of the USB interface is configured based on the identification information corresponding to the two functions, so that the flexible configuration of the functions supported by the USB interface is realized, and the user experience is improved.
Optionally, the USB interface includes a data transmission pin; acquiring the first identification information includes: determining first identification information based on a voltage of a data transmission pin; the acquiring of the second identification information includes: the second identification information is determined based on the voltage of the data transfer pin.
Optionally, the first type is a standard charging interface DCP, the second type is a standard data interface SDP, the first function is to perform fast charging on the external device, and the second function is to perform data communication with the external device.
Optionally, the obtaining the first identification information includes: identifying a rapid charging protocol supported by the external equipment based on the voltage of the data transmission pin; first identification information is determined according to a fast charge protocol.
Optionally, the first type is SDP, the second type is DCP, the first function is to perform data communication with an external device, and the second function is to perform fast charging on the external device.
Optionally, the obtaining the second identification information includes: identifying a rapid charging protocol supported by the external equipment based on the voltage of the data transmission pin; the first identification information is determined according to a fast charge protocol.
Optionally, configuring the type of the USB interface based on the first identification information and the second identification information includes: when the first identification information is used for indicating that the first function is normal and the second identification information is used for indicating that the second function is normal, generating first prompt information; the first prompt message is used for prompting the user to select the first function or the second function; when responding to a first operation, configuring the USB interface to be of a first type, wherein the first operation is used for indicating to select a first function; or, in response to a second operation, configuring the USB interface to be of a second type, the second operation being used to indicate a selection of a second function.
Like this, when can realizing first function or second function, the function that the main equipment can realize the USB interface is indicateed, convenience of customers configures the USB interface according to the demand to promote external device's the speed of charging, perhaps in order to realize external device and main equipment's data communication, and then promote user experience. In addition, the two functions are prompted, so that a user who does not know the electronic equipment can master the using method, and the user experience is improved.
Optionally, configuring the type of the USB interface based on the first identification information and the second identification information includes: and when the first identification information is used for indicating that the first function is normal and the second identification information is used for indicating that the second function is abnormal, controlling the USB interface to be switched from the second type to the first type.
In this way, when the USB interface can realize the first function and cannot realize the second function, the host device configures the USB interface into the first type to realize the first function. Therefore, the USB interface can realize a function, and further improves user experience.
Optionally, before controlling the USB interface to switch from the second type to the first type, the method further includes: interrupting power supply to the external equipment; after controlling the USB interface to switch from the second type to the first type, the method further includes: and recovering the power supply to the external equipment.
Therefore, the external equipment can recognize the USB interface again, and further realize the first function of the USB interface.
Optionally, determining the type of the USB interface based on the first identification information and the second identification information includes: and when the first identification information indicates that the first function is abnormal and the second identification information indicates that the second function is normal, controlling the USB interface to be of a second type.
In this way, when the USB interface can realize the second function and cannot realize the first function, the host device configures the USB interface to the second type to realize the second function. Thus, the USB interface can realize a function, and further improves user experience.
Optionally, configuring the type of the USB interface based on the first identification information and the second identification information includes: when the first identification information is used for indicating the first function abnormity and the second identification information is used for indicating the second function abnormity, generating second prompt information; the second prompt message is used for prompting the user that the USB interface cannot use the first function and the second function.
Like this, when first function and second function can not realize, indicate, and then the user can in time change or maintain the USB interface, promote user experience.
Optionally, the fast charging protocol includes, but is not limited to: super fast charge SCP, flash charge VOOC and fast charge QC.
In a second aspect, an embodiment of the present application provides a master device, where the master device is configured to perform the method of any one of the first aspects. The master device may be a terminal device. The terminal device includes: a mobile phone, a tablet computer, a laptop computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), or a wearable device. The master device may also be a USB interface extender (USB Hub).
The master device includes: the system comprises a USB interface, a quick charge protocol integrated circuit, a Micro Control Unit (MCU) and a voltage conversion unit; the USB interface is used for connecting external equipment; the quick charging protocol integrated circuit is used for acquiring first identification information based on a data signal transmitted by the external equipment through the USB interface, and the first identification information is used for indicating whether a first function of the USB interface is normal or abnormal when the external equipment is accessed; the quick charging protocol integrated circuit is also used for sending a first signal to the MCU after the first identification information is obtained, wherein the first signal is used for indicating that the first function identification is finished; the MCU is used for acquiring first identification information from the fast charging protocol integrated circuit after receiving the first signal, controlling the voltage conversion unit to interrupt power supply to the external equipment and controlling the USB interface to be switched from the first type to the second type; the voltage conversion unit is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched from the first type to the second type; the quick charging protocol integrated circuit is also used for sending a second signal to the MCU after the second identification information is obtained, and the second signal is used for indicating that the second function identification is finished; the MCU is also used for acquiring second identification information from the fast charging protocol integrated circuit after receiving the second signal; the MCU is also used for configuring the type of the USB interface based on the first identification information and the second identification information.
According to the feedback of an Integrated Circuit (IC) to the MCU and the control of the USB interface to the power supply of the external equipment, the identification and switching of two functions of the USB interface are realized. Therefore, the external equipment does not need to be plugged manually, the switching of two functions is realized, and the operation is simple.
Optionally, the MCU is further configured to control the voltage conversion unit to interrupt power supply to the external device, including: the MCU is used for controlling the voltage conversion unit to interrupt power supply to the external equipment through the quick charging protocol integrated circuit.
Optionally, the voltage conversion unit includes: a DC/DC converter; the DC/DC converter is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type.
Optionally, the voltage conversion unit includes: a DC/DC converter and a switch; the switch is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type; the DC/DC converter is used for controlling the charging voltage provided by the USB interface to the external equipment.
Optionally, when the first identification information is used to indicate that the first function is normal and the second identification information is used to indicate that the second function is normal, the MCU is specifically configured to generate first prompt information, where the first prompt information is used to prompt a user to select the first function or the second function; the MCU is specifically used for configuring the USB interface to be of a first type when responding to a first operation, and the first operation is used for indicating and selecting a first function; or the MCU is specifically configured to configure the USB interface as a second type in response to a second operation, where the second operation is used to instruct selection of the second function.
Optionally, when the first identification information is used to indicate that the first function is normal and the second identification information is used to indicate that the second function is abnormal, the MCU is specifically configured to control the USB interface to switch from the second type to the first type.
Optionally, the voltage conversion unit is further configured to interrupt power supply to the external device, and recover power supply to the external device after the USB interface is switched from the second type to the first type.
Optionally, when the first identification information indicates that the first function is abnormal and the second identification information indicates that the second function is normal, the MCU is specifically configured to control the USB interface to be of the second type.
Optionally, when the first identification information is used to indicate that the first function is abnormal and the second identification information is used to indicate that the second function is abnormal, the MCU is specifically configured to generate a second prompt message, where the second prompt message is used to prompt the user that the USB interface cannot use the first function and the second function.
Optionally, the first type is a standard charging interface DCP, the second type is a standard data interface SDP, the first function is to perform fast charging on the external device, and the second function is to perform data communication with the external device; or the first type is SDP, the second type is DCP, the first function is to perform data communication with the external device, and the second function is to perform quick charging on the external device.
The main device provided in the second aspect and each possible design of the second aspect may have beneficial effects that are brought by each possible structure of the first aspect and the first aspect, and are not described herein again.
In a third aspect, an embodiment of the present application provides a terminal device, where the terminal device may be: a mobile phone, a tablet computer, a laptop computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), or a wearable device.
The terminal device includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored by the memory to cause the processor to perform the method of the first aspect described above.
The beneficial effects of the terminal device provided in the third aspect and each possible design of the third aspect may refer to the beneficial effects brought by each possible structure of the first aspect and the second aspect, and are not described herein again.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, in which a computer program or instructions are stored, and when the computer program or instructions are executed, the method of the first aspect is implemented.
The advantages of the computer-readable storage medium provided in the fourth aspect and in each possible design of the fourth aspect may refer to the advantages brought by each possible structure of the first aspect and the first aspect, and are not described herein again.
In a fifth aspect, embodiments of the present application provide a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the method of the first aspect is implemented.
The beneficial effects of the computer program product provided in the fifth aspect and in each possible design of the fifth aspect may refer to the beneficial effects brought by each possible structure of the first aspect and the first aspect, and are not described herein again.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a USB interface according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a possible implementation of a USB interface configuration circuit;
fig. 5 is a schematic structural diagram of a USB interface configuration circuit according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a USB interface configuration circuit according to an embodiment of the present disclosure;
fig. 7 is a schematic flowchart of a USB interface configuration method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a USB interface configuration method according to an embodiment of the present application;
fig. 9 is a flowchart illustrating a USB interface configuration method according to an embodiment of the present application.
Detailed Description
In order to facilitate clear description of technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish identical items or similar items with substantially the same functions and actions. For example, the first device and the second device are only used for distinguishing different devices, and the order of the devices is not limited. Those skilled in the art will appreciate that the terms "first," "second," and the like do not denote any order or quantity, nor do the terms "first," "second," and the like denote any order or importance.
It is noted that the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that the network architecture and the service scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not constitute a limitation to the technical solution provided in the embodiment of the present application, and it is known by a person skilled in the art that the technical solution provided in the embodiment of the present application is also applicable to similar technical problems along with the evolution of the network architecture and the appearance of a new service scenario.
It is understood that the term "plurality" herein refers to two or more. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship; in the formula, the character "/" indicates that the preceding and following related objects are in a relationship of "division".
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for convenience of description and distinction and are not intended to limit the scope of the embodiments of the present application.
It should be understood that, in the embodiment of the present application, the sequence numbers of the above-mentioned processes do not imply an order of execution, and the order of execution of the processes should be determined by their functions and inherent logic, and should not limit the implementation process of the embodiment of the present application in any way.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application. Referring to fig. 1, the application scenario may include an external device 101 and a main device 102. The external device 101 and the main device 102 are both provided with USB interfaces. The external device 101 may be connected to the USB interface of the main device 102 through a USB data line via a USB interface of the external device 101.
In a possible implementation manner, the USB interface on the external device 101 and the USB interface on the main device 102 may be referred to as USB female connectors. The two interfaces on the USB data line are called USB male.
The external device 101 may be an electronic device having a fast charging function and/or a data communication function. The electronic device includes a terminal device. A terminal device may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), etc. The terminal device may be a mobile phone (mobile phone), a smart tv, a wearable device, a tablet computer (Pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving (self-driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), and so on.
By way of example and not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable equipment can also be called wearable intelligent equipment, is the general term of equipment that uses wearable technique to carry out intelligent design, develop can dress to daily wearing, such as glasses, gloves, wrist-watch, dress and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable smart device includes full functionality, large size, and can implement full or partial functionality without relying on a smart phone, such as: smart watches or smart glasses and the like, and only focus on a certain type of application functions, and need to be used in cooperation with other devices such as smart phones, such as various smart bracelets for physical sign monitoring, smart jewelry and the like.
In addition, in the embodiment of the present application, the terminal device may also be a terminal device in an internet of things (IoT) system, where IoT is an important component of future information technology development, and the main technical feature of the present application is to connect an article with a network through a communication technology, so as to implement an intelligent network with human-computer interconnection and object-object interconnection.
The main device 102 may be an electronic device having a data communication function and providing a quick charging function to an external device. The electronic device includes a terminal device. A terminal device may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), etc. The terminal device may be a mobile phone (mobile phone), a smart tv, a wearable device, a tablet computer (Pad), a computer with a wireless transceiving function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving (self-driving), a wireless terminal in remote surgery (remote medical supply), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), and so on.
By way of example and not limitation, in the embodiments of the present application, the terminal device may also be a wearable device. Wearable equipment can also be called wearable intelligent equipment, is the general term of equipment that uses wearable technique to carry out intelligent design, develop can dress to daily wearing, such as glasses, gloves, wrist-watch, dress and shoes. The wearable device may be worn directly on the body or may be a portable device integrated into the user's clothing or accessory. The wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction and cloud interaction. The generalized wearable smart device includes full functionality, large size, and can implement full or partial functionality without relying on a smart phone, such as: smart watches or smart glasses and the like, and only focus on a certain type of application functions, and need to be used in cooperation with other devices such as smart phones, such as various smart bracelets for physical sign monitoring, smart jewelry and the like.
In addition, in the embodiment of the present application, the terminal device may also be a terminal device in an internet of things (IoT) system, where IoT is an important component of future information technology development, and a main technical feature of the present application is to connect an article with a network through a communication technology, so as to implement an intelligent network with interconnected human-computer and interconnected objects. The embodiment of the present application does not limit the specific technology and the specific device form adopted by the terminal device.
The electronic device may also be a USB interface extender (USB Hub).
In the embodiment of the application, the USB interface can be a universal serial bus Type-A (USB-A) interface, a universal serial bus Type-C (USB-C) interface and the like. The shape and structure of the USB interface are not limited in the embodiments of the present application. The USB interface can be a USB interface in a notebook computer, a USB Hub, a reverse quick charging interface of a mobile phone, a vehicle-mounted quick charging interface and the like.
In order to better understand the embodiment of the present application, the following describes the structure of the terminal device 200 according to the embodiment of the present application: as shown in fig. 2, the terminal device 200 may include: system On Chip (SOC) 201, main power management unit (master PMU) Integrated Circuit (IC) 202, charging chip 203, USB interface 204, Micro Control Unit (MCU) 205, power on key (power on key)206, battery (battery)207, slave PMU IC (slave PMU IC)208, front camera (front camera)209, rear camera (rear camera)210, rear camera (rear camera)211, rear camera (rear camera)212, modem (modem)213, radio frequency (radio frequency) front, RF IC214, antenna (antenna)215, low power consumption memory (low power consumption memory, data 216, flash memory module (flash memory) 217, Liquid Crystal Display (LCD) 218, Liquid Crystal Display (LCD) module 218, liquid crystal display (flash memory) module 218, Liquid Crystal Display (LCD) module 218, and slave PMU (slave PMU) module, An audio processing module (audio codec)220, a sensor (sensor)221, a motor (motor)222, a speaker (speaker)223, a Microphone (MIC)224, and a receiver (receiver) 225.
It is to be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation to the terminal device 200. In other embodiments of the present application, terminal device 200 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Where SOC201 may be a processor, SOC201 may include one or more processing units, such as: SOC201 may include an Application Processor (AP), a modem 213, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. Wherein, the different processing units may be independent devices or may be integrated in one or more processors.
A controller may be disposed in the SOC201, and the controller may generate an operation control signal according to the instruction operation code and the timing signal, so as to complete the control of instruction fetching and instruction execution.
A memory may also be provided in SOC201 for storing instructions and data. In some embodiments, the memory in SOC201 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the SOC 201. If the SOC201 needs to use the instructions or data again, it can be called directly from memory. Repeated accesses are avoided, reducing the latency of the SOC201, thereby increasing the efficiency of the system.
In some embodiments, SOC201 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, and/or a Subscriber Identity Module (SIM) interface, and the like.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line SDA and a Serial Clock Line (SCL). In some embodiments, SOC201 may contain multiple sets of I2C buses. The SOC201 may be coupled to a touch sensor, a charger, a flash, a camera, etc., via different I2C bus interfaces, respectively. For example: the SOC201 may couple the touch sensor through an I2C interface, so that the SOC201 and the touch sensor communicate through an I2C bus interface, thereby implementing the touch function of the terminal device 200.
The I2S interface may be used for audio communication. In some embodiments, SOC201 may contain multiple sets of I2S buses. The SOC201 may be coupled to the audio processing module 220 via an I2S bus, enabling communication between the SOC201 and the audio processing module 220. In some embodiments, the audio processing module 220 can transmit the audio signal to the wireless communication module through the I2S interface, so as to implement the function of answering a call through the bluetooth headset.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio processing module 220 and the wireless communication module may be coupled by a PCM bus interface. In some embodiments, the audio processing module 220 may also transmit the audio signal to the wireless communication module through the PCM interface, so as to implement the function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the SOC201 with a wireless communication module. For example: the SOC201 communicates with a bluetooth module in the wireless communication module through a UART interface to implement a bluetooth function. In some embodiments, the audio processing module 220 may transmit the audio signal to the wireless communication module through the UART interface, so as to implement the function of playing music through the bluetooth headset.
The MIPI interface may be used to connect the SOC201 with peripheral devices such as a display screen and a camera. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, SOC201 and the camera communicate through a CSI interface, implementing the shooting function of terminal device 200. The SOC201 and the display screen communicate via a DSI interface, and the display function of the terminal device 200 is realized.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, the GPIO interface may be used to connect the SOC201, the camera, the display screen, the wireless communication module, the audio processing module 220, the sensor, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
It should be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is only an exemplary illustration, and does not constitute a limitation on the structure of the terminal device 200. In other embodiments of the present application, the terminal device 200 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The master PMU202 and the slave PMU208 may both be referred to as power management modules, and the PMUs referred to in this embodiment of the present application may be the master PMU202 or the slave PMU208, which is not specifically limited in this embodiment of the present application. For convenience of description, the PMU is taken as the main PMU202 in the embodiment of the present application for illustration.
Main PMU202 may connect power-on key 206, charging chip 203, and SOC 201. The main PMU202 is configured to receive input from the battery 207 and/or the charging chip 203, and to supply power to the SOC201, the internal memory, the display, the camera, the wireless communication module, and the like. Main PMU202 may also be used to monitor battery capacity, battery cycling times, battery state of health (leakage, impedance), etc. Main PMU202 may also be used to trigger terminal device 200 to perform a power-on procedure or a wake-up procedure when charging or power-on key 206 is pressed. In some embodiments, main PMU202 may also be located in SOC 201. In other embodiments, main PMU202 and charging chip 203 may be located in the same device.
The charging chip 203 may also be referred to as a charging management module, a Charger chip, or the like, and the Charger chip includes, for example, a Charger IC. The charging chip 203 is used for receiving a charging input from a charger (or adapter). The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging chip 203 may receive charging input of a wired charger through the USB interface 204. In some wireless charging embodiments, the charging chip 203 may receive a wireless charging input through a wireless charging coil of the terminal device. While the charging chip 203 charges the battery 207, power can be supplied to the terminal device through the main PMU 202.
The USB interface 204 is an interface conforming to the USB standard specification. The USB interface may be used to connect a charger to charge the terminal device 200, or may be used to transmit data between the terminal device 200 and an external device, or may be used to connect an earphone to play audio through the earphone. The interface may also be used to connect other electronic devices, such as cell phones or AR devices. The USB interface can also be used for quickly charging the external equipment.
It should be noted that, in the embodiment of the present application, the USB interface 204 is connected to the MCU205, and the MCU205 is configured to implement quick charging of the external device or implement data communication with the external device by configuring the USB interface through a control signal. The MCU205 may implement the following logic: the terminal device sets the USB interface 204 as a Dedicated Charging (DCP) interface through the MCU205, and when the external device is plugged into the USB interface, the external device recognizes that the USB interface is a standard charger, and then the USB interface charges the external device; or, the terminal device sets the USB interface 204 as a Standard Data Protocol (SDP) interface through the MCU205, and when the external device is plugged into the USB interface, the external device recognizes the USB interface as a standard data interface, establishes a communication connection, and implements data communication with the external device.
The power-on key 206 may be a mechanical key or a touch key. The terminal device 200 may receive a power-on key input to implement a power-on or wake-up system process.
The terminal device 200 may implement a photographing function through an image signal processor, a camera, a video codec, a graphic processor, a display screen, an application processor, and the like. The cameras may include a front facing camera 209, and three rear facing cameras 210 and 212. It will be appreciated that the number of cameras, and the particular form of the cameras, may be adjusted according to the application.
The ISP is used for processing data fed back by the camera. For example, when a user takes a picture, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, an optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and converting the electric signal into an image visible to the naked eye. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in a camera.
The camera is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The light sensing elements may be Charge Coupled Devices (CCDs) or complementary metal-oxide-semiconductor (CMOS) phototransistors, the light sensing elements convert optical signals into electrical signals and then transmit the electrical signals to the ISP which converts the digital image signals to digital image signals, the ISP outputs the digital image signals to the DSP for processing, the DSP converts the digital image signals to standard RGB, YUV, etc. in some embodiments, the terminal device 200 may include 1 or N cameras, with N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the terminal device 200 selects a frequency point, the digital signal processor is used to perform fourier transform or the like on the frequency point energy.
Video codecs are used to compress or decompress digital video. The terminal device 200 may support one or more video codecs. In this way, the terminal device 200 can play or record video in a plurality of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The neural Network Processor (NPU) is a neural-network (NN) computing processor that processes input information quickly by referencing a biological neural network structure, for example, by referencing a transfer mode between neurons in a human brain, and may also learn by itself continuously. The NPU can implement applications such as intelligent recognition of the terminal device 200, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The wireless communication function of the terminal device 200 may be implemented by the modem 213, the rf chip 214, the antenna 215, a mobile communication module, a wireless communication module, and a baseband processor, etc.
The antenna 215 may be implemented to transmit and receive electromagnetic wave signals based on the rf chip 214. Each antenna in terminal device 200 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 215 may be multiplexed as a diversity antenna for a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module may provide a solution including 2G/3G/4G/5G wireless communication applied on the terminal device 200. The mobile communication module may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit the electromagnetic waves to the modem 213 for demodulation. The mobile communication module can also amplify the signal modulated by the modem 213 and convert the signal into electromagnetic wave to radiate via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module may be provided in the processor. In some embodiments, at least part of the functional modules of the mobile communication module may be provided in the same device as at least part of the modules of the processor.
Modem 213 may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 223, the receiver 225, etc.) or displays an image or video through a display screen. In some embodiments, modem 213 may be a stand-alone device. In other embodiments, the modem 213 may be separate from the processor, and may be provided in the same device as the mobile communication module or other functional module.
The wireless communication module may provide a solution for wireless communication applied to the terminal device 200, including Wireless Local Area Networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), bluetooth (bluetooth, BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module may be one or more devices integrating at least one communication processing module. The wireless communication module receives electromagnetic waves through the antenna, frequency-modulates and filters electromagnetic wave signals, and sends the processed signals to the processor. The wireless communication module can also receive a signal to be sent from the processor, frequency-modulate and amplify the signal, and convert the signal into electromagnetic waves through the antenna to radiate the electromagnetic waves.
The external memory interface may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the terminal device 200. The external memory card communicates with the SOC201 through an external memory interface to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory may be used to store computer-executable program code, which includes instructions. The internal memory may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, a phonebook, etc.) created during use of the terminal device 200, and the like. Further, the internal memory may include a high speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, flash memory device, LPDDR216, UFS217, or the like. The SOC201 executes various functional applications of the terminal device 200 and data processing by executing instructions stored in an internal memory and/or instructions stored in a memory provided in the processor.
The display screen is used for displaying images, videos and the like. The display screen includes a display panel. The display panel may employ an LCD module 218, an organic light-emitting diode (OLED), an active matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (flex-emitting diode, FLED), a miniature, a Micro-ol, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, terminal device 200 may include 1 or N display screens, N being a positive integer greater than 1. The LCD module 218 may be a touch screen, and may also receive a touch operation of a user based on the LCD module.
The fingerprint module 219 is used for collecting fingerprints. The terminal device 200 may utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and the like.
The terminal device 200 may implement an audio function through the audio processing module 220, the speaker 223, the receiver 225, the microphone 224, the earphone interface, and the application processor, etc. Such as music playing, recording, etc.
The audio processing module 220 is used for converting digital audio information into an analog audio signal output and also for converting an analog audio input into a digital audio signal. For example, the audio processing module 220 may convert audio of an analog headset that the Type-C interface 204 accesses into a digital audio signal. The audio processing module 220 may also be used to encode and decode audio signals. In some embodiments, the audio processing module 220 may be disposed in the SOC201, or some functional modules of the audio processing module 220 may be disposed in the SOC 201.
The speaker 223, also called a "horn", is used to convert audio electrical signals into sound signals. The terminal device 200 can listen to music through the speaker 170A, or listen to a handsfree call.
A receiver 225, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the terminal apparatus 200 picks up a call or voice information, it is possible to pick up a voice by bringing the receiver 170B close to the human ear.
The microphone 224, also referred to as a "mouthpiece," is used to convert sound signals into electrical signals. When making a call or sending voice information, the user can input a voice signal into the microphone 224 by speaking near the microphone 224 through the mouth. The terminal device 200 may be provided with at least one microphone 224. In other embodiments, the terminal device 200 may be provided with two microphones 224, which may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the terminal device 200 may further include three, four or more microphones 224 to collect sound signals, reduce noise, identify sound sources, perform directional recording, and so on.
The motor 222 may generate a vibration cue. The motor 222 may be used for both an electrical vibration alert and a touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 222 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The terminal device 200 may further include various sensors 221 (not shown in the figure) and the like. The embodiment of the present application does not limit the specific structure of the terminal device 200.
In a possible design, when the main device is connected with the external device through the USB interface, if the main device is performing fast charging on the external device, the main device needs to be recognized as a standard charger by the external device, and then the fast charging is performed through a fast charging protocol. The fast charging protocol can be SCP, VOOC, QC and the like.
However, the host device cannot coexist with the fast charging function of the external device or the data communication function of the external device, and only one of them can be realized. When the user needs to change and use another function, the setting of the USB interface in the main equipment needs to be changed, and the external equipment is plugged and pulled manually to be reconnected and identified, so that the switching of the two functions is realized, and the operation is complex. For a user who cannot know the electronic device, even the user does not know that the USB interface of the main device can be set, which results in that the charging speed of the external device is slow or the data communication between the main device and the external device cannot be realized.
For ease of understanding, the arrangement of the USB interface in a possible implementation is described below in conjunction with fig. 3 and 4.
Fig. 3 is a schematic structural diagram of a USB interface in a host device in a possible implementation. As shown in FIG. 3, the USB interface includes 4 pins, A1-A4.
Pin a 1: and a power supply module in the master device is connected to enable the master device to supply power to the USB interface, that is, the master device provides VBUS for the USB interface, which is also called VBUS pin.
Pins a2, A3: the data transmission pins are also called as D + pins and D-pins and are used for transmitting audio and video streams or files and the like. Pins A2, A3 may be used for USB2.0 compatibility.
It is understood that the USB signal is a differential signal, and data transmission is performed through the D + signal line and the D-signal line. After the main equipment is connected with the external equipment through the USB interface, a D + signal is transmitted on a D + signal wire connected with a D + pin; d-signals are transmitted on a D-signal line connected with the D-pin.
Pin a 4: the ground pin is also referred to as a GND pin.
It is understood that the USB interface may include more than the 4 pins shown in fig. 3, and may also include: a pin for data reception (also referred to as RX2+ pin, RX 2-pin), and a pin for external device detection (also referred to as CC1 pin). The embodiment of the application does not limit the shape, the number of pins, the functions of the pins and the like of the USB interface.
Fig. 4 is a schematic structural diagram of a configuration circuit of a USB interface type in a host device in a possible implementation. The circuit comprises: an MCU401, an Integrated Circuit (IC) 402, a direct current/direct current converter (DC/DC converter) 403, a USB interface 404, and a data communication port 405.
The MCU401 is connected with a rapid charging protocol IC402, and the rapid charging protocol IC402 is connected with a DC/DC converter 403; the flash protocol IC402 is connected (not shown) to pins (e.g., D + pin and D-pin) for data transmission in the USB interface 404; the DC/DC converter 403 is connected to a pin (e.g., VBUS pin) for supplying power to an external device in the USB interface 404 (not shown in the figure); the data communication port 405 is connected to pins (e.g., a D + pin and a D-pin) for data transmission in the USB interface 404 (not shown).
The MCU401 is configured to control enabling (enable) or disabling (disable) of the flash protocol IC402, so as to control a type (DCP or SDP) of the USB interface 404. In a possible implementation, the MCU401 is also used to control the voltage output by the DC/DC converter 403. The MCU401 may be an Embedded Controller (EC) or other type of controller.
The rapid charging protocol IC402 is used for interacting with an external device through the USB interface 404, implementing type identification of the USB interface 404 by the external device, and implementing rapid charging identification when the type of the USB interface 404 is DCP. The fast charge protocol IC402 is also used to control the output voltage of the DC/DC converter 403 after fast charge identification.
It will be appreciated that the fast charge protocol IC402 may identify a variety of fast charge protocols including, but not limited to: SCP, VOOC, or QC.
The DC/DC converter 403 is used to output various voltages to charge an external device plugged into the USB interface 404, including but not limited to: 5 volts (V), 9V, 10V or 12V. A dc/dc converter may also be referred to as a dc-to-dc converter.
The USB interface 404 is used to connect to an external device. The USB interface 404 may transmit a charging handshake signal to the fast charging protocol IC402 to enable identification of the type of the USB interface 404. Or the USB interface 404 may transmit data communication signals to the data communication port 405 to implement data communication. It is understood that both the charging handshake signal and the data communication signal are transmitted through the data transmission pin.
The data communication port 405 is used for data communication with an external device through the USB interface 404. The data communication port 405 may be located on a System On Chip (SOC). The SOC may be a processor including one or more processing units, such as: an Application Processor (AP), a modem, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), and a controller. The different processing units may be separate devices or may be integrated into one or more processors.
The following describes a process of the USB interface in the host device for fast charging the external device and a process of data communication with the external device with reference to fig. 4.
It can be understood that the USB interface 404 is a DCP interface when the external device is rapidly charged; the USB interface 404 is an SDP interface when performing data communication with an external device.
It should be noted that, when the USB interface 404 is configured as a DCP, the flash protocol IC402 is enabled. With the USB interface 404 configured as SDP, the flash protocol IC402 is disabled.
It is understood that the disabling of the fast charge protocol IC402 may be manifested as a disconnection between the USB interface 404 and the fast charge protocol IC402, or the fast charge protocol IC402 being in a high impedance state.
In a possible implementation manner, due to the fact that an actual circuit is complex and a connection is complex, the USB interface 404 and the fast charging protocol IC402 may not be disconnected or the fast charging protocol IC402 may be in a high impedance state. Illustratively, a switch is arranged on a path between the USB interface 404 and the fast charge protocol IC402 to disconnect the USB interface 404 from the fast charge protocol IC 402. During USB communication, the path of the D + signal between the USB interface 404 and the fast charge protocol IC402 and the path of the D-signal between the USB interface 404 and the fast charge protocol IC402 are disconnected.
The DCP configuration process is as follows: the MCU401 sends a first enable signal (S1 signal) to the fast charge protocol IC402, and the S1 signal is used to enable the fast charge protocol IC 402. After the fast charge protocol IC402 receives the S1 signal, the fast charge protocol IC402 is enabled.
The SDP configuration procedure is as follows: the MCU401 sends a second enable signal (S2 signal) to the fast charge protocol IC402, and the S2 signal is used to enable the fast charge protocol IC402 to turn off. After the rapid charging protocol IC402 receives the S2 signal, the rapid charging protocol IC402 is disabled.
When an external device is plugged into the USB interface 404, the external device identifies the type of the USB interface 404. When the external device recognizes that the type of the USB interface 404 is DCP, a fast charging recognition process is started to enable the host device to confirm the fast charging protocol supported by the external device. After the external device performs the fast charging identification with the fast charging protocol IC402, the fast charging protocol IC402 sends a third enable signal (S3 signal) to the DC/DC converter 403, and the S3 signal is used to adjust the output voltage of the DC/DC converter 403. The DC/DC converter 403 changes the output voltage upon receiving the S3 signal. The output voltage of the DC/DC converter 403 changes, and the charging voltage of the external device by the USB interface 404 changes, so that the external device is quickly charged.
Or, when the external device recognizes that the USB interface 404 is an SDP, an enumeration communication procedure is started to enable the main device to enumerate and obtain device information such as the type and transmission rate of the external device. After enumeration is successful, the data communication port 405 in the master device realizes data communication (file transfer, etc.) with the external device.
Illustratively, when the external device recognizes that the USB interface 404 is an SDP, the external device pulls up a level (voltage) on a D + signal line through a pull-up resistor, triggers an enumeration process of the host device, the host device starts to enumerate and acquire device information such as the type and rate of the external device, and the host device performs data communication with the external device after loading a corresponding driver according to the device information of the external device.
In the circuit shown in fig. 4, the type of the USB interface is preset before the external device is plugged into the USB interface. The external equipment can only be identified according to the type of the preset USB interface, and the MCU cannot acquire the identification state of the external equipment in the identification process. When the user needs to use another function, the connection between the USB interface and the external device needs to be disconnected manually, and the USB interface in the main device needs to be reconfigured, so that the operation process is complicated, and the user experience is poor.
Furthermore, when the user does not know the characteristics of the USB interface of the host device, the USB interface may not be reconfigured, or even be aware that the USB interface is configurable. Therefore, the charging speed of the external equipment is low, or the external equipment cannot perform data communication with the main equipment, and the user experience is poor.
In view of this, an embodiment of the present application provides a method for configuring a USB interface, where an MCU may obtain identification information of a USB interface from a fast charging protocol IC, control a power supply voltage to an external device, and change a type of the USB interface, so as to implement type switching of the USB interface by the external device and identification of a corresponding function, and a host device prompts the corresponding function supported by the USB interface according to identification information corresponding to different types of the USB interface. Therefore, the USB interface is not required to be manually disconnected from the external equipment, the operation is simple, and the user experience is improved. And the main equipment prompts the corresponding function of the type of the USB interface, so that the user can configure the USB interface conveniently, and the user experience is improved.
The following describes a configuration circuit and a configuration method of a USB interface according to an embodiment of the present application with reference to the drawings.
Fig. 5 and fig. 6 are schematic circuit connection diagrams of the USB interface and the MCU provided in the embodiments of the present application. The circuits shown in fig. 5 and 6 are respectively suitable for different USB interfaces. Fig. 5 applies to part of the USB-a interface. Fig. 6 is applicable to the USB-C interface and part of the USB-a interface.
Exemplarily, fig. 5 is a schematic circuit connection diagram of a USB interface and an MCU provided in an embodiment of the present application. The circuit comprises: the device comprises an MCU 501, a quick charge protocol IC502, a DC/DC converter 503, a USB interface 504 and a data communication port 505.
The MCU 501 is connected with a quick charge protocol IC502, and the quick charge protocol IC502 is connected with a DC/DC converter 503; the flash protocol IC502 is connected to pins (e.g., D + pin and D-pin) for data transmission in the USB interface 504 (not shown); the DC/DC converter 503 is connected to a pin (e.g., VBUS pin) for supplying power to an external device in the USB interface 504 (not shown in the figure); the data communication port 505 is connected to pins (e.g., a D + pin and a D-pin) for data transmission in the USB interface 504 (not shown).
The MCU 501 is configured to control whether the fast charging protocol IC502 enables a short-circuit connection between a pin D + and a pin D-in the USB interface 504 through an enable signal, so as to control a type (DCP or SDP) of the USB interface 504.
Illustratively, the flash protocol IC502 shorts pin D + and pin D-in the USB interface 504, the USB interface 504 configured as an SDP; the flash protocol IC502 does not short circuit pin D + and pin D-in the USB interface 504, and the USB interface 504 is configured as a DCP.
In a possible implementation, the MCU 501 is further configured to control a voltage output by the DC/DC converter 503. The MCU 501 may be an Embedded Controller (EC) or other type of controller.
The fast charge protocol IC502 is configured to perform fast charge identification based on the D + signal and the D-signal transmitted by the USB interface 504, and control an output voltage of the DC/DC converter 503 based on a fast charge identification result. The fast charge protocol IC502 is further configured to store the fast charge identification status of the USB interface 504 and the identification status of the USB interface 504 by the external device.
It is to be appreciated that the fast charge protocol IC502 may perform fast charge identification for a variety of fast charge protocols including, but not limited to: SCP, VOOC, or QC.
It should be noted that, when the USB interface 504 is configured as a DCP, the flash protocol IC502 may also determine the identification status of the external device to the DCP based on the D + signal and the D-signal transmitted by the USB interface 504. In a possible implementation manner, the rapid charging protocol IC does not detect any one of the D + signal and the D-signal within a fixed time, and determines that the DCP identifies the abnormity. D + signals and D-signals are detected within a fixed time, and the DCP is determined to be normally identified.
The DC/DC converter 503 is used to output various voltages to charge the external device connected to the USB interface 504, including but not limited to: 5V, 9V, 10V or 12V. It can be understood that the voltage conversion unit includes: the DC/DC converter 503 is included in the voltage conversion unit. The voltage conversion unit may further include: a switch 506.
The USB interface 504 is used for connecting to an external device. The USB interface 504 may transmit a charging handshake signal to the fast charging protocol IC502 to enable identification of the type of the USB interface 504. Or the USB interface 504 may transmit data communication signals to the data communication port 505 to implement data communication. The charging handshake signal and the data communication signal both belong to a data transmission signal. And will not be described in detail herein.
The data communication port 505 is used for data communication with an external device through the USB interface 504. The data communication port 505 may be located in a SOC.
Different from fig. 4, the MCU may obtain the fast charging identification status of the USB interface from the fast charging protocol IC, and stop or continue the power supply of the USB interface to the external device through the fast charging protocol IC.
It should be noted that, when the external device identifies the type of the USB interface, the rapid charging protocol IC detects a D + signal or a D-signal of the USB interface, and determines whether the external device is identified normally.
When the rapid charging protocol IC is configured as a DCP interface by the MCU, the D +/D-can be in a short circuit state (less than 200 ohms) in a default state, and handshake communication is carried out according to the rapid charging protocol after the external equipment identifies that the USB interface is the DCP;
when the rapid charging protocol IC is configured as an SDP interface by the MCU, the rapid charging protocol IC detects a D + signal and a D-signal of the USB interface, confirms the identification state of the external equipment, and connects a data communication port with the USB interface from the outside of the rapid charging protocol IC;
in a possible implementation manner, a switch for switching the D + signal and the D-signal to the data communication port is arranged inside the rapid charging protocol IC. And the quick charging protocol IC detects the D + signal and the D-signal of the USB interface, confirms the identification state of the external equipment and outputs the D + signal and the D-signal to the data communication port through the internal signal switch.
In a possible implementation, a switch 506 is provided between the DC/DC converter 503 and the USB interface 504. The switch 506 is used to control the voltage output from the power source of the host device to the USB interface 504, and further control the power supply voltage output from the USB interface 504 to the external device. When the switch 506 is closed, the USB interface 504 supplies power to the external device; when the switch 506 is turned on, the USB interface 504 stops supplying power to the external device.
Thus, the USB interface can be controlled to stop or continue to supply power to the external device by opening and closing the switch 506.
The following describes, with reference to the circuit shown in fig. 7, a configuration process of the USB interface by the host device after the external device accesses the USB interface.
Taking the default type of the USB interface as the DCP interface as an example, in the default state, the switch is closed, and the system supplies power to the USB interface.
And S701, when the external equipment is connected to the USB interface, identifying the type of the USB interface of the main equipment.
In the embodiment of the present application, the types of the USB interface include DCP and SDP. In a possible implementation mode, when the type of the USB interface is DCP, the quick charge protocol IC controls a path of the D + signal to be in short-circuit connection with a path of the D-signal. When the type of the USB interface is SDP, the quick charge protocol IC controls the short-circuit connection between the path of the D + signal and the path of the D-signal.
Illustratively, the first port and the second port in the rapid charging protocol IC are short-circuited through a metal oxide semiconductor field-effect transistor (MOSFET). The first port is connected with a D + pin in the USB interface, and the second port is connected with a D-pin in the USB interface.
In the embodiment of the application, the external device can be connected to the USB interface of the main device in an inserting manner. It is to be understood that the insertion referred to herein and hereinafter is merely one manner of access and is not intended to be limiting.
In a possible implementation manner, when the external device is inserted into the USB interface and transmits a D + signal to the rapid charging protocol IC, if a charging level is detected on the D-signal line, the external device determines that the USB interface is DCP. And if the charging level is not detected on the D-signal line, the external equipment confirms that the USB interface is the SDP.
Correspondingly, when the external equipment identifies the type of the USB interface of the main equipment, the quick charging protocol IC can detect the D + signal or the D-signal of the USB interface, and further confirm the identification state of the external equipment on the USB interface. Specifically, the rapid charging protocol IC can detect the voltage of a D + pin or the voltage of a D-pin of the USB interface, and then confirm the identification state of the USB interface based on the voltage of the D + pin or the voltage of the D-pin.
And S702, when the external equipment confirms that the USB interface is the DCP, starting a quick charge identification process by the external equipment.
The external equipment confirms that the type of the USB interface is the DCP.
It can be understood that, when the external device confirms that the USB interface is DCP, the external device performs fast charging identification with the fast charging protocol IC. Therefore, whether the main equipment can realize the function of quickly charging the external equipment or not can be confirmed.
Specifically, the rapid charging protocol IC confirms the rapid charging protocol supported by the external device based on a plurality of rapid charging protocols, and further confirms the output voltage of the DC/DC converter.
Illustratively, the fast charge protocol IC confirms the fast charge protocol supported by the external device based on the voltage of the D + pin or the voltage of the D-pin of the USB interface, and further confirms the output voltage of the DC/DC converter.
And S703, after completing the fast charging identification, the fast charging protocol IC sends a first signal to the MCU, wherein the first signal is used for indicating the completion of the fast charging identification.
And S704, after receiving the first signal, the MCU reads the quick charge identification information stored in the register in the quick charge protocol IC, and sends a fourth signal to the quick charge protocol IC (S4 signal), wherein the S4 signal is used for indicating the quick charge protocol IC to switch the type of the USB interface to be SDP and indicating the quick charge protocol IC to interrupt the power supply of the USB interface to the external equipment.
In the embodiment of the application, the quick charge identification information is used for indicating that the quick charge identification is normal or abnormal. For example, the fast charge identification is represented by 1, and the fast charge identification is represented by 0. It can be understood that, when the fast charging identification is normal, the main device can realize the function of fast charging the external device. When the quick charging identification is abnormal, the main equipment can not realize the function of quickly charging the external equipment.
And S705, after receiving the S4 signal, the quick charge protocol IC interrupts the power supply of the USB interface to the external equipment.
In a first possible implementation manner, after receiving the S4 signal, the fast charging protocol IC controls the DC/DC converter to stop outputting, so as to interrupt power supply from the USB interface to the external device.
In a second possible implementation manner, after the rapid charging protocol IC receives the S4 signal, the control switch is turned off to interrupt the power supply from the USB interface to the external device.
Therefore, the external equipment and the main equipment are automatically disconnected, the condition that the external equipment is pulled out manually is reduced, and user operation is reduced.
And S706, after receiving the S4 signal, the quick charge protocol IC configures the USB interface as SDP.
In a possible implementation manner, the rapid charging protocol IC cancels the short-circuit connection between the first port and the second port, and the USB interface is an SDP.
And S707, after a period of time, the quick charging protocol IC recovers the power supply of the USB interface to the external equipment, and further triggers the external equipment to identify the type of the USB interface.
In the embodiment of the present application, the period of time may be 1s, or may be any other time duration. The embodiment of the present application does not limit this.
In a possible implementation manner, after a period of time, the rapid charging protocol IC controls the DC/DC converter to continue outputting, and recovers the power supply of the USB interface to the external device.
In a second possible implementation manner, after a period of time, the fast charging protocol IC controls the switch to be turned on, and power supply of the USB interface to the external device is restored.
It is to be understood that since the USB interface is configured as an SDP in S706, the external device recognizes the USB interface as an SDP. The state of SDP identification of the USB interface of the external equipment and the main equipment can be confirmed by the quick charging protocol IC through the D + signal and the D-signal transmitted by the USB interface. Therefore, whether the data communication between the external equipment and the main equipment is normal or not can be confirmed.
And S708, after the SDP identification is completed by the quick charge protocol IC, the quick charge protocol IC sends a second signal to the MCU, and the second signal is used for indicating the completion of the SDP identification.
S709, the MCU reads SDP identification information stored in a register in the rapid charging protocol IC.
In the embodiment of the application, the fast charging identification information is used for indicating that the SDP identification is normal or abnormal. It can be understood that when the SDP identification is normal, the main device may implement a function of data communication with the external device. When the SDP is abnormal, the master device cannot implement the function of data communication with the external device.
And S710, the MCU judges and configures the USB interface based on the quick charging identification information and the SDP identification information.
In a first possible implementation manner, when the fast charge identification is normal and the SDP identification is abnormal, the MCU controls the USB interface to switch to the DCP interface, and executes S705 and S707.
In a possible implementation manner two, the fast charging identification is abnormal and the SDP identification is normal, and the master device performs SDP enumeration communication.
In a third possible implementation manner, when the fast charging identification is normal and the SDP identification is normal, the master device generates first prompt information, where the first prompt information is used to prompt the user to select the fast charging function or the data communication function. After receiving an operation of selecting a fast charging (fast charging function) by a user, the main device controls the USB interface to be switched to the DCP interface. And after receiving the operation of selecting the data communication function by the user, the main equipment carries out SDP enumeration communication.
In the embodiment of the application, the first prompt information has a plurality of prompt modes, for example, voice prompt, pop-up frame prompt and the like. The embodiment of the present application does not limit this.
In a possible implementation manner, if the fast charge identification is abnormal and the SDP identification is abnormal, the MCU does not operate or generates the second prompt message. The second prompt message is used for prompting the user to replace the USB interface.
On the basis of the four possible implementation manners, the main device may also prompt the functions that can be implemented by the USB interface based on the fast charging identification information and the SDP identification information, so as to prompt the user about the characteristics of the USB interface. Therefore, the user can select the corresponding function or replace the USB interface according to the requirement.
In conclusion, the MCU can obtain the identification information of the USB interface from the fast charging protocol IC, and control the power supply voltage to the external device, thereby implementing the secondary identification of the USB interface by the external device. Therefore, the identification of two functions can be realized by one-time access of the external equipment, the number of times of manual plugging and unplugging of the external equipment is reduced, and the operation is simple.
In addition, the main equipment carries out function prompt of the USB interface according to the twice identification information and carries out type switching of the USB interface according to selection of a user. The USB interface is convenient for a user to configure, and the user experience is improved. The function prompt also helps users who do not know the product characteristics to master the using method, and the product user experience is improved.
It can be understood that after S704, the MCU controls the DC/DC converter or the switch through the fast charging protocol IC to interrupt or recover the power supply from the USB interface to the external device. The MCU can also directly control the DC/DC converter or the switch to realize the interruption or the recovery of the power supply of the USB interface to the external equipment.
In a first possible implementation manner, after the MCU reads the fast charging identification information stored in the register in the fast charging protocol IC, the MCU controls the DC/DC converter to stop outputting, so as to interrupt the power supply from the USB interface to the external device. And after a period of time, the MCU controls the continuous output of the DC/DC converter to recover the power supply of the USB interface to the external equipment.
In a possible implementation manner two, after the MCU reads the fast charging identification information stored in the register in the fast charging protocol IC, the MCU controls the switch to be turned off, so as to interrupt the power supply from the USB interface to the external device. And after a period of time, the MCU controls the switch to be closed so as to recover the power supply of the USB interface to the external equipment.
It is understood that, in the above embodiment, the type of the USB interface defaults to DCP, and the type of the USB interface may default to SDP. Illustratively, after the SDP identification is completed, the MCU acquires SDP identification information in the fast charging protocol IC, and controls the DC/DC converter to stop outputting, so as to interrupt the power supply from the USB interface to the external device. And after the MCU controls the quick charging protocol IC to complete the type switching of the USB interface, the DC/DC converter is controlled to continue outputting, the USB interface is recovered to supply power to the external equipment, and the secondary identification of the external equipment is triggered.
In a possible implementation manner, more than 1 pin for supplying power to the USB interface is included in the USB interface. The voltage used for rapid charging may be configured separately from the system voltage, which may be used as a separate path to power the external device.
Exemplarily, fig. 6 is a schematic circuit connection diagram of a USB interface and an MCU provided in an embodiment of the present application. The circuit comprises: MCU 601, fast charging protocol IC 602, DC/DC converter 603, USB interface 604, data communication port 605 and switch 606.
The MCU 601 is connected with the rapid charging protocol IC 602, and the rapid charging protocol IC 602 is connected with the DC/DC converter 603; the flash protocol IC 602 is connected to pins (e.g., D + pin and D-pin) for data transmission in the USB interface 604 (not shown in the figure); the DC/DC converter 603 is connected to a pin (e.g., VBUS pin) of the USB interface 604 for supplying power to an external device (not shown in the figure); a pin for supplying power to the external equipment in the USB interface 604 is further connected to the switch 606; the data communication port 605 is connected to pins (e.g., a D + pin and a D-pin) for data transmission in the USB interface 604 (not shown). The DC/DC converter 603 and the switch 606 constitute a voltage conversion unit.
The relevant components in the circuit shown in fig. 6 may refer to the description of the relevant components in the circuit shown in fig. 5, and are not described again here.
In contrast to fig. 5, the DC/DC converter shown in fig. 6 does not supply the system voltage. The system voltage is an independent path for supplying power to the external equipment. Illustratively, the system voltage is 5V. The DC/DC converter can output a voltage of 9V, 10V or 12V for rapid charging by an external device.
After the external device is inserted into the USB interface in the circuit shown in fig. 6, the configuration process of the USB interface by the host device is similar to the above configuration process, and is not described here again.
Exemplarily, fig. 8 is a schematic flowchart of a method for configuring a USB interface according to an embodiment of the present application. As shown in fig. 8, the configuration method of the USB interface includes:
s801, identifying the external equipment and the main equipment based on the first type of the USB interface.
In a possible implementation, the first type of the USB interface may be SDP or DCP. And when the first type is DCP, the external equipment and the rapid charging protocol IC also carry out rapid charging identification.
In a possible implementation mode, the external device transmits a D + signal or a D-signal to the rapid charging protocol IC through the USB interface, detects a signal on a D-signal line or a signal on a D + signal line, and identifies the type of the USB interface. And when the type of the USB interface is DCP, the USB interface performs fast charging identification with the main equipment.
Illustratively, when the external device transmits a D + signal to the fast charging protocol IC on the D + signal line and detects a charging level on the D-signal line, the external device determines that the type of the USB interface is DCP. When the external equipment transmits a D + signal to the quick charging protocol IC on the D + signal line and the charging level is not detected on the D-signal line, the external equipment confirms that the type of the USB interface is SDP.
Adaptively, the fast charge protocol IC may confirm whether the first function corresponding to the first type can be implemented based on the D + signal and the D-signal. Specifically, the rapid charging protocol IC may detect a voltage of a data transmission pin of the USB interface, and determine whether the first function of the USB interface is normal or abnormal based on a voltage value and/or a voltage change.
S802, the main device records first identification information of the first type.
In the embodiment of the application, the first identification information is used for indicating whether the first function is abnormal or not. Illustratively, the first function normal may be denoted by 1. The first functional abnormality may be represented by 0.
It can be understood that, when the first identification information is used to indicate that the first function is normal, the USB interface may implement the first function when the external device is accessed; the first identification information is used for indicating that the USB interface can not realize the first function when the external equipment is accessed when the first function is abnormal.
It is to be understood that, when the first type is DCP, the first identification information may be the fast charge identification information described above. When the first type is SDP, the first identification information may be SDP identification information described above.
And S803, the master device stops outputting the system voltage and switches the type of the USB interface to be the second type.
It is to be understood that when the first type of the USB interface is SDP, the second type is DCP; when the first type of the USB interface is DCP, the second type is SDP.
It will be appreciated that the system voltage is typically 5V. And the external equipment detects the voltage drop of the USB interface because the main equipment stops outputting the system voltage, and further confirms that the connection with the main equipment is interrupted.
Illustratively, the main device stops outputting the system voltage by controlling the switch to be switched off so as to interrupt power supply to the external device.
In a possible implementation manner, after the external device detects that the voltage of the USB interface drops to 1V, it is determined that the connection with the host device is interrupted.
And S804, the main equipment outputs the system voltage to the external equipment.
It can be appreciated that the master device recovers the output of the system voltage after a certain time period, thereby recovering the connection with the external device. Illustratively, the master device effects restoration of the output system voltage by controlling the switch closure.
Therefore, the plugging and unplugging process of the external equipment is simulated by controlling the stopping and recovering of the system voltage, and the secondary identification of the external equipment is realized.
And S805, the external device and the main device are identified based on the second type of the USB interface of the main device.
It can be understood that when the main device outputs the system voltage to the external device, the external device is connected to the main device, and the external device recognizes the type of the USB interface.
In a possible implementation mode, the external device transmits a D + signal or a D-signal to the rapid charging protocol IC through the USB interface, detects a signal on a D-signal line or a signal on a D + signal line, and identifies the type of the USB interface.
Illustratively, when the external device transmits a D + signal to the fast charging protocol IC on the D + signal line and detects a charging level on the D-signal line, the external device determines that the type of the USB interface is DCP. When the external equipment transmits a D + signal to the rapid charging protocol IC on the D + signal line and the charging level is not detected on the D-signal line, the external equipment confirms that the type of the USB interface is SDP.
Adaptively, the fast charge protocol IC may confirm whether the first function corresponding to the first type can be implemented based on the D + signal and the D-signal. Specifically, the rapid charging protocol IC may detect a voltage of a data transmission pin of the USB interface, and determine whether the second function of the USB interface is normal or abnormal based on the voltage value and/or the voltage change.
S806, the main device records second identification information of the second type.
In this embodiment of the application, the second identification information is used to indicate whether the second function is abnormal. Illustratively, the second function normal may be denoted by 1. The second functional abnormality may be represented by 0.
It can be understood that, when the second identification information is used to indicate that the second function is normal, the USB interface may implement the second function when the external device is accessed; the second identification information is used for indicating that the USB interface can not realize the second function when the external equipment is accessed when the second function is abnormal.
It is to be understood that, when the second type is DCP, the second identification information may be the fast charge identification information described above. When the second type is SDP, the second identification information may be SDP identification information described above.
S807, the main device determines the type of the USB interface based on the first identification information and the second identification information.
In a first possible implementation manner, when the first function is normal and the second function is abnormal, the master device controls the USB interface to switch to the first type.
In a possible implementation manner, the first function is abnormal and the second function is normal, and the master device controls the USB interface to be of the second type.
In a third possible implementation manner, the first function is normal and the second function is normal, the master device generates first prompt information, and the first prompt information is used for prompting a user to select the first type or the second type. And after receiving the operation of selecting the first type by the user, the main equipment controls the USB interface to be switched to the first type. And the master equipment performs the second type of communication after receiving the operation of selecting the second type by the user.
In a possible implementation manner, the first function is abnormal and the second function is abnormal, and the master device does not respond or generates the second prompt message. The second prompt message is used for prompting the user that the USB interface cannot use the first function and the second function. Therefore, the user can replace the USB interface in time.
In conclusion, the main device realizes the process of simulating manual plugging by stopping the voltage output of the system and starting the voltage output of the system, so that the secondary identification of the external device on the USB interface is realized. Therefore, the external equipment can be identified by one-time insertion of the external equipment, the number of times of manual plugging and unplugging of the external equipment is reduced, and the operation is simple.
In addition, the main equipment carries out function prompt of the USB interface according to the twice identification information and carries out type switching of the USB interface according to selection of a user. The USB interface is convenient for a user to configure, and the user experience is improved. The function prompt also helps users who do not know the product characteristics to master the using method, and the product user experience is improved.
The following describes a configuration method of a USB interface, taking the USB interface as DCP as an example.
Fig. 9 is a schematic flowchart of a configuration method of a USB interface according to an embodiment of the present disclosure. As shown in fig. 9, taking the USB interface as the DCP as an example, the configuration method of the USB interface includes:
s901, after the external device is detected to be inserted into the USB interface, the quick charge protocol IC in the main device carries out quick charge identification.
The quick charge identification process may refer to the above related description, and is not described herein again.
And S902, the MCU in the main device acquires the identification information of the rapid charging protocol IC and records whether the rapid charging identification is normal or abnormal.
And S903, the MCU in the main equipment controls the USB interface to stop outputting the system voltage, and configures the USB interface as SDP.
And S904, the master device controls the USB interface to start outputting the system voltage.
And S905, carrying out SDP identification by the rapid charging protocol IC.
For the SDP identification process, reference may be made to the above description, and details are not repeated here.
S906, the MCU in the main equipment acquires the identification information of the rapid charging protocol IC, and records the SDP identification is normal or abnormal.
And S907, the MCU in the main device judges based on the two pieces of identification information.
In a first possible implementation manner, when the MCU in the host device confirms that the fast charging identification is normal and the SDP identification is abnormal, the host device executes S908 and S909.
S908, the MCU controls the USB interface to stop outputting the system voltage, and configures the USB interface as DCP.
And S909, controlling the USB interface to start outputting the system voltage after the USB interface is the DCP.
In a second possible implementation manner, when the MCU in the main device confirms that the fast charging identification is abnormal and the SDP identification is normal, the main device executes S910. S910, the MCU controls the data communication port to carry out SDP enumeration communication.
In a third possible implementation manner, when the MCU in the master device determines that the fast charging identification is normal and the SDP identification is normal, the master device executes S911. And S911, the MCU generates first prompt information, and the first prompt information is used for prompting a user to select a quick charging function or an SDP function.
For example, the first prompt message may be prompted by a pop-up box display on the display screen. The first prompt message can also be prompted through voice broadcast.
It is understood that, when receiving the operation of the user selecting the fast charge function, the master device performs S908 and S909. When receiving an operation of the user selecting the data communication function, the master device performs S910.
In a possible implementation manner, when the MCU in the master device confirms that the fast charging identification is abnormal and the SDP identification is abnormal, the master device executes S912 or does not perform any operation. S912, the MCU generates second prompt information. The second prompt message is used for prompting the user that the USB interface cannot use the first function and the second function. Therefore, the user can be prompted to replace the USB interface in time.
Therefore, the MCU can acquire the identification information of the USB interface from the quick charging protocol IC, control the power supply voltage of the external equipment and realize the secondary identification of the external equipment on the USB interface. Therefore, the external equipment can be identified by one-time insertion of the external equipment, the number of times of manual plugging and unplugging of the external equipment is reduced, and the operation is simple.
In addition, the main equipment carries out function prompt of the USB interface according to the twice identification information and carries out type switching of the USB interface according to selection of a user. The USB interface is convenient for a user to configure, and the user experience is improved. The function prompt also helps users who do not know the product characteristics to master the use method, and the product user experience is improved.
The embodiment of the application also provides the main equipment. The master device is configured to perform the method of the above embodiment. The master device may be a terminal device. The terminal device includes: a mobile phone, a tablet computer, a laptop computer, a Personal Digital Assistant (PDA), a Mobile Internet Device (MID), or a wearable device. The master device may also be a USB interface extender (USB Hub).
The master device includes: the system comprises a USB interface, a quick charge protocol integrated circuit, a Micro Control Unit (MCU) and a voltage conversion unit; the USB interface is used for connecting external equipment; the fast charging protocol integrated circuit is used for acquiring first identification information based on a data signal transmitted by the external equipment through the USB interface, and the first identification information is used for indicating whether a first function of the USB interface is normal or abnormal when the external equipment is accessed; the quick charging protocol integrated circuit is also used for sending a first signal to the MCU after the first identification information is obtained, wherein the first signal is used for indicating that the first function identification is finished; the MCU is used for acquiring first identification information from the fast charging protocol integrated circuit after receiving the first signal, controlling the voltage conversion unit to interrupt power supply to the external equipment and controlling the USB interface to be switched from the first type to the second type; the voltage conversion unit is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched from the first type to the second type; the quick charging protocol integrated circuit is also used for sending a second signal to the MCU after the second identification information is obtained, and the second signal is used for indicating that the second function identification is finished; the MCU is also used for acquiring second identification information from the fast charging protocol integrated circuit after receiving the second signal; the MCU is also used for configuring the type of the USB interface based on the first identification information and the second identification information.
Optionally, the MCU is further configured to control the voltage conversion unit to interrupt power supply to the external device, including: the MCU is used for controlling the voltage conversion unit to interrupt power supply to the external equipment through the quick charging protocol integrated circuit.
Optionally, the voltage conversion unit includes: a DC/DC converter; the DC/DC converter is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type.
Optionally, the voltage converting unit includes: a DC/DC converter and a switch; the switch is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type; the DC/DC converter is used for controlling the charging voltage provided by the USB interface to the external equipment.
Optionally, when the first identification information is used to indicate that the first function is normal and the second identification information is used to indicate that the second function is normal, the MCU is specifically configured to generate a first prompt information, where the first prompt information is used to prompt a user to select the first function or the second function; the MCU is specifically used for configuring the USB interface to be of a first type when responding to a first operation, and the first operation is used for indicating and selecting a first function; or the MCU is specifically configured to configure the USB interface to be of the second type in response to a second operation, where the second operation is used to instruct selection of the second function.
Optionally, when the first identification information is used to indicate that the first function is normal and the second identification information is used to indicate that the second function is abnormal, the MCU is specifically configured to control the USB interface to switch from the second type to the first type.
Optionally, the voltage conversion unit is further configured to interrupt power supply to the external device, and recover power supply to the external device after the USB interface is switched from the second type to the first type.
Optionally, when the first identification information indicates that the first function is abnormal and the second identification information indicates that the second function is normal, the MCU is specifically configured to control the USB interface to be of the second type.
Optionally, when the first identification information is used to indicate that the first function is abnormal and the second identification information is used to indicate that the second function is abnormal, the MCU is specifically configured to generate a second prompt message, where the second prompt message is used to prompt the user that the USB interface cannot use the first function and the second function.
Optionally, the first type is a standard charging interface DCP, the second type is a standard data interface SDP, the first function is to perform fast charging on the external device, and the second function is to perform data communication with the external device; or the first type is SDP, the second type is DCP, the first function is to perform data communication with the external device, and the second function is to perform quick charging on the external device.
The embodiment of the application also provides terminal equipment, a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the methods in the embodiments described above.
The embodiment of the application also provides a computer readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may include any medium that can communicate a computer program from one place to another. A storage medium may be any target medium that can be accessed by a computer.
In one possible implementation, the computer-readable medium may include RAM, ROM, a compact disk read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes disc, laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above embodiments are only for illustrating the embodiments of the present invention and are not to be construed as limiting the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the embodiments of the present invention shall be included in the scope of the present invention.

Claims (25)

1. A configuration method of a universal serial bus interface is applied to a master device and comprises the following steps:
when an external device is accessed to a Universal Serial Bus (USB) interface of the main device, acquiring first identification information, wherein the first identification information is used for indicating that a first function of the USB interface is normal or abnormal when the external device is accessed;
interrupting power supply to the external equipment and controlling the USB interface to be switched from a first type to a second type; when the USB interface is in the first type, the USB interface is used for realizing the first function;
after the USB interface is switched from the first type to the second type, the power supply to the external equipment is recovered;
acquiring second identification information, wherein the second identification information is used for indicating that a second function of the USB interface is normal or abnormal when the external equipment is accessed; when the USB interface is in the second type, the USB interface is used for realizing the second function;
configuring the type of the USB interface based on the first identification information and the second identification information.
2. The method of claim 1, wherein the USB interface comprises a data transfer pin;
the acquiring of the first identification information includes: determining the first identification information based on a voltage of the data transmission pin;
the acquiring of the second identification information includes: determining the second identification information based on a voltage of the data transmission pin.
3. The method according to claim 1 or 2, wherein the first type is a standard charging interface (DCP), the second type is a standard data interface (SDP), the first function is to perform fast charging on the external device, and the second function is to perform data communication with the external device.
4. The method of claim 3, wherein the obtaining the first identification information comprises:
identifying a fast charging protocol supported by the external equipment based on the voltage of the data transmission pin;
determining the first identification information according to the rapid charging protocol.
5. The method of claim 1 or 2, wherein the first type is the SDP, the second type is the DCP, the first function is data communication with the external device, and the second function is fast charging of the external device.
6. The method of claim 5, wherein the obtaining second identification information comprises:
identifying a fast charging protocol supported by the external equipment based on the voltage of the data transmission pin;
and determining the first identification information according to the quick charging protocol.
7. The method according to any of claims 1-6, wherein the configuring the type of the USB interface based on the first identification information and the second identification information comprises:
when the first identification information is used for indicating that the first function is normal and the second identification information is used for indicating that the second function is normal, generating first prompt information; the first prompt message is used for prompting a user to select a first function or the second function;
when responding to a first operation, configuring the USB interface to be the first type, wherein the first operation is used for indicating to select the first function;
or, when responding to a second operation, configuring the USB interface to be the second type, where the second operation is used to instruct to select the second function.
8. The method according to any of claims 1-6, wherein the configuring the type of the USB interface based on the first identification information and the second identification information comprises:
and when the first identification information is used for indicating that the first function is normal and the second identification information is used for indicating that the second function is abnormal, controlling the USB interface to be switched from the second type to the first type.
9. The method of claim 8, wherein prior to said controlling said USB interface to switch from said second type to said first type, further comprising:
interrupting power supply to the external device;
after the controlling the USB interface to switch from the second type to the first type, the method further includes: and restoring the power supply to the external equipment.
10. The method according to any of claims 1-6, wherein the determining the type of the USB interface based on the first identification information and the second identification information comprises:
and when the first identification information indicates that the first function is abnormal and the second identification information indicates that the second function is normal, controlling the USB interface to be the second type.
11. The method according to any of claims 1-6, wherein the configuring the type of the USB interface based on the first identification information and the second identification information comprises:
and when the first identification information is used for indicating that the first function is abnormal and the second identification information is used for indicating that the second function is abnormal, generating second prompt information, wherein the second prompt information is used for prompting a user that the USB interface cannot use the first function and the second function.
12. The method of any of claims 4-11, wherein the fast charging protocol includes, but is not limited to: super fast charge SCP, flash charge VOOC and fast charge QC.
13. A master device for performing the method of any one of claims 1-12, the master device comprising: the system comprises a USB interface, a quick charge protocol integrated circuit, a Micro Control Unit (MCU) and a voltage conversion unit;
the USB interface is used for connecting external equipment;
the quick charging protocol integrated circuit is used for acquiring first identification information based on a data signal transmitted by the external equipment through the USB interface, and the first identification information is used for indicating whether a first function of the USB interface is normal or abnormal when the external equipment is accessed;
the quick charging protocol integrated circuit is further used for sending a first signal to the MCU after the first identification information is acquired, wherein the first signal is used for indicating that the first function identification is completed;
the MCU is used for acquiring the first identification information from the quick charging protocol integrated circuit after receiving the first signal, controlling the voltage conversion unit to interrupt power supply to the external equipment and controlling the USB interface to be switched from a first type to a second type;
the voltage conversion unit is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched from the first type to the second type;
the rapid charging protocol integrated circuit is further configured to send a second signal to the MCU after the second identification information is obtained, where the second signal is used to indicate that the second function identification is completed;
the MCU is further used for acquiring the second identification information from the rapid charging protocol integrated circuit after receiving the second signal;
the MCU is further used for configuring the type of the USB interface based on the first identification information and the second identification information.
14. The master device of claim 13, wherein the MCU is further configured to control the voltage conversion unit to interrupt power supply to the external device, and the control method comprises:
the MCU is used for controlling the voltage conversion unit to interrupt power supply to the external equipment through the quick charging protocol integrated circuit.
15. The master device according to claim 13 or 14, wherein the voltage conversion unit comprises: a DC/DC converter;
the DC/DC converter is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type.
16. The master device according to claim 13 or 14, wherein the voltage conversion unit comprises: a DC/DC converter and a switch;
the switch is used for interrupting the power supply of the external equipment and recovering the power supply of the external equipment after the USB interface is switched to the second type;
the DC/DC converter is used for controlling the charging voltage provided by the USB interface to the external equipment.
17. Master device according to one of claims 13 to 16,
when the first identification information is used for indicating that the first function is normal and the second identification information is used for indicating that the second function is normal, the MCU is specifically used for generating first prompt information, and the first prompt information is used for prompting a user to select the first function or the second function;
the MCU is specifically used for configuring the USB interface to be the first type when responding to a first operation, and the first operation is used for indicating to select the first function;
or the MCU is specifically configured to configure the USB interface to be the second type in response to a second operation, where the second operation is used to instruct selection of the second function.
18. Master device according to one of claims 13 to 16,
when the first identification information is used to indicate that the first function is normal and the second identification information is used to indicate that the second function is abnormal, the MCU is specifically configured to control the USB interface to switch from the second type to the first type.
19. The master device of claim 18,
the voltage conversion unit is further configured to interrupt power supply to the external device, and to recover power supply to the external device after the USB interface is switched from the second type to the first type.
20. The master device of any one of claims 13-16,
when the first identification information indicates that the first function is abnormal and the second identification information indicates that the second function is normal, the MCU is specifically configured to control the USB interface to be the second type.
21. The master device of any one of claims 13-16,
when the first identification information is used for indicating that the first function is abnormal and the second identification information is used for indicating that the second function is abnormal, the MCU is specifically used for generating second prompt information, and the second prompt information is used for prompting a user that the USB interface cannot use the first function and the second function.
22. The master device according to any of claims 13-21, wherein the first type is a standard charging interface (DCP), the second type is a standard data interface (SDP), the first function is to perform fast charging on the external device, and the second function is to perform data communication with the external device;
or the first type is SDP, the second type is DCP, the first function is to perform data communication with the external device, and the second function is to perform fast charging on the external device.
23. A terminal device, comprising: a processor and a memory;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored by the memory, causing the processor to perform the method of any of claims 1-12.
24. A computer-readable storage medium, in which a computer program or instructions are stored which, when executed, implement the method of any one of claims 1-12.
25. A computer program product comprising a computer program or instructions for implementing the method of any one of claims 1-12 when executed by a processor.
CN202111289687.1A 2021-11-02 2021-11-02 Configuration method of universal serial bus interface and related device Active CN115017075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111289687.1A CN115017075B (en) 2021-11-02 2021-11-02 Configuration method of universal serial bus interface and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111289687.1A CN115017075B (en) 2021-11-02 2021-11-02 Configuration method of universal serial bus interface and related device

Publications (2)

Publication Number Publication Date
CN115017075A true CN115017075A (en) 2022-09-06
CN115017075B CN115017075B (en) 2023-04-18

Family

ID=83064911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111289687.1A Active CN115017075B (en) 2021-11-02 2021-11-02 Configuration method of universal serial bus interface and related device

Country Status (1)

Country Link
CN (1) CN115017075B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105922945A (en) * 2016-04-27 2016-09-07 重庆长安汽车股份有限公司 Method for supporting mobile phone quick charge on vehicle terminal USB port
CN106787232A (en) * 2016-11-30 2017-05-31 合肥宝龙达信息技术有限公司 The automatic switchover system and method for a kind of wireless charging and Wireless Data Transmission
CN107516919A (en) * 2017-08-25 2017-12-26 维沃移动通信有限公司 A kind of charging method and charger
CN111026695A (en) * 2019-12-10 2020-04-17 上海闻泰电子科技有限公司 USB connection device, method, computer equipment and storage medium
CN111736484A (en) * 2020-07-21 2020-10-02 惠州Tcl移动通信有限公司 Intelligent terminal and control method thereof
CN112425030A (en) * 2018-07-27 2021-02-26 三星电子株式会社 Electronic device for controlling communication channel by wireless charging and operation method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105922945A (en) * 2016-04-27 2016-09-07 重庆长安汽车股份有限公司 Method for supporting mobile phone quick charge on vehicle terminal USB port
CN106787232A (en) * 2016-11-30 2017-05-31 合肥宝龙达信息技术有限公司 The automatic switchover system and method for a kind of wireless charging and Wireless Data Transmission
CN107516919A (en) * 2017-08-25 2017-12-26 维沃移动通信有限公司 A kind of charging method and charger
CN112425030A (en) * 2018-07-27 2021-02-26 三星电子株式会社 Electronic device for controlling communication channel by wireless charging and operation method thereof
CN111026695A (en) * 2019-12-10 2020-04-17 上海闻泰电子科技有限公司 USB connection device, method, computer equipment and storage medium
CN111736484A (en) * 2020-07-21 2020-10-02 惠州Tcl移动通信有限公司 Intelligent terminal and control method thereof

Also Published As

Publication number Publication date
CN115017075B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
WO2021164556A1 (en) Wireless earphone case and system
CN112771900B (en) Data transmission method and electronic equipment
CN110602315A (en) Electronic equipment with foldable screen and display method
CN115589051B (en) Charging method and terminal equipment
CN113672534B (en) Terminal device and switch circuit
CN111385777A (en) TWS earphone low-power reminding method and electronic equipment
CN111711472A (en) NFC device output signal control method, terminal device, medium and electronic device
CN114498804B (en) Electronic equipment and control circuit for starting up or waking up system
CN111492678B (en) File transmission method and electronic equipment
CN112532145A (en) Motor vibration control method and electronic device
CN113497851B (en) Control display method and electronic equipment
CN110806994B (en) Signal transmission method and device
WO2023246340A1 (en) Electronic device
CN115017075B (en) Configuration method of universal serial bus interface and related device
CN115665632B (en) Audio circuit, related device and control method
CN115119336B (en) Earphone connection system, earphone connection method, earphone, electronic device and readable storage medium
CN114780029B (en) Device identification method and related device
WO2022206825A1 (en) Method and system for adjusting volume, and electronic device
CN114466238B (en) Frame demultiplexing method, electronic device and storage medium
WO2023005333A1 (en) Electronic device and camera module
CN115019803B (en) Audio processing method, electronic device, and storage medium
CN113923528B (en) Screen sharing method, terminal and storage medium
CN114449492B (en) Data transmission method and terminal equipment
CN117724595A (en) Power management circuit, method, apparatus, electronic device, and readable storage medium
CN117134009A (en) Charging method and electronic 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