CN108228509B - USB interface switching device and electronic equipment - Google Patents

USB interface switching device and electronic equipment Download PDF

Info

Publication number
CN108228509B
CN108228509B CN201810007069.5A CN201810007069A CN108228509B CN 108228509 B CN108228509 B CN 108228509B CN 201810007069 A CN201810007069 A CN 201810007069A CN 108228509 B CN108228509 B CN 108228509B
Authority
CN
China
Prior art keywords
usb interface
signal
processor
level
control chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810007069.5A
Other languages
Chinese (zh)
Other versions
CN108228509A (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.)
Quarkdata Software Co ltd
Original Assignee
Quarkdata Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Quarkdata Software Co ltd filed Critical Quarkdata Software Co ltd
Priority to CN201810007069.5A priority Critical patent/CN108228509B/en
Publication of CN108228509A publication Critical patent/CN108228509A/en
Application granted granted Critical
Publication of CN108228509B publication Critical patent/CN108228509B/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/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Power Sources (AREA)

Abstract

The invention provides a USB interface switching device and an electronic device, comprising: the control chip is used for detecting level signals of corresponding pins in the first USB interface and the second USB interface and sending at least one detected level signal to the processor; the processor is used for receiving the at least one level signal, generating an interface switching signal after determining whether the level signal which changes exists in the at least one level signal, and sending the interface switching signal to the control chip; and the control chip is also used for controlling a second channel at least comprising the processor and the second USB interface to be in a conducting state through the controlled switch according to the received interface switching signal, and controlling a first channel at least comprising the processor and the first USB interface to be in a disconnecting state through the controlled switch. The invention also discloses electronic equipment comprising the USB interface switching device.

Description

USB interface switching device and electronic equipment
Technical Field
The invention relates to the technical field of electronics, in particular to a USB interface switching device and electronic equipment.
Background
At present, most of intelligent devices have the requirement of double USB interfaces or multiple USB interfaces, and when only one System-on-a-Chip (SOC) Chip of a USB circuit (PHY) module is provided in an intelligent device, multiple USB interfaces need to be expanded, which can be expanded through a USB Hub (which can expand one USB interface into multiple USB interfaces), and the expanded USB interfaces are all interfaces of the same type, for example, all USB Host (Host) interfaces through which data can be obtained from another USB device. However, in some special application scenarios, a user needs to implement dual USB interfaces, where one of the dual USB interfaces is used as a slave (Device) (or OTG) interface for charging or as a Gadget Device, that is, to implement mutual switching between a host and a Device; and the other one is used as a Host interface for mounting USB slave equipment such as a USB flash disk. However, in the hardware architecture of most SOC chips, only one USB PHY module can be supported, and based on the specification of the USB protocol, a single USB PHY module cannot support both the Host interface and the Device interface, and cannot meet the user's requirement.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a USB interface switching apparatus and an electronic device, which are used to solve the problem that a single processor cannot support a master interface and a slave interface simultaneously in the prior art.
In a first aspect, an embodiment of the present invention provides a USB interface switching apparatus, including: a first USB interface, a second USB interface, a controlled switch, a control chip and a processor, wherein,
the controlled switch is respectively connected with the control chip, the processor, the first USB interface and the second USB interface;
the control chip is also connected with the processor, the first USB interface and the second USB interface;
the control chip is used for detecting level signals of corresponding pins in the first USB interface and the second USB interface and sending at least one detected level signal to the processor;
the processor is used for receiving the at least one level signal, generating an interface switching signal after determining that the level signal which changes exists in the at least one level signal, and sending the interface switching signal to the control chip;
the control chip is further configured to control, according to the received interface switching signal, a second path at least including the processor and the second USB interface to be in a conducting state through the controlled switch, control a first path at least including the processor and the first USB interface to be in a disconnecting state through the controlled switch, or,
and controlling a second path at least comprising a processor and the second USB interface to be in a disconnected state through the controlled switch, and controlling a first path at least comprising the processor and the first USB interface to be in a connected state through the controlled switch.
Optionally, the method further comprises: the semiconductor chip is respectively connected with the identification pin of the processor and the control chip;
the control chip is also used for detecting a first level signal of the identification pin in the first USB interface and a second level signal of the identification pin in the second USB interface and sending the detected first level signal and second level signal to the processor;
the processor is further used for generating a first level control signal after determining that any one of the first level signal and the second level signal changes, and sending the first level control signal to the control chip so that the control chip sends the first level control signal to the semiconductor chip;
the semiconductor chip is used for receiving a first level control signal sent by a control chip and pulling down the level of the identification pin according to the first level control signal.
Optionally, the method further comprises: the power supply module is respectively connected with the control chip and a power supply pin of the second USB interface;
the processor is further configured to generate a first power supply signal after determining that the second level signal changes, and send the first power supply signal to a control chip, so that the control chip sends the first power supply signal to the power module;
the control chip is further configured to control a power supply module to supply power to a power pin of the second USB interface according to the received first power supply signal.
Optionally, the method further comprises: the data transmission pin of the power management chip is respectively connected with the data transmission pin in the processor and the controlled switch;
the power management chip is used for detecting a third level signal of a power pin of the first USB interface and sending the third level signal to the processor;
the processor is further configured to generate a second level control signal after determining that the received third level signal changes, and send the second level control signal to the control chip;
and the control chip is used for controlling the suspension of the identification pin of the processor through a semiconductor chip according to the second level control signal.
Optionally, a power pin of the power management chip is connected with a power pin of the first USB interface;
the processor is further configured to generate a second power supply signal after the first level signal is determined to be changed, and send the second power supply signal to the power management chip;
the power management chip is further configured to supply power to a power pin in the first USB interface according to the received second power supply signal.
Optionally, the processor is further configured to:
after determining that the received first level signal and the second level signal sent by the control chip are changed, receiving a path selection command, generating a first control signal according to the path selection command, and sending the first control signal to the control chip;
or after determining that the received first level signal and the received third level signal sent by the control chip are changed, receiving a path selection command, generating a second control signal according to the path selection command, and sending the second control signal to the control chip;
the control chip is further configured to determine whether the second path is controlled to be in a conducting state and the first path is controlled to be in a disconnecting state by the controlled switch according to the received first control signal or the received second control signal.
Optionally, the method further comprises: the current conversion module is respectively connected with the power pin and the power module in the second USB interface;
the current conversion module is configured to convert the received voltage transmitted by the power supply module into a voltage with a preset threshold value, so as to supply power to the power pin in the second USB interface.
Optionally, the controlled switches include a first controlled switch, a second controlled switch, and a third controlled switch;
the first controlled switch is respectively connected with the control chip, the second controlled switch and the third controlled switch, and is used for determining whether to control the second channel to be in a conducting state and the first channel to be in a disconnecting state according to the received interface switching signal, the first control signal and the second control signal sent by the control chip;
the second controlled switch is connected with the first USB interface and used for determining whether the second controlled switch is turned on or not according to the received interface switching signal, the first control signal and the second control signal sent by the control chip;
and the third controlled switch is connected with the second USB interface and used for determining whether to turn on the third controlled switch according to the received interface switching signal, the first control signal and the second control signal sent by the control chip.
In a second aspect, an embodiment of the present invention provides an electronic device, including the USB interface switching apparatus as described above.
According to the technical scheme of the invention, the detection of the levels of the corresponding pins in the first USB interface and the second USB interface is realized through the control chip, and the processor controls the conduction of the first USB interface or the second USB interface through the control chip according to the change of the levels so as to realize the switching of the first USB interface and the second USB interface, so that the operation is quick and simple.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic structural diagram of a USB interface switching device according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a second USB interface according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a USB interface switching circuit according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic structural diagram of a USB interface switching device according to an embodiment of the present invention. As shown in fig. 1, the apparatus includes: the USB interface control device comprises a first USB interface 11, a second USB interface 12, a controlled switch 13, a control chip 14 and a processor 15.
The controlled switch 13 is respectively connected with a control chip 14, a processor 15, the first USB interface 11 and the second USB interface 12;
the control chip 14 is further connected to the processor 15, the first USB interface 11, and the second USB interface 12 respectively;
the control chip 14 is configured to detect level signals of corresponding pins in the first USB interface 11 and the second USB interface 12, and send at least one detected level signal to the processor 15;
the processor 15 is configured to receive the level, generate an interface switching signal after determining that a changed level signal exists in the at least one level signal, and send the interface switching signal to the control chip 14;
the control chip 14 is further configured to control, according to the received interface switching signal, a second path at least including the processor 15 and the second USB interface 12 to be in a conducting state through the controlled switch 13, control a first path at least including the processor 15 and the first USB interface 11 to be in a disconnecting state through the controlled switch 13, or,
the second path at least comprising the processor 15 and the second USB interface 12 is controlled to be in an off state by the controlled switch 13, and the first path at least comprising the processor 15 and the first USB interface 11 is controlled to be in an on state by the controlled switch 13.
The first USB interface 11 is used for connecting a master device and a slave device in a plug-in manner, and is preferably an OTG interface, where OTG is an abbreviation of On-The-Go, and is mainly used for connection between various devices or mobile devices to exchange data. For example, when the first USB interface is connected to the master Device, i.e., the first USB interface is in a slave (Device) mode, data can be transmitted to the master Device through the first USB interface, and when the first USB interface is connected to the slave Device, i.e., the first USB interface is in a master (Host) mode, data in the slave Device can be acquired through the first USB interface. The second USB interface 12 is used for plug-in connection with the slave device, that is, the second USB interface is in a Host mode, which can refer to fig. 2.
The master device may be, but is not limited to, a mobile phone, a PC, a tablet, and other computing devices, the slave device may be, but is not limited to, a USB disk, a USB electrical device, and other devices, and the control chip may be, but is not limited to, a General Purpose Input Output (GPIO) chip, which is not limited in this respect.
Optionally, the apparatus further comprises: the semiconductor chip is respectively connected with the identification pin of the processor 15 and the control chip 14;
the control chip 14 is further configured to detect a first level signal of an identification pin in the first USB interface 11 and a second level signal of an identification pin in the second USB interface 12, and send the detected first level signal and second level signal to the processor 15;
the processor 15 is further configured to generate a first level control signal after determining that any one of the first level signal and the second level signal changes, and send the first level control signal to the control chip 14, so that the control chip 14 sends the first level control signal to the semiconductor chip;
the semiconductor chip is configured to receive a first level control signal sent by the control chip 14, and pull down a level of the identification pin of the processor 15 according to the first level control signal.
The semiconductor chip may be, but is not limited to, a metal-oxide-semiconductor field effect transistor (Mos transistor), and the like, which is not limited in this respect.
Referring to fig. 3, in an initial state of the apparatus, a first path including the processor, the controlled switch, and a first USB interface (USB 1 for short) is in a conducting state (i.e., the controlled switch controls a connection of the first path to be in an open state), a second path including the processor, the controlled switch, and a second USB interface (USB 2 for short) is in an open state (i.e., the controlled switch controls a connection of the second path to be in an open state), an Identification (ID) pin in the first USB interface is in a high level, the pin is always connected to a ground pin (GND), and a level of the Identification (ID) pin in the second USB interface is in a high level. When the first path is turned on, the data transmission between the electronic device with the USB interface switching device and the master device or the slave device can be realized through the data transmission pin (e.g., D +, D-) in the USB1, and when the second path is turned on, the data transmission between the electronic device with the USB interface switching device and the slave device can be realized through the data transmission pin (e.g., D +, D-) in the USB 2.
In one embodiment, when the USB1 is in the Host mode and the USB2 is in the Host mode, after the slave device is inserted into the USB1 or the USB2 is inserted into the slave device, the levels of the ID pins of the USB1 and the USB2 are both pulled down mechanically by the slave device, that is, the levels of the ID pins of the USB1 and the USB2 are 0, the control chip detects the first level signal or the second level signal and sends the first level signal or the second level signal to the processor, the processor determines whether the first level signal or the second level signal is less than the respective preset level, when the preset level corresponding to the first level signal is in the initial state, the level of the ID pin of the USB1 is equal to the level of the ID pin of the USB2 when the preset level corresponding to the second level signal is in the initial state. After determining that the first level signal is smaller than the corresponding preset level or that the second level signal is smaller than the corresponding preset level, the processor generates a first level control signal and sends the first level control signal to the control chip 14, and the control chip 14 further sends the first level control signal to the semiconductor chip through a corresponding pin. The semiconductor chip pulls down the level of the identification pin of the processor 15 according to the received first level control signal, the level of the identification pin of the processor pulled down is the same as the first level signal or the second level signal, and the first level signal and the second level signal can be the same.
Optionally, the processor 15 is further configured to:
after determining that the received first level signal and the second level signal sent by the control chip are both changed, receiving a path selection command, generating a first control signal according to the path selection command, and sending the first control signal to the control chip 14;
or after determining that the received first level signal and the received third level signal sent by the control chip are both changed, receiving a path selection command, generating a second control signal according to the path selection command, and sending the second control signal to the control chip 14;
the control chip 14 is further configured to determine whether the second path is controlled to be in a conducting state and the first path is controlled to be in a disconnecting state by the controlled switch 14 according to the received first control signal or the received second control signal.
In one embodiment, referring to fig. 3, the USB1 is in the Host mode, and the USB2 is in the Host mode, when the USB1 and the USB2 are plugged with slaves at the same time, the ID pins of the USB1 and the USB2 are pulled low, that is, the first level signal and the second level signal are both smaller than the respective preset levels. At this moment, the processor can display a path selection prompt frame through the touch screen, the prompt frame comprises a first path option and a second path option, a user selects according to the requirement of the user, and the processor generates a first control signal which comprises a first path conducting signal and a second path conducting signal.
After the user selects the first path, the control chip controls the controlled switch to keep the first path in a conducting state and the second path in a disconnected state (i.e. an initial state) through the corresponding pins according to the received first path conducting signal, at this time, the electronic device having the USB interface switching device can read data in the slave device or charge the slave device through the USB1, and the USB2 is not available for data transmission or charging.
After the user selects the second channel, the control chip controls the controlled switch through the corresponding pin according to the received second channel conducting signal to enable the first channel to be in an off state and the second channel to be in an on state, at this time, the electronic device with the USB interface switching device can read data in the slave device through the USB2 or charge the slave device, and the USB1 is not available for data transmission or charging.
In one embodiment and referring to FIG. 3, the USB1 is in slave mode, the USB2 is in Host mode, and when the USB1 is plugged into the Host and the USB2 is plugged into the slave, the power (VBUS) pin of the USB1 is at 5V, the ID pin of the USB2 is pulled low, i.e., the third level signal is greater than the predetermined power level, and the second level signal is less than each predetermined level. At this moment, the processor can display a path selection prompt frame through the touch screen, the prompt frame comprises a first path option and a second path option, a user selects according to the self requirement, a second control signal is generated and sent to the control chip, and the second control signal comprises a first path conducting signal and a second path conducting signal.
After the user selects the first path, the control chip controls the controlled switch to keep the first path in a conducting state and the second path in a disconnected state (i.e. an initial state) through the corresponding pins according to the received first path conducting signal, at this time, the host device can read data of the electronic device with the USB interface switching device through the USB1, and the USB2 is not available for data transmission.
After the user selects the second channel, the control chip controls the controlled switch through the corresponding pin according to the received second channel conducting signal to enable the first channel to be in an off state and the second channel to be in an on state, at this time, the electronic device with the USB interface switching device can read data in the slave device through the USB2, and the USB1 is not available for data transmission.
Optionally, the apparatus further comprises: a data transmission pin of the power management chip is respectively connected with a data transmission pin in the processor 15 and the controlled switch 13;
the power management chip is configured to detect a third level signal of the power pin of the first USB interface 11, and send the third level signal to the processor 15;
the processor 15 is further configured to generate a second level control signal after determining that the received third level signal changes, and send the second level control signal to the control chip 14;
the control chip 14 is configured to control the tag pin of the processor 15 to be suspended through a semiconductor chip according to the second level control signal.
The Power Management chip may be, but is not limited to, a Power Management integrated circuit (Power Management IC) chip, and the like, which is not limited in this respect.
Optionally, a power pin of the power management chip is connected to a power pin of the first USB interface 11;
the processor 15 is further configured to generate a second power supply signal after determining that the first level signal changes, and send the second power supply signal to the power management chip;
the power management chip is further configured to supply power to a power pin in the first USB interface 11 according to the received second power supply signal.
The Power Management chip includes a Power Management Integrated Circuit (PMIC), which is used to manage Power devices in a host system and is often applied to electronic devices such as mobile phones and various mobile terminals.
Referring to fig. 3, when a master device is inserted into the USB1, the VBUS pin of the USB1 has a level of 5V, and after determining that the VBUS has a level of 5V, the processor generates a second level control signal and sends the second level control signal to the control chip, and the control chip controls the mosfet to suspend (also called suspend) the ID pin of the processor according to the second level control signal.
When a slave device is inserted into the USB1, the ID pin of the USB1 is pulled low, and at this time, the ID pin in the USB1 is powered by the power management chip, i.e., 5V is provided.
Optionally, the apparatus further comprises: the power supply module is respectively connected with the control chip 14 and a power supply pin of the second USB interface 12;
the processor 15 is further configured to generate a first power supply signal after determining that the second level signal changes, and send the first power supply signal to the control chip 14, so that the control chip 14 sends the first power supply signal to the power module;
the control chip 14 is further configured to control a power supply module to supply power to a power pin of the second USB interface according to the received first power supply signal.
Optionally, the apparatus further comprises: the current conversion module is respectively connected with a power pin and a power module in the second USB interface 12;
the current conversion module is configured to convert the received voltage transmitted by the power supply module into a voltage with a preset threshold, so as to supply power to the power pin in the second USB interface 12.
After determining that the level of the ID pin of the USB2 changes, the processor indicates that a slave device is inserted into the USB2, and at this time, power needs to be supplied to the slave device, and the voltage output by the power module is converted into a 5V voltage by a power module output voltage-to-current conversion module (DC/DC) to supply power to the power pin of the second USB interface.
In addition, the current conversion module may also be connected to the power pin and the power management chip in the second USB interface 12, respectively. When power is needed to be supplied to the power pin in the second USB interface, 5V voltage is output through the power pin of the power management chip, or 5V voltage may be supplied to the power pin through an independent power source such as a battery.
Optionally, the controlled switches include a first controlled switch, a second controlled switch, and a third controlled switch;
the first controlled switch is connected to the control chip 14, the second controlled switch, and the third controlled switch, respectively, and is configured to determine whether to control the second path to be in a conducting state and the first path to be in a disconnecting state according to a received interface switching signal, a first control signal, and a second control signal sent by the control chip 14;
the second controlled switch is connected with the first USB interface 11, and is configured to determine whether to turn on the second controlled switch according to a received interface switching signal, a first control signal, and a second control signal sent by the control chip;
the third controlled switch is connected to the second USB interface 12, and configured to determine whether to turn on the third controlled switch according to the received interface switching signal, the first control signal, and the second control signal sent by the control chip.
Referring to fig. 3, the present invention may further control the USB1 and the USB2 to be switched on or off through a Switch1 (Switch 1 for short), a Switch2 (Switch 2 for short), and a Switch 3(Switch3) by switches, where the first path includes a processor, a Switch1, and a Switch2, the second path includes a processor, a Switch1, and a Switch3, the initial state of the first path is an on state, that is, the Switch2 is on, the connection between the Switch1 and the Switch1 is on, and the second path is an off state, that is, the connection between the Switch3 and the Switch1 and the Switch3 is off.
For example, when a slave device is inserted into the USB1, the processor generates an interface switching signal according to a first level signal sent by the control chip, or when a master device is inserted into the USB1, the processor generates an interface switching signal according to a third level signal sent by the control chip, and sends the interface switching signal to the control chip, and the control chip controls the first path to be in a conducting state and the second path to be in a disconnecting state through corresponding pins.
After the slave device is inserted into the USB2, the processor generates an interface switching signal according to the second level signal sent by the control chip, and sends the interface switching signal to the control chip, and the control chip controls the first path to be in an off state and the second path to be in an on state through the corresponding pins.
When the slave devices are simultaneously inserted into the USB1 and the USB2, at this time, the user is required to select the first path and the second path, and generate a first control signal according to the user's touch or click input, and send the first control signal to the control chip, where the control chip controls the first path to be a conducting state and the second path to be a disconnected state through corresponding pins, or controls the first path to be a disconnected state and the second path to be a conducting state through corresponding pins. The first channel or the second channel is controlled through the second control switch or the third control switch, so that the control circuit is controlled more accurately.
The invention also discloses an electronic device comprising the USB interface switching device.
The USB interface switching device provided in the embodiments of the present invention may be specific hardware on a device, or software or firmware installed on a device. The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, reference may be made to the corresponding contents in the method embodiments without reference to the device embodiments. It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the foregoing systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided by the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present invention, which are used for illustrating the technical solutions of the present invention and not for limiting the same, and the protection scope of the present invention is not limited thereto, although the present invention is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the present invention in its spirit and scope. Are intended to be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (9)

1. A USB interface switching apparatus, comprising: the USB interface control device comprises a first USB interface, a second USB interface, a controlled switch, a control chip and a processor, wherein the first USB interface and the second USB interface are interfaces in different modes,
the controlled switch is respectively connected with the control chip, the processor, the first USB interface and the second USB interface;
the control chip is also connected with the processor, the first USB interface and the second USB interface respectively;
the control chip is used for detecting level signals of corresponding pins in the first USB interface and the second USB interface and sending at least one detected level signal to the processor;
the processor is used for receiving the at least one level signal, generating an interface switching signal after determining that the level signal which changes exists in the at least one level signal, and sending the interface switching signal to the control chip;
the control chip is used for controlling a second path at least comprising a processor and the second USB interface to be in a conducting state through the controlled switch according to a received interface switching signal, controlling a first path at least comprising the processor and the first USB interface to be in a disconnecting state through the controlled switch, or,
and controlling a second path at least comprising a processor and the second USB interface to be in a disconnected state through the controlled switch, and controlling a first path at least comprising the processor and the first USB interface to be in a connected state through the controlled switch.
2. The apparatus of claim 1, further comprising: the semiconductor chip is respectively connected with the identification pin of the processor and the control chip;
the control chip is also used for detecting a first level signal of the identification pin in the first USB interface and a second level signal of the identification pin in the second USB interface and sending the detected first level signal and second level signal to the processor;
the processor is further used for generating a first level control signal after determining that any one of the first level signal and the second level signal changes, and sending the first level control signal to the control chip so that the control chip sends the first level control signal to the semiconductor chip;
the semiconductor chip is used for receiving a first level control signal sent by a control chip and pulling down the level of the identification pin according to the first level control signal.
3. The apparatus of claim 2, further comprising: the power supply module is respectively connected with the control chip and a power supply pin of the second USB interface;
the processor is further used for generating a first power supply signal after the second level signal is determined to be changed, and sending the first power supply signal to the control chip;
the control chip is further configured to control a power supply module to supply power to a power pin of the second USB interface according to the received first power supply signal.
4. The apparatus of claim 2, further comprising: the data transmission pin of the power management chip is respectively connected with the data transmission pin in the processor and the controlled switch;
the power management chip is used for detecting a third level signal of a power pin of the first USB interface and sending the third level signal to the processor;
the processor is further configured to generate a second level control signal after determining that the received third level signal changes, and send the second level control signal to the control chip;
and the control chip is used for controlling the suspension of the identification pin of the processor through a semiconductor chip according to the second level control signal.
5. The apparatus of claim 4, wherein a power pin of the power management chip is connected with a power pin of the first USB interface;
the processor is further configured to generate a second power supply signal after the first level signal is determined to be changed, and send the second power supply signal to the power management chip;
the power management chip is further configured to supply power to a power pin in the first USB interface according to the received second power supply signal.
6. The apparatus of claim 2, wherein the processor is further configured to:
after determining that the received first level signal and the second level signal sent by the control chip are changed, receiving a path selection command, generating a first control signal according to the path selection command, and sending the first control signal to the control chip;
or after determining that the received first level signal and the received third level signal sent by the control chip are changed, receiving a path selection command, generating a second control signal according to the path selection command, and sending the second control signal to the control chip;
the control chip is further configured to determine whether the second path is controlled to be in a conducting state and the first path is controlled to be in a disconnecting state by the controlled switch according to the received first control signal or the received second control signal.
7. The apparatus of claim 3, further comprising: the current conversion module is respectively connected with the power pin and the power module in the second USB interface;
the current conversion module is configured to convert the received voltage transmitted by the power supply module into a voltage with a preset threshold value, so as to supply power to the power pin in the second USB interface.
8. The apparatus of claim 6, wherein the controlled switch comprises a first controlled switch, a second controlled switch, a third controlled switch;
the first controlled switch is respectively connected with the control chip, the second controlled switch and the third controlled switch, and is used for determining whether to control the second channel to be in a conducting state and the first channel to be in a disconnecting state according to the received interface switching signal, the first control signal and the second control signal sent by the control chip;
the second controlled switch is connected with the first USB interface and used for determining whether the second controlled switch is turned on or not according to the received interface switching signal, the first control signal and the second control signal sent by the control chip;
and the third controlled switch is connected with the second USB interface and used for determining whether to turn on the third controlled switch according to the received interface switching signal, the first control signal and the second control signal sent by the control chip.
9. An electronic device comprising the USB interface switching apparatus according to any one of claims 1 to 8.
CN201810007069.5A 2018-01-04 2018-01-04 USB interface switching device and electronic equipment Active CN108228509B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810007069.5A CN108228509B (en) 2018-01-04 2018-01-04 USB interface switching device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810007069.5A CN108228509B (en) 2018-01-04 2018-01-04 USB interface switching device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108228509A CN108228509A (en) 2018-06-29
CN108228509B true CN108228509B (en) 2020-06-09

Family

ID=62642761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810007069.5A Active CN108228509B (en) 2018-01-04 2018-01-04 USB interface switching device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108228509B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020019332A1 (en) * 2018-07-27 2020-01-30 华为技术有限公司 Mobile terminal
CN110209620A (en) * 2019-07-04 2019-09-06 深圳昆仑通态科技有限责任公司 A kind of multiplex roles electronic equipment
CN111723040A (en) * 2020-05-11 2020-09-29 百富计算机技术(深圳)有限公司 USB interface switching device, switching method and terminal equipment
CN111694779A (en) * 2020-06-18 2020-09-22 京东方科技集团股份有限公司 Interface switching device, communication equipment and interface switching method
CN111949594B (en) * 2020-08-18 2022-10-28 上海乐今通信技术有限公司 Mobile terminal with multiple USB interfaces and implementation method
CN112988638B (en) * 2021-03-12 2024-05-17 深圳宝新创信息技术有限公司 Keyboard interface multiplexing method and electronic equipment
CN113535622A (en) * 2021-06-04 2021-10-22 浙江大华技术股份有限公司 Power supply switching system, USB socket and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6732218B2 (en) * 2002-07-26 2004-05-04 Motorola, Inc. Dual-role compatible USB hub device and method
US7886106B2 (en) * 2008-11-11 2011-02-08 Aten International Co., Ltd. USB sharing switch with automatic switching capabilities
US8447890B1 (en) * 2009-10-30 2013-05-21 Cypress Semiconductor Corporation Operation of multiple masters/hosts through a hub
CN104731731A (en) * 2013-12-18 2015-06-24 昆达电脑科技(昆山)有限公司 USB interface switching device

Also Published As

Publication number Publication date
CN108228509A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
CN108228509B (en) USB interface switching device and electronic equipment
KR102216484B1 (en) Method and Apparatus for Controlling Battery Charging
AU2015312625B2 (en) Electronic device, method of controlling charging by electronic device, and method of supplying power by power supply device
CN106291210B (en) USB interface detector, USB interface detection method, USB connector and electronic equipment
US9059906B1 (en) Data communication interface
CN111697663B (en) Charging circuit and charging cable
US10042801B2 (en) System for detecting universal serial bus (USB) device and method thereof
JP6714469B2 (en) Electronic device and control method thereof
US8200852B2 (en) Multi-mode dongle for peripheral devices and associated methods
US20160004287A1 (en) Portable electronic device and power management method thereof
US20160004650A1 (en) Portable device, cable assembly, and usb system
CN109672950B (en) Power saving circuit and power saving method based on Type-C earphone
US20200117633A1 (en) Methods and apparatus to enable status change detection in a low power mode of a microcontroller unit
US8941361B2 (en) Computer system and control method thereof
US8935451B2 (en) Network card detecting circuit
KR20090076230A (en) Multi interface ic card
CN111881074B (en) Electronic system, host device and control method
EP3609046B1 (en) Motherboard with a charging function
CN212846570U (en) Type-C interface circuit and touch-control all-in-one
US20220206984A1 (en) Electronic apparatus and signal switching method
CN110800168A (en) Method and apparatus for changing impedance of terminal included in connector
KR20190075280A (en) Host controller, secure element and serial peripheral interface
TWI662764B (en) Motherboard with a smart charging function
JP6916629B2 (en) Electronics and control methods
CN110825202B (en) Motherboard with intelligent charging function

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