CN109032984A - A kind of method and USB OTG equipment of multiplexing USB interface - Google Patents

A kind of method and USB OTG equipment of multiplexing USB interface Download PDF

Info

Publication number
CN109032984A
CN109032984A CN201810548237.1A CN201810548237A CN109032984A CN 109032984 A CN109032984 A CN 109032984A CN 201810548237 A CN201810548237 A CN 201810548237A CN 109032984 A CN109032984 A CN 109032984A
Authority
CN
China
Prior art keywords
equipment
usb
external equipment
device type
level
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.)
Pending
Application number
CN201810548237.1A
Other languages
Chinese (zh)
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.)
GUANGZHOU GEOELECTRON SCIENCE & TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU GEOELECTRON SCIENCE & TECHNOLOGY 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 GUANGZHOU GEOELECTRON SCIENCE & TECHNOLOGY Co Ltd filed Critical GUANGZHOU GEOELECTRON SCIENCE & TECHNOLOGY Co Ltd
Priority to CN201810548237.1A priority Critical patent/CN109032984A/en
Publication of CN109032984A publication Critical patent/CN109032984A/en
Pending legal-status Critical Current

Links

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

Abstract

A kind of method and USB OTG equipment of multiplexing USB interface, it include: when the USB interface on the usb bus of USB OTG equipment is inserted into external equipment, output is for obtaining the inquiry message of the device type of external equipment and monitoring feedback information of the user response after inquiry message, when the device type of feedback information instruction external equipment is the first device type, it disconnects the other equipment of removing external equipment connected on usb bus and the level of the ID pin of the corresponding USB socket of usb bus is simultaneously adjusted to the first level, using USB OTG equipment as from equipment;When the device type of feedback information instruction external equipment is the second device type, the level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level, using USB OTG equipment as main equipment;It can ensure that USB OTG equipment can work normally under various working environments, improve reliability when its work.

Description

A kind of method and USB OTG equipment of multiplexing USB interface
Technical field
The present invention relates to field of communication technology more particularly to a kind of multiplexing universal serial bus (Universal Serial Bus, USB) interface method and USB OTG equipment.
Background technique
USB interface is a kind of general-purpose interface of data exchange, has been widely used in various communication products.With movement The enhancing of the computing capability of equipment and the demand of practical application, USB realize NAB National Association 0f Broadcasters (Universal Serial Bus Implementers Forums, USBIF) specification of USB OTG (On-The-Go) is developed, it will usually support USB OTG rule The equipment of model is referred to as USB OTG equipment.
Common USB OTG equipment, such as mobile embedded type equipment can be inserted into external by the USB interface on usb bus Equipment.Mobile embedded type equipment needs mobile power source to power in a mobile environment, therefore it is required that mobile embedded type equipment conduct Main equipment, mobile power source are used as from equipment;Mobile embedded type equipment is also needed through usb bus and PC (Personal Computer, PC) data exchange is carried out, it needs that mobile embedded type equipment is required to be used as from equipment at this time, and PC is as main equipment. But according to USB OTG specification it is found that USB OTG equipment be selected as main equipment still from equipment when, be slotting according to USB What the level of the ID pin of seat just judged: when the ID pin of USB socket is grounded (low level), USB OTG equipment conduct Main equipment;When ID pin floating (high level) of USB socket, USB OTG equipment is used as from equipment.Those skilled in the art exist It is found in practical application, mobile embedded type equipment is when accessing PC, if USB OTG equipment has accessed some needs at this time When USB OTG equipment does the external equipment of main equipment, the ID pin of USB socket has been in ground state (low level), therefore, moves Dynamic embedded device is still confirmed to be main equipment, it will causes USB OTG equipment cannot be with PC normal communication;It is embedded in when mobile When formula equipment accesses mobile power source, the state of the ID pin of USB socket is vacant state (high level), mobile embedded type equipment meeting It is confirmed to be from equipment, then mobile power source can not charge for it, while external equipment can not work normally.As it can be seen that merely It determines that the role of USB OTG equipment will appear many problems by the level height of the ID pin of USB socket, leads to USB OTG equipment or external equipment can not work normally.
Summary of the invention
The embodiment of the present invention discloses the method and USB OTG equipment of a kind of multiplexing USB interface, can be improved USB OTG and sets The standby reliability worked normally.
A kind of method that first aspect of the embodiment of the present invention discloses multiplexing USB interface, comprising:
Whether the USB interface detected on the usb bus of USB OTG equipment is inserted into external equipment;
When detecting that the USB interface is inserted into the external equipment, export for obtaining setting for the external equipment The inquiry message of standby type, and feedback information of the monitoring user response after the inquiry message, the feedback information carry There is the device type of the external equipment;
When the feedback information indicates that the device type of the external equipment is the first device type, described in disconnection Other equipment of the removing external equipment connected on usb bus, by the ID pin of the corresponding USB socket of the usb bus Level be adjusted to the first level so that the USB OTG equipment, which is used as from equipment, accesses the external equipment;
When the feedback information indicates that the device type of the external equipment is the second device type, by the USB The level of the ID pin of the corresponding USB socket of bus is adjusted to second electrical level so that the USB OTG equipment as main equipment with The external equipment connection.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described to detect that the USB connects When mouth is inserted into the external equipment, the inquiry message for obtaining the device type of the external equipment, and monitoring are exported Feedback information of the user response after the inquiry message include:
When detecting that the USB interface is inserted into the external equipment, voice is played for obtaining the external equipment Device type inquiry message, and acquisition user's input for replying the voice messaging of the inquiry message, will be described Voice messaging is determined as feedback information of the user response after the inquiry message;Alternatively,
Several indicator lights flashing on control instructions light panel, detection user refer to some in several indicator lights The confirmation operation for showing lamp is obtained when detecting the confirmation operation to the confirmation message of some indicator light, and by institute It states confirmation message and is determined as feedback information of the user response after the inquiry message, each indicator light corresponds to a kind of equipment class Type, the confirmation message are used to indicate device type corresponding to some described indicator light.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described to disconnect on the usb bus Other equipment of the removing external equipment of connection include:
It is switched by the micro-control unit of the USB OTG equipment to usb bus and sends control signal, described in control Usb bus switch disconnects connection, disconnection and other equipment between the usb bus and the D+ pin of other equipment D- pin between connection and disconnection and the VBUS pin of other equipment between connection.
As an alternative embodiment, in first aspect of the embodiment of the present invention, when the feedback information indicates When the device type of the external equipment is the second device type, by the electricity of the ID pin of the corresponding USB socket of the usb bus It is flat to be adjusted to second electrical level, so that after the USB OTG equipment is connect as main equipment with the external equipment, the method Further include:
The contact current value that the USB OTG equipment is connect with the external equipment is obtained, and judges the contact electric current Whether value is greater than pre-set current value;
When the contact current value is greater than the pre-set current value, export for indicating that the USB OTG equipment is in The prompting message of charged state.
As an alternative embodiment, in first aspect of the embodiment of the present invention, it is described when the feedback information refers to When the device type for showing the external equipment is the second device type, by the ID pin of the corresponding USB socket of the usb bus Level be adjusted to second electrical level so that the USB OTG equipment connect with the external equipment as main equipment and includes:
When the feedback information indicates that the device type of the external equipment is the second device type, described in judgement Whether the level of the ID pin of the corresponding USB socket of usb bus is second electrical level;
If so, keeping the level of the ID pin is the second electrical level, so that the USB OTG equipment is set as master It is standby to be connect with the external equipment.
Second aspect of the embodiment of the present invention discloses a kind of USB OTG equipment, comprising:
Detection unit, whether the USB interface on usb bus for detecting the USB OTG equipment, which is inserted into outside, sets It is standby;
Interactive unit, for exporting when the detection unit detects that the USB interface is inserted into the external equipment For obtaining the inquiry message of the device type of the external equipment, and monitoring user response is anti-after the inquiry message Feedforward information, the feedback information carry the device type of the external equipment;
First execution unit, for monitoring that the feedback information indicates the external equipment when the interactive unit When device type is the first device type, other equipment of the removing external equipment connected on the usb bus are disconnected, it will The level of the ID pin of the corresponding USB socket of the usb bus is adjusted to the first level, so that the USB OTG equipment conduct The external equipment is accessed from equipment;
Second execution unit, for monitoring that the feedback information indicates the external equipment when the interactive unit When device type is the second device type, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted to the second electricity It is flat, so that the USB OTG equipment is connect as main equipment with the external equipment.
As an alternative embodiment, the interactive unit is used for when inspection in second aspect of the embodiment of the present invention When measuring the USB interface and being inserted into the external equipment, the inquiry for obtaining the device type of the external equipment is exported Information, and the mode of feedback information of the monitoring user response after the inquiry message specifically:
The interactive unit, for when detecting that the USB interface is inserted into the external equipment, voice broadcasting to be used for Obtain the inquiry message of the device type of the external equipment, and acquisition user's input for replying the inquiry message The voice messaging is determined as feedback information of the user response after the inquiry message by voice messaging;Alternatively, control instructions Several indicator lights flashing on light panel, detection user to the confirmation operation of some indicator light in several indicator lights, When detecting the confirmation operation, the confirmation message to some indicator light is obtained, and the confirmation message is determined For feedback information of the user response after the inquiry message, each indicator light corresponds to a kind of device type, the confirmation letter Breath is used to indicate device type corresponding to some described indicator light.
As an alternative embodiment, first execution unit is used in second aspect of the embodiment of the present invention When the interactive unit monitors that the feedback information indicates that the device type of the external equipment is the first device type, The other equipment for disconnecting the removing external equipment connected on the usb bus, by the corresponding USB socket of the usb bus The level of ID pin be adjusted to the first level so that the USB OTG equipment accesses the external equipment as from equipment Mode specifically:
First execution unit, for monitoring that the feedback information indicates that the outside is set when the interactive unit When standby device type is the first device type, is switched and sent to usb bus by the micro-control unit of the USB OTG equipment Signal is controlled, to control the company between the usb bus switch disconnection usb bus and the D+ pin of other equipment It connects, disconnect between connection and disconnection and the VBUS pin of other equipment between the D- pin of other equipment Connection, is adjusted to the first level for the level of the ID pin of the corresponding USB socket of the usb bus, so that the USB OTG is set Standby be used as from equipment accesses the external equipment.
As an alternative embodiment, the USB OTG equipment is also wrapped in second aspect of the embodiment of the present invention It includes:
Acquiring unit, the equipment for indicating the external equipment in the feedback information in second execution unit When type is the second device type, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted to second electrical level, So that after the USB OTG equipment is connect as main equipment with the external equipment, obtain the USB OTG equipment with it is described The contact current value of external equipment connection;
Whether judging unit, the contact current value for judging that the acquiring unit obtains are greater than pre-set current value;
Output unit, for exporting for indicating the USB when the contact current value is greater than the pre-set current value OTG equipment is in the prompting message of charged state.
As an alternative embodiment, second execution unit is used in second aspect of the embodiment of the present invention When the interactive unit monitors that the feedback information indicates that the device type of the external equipment is the second device type, The level of the ID pin of the corresponding USB socket of the usb bus is adjusted to second electrical level, so that the USB OTG equipment is made The mode being connect for main equipment with the external equipment specifically:
Second execution unit, for monitoring that the feedback information indicates that the outside is set when the interactive unit Standby device type be the second device type when, judge the ID pin of the corresponding USB socket of the usb bus level whether be Second electrical level;If so, keeping the level of the ID pin is the second electrical level, so that the USB OTG equipment is as master Equipment is connect with the external equipment.
The third aspect of the embodiment of the present invention discloses a kind of USB OTG equipment, comprising:
It is stored with the memory of executable program code;
The processor coupled with the memory;
The processor calls the executable program code stored in the memory, executes the embodiment of the present invention the A kind of method of multiplexing USB interface disclosed in one side.
Fourth aspect of the embodiment of the present invention discloses a kind of computer readable storage medium, stores computer program, wherein The computer program makes computer execute a kind of method of multiplexing USB interface disclosed in first aspect of the embodiment of the present invention.
The 5th aspect of the embodiment of the present invention discloses a kind of computer program product, when the computer program product is calculating When being run on machine, so that the computer executes some or all of any one method of first aspect step.
The aspect of the embodiment of the present invention the 6th disclose a kind of using distribution platform, and the application distribution platform is for publication calculating Machine program product, wherein when the computer program product is run on computers, so that the computer executes first party Some or all of any one method in face step.
Compared with prior art, the embodiment of the present invention has the advantages that
In the embodiment of the present invention, whether the USB interface detected on the usb bus of USB OTG equipment is inserted into external equipment; When detecting that USB interface is inserted into external equipment, the inquiry message for obtaining the device type of external equipment is exported, and Feedback information of the user response after inquiry message is monitored, feedback information carries the device type of external equipment;Work as feedback letter When breath indicates that the device type of external equipment is the first device type, the removing external equipment connected on usb bus is disconnected The level of the ID pin of the corresponding USB socket of usb bus is adjusted to the first level by other equipment, so that USB OTG equipment is made To access external equipment from equipment;When feedback information indicates that the device type of external equipment is the second device type, by USB The level of the ID pin of the corresponding USB socket of bus is adjusted to second electrical level, so that USB OTG equipment is as main equipment and outside Equipment connection;It can be seen that the implementation embodiment of the present invention, can confirm the equipment of the external equipment of USB OTG equipment access by user Type further adjusts the level of the ID pin of USB socket according to device type, is set so that USB OTG equipment is arranged as master It is standby or as from equipment, it can be ensured that USB OTG equipment can work normally under various working environments, improve USB OTG Reliability when equipment works.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for ability For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is a kind of flow diagram of the method for multiplexing USB interface disclosed by the embodiments of the present invention;
Fig. 2 is the flow diagram of the method for another multiplexing USB interface disclosed by the embodiments of the present invention;
Fig. 3 is the flow diagram of the method for another multiplexing USB interface disclosed by the embodiments of the present invention;
Fig. 4 is a kind of structural schematic diagram of USB OTG equipment disclosed by the embodiments of the present invention;
Fig. 5 is the structural schematic diagram of another kind USB OTG equipment disclosed by the embodiments of the present invention;
Fig. 6 is the structural schematic diagram of another kind USB OTG equipment disclosed by the embodiments of the present invention;
Fig. 7 is the structural schematic diagram of another kind USB OTG equipment disclosed by the embodiments of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that the described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts Example is applied, shall fall within the protection scope of the present invention.
It should be noted that term " includes " and " having " and their any changes in the embodiment of the present invention and attached drawing Shape, it is intended that cover and non-exclusive include.Such as contain the process, method of a series of steps or units, system, product or Equipment is not limited to listed step or unit, but optionally further comprising the step of not listing or unit or optional Ground further includes the other step or units intrinsic for these process, methods, product or equipment.
The embodiment of the present invention discloses the method and USB OTG equipment of a kind of multiplexing USB interface, it can be ensured that USB OTG is set It is standby to be worked normally under various working environments, improve reliability when its work.It is described in detail separately below.
Embodiment one
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of the method for multiplexing USB interface disclosed by the embodiments of the present invention.Such as Shown in Fig. 1, the method for the multiplexing USB interface be may comprise steps of:
101, whether the USB interface on the usb bus of USB OTG equipment detection USB OTG equipment is inserted into external equipment, If so, executing step 102~step 103 or executing step 102 and step 104, if not, terminating this process.
In the embodiment of the present invention, at least one USB interface can be set on the usb bus of USB OTG equipment, it is any USB interface can be inserted into external equipment, wherein external equipment can set for mobile power source, PC or other USB OTG It is standby etc., in the embodiment of the present invention without limitation.Also, when external equipment is mobile power source, it is desirable that USB OTG equipment is as master Equipment, mobile power source are used as from equipment;When external equipment is PC or other USB OTG equipment, it is desirable that USB OTG Equipment is used as from equipment, and PC or other USB OTG equipment are as main equipment.If the master-slave equipment of USB OTG equipment Configuration error will lead to the case where charging exception or data transmission exception.Therefore, when USB OTG equipment detects USB OTG When USB interface on the usb bus of equipment is inserted into external equipment, executes step 102~step 103 or execute step 102 And step 104.
In the embodiment of the present invention, above-mentioned introduced USB interface can be type-c interface.If it is type-c interface When, USB OTG equipment remains that the cc line on the plug of the cc line and type-c interface inside USB OTG equipment is in connection State, and type-c interface is worked based on power transmission protocol (Power Delivery, PD), can guarantee that type-c connects The external equipment of mouth insertion is when supporting the mobile power source of fast charge, and USB OTG equipment can be realized by type-c interface to shifting The fast charge of dynamic power supply.
102, USB OTG equipment exports the inquiry message for obtaining the device type of external equipment, and monitoring user In response to the feedback information after inquiry message, which carries the device type of external equipment.
In the embodiment of the present invention, inquiry message of the USB OTG equipment output for obtaining the device type of external equipment Mode can export the inquiry text information of the device type for obtaining external equipment on a display screen for USB OTG equipment, Or USB OTG equipment voice broadcast is for obtaining inquiry voice messaging of device type of external equipment etc., it is of the invention In embodiment without limitation.
As an alternative embodiment, feedback information of the USB OTG equipment monitoring user response after inquiry message, The device type that feedback information carries external equipment may include:
USB OTG equipment is to enabled instruction is sent with the keyboard equipment of USB OTG device pairing in advance, to start the keyboard Equipment;
The user response that USB OTG equipment receives keyboard equipment return is keyed in after inquiry message by the keyboard equipment Feedback information;
The USB OTG device analysis feedback information obtains the device type for the external equipment that the feedback information includes.
By implementing this optional embodiment, USB OTG equipment can be to the key in advance with USB OTG device pairing Disc apparatus sends enabled instruction, receives the feedback information that user keys in start the keyboard equipment, user is allowed to pass through key Disk inputs the device type information of external equipment, to realize the configuration to USB OTG equipment as master-slave equipment.This process So that user's key entry feedback information is more convenient, meet user's use habit, improves user experience.
103, when feedback information indicates that the device type of external equipment is the first device type, USB OTG equipment is disconnected The other equipment for opening the removing external equipment connected on usb bus, by the level of the ID pin of the corresponding USB socket of usb bus It is adjusted to the first level, so that USB OTG equipment, which is used as from equipment, accesses external equipment.
In the embodiment of the present invention, the first device type may include that PC or other USB OTG equipment etc. are used for The device type of the electronic equipment carried out data transmission with USB OTG equipment, the first device type can also include that can be realized The device type of the electronic equipment of other functions, it is only necessary to meet after electronic equipment is inserted into USB interface, electronic equipment is as master Equipment work, USB OTG equipment are used as from equipment and work;When feedback information indicates that the device type of external equipment sets for first When standby type, if illustrating that USB OTG equipment will carry out data exchange with the external equipment, it is desirable that USB OTG equipment be used as from Equipment accesses external equipment, but may be connected with the other equipment for removing external equipment on usb bus at this time, for example, usb bus On another USB interface be connected with mobile power source, wherein it is required that USB OTG equipment is connect as main equipment with the mobile power source It can just charge normal.At this point, transmitting for the preferential data for realizing USB OTG equipment and external equipment, USB OTG equipment is disconnected Other equipment of the removing external equipment connected on usb bus, by the level tune of the ID pin of the corresponding USB socket of usb bus Whole is the first level (high level), so that USB OTG equipment, which is used as from equipment, accesses external equipment.
104, when feedback information indicates that the device type of external equipment is the second device type, USB OTG equipment will The level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level so that USB OTG equipment as main equipment with External equipment connection.
In the embodiment of the present invention, the second device type may include the filling for realizing USB OTG equipment such as mobile power source The device type of the electronic equipment of Electricity Functional, the second device type can also include the electronic equipment that can be realized other functions Device type, it is only necessary to meet after electronic equipment is inserted into USB interface, electronic equipment is used as from equipment work, USB OTG equipment It works as main equipment;When feedback information indicates that the device type of external equipment is the second device type, by usb bus pair The level of the ID pin for the USB socket answered is adjusted to second electrical level (low level), so that USB OTG equipment is as main equipment and outside Portion's equipment connects to realize the charging to USB OTG equipment.
In the embodiment of the present invention, when feedback information indicates that the device type of external equipment is the second device type, USB The level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level by OTG equipment, so that USB OTG equipment conduct Main equipment is connect with external equipment
When feedback information indicates that the device type of external equipment is the second device type, USB OTG equipment judges USB Whether the level of the ID pin of the corresponding USB socket of bus is second electrical level;
If so, it is second electrical level that USB OTG equipment, which keeps the level of ID pin, so that USB OTG equipment is set as master It is standby to be connect with external equipment.
It should be noted that when feedback information indicates that the device type of external equipment is the second device type, due to Several other equipment for removing external equipment are connected on usb bus, the level of the ID pin of USB socket is second at this time Level, it is second electrical level that USB OTG equipment, which needs to keep the level of ID pin, so that USB OTG equipment is as main equipment and outside The connection of portion's equipment.
As it can be seen that by implement Fig. 1 described in multiplexing USB interface method, when detect USB interface be inserted into external equipment When, export the inquiry message for obtaining the device type of external equipment, and monitoring user response is anti-after inquiry message Feedforward information, feedback information carry the device type of external equipment;When feedback information indicates that the device type of external equipment is When the first device type, other equipment of the removing external equipment connected on usb bus are disconnected, the corresponding USB of usb bus is inserted The level of the ID pin of seat is adjusted to the first level, so that USB OTG equipment, which is used as from equipment, accesses external equipment;Work as feedback letter When breath indicates that the device type of external equipment is the second device type, by the electricity of the ID pin of the corresponding USB socket of usb bus It is flat to be adjusted to second electrical level, so that USB OTG equipment is connect as main equipment with external equipment.This process can pass through user Confirm the device type of the external equipment of USB OTG equipment access, the ID that USB socket is further adjusted according to device type draws The level of foot, USB OTG equipment is arranged as main equipment or as from equipment, it can be ensured that USB OTG equipment is various It can be worked normally under working environment, improve the reliability when work of USB OTG equipment.
Embodiment two
Referring to Fig. 2, Fig. 2 is the flow diagram of the method for another multiplexing USB interface disclosed by the embodiments of the present invention. As shown in Fig. 2, the method for the multiplexing USB interface may comprise steps of:
201, whether the USB interface on the usb bus of USB OTG equipment detection USB OTG equipment is inserted into external equipment, If so, executing step 202~step 203 or executing step 202 and step 204, if not, terminating this process.
202, USB OTG equipment exports the inquiry message for obtaining the device type of external equipment, and monitoring user In response to the feedback information after inquiry message, feedback information carries the device type of external equipment.
As an alternative embodiment, USB OTG equipment exports the inquiry for obtaining the device type of external equipment Ask that information, and feedback information of the monitoring user response after inquiry message may include:
USB OTG equipment voice plays the inquiry message for obtaining the device type of external equipment, and acquisition user The voice messaging for being used to reply inquiry message of input, is determined as feedback letter of the user response after inquiry message for voice messaging Breath;Alternatively,
Several indicator lights flashing on USB OTG equipment control instructions light panel, detects user in several indicator lights The confirmation operation of some indicator light obtains the confirmation message to some indicator light, and will be true when detecting confirmation operation Recognize information and be determined as feedback information of the user response after inquiry message, each indicator light corresponds to a kind of device type, confirmation Information is used to indicate device type corresponding to some indicator light.
By implementing this optional embodiment, USB OTG equipment both can play inquiry message with voice and voice is adopted Collect the voice messaging for being used to reply inquiry message of user's input to monitor the feedback information of user, also can control indicator light sudden strain of a muscle Sparkle the feedback information for monitoring user with this to detect user to the confirmation operation of indicator light.This process provides a variety of and user Interactive mode obtain the device type of external equipment, more fitting user's use habit improves user experience.
203, when feedback information indicates that the device type of external equipment is the first device type, USB OTG equipment is logical The micro-control unit for crossing USB OTG equipment is switched to usb bus sends control signal, total to control usb bus switch disconnection USB Connection between connection, disconnection between line and the D+ pin of other equipment and the D- pin of other equipment and disconnect with it is other The level of the ID pin of the corresponding USB socket of usb bus is adjusted to the first level by the connection between the VBUS pin of equipment, So that USB OTG equipment, which is used as from equipment, accesses external equipment.
In the embodiment of the present invention, the pin on usb bus may include VBUS pin, D+ pin, D- pin and ID pin, Pin on USB socket corresponding with usb bus may include VBUS pin, D+ pin and D- pin.When external equipment is inserted into When the USB interface of USB OTG equipment, insertion signal when external equipment insertion is detected, when detecting insertion signal, microcontroller Unit can inquire whether the device type of user's external equipment is the first device type by loudspeaker, and micro-control unit can also be with Request signal etc. is exported by the LED light in USB OTG equipment, is indicated when receiving user according to the feedback information that inquiry returns When the device type of external equipment is the first device type out, is switched to usb bus and send control signal, to control usb bus Switch disconnects the connection between connection, disconnection and the D- pin of other equipment between usb bus and the D+ pin of other equipment And the connection between disconnection and the VBUS pin of other equipment, by the level tune of the ID pin of the corresponding USB socket of usb bus Whole is the first level, be connected to the D+ pin of USB socket and micro-control unit, the D- pin of USB socket and micro-control unit and The VBUS pin of USB socket and micro-control unit, so that USB OTG equipment, which is used as from equipment, accesses external equipment.
204, when feedback information indicates that the device type of external equipment is the second device type, USB OTG equipment will The level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level so that USB OTG equipment as main equipment with External equipment connection.
In the embodiment of the present invention, when feedback information indicates that the device type of external equipment is the second device type, USB The level of the ID pin of the corresponding USB socket of usb bus can be adjusted to second electrical level by OTG equipment, and be connected to USB socket with The VBUS pin of micro-control unit disconnects the D+ pin of USB socket and micro-control unit and disconnects USB socket and microcontroller list The D- pin of member, so that USB OTG equipment is connect as main equipment with external equipment, and keeps micro-control unit and other equipment Normal connection.
As it can be seen that the method by implementing multiplexing USB interface described in Fig. 2, can be arranged USB by interacting with user OTG equipment is as main equipment or as from equipment, it is ensured that the normal realization of data exchange and charge function improves The reliability that USB OTG equipment works normally.
Embodiment three
Referring to Fig. 3, Fig. 3 is the flow diagram of the method for another multiplexing USB interface disclosed by the embodiments of the present invention. As shown in figure 3, the method for the multiplexing USB interface may comprise steps of:
301, whether the USB interface on USB OTG equipment detection usb bus is inserted into external equipment, if so, executing step Rapid 302~step 303 executes step 302 and step 304~step 305, if not, terminating this process.
302, USB OTG equipment exports the inquiry message for obtaining the device type of external equipment, and monitoring user In response to the feedback information after inquiry message, feedback information carries the device type of external equipment.
303, when feedback information indicates that the device type of external equipment is the first device type, USB OTG equipment is logical The micro-control unit for crossing USB OTG equipment is switched to usb bus sends control signal, total to control usb bus switch disconnection USB Connection between connection, disconnection between line and the D+ pin of other equipment and the D- pin of other equipment and disconnect with it is other The level of the ID pin of the corresponding USB socket of usb bus is adjusted to the first level by the connection between the VBUS pin of equipment, So that USB OTG equipment, which is used as from equipment, accesses external equipment.
After executing the step 303, terminate this process.
304, when feedback information indicates that the device type of external equipment is the second device type, USB OTG equipment will The level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level so that USB OTG equipment as main equipment with External equipment connection.
After executing the step 304, step 305 is turned to.
305, USB OTG equipment obtains the contact current value that USB OTG equipment is connect with external equipment, and judges contact electricity Whether flow valuve is greater than pre-set current value, if so, step 306 is executed, if not, terminating this process.
In the embodiment of the present invention, when the contact current value that USB OTG equipment is connect with external equipment is greater than pre-set current value When, illustrate that USB OTG equipment is in normal charging condition, executes step 306 at this time;When USB OTG equipment and external equipment connect When the contact current value connect is less than or equal to pre-set current value, illustrates that USB OTG equipment is in abnormal charged state, terminate this Secondary process.
As an alternative embodiment, after judging that contact current value is less than or equal to pre-set current value, Following steps can also be performed:
USB OTG equipment sends electric power detection signal to external equipment, and electric power detection signal is used to indicate acquisition outside and sets Standby voltage value;
USB OTG equipment receives the voltage value for the external equipment that external equipment is returned according to the electric power detection signal, And judge whether the voltage value is lower than default charge value;
When judging that the voltage value is lower than default charge value, USB OTG equipment issues the first prompting message, this One prompting message is for prompting external equipment to be in low battery state;
When judging that the voltage value is not less than default charge value, USB OTG equipment issues the second prompting message, should Second prompting message is for prompting external equipment to be in malfunction.
By implementing this optional embodiment, judge contact current value be less than or equal to pre-set current value it Afterwards, the voltage value of the available external equipment of USB OTG equipment, if the voltage value is lower than default charge value, explanation External equipment is in low battery state, and charging at this time is different normally due to what the low battery state of external equipment generated, sending the One prompting message reminds user to charge external equipment to guarantee external equipment normally filling to USB OTG equipment with this Electricity;If the voltage value is not less than default charge value, illustrate that external equipment is in the state of electricity abundance, but there is no right USB OTG equipment is charged normal, and external equipment is in malfunction at this time, is issued the second prompting message, is reminded use with this External equipment is overhauled to guarantee that external equipment charges normal USB OTG equipment in family.This process is for different different Reason condition issues different prompting messages, allows user targetedly to solve charging abnormal conditions, improves abnormal solution Efficiency.
306, the output of USB OTG equipment is for indicating that USB OTG equipment is in the prompting message of charged state.
As an alternative embodiment, following steps can also be performed after executing the step 306:
The temperature value of the temperature detecting unit detection USB OTG equipment of USB OTG equipment utilization USB OTG equipment;
When temperature value reaches preset temperature threshold, electricity that USB OTG equipment transmits from external equipment to USB OTG equipment It flows signal and executes current-limiting operation.
As it can be seen that USB can be arranged by interacting with user by the method for multiplexing USB interface described in implementing Fig. 3 OTG equipment is as main equipment or as from equipment, it is ensured that the normal realization of data exchange and charge function improves The reliability that USB OTG equipment works normally.
In addition, by the method for multiplexing USB interface described in implementing Fig. 3, it can be in USB OTG equipment as main equipment After connecting with external equipment, the contact current value that USB OTG equipment is connect with external equipment is obtained, when the contact current value is big When pre-set current value, export for indicating that USB OTG equipment is in the prompting message of charged state.This process can be Just output is used when USB OTG equipment is connect as main equipment with external equipment and the contact current value connected is greater than pre-set current value It is in the prompting message of charged state in expression USB OTG equipment, reduces USB OTG equipment as main equipment and external equipment Connection but due to the wrong report situation that external equipment failure causes charging abnormal, improves the precision of output prompting message.
In addition, judging that it is default that contact current value is greater than by the method for multiplexing USB interface described in implementing Fig. 3 After current value, temperature can also be worked as using the temperature value of the temperature detecting unit detection USB OTG equipment of USB OTG equipment When value reaches preset temperature threshold, illustrate that the temperature of USB OTG equipment is excessively high, external equipment can be set to USB OTG at this time The current signal of standby transmission executes current-limiting operation, and the temperature of USB OTG equipment is controlled with this, plays the guarantor to USB OTG equipment Shield effect, but also charging is more intelligent.
Example IV
Referring to Fig. 4, Fig. 4 is a kind of structural schematic diagram of USB OTG equipment disclosed by the embodiments of the present invention.Such as Fig. 4 institute Show, which may include:
Detection unit 401, whether the USB interface on usb bus for detecting USB OTG equipment, which is inserted into outside, sets It is standby.
Interactive unit 402, for exporting for obtaining when detection unit 401 detects that USB interface is inserted into external equipment Take the inquiry message of the device type of external equipment, and feedback information of the monitoring user response after inquiry message, feedback letter Breath carries the device type of external equipment.
As an alternative embodiment, interactive unit 402 monitors feedback information of the user response after inquiry message, The device type that feedback information carries external equipment may include:
Interactive unit 402 is to enabled instruction is sent with the keyboard equipment of USB OTG device pairing in advance, to start the keyboard Equipment;
Interactive unit 402 receives the user response that the keyboard equipment returns and is keyed in after inquiry message by the keyboard equipment Feedback information;
Interactive unit 402 analyzes the feedback information and obtains the device type for the external equipment that the feedback information includes.
By implementing this optional embodiment, USB OTG equipment can be to the key in advance with USB OTG device pairing Disc apparatus sends enabled instruction, receives the feedback information that user keys in start the keyboard equipment, user is allowed to pass through key Disk inputs the device type information of external equipment, to realize the configuration to USB OTG equipment as master-slave equipment.This process So that user's key entry feedback information is more convenient, meet user's use habit, improves user experience.
First execution unit 403, for monitoring that feedback information indicates the equipment class of external equipment when interactive unit 402 When type is the first device type, other equipment of the removing external equipment connected on usb bus are disconnected, usb bus is corresponding The level of the ID pin of USB socket is adjusted to the first level, so that USB OTG equipment, which is used as from equipment, accesses external equipment.
Second execution unit 404, for monitoring that feedback information indicates the equipment class of external equipment when interactive unit 402 When type is the second device type, the level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level, so that USB OTG equipment is connect as main equipment with external equipment.
As it can be seen that USB OTG can be arranged by interacting with user by implementing USB OTG equipment described in Fig. 4 and set It is standby as main equipment or as from equipment, it is ensured that the normal realization of data exchange and charge function improves USB OTG The reliability that equipment works normally.
Embodiment five
Referring to Fig. 5, Fig. 5 is the structural schematic diagram of another kind USB OTG equipment disclosed by the embodiments of the present invention.Wherein, USB OTG equipment 400 shown in fig. 5 be as shown in Figure 4 USB OTG equipment 400 optimization obtain, with USB shown in Fig. 4 OTG equipment 400 is compared, in USB OTG equipment 400 shown in Fig. 5:
Interactive unit 402 is used for when detecting that USB interface is inserted into external equipment, is exported for obtaining external equipment The inquiry message of device type, and the mode of feedback information of the monitoring user response after inquiry message are specifically as follows:
Interactive unit 402, for when detecting that USB interface is inserted into external equipment, voice to be played for obtaining outside The inquiry message of the device type of equipment, and the voice messaging for being used to reply inquiry message of acquisition user's input, by voice Information is determined as feedback information of the user response after inquiry message;Alternatively, several indicator lights on control instructions light panel dodge Bright, detection user obtains to certain the confirmation operation of some indicator light in several indicator lights when detecting confirmation operation The confirmation message of one indicator light, and will confirm that information is determined as feedback information of the user response after inquiry message, each Indicator light corresponds to a kind of device type, and confirmation message is used to indicate device type corresponding to some indicator light.
Optionally, the first execution unit 403 is used to monitor that feedback information indicates external equipment when interactive unit 402 When device type is the first device type, other equipment of the removing external equipment connected on usb bus are disconnected, by usb bus The level of the ID pin of corresponding USB socket is adjusted to the first level, sets so that USB OTG equipment is used as from equipment access is external Standby mode is specifically as follows:
First execution unit 403, for monitoring that feedback information indicates the equipment class of external equipment when interactive unit 402 When type is the first device type, is switched by the micro-control unit of USB OTG equipment to usb bus and send control signal, with control Usb bus processed switch disconnect connection between usb bus and the D+ pin of other equipment, disconnect with the D- pin of other equipment it Between connection and disconnection and the VBUS pin of other equipment between connection, by the ID pin of the corresponding USB socket of usb bus Level be adjusted to the first level so that USB OTG equipment be used as from equipment access external equipment.
Further alternative, USB OTG equipment 400 shown in fig. 5 can also include:
Acquiring unit 405, for indicating that the device type of external equipment is in feedback information in the second execution unit 404 When the second device type, the level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level, so that USB OTG After equipment is connect as main equipment with external equipment, the contact current value that USB OTG equipment is connect with external equipment is obtained.
Whether judging unit 406, the contact current value for judging that acquiring unit 405 obtains are greater than pre-set current value.
As an alternative embodiment, after judging that contact current value is less than or equal to pre-set current value, Judging unit 406 can be also used for:
Electric power detection signal is sent to external equipment, electric power detection signal is used to indicate the current electric quantity for obtaining external equipment Value;
The voltage value for the external equipment that external equipment is returned according to the electric power detection signal is received, and judges that this is current Whether charge value is lower than default charge value;
When judging that the voltage value is lower than default charge value, the first prompting message, first prompting message are issued For prompting external equipment to be in low battery state;
When judging that the voltage value is not less than default charge value, the second prompting message is issued, which disappears Breath is for prompting external equipment to be in malfunction.
By implementing this optional embodiment, judge contact current value be less than or equal to pre-set current value it Afterwards, the voltage value of the available external equipment of USB OTG equipment, if the voltage value is lower than default charge value, explanation External equipment is in low battery state, and charging at this time is different normally due to what the low battery state of external equipment generated, sending the One prompting message reminds user to charge external equipment to guarantee external equipment normally filling to USB OTG equipment with this Electricity;If the voltage value is not less than default charge value, illustrate external equipment in the state of electricity abundance still not to USB OTG equipment is charged normal, and external equipment is in malfunction at this time, is issued the second prompting message, is reminded user couple with this External equipment is overhauled to guarantee that external equipment charges normal USB OTG equipment.This process is for different abnormal feelings Condition issues different prompting messages, allows user targetedly to solve charging abnormal conditions, improves the effect solved extremely Rate.
As another optional embodiment, judge that contact current value is greater than pre-set current value in judging unit 406 Later, judging unit 406 can be also used for:
Utilize the temperature value of the temperature detecting unit detection USB OTG equipment of USB OTG equipment;
When the temperature value detected reaches preset temperature threshold, electric current that external equipment is transmitted to USB OTG equipment Signal executes current-limiting operation.
Output unit 407, for when judging unit 406 judges that contact current value is greater than pre-set current value, output to be used The prompting message of charged state is in expression USB OTG equipment.
It is further optional, in USB OTG equipment 400 shown in Fig. 5:
Second execution unit 404 is used to monitor that feedback information indicates the equipment class of external equipment when interactive unit 402 When type is the second device type, the level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level, so that USB The mode that OTG equipment is connect as main equipment with external equipment specifically:
Second execution unit 404, for monitoring that feedback information indicates the equipment class of external equipment when interactive unit 402 When type is the second device type, judge whether the level of the ID pin of the corresponding USB socket of usb bus is second electrical level;If It is to keep the level of ID pin for second electrical level, so that USB OTG equipment is connect as main equipment with external equipment.
As it can be seen that USB OTG can be arranged by interacting with user by implementing USB OTG equipment described in Fig. 5 and set It is standby as main equipment or as from equipment, it is ensured that the normal realization of data exchange and charge function improves USB OTG The reliability that equipment works normally.
In addition, providing a variety of interactive modes with user by implementing USB OTG equipment described in Fig. 5 to obtain The device type of external equipment, more fitting user's use habit, improve user experience.
In addition, by implementing USB OTG equipment described in Fig. 5, it can be in USB OTG equipment as main equipment and outside The contact current value of equipment connection and connection is just exported when being greater than pre-set current value for indicating that USB OTG equipment is in charging shape The prompting message of state reduces USB OTG equipment and connect as main equipment with external equipment but since external equipment failure causes Charge abnormal wrong report situation, improves the precision of output prompting message.
In addition, judging contact current value greater than pre-set current value by implementing USB OTG equipment described in Fig. 5 It later, can also be using the temperature value of the temperature detecting unit detection USB OTG equipment of USB OTG equipment, when temperature value reaches When preset temperature threshold, illustrate that the temperature of USB OTG equipment is excessively high, external equipment can be transmitted to USB OTG equipment at this time Current signal execute current-limiting operation, the temperature of USB OTG equipment is controlled with this, plays the protective effect to USB OTG equipment, But also charging is more intelligent.
Embodiment six
It is the knot of another kind USB OTG equipment disclosed by the embodiments of the present invention with Fig. 7, Fig. 6 and Fig. 7 referring to Figure 6 together Structure schematic diagram.As shown in fig. 6, the USB OTG equipment may include:
It is stored with the memory 601 of executable program code;
The processor 602 coupled with memory 601;
Wherein, processor 602 calls the executable program code stored in memory 601, and it is any one to execute FIG. 1 to FIG. 3 The method of kind multiplexing USB interface.
Referring to Fig. 7, being connected with n USB interface (not shown) on usb bus, USB interface is connected separately with external equipment 1-n, wherein via the connection between the USB interface on usb bus switch control external equipment 1-n and usb bus.When anti- When feedforward information indicates that the external equipment type of USB OTG equipment connection is the first device type, micro-control unit can be total to USB Wiretap sends switching control instruction, controls usb bus switch with this and disconnects its in addition to external equipment connected on usb bus Connection between the D+ pin and usb bus of his equipment, the connection between the D- pin and usb bus of other equipment and other Connection between the VBUS pin and usb bus of equipment, and by the ID pin that usb bus switchs corresponding USB socket adjust to First level, at the same be connected to micro-control unit D+ pin and USB socket, the D- pin of micro-control unit and USB socket and The VBUS pin and USB socket of micro-control unit, so that USB OTG equipment, which is used as from equipment, accesses external equipment.Work as feedback letter When the external equipment type of breath instruction USB OTG equipment connection is the second device type, usb bus is switched into corresponding USB and is inserted The ID pin of seat is adjusted to second electrical level, and is connected to the VBUS pin and USB socket of micro-control unit, so that USB OTG equipment It is connect as main equipment with external equipment.This process ensure USB OTG device data exchange and charge function it is normal It realizes, improves the reliability of USB OTG equipment normal work.
The embodiment of the present invention discloses a kind of computer readable storage medium, stores computer program, wherein the computer The method that program makes computer execute any one multiplexing USB interface of FIG. 1 to FIG. 3.
A kind of computer program product is also disclosed in the embodiment of the present invention, wherein when computer program product on computers When operation, so that computer executes some or all of the method in such as above each method embodiment step.
The embodiment of the present invention is also disclosed a kind of using distribution platform, wherein using distribution platform for issuing computer journey Sequence product, wherein when computer program product is run on computers, so that computer executes such as the above each method embodiment In some or all of method step.
In various embodiments of the present invention, it should be appreciated that magnitude of the sequence numbers of the above procedures are not meant to execute suitable Successively, the execution sequence of each process should be determined by its function and internal logic the certainty of sequence, without coping with the embodiment of the present invention Implementation process constitutes any restriction.
In embodiment provided by the present invention, it should be appreciated that " B corresponding with A " indicates that B is associated with A, can be with according to A Determine B.It is also to be understood that determine that B is not meant to determine B only according to A according to A, it can also be according to A and/or other information Determine B.
In addition, each functional unit in various embodiments of the present invention can integrate in one processing unit, it is also possible to Each unit physically exists alone, and can also be integrated in one unit with two or more units.Above-mentioned integrated unit Both it can take the form of hardware realization, can also realize in the form of software functional units.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can store in a retrievable memory of computer.Based on this understanding, technical solution of the present invention substantially or Person says all or part of of the part that contributes to existing technology or the technical solution, can be in the form of software products It embodies, which is stored in a memory, including several requests are with so that a computer is set Standby (can be personal computer, server or network equipment etc., specifically can be the processor in computer equipment) executes Some or all of each embodiment above method of the invention step.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage Medium include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), programmable read only memory (Programmable Read-only Memory, PROM), erasable programmable is read-only deposits Reservoir (Erasable Programmable Read Only Memory, EPROM), disposable programmable read-only memory (One- Time Programmable Read-Only Memory, OTPROM), the electronics formula of erasing can make carbon copies read-only memory (Electrically-Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact Disc Read-Only Memory, CD-ROM) or other disc memories, magnetic disk storage, magnetic tape storage or can For carrying or any other computer-readable medium of storing data.
The method and USB OTG equipment of a kind of multiplexing USB interface disclosed by the embodiments of the present invention have been carried out in detail above It introduces, used herein a specific example illustrates the principle and implementation of the invention, the explanation of above embodiments It is merely used to help understand method and its core concept of the invention;At the same time, for those skilled in the art, according to this The thought of invention, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification is not answered It is interpreted as limitation of the present invention.

Claims (10)

1. a kind of method for being multiplexed general-purpose serial bus USB interface characterized by comprising
Whether the USB interface detected on the usb bus of USB OTG equipment is inserted into external equipment;
When detecting that the USB interface is inserted into the external equipment, the equipment class for obtaining the external equipment is exported The inquiry message of type, and feedback information of the monitoring user response after the inquiry message, the feedback information carry State the device type of external equipment;
When the feedback information indicates that the device type of the external equipment is the first device type, it is total to disconnect the USB Other equipment of the removing external equipment connected on line, by the level of the ID pin of the corresponding USB socket of the usb bus It is adjusted to the first level, so that the USB OTG equipment, which is used as from equipment, accesses the external equipment;
When the feedback information indicates that the device type of the external equipment is the second device type, by the usb bus The level of the ID pin of corresponding USB socket is adjusted to second electrical level so that the USB OTG equipment as main equipment with it is described External equipment connection.
2. the method according to claim 1, wherein described ought detect that the USB interface is inserted into outside described When portion's equipment, the inquiry message for obtaining the device type of the external equipment, and monitoring user response are exported in described Feedback information after inquiry message includes:
When detecting that the USB interface is inserted into the external equipment, voice is played for obtaining setting for the external equipment The inquiry message of standby type, and the voice messaging for being used to reply the inquiry message of acquisition user's input, by the voice Information is determined as feedback information of the user response after the inquiry message;Alternatively,
Several indicator lights flashing on control instructions light panel, detects user to some indicator light in several indicator lights Confirmation operation obtain when detecting the confirmation operation to the confirmation message of some indicator light, and will be described true To recognize information and is determined as feedback information of the user response after the inquiry message, each indicator light corresponds to a kind of device type, The confirmation message is used to indicate device type corresponding to some described indicator light.
3. method according to claim 1 or 2, which is characterized in that described to disconnect the removing institute connected on the usb bus The other equipment for stating external equipment include:
It is switched by the micro-control unit of the USB OTG equipment to usb bus and sends control signal, it is total to control the USB Wiretap disconnects connection between the usb bus and the D+ pin of other equipment, disconnects the D- with other equipment Connection and disconnection between pin and the connection between the VBUS pin of other equipment.
4. described in any item methods according to claim 1~3, which is characterized in that when the feedback information indicates outside described When the device type of portion's equipment is the second device type, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted For second electrical level, so that the method is also wrapped after the USB OTG equipment is connect as main equipment with the external equipment It includes:
The contact current value that the USB OTG equipment is connect with the external equipment is obtained, and judges that the contact current value is It is no to be greater than pre-set current value;
When the contact current value is greater than the pre-set current value, output is for indicating that the USB OTG equipment is in charging The prompting message of state.
5. the method according to claim 1, wherein described when the feedback information indicates the external equipment Device type be the second device type when, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted to second Level, so that the USB OTG equipment connect with the external equipment as main equipment and includes:
When the feedback information indicates that the device type of the external equipment is the second device type, judge that the USB is total Whether the level of the ID pin of the corresponding USB socket of line is second electrical level;
If so, keeping the level of the ID pin is the second electrical level so that the USB OTG equipment as main equipment and The external equipment connection.
6. a kind of USB OTG equipment characterized by comprising
Whether detection unit, the USB interface on usb bus for detecting the USB OTG equipment are inserted into external equipment;
Interactive unit, for when the detection unit detects that the USB interface is inserted into the external equipment, output to be used for Obtain the inquiry message of the device type of the external equipment, and feedback letter of the monitoring user response after the inquiry message Breath, the feedback information carry the device type of the external equipment;
First execution unit, for monitoring the equipment that the feedback information indicates the external equipment when the interactive unit When type is the first device type, other equipment of the removing external equipment connected on the usb bus are disconnected, it will be described The level of the ID pin of the corresponding USB socket of usb bus is adjusted to the first level, so that the USB OTG equipment is used as from setting It is standby to access the external equipment;
Second execution unit, for monitoring the equipment that the feedback information indicates the external equipment when the interactive unit When type is the second device type, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted to second electrical level, So that the USB OTG equipment is connect as main equipment with the external equipment.
7. USB OTG equipment according to claim 6, which is characterized in that the interactive unit is used for described when detecting When USB interface is inserted into the external equipment, the inquiry message for obtaining the device type of the external equipment is exported, and Monitor the mode of feedback information of the user response after the inquiry message specifically:
The interactive unit, for when detecting that the USB interface is inserted into the external equipment, voice to be played for obtaining The inquiry message of the device type of the external equipment, and the voice for being used to reply the inquiry message of acquisition user's input The voice messaging is determined as feedback information of the user response after the inquiry message by information;Alternatively, control instructions lamp face Several indicator lights flashing on plate, detects user to the confirmation operation of some indicator light in several indicator lights, works as inspection When measuring the confirmation operation, the confirmation message to some indicator light is obtained, and the confirmation message is determined as using In response to the feedback information after the inquiry message, each indicator light corresponds to a kind of device type at family, and the confirmation message is used Device type corresponding to some indicator light described in indicating.
8. USB OTG equipment according to claim 6 or 7, which is characterized in that first execution unit is used for when described When interactive unit monitors that the feedback information indicates that the device type of the external equipment is the first device type, institute is disconnected The other equipment for stating the removing external equipment connected on usb bus, the ID of the corresponding USB socket of the usb bus is drawn The level of foot is adjusted to the first level, to make the USB OTG equipment as having in a manner of accessing the external equipment from equipment Body are as follows:
First execution unit, for monitoring that the feedback information indicates the external equipment when the interactive unit When device type is the first device type, is switched by the micro-control unit of the USB OTG equipment to usb bus and send control Signal, to control the connection between the usb bus switch disconnection usb bus and the D+ pin of other equipment, break The connection between the D- pin of other equipment and the connection between disconnection and the VBUS pin of other equipment are opened, The level of the ID pin of the corresponding USB socket of the usb bus is adjusted to the first level, so that the USB OTG equipment is made To access the external equipment from equipment.
9. according to the described in any item USB OTG equipment of claim 6~8, which is characterized in that the USB OTG equipment is also wrapped It includes:
Acquiring unit, for indicating the device type of the external equipment in the feedback information in second execution unit When for the second device type, the level of the ID pin of the corresponding USB socket of the usb bus is adjusted to second electrical level, so that After the USB OTG equipment is connect as main equipment with the external equipment, the USB OTG equipment and the outside are obtained The contact current value of equipment connection;
Whether judging unit, the contact current value for judging that the acquiring unit obtains are greater than pre-set current value;
Output unit, for exporting for indicating the USB OTG when the contact current value is greater than the pre-set current value Equipment is in the prompting message of charged state.
10. USB OTG equipment according to claim 9, which is characterized in that second execution unit is used to work as the friendship It, will be described when mutual unit monitors that the feedback information indicates that the device type of the external equipment is the second device type The level of the ID pin of the corresponding USB socket of usb bus is adjusted to second electrical level, so that the USB OTG equipment is set as master The standby mode being connect with the external equipment specifically:
Second execution unit, for monitoring that the feedback information indicates the external equipment when the interactive unit When device type is the second device type, judge whether the level of the ID pin of the corresponding USB socket of the usb bus is second Level;If so, the level for keeping the ID pin is the second electrical level, so that the USB OTG equipment is as main equipment It is connect with the external equipment.
CN201810548237.1A 2018-05-31 2018-05-31 A kind of method and USB OTG equipment of multiplexing USB interface Pending CN109032984A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810548237.1A CN109032984A (en) 2018-05-31 2018-05-31 A kind of method and USB OTG equipment of multiplexing USB interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810548237.1A CN109032984A (en) 2018-05-31 2018-05-31 A kind of method and USB OTG equipment of multiplexing USB interface

Publications (1)

Publication Number Publication Date
CN109032984A true CN109032984A (en) 2018-12-18

Family

ID=64611912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810548237.1A Pending CN109032984A (en) 2018-05-31 2018-05-31 A kind of method and USB OTG equipment of multiplexing USB interface

Country Status (1)

Country Link
CN (1) CN109032984A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471812A (en) * 2019-07-23 2019-11-19 广东以诺通讯有限公司 A kind of method of USB and AccessPort multiplexing
CN111447127A (en) * 2020-03-11 2020-07-24 北京金茂绿建科技有限公司 Bus multiplexing method and system
CN111836089A (en) * 2019-04-17 2020-10-27 百度在线网络技术(北京)有限公司 Processing method, device and equipment for matching channel list and storage medium
CN111949594A (en) * 2020-08-18 2020-11-17 上海乐今通信技术有限公司 Mobile terminal with multiple USB interfaces and implementation method
CN112579500A (en) * 2020-12-08 2021-03-30 深圳市道通科技股份有限公司 Method and device for prompting anti-misplug USB interface and electronic equipment
CN113157612A (en) * 2020-01-22 2021-07-23 海信视像科技股份有限公司 Interface adapting circuit and display device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561369A (en) * 2013-10-31 2014-02-05 惠州Tcl移动通信有限公司 Usb interface circuit and electronic equipment
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN104090860A (en) * 2014-07-04 2014-10-08 苏州佳世达电通有限公司 Display device and operating method thereof
CN106598892A (en) * 2015-10-14 2017-04-26 小米科技有限责任公司 Switching control method and apparatus
KR20170098467A (en) * 2016-02-22 2017-08-30 에스케이텔레콤 주식회사 Apparatus and method for providing usb interface between potable device and external device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103561369A (en) * 2013-10-31 2014-02-05 惠州Tcl移动通信有限公司 Usb interface circuit and electronic equipment
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN104090860A (en) * 2014-07-04 2014-10-08 苏州佳世达电通有限公司 Display device and operating method thereof
CN106598892A (en) * 2015-10-14 2017-04-26 小米科技有限责任公司 Switching control method and apparatus
KR20170098467A (en) * 2016-02-22 2017-08-30 에스케이텔레콤 주식회사 Apparatus and method for providing usb interface between potable device and external device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111836089A (en) * 2019-04-17 2020-10-27 百度在线网络技术(北京)有限公司 Processing method, device and equipment for matching channel list and storage medium
CN110471812A (en) * 2019-07-23 2019-11-19 广东以诺通讯有限公司 A kind of method of USB and AccessPort multiplexing
CN113157612A (en) * 2020-01-22 2021-07-23 海信视像科技股份有限公司 Interface adapting circuit and display device
CN113157612B (en) * 2020-01-22 2022-12-13 海信视像科技股份有限公司 Interface adapting circuit and display device
CN111447127A (en) * 2020-03-11 2020-07-24 北京金茂绿建科技有限公司 Bus multiplexing method and system
CN111949594A (en) * 2020-08-18 2020-11-17 上海乐今通信技术有限公司 Mobile terminal with multiple USB interfaces and implementation method
CN112579500A (en) * 2020-12-08 2021-03-30 深圳市道通科技股份有限公司 Method and device for prompting anti-misplug USB interface and electronic equipment

Similar Documents

Publication Publication Date Title
CN109032984A (en) A kind of method and USB OTG equipment of multiplexing USB interface
CN202308695U (en) Cable device
CN102183928B (en) Method, device and intelligent household appliance controller for controlling running mode of household appliance
TWI353098B (en) Method for rapidly charging a universal serial bus
CN108539808A (en) The alternate mode of USB Type-C is applied to quick charging system
KR20180092691A (en) An apparatus for supplying external device with power and a method thereof
CN105416206A (en) Electric automobile whole-vehicle controller and control method
TW201035727A (en) Port power controller for USB hubs with legacy battery charge support
CN106849244B (en) A kind of voltage control method of charging interface, charger and mobile terminal
CN106104504A (en) The system and method disconnecting detection on the double mode port of usb hub
CN108110831A (en) A kind of charging wire fault detection method for being used to share charger baby
CN209659302U (en) A kind of interface gating circuit and communication equipment
CN110164049A (en) A kind of method and apparatus based on password replacement battery
CN205139639U (en) Computer start and pass machine
CN106814643B (en) A kind of control method and system of two-node cluster hot backup
CN103052149A (en) Terminal and method for realizing power adaptability
CN104252430B (en) A kind of method and electronic equipment of state instruction
CN106301804A (en) A kind of realize the server of WOL, system and method
CN106771738A (en) A kind of equipment for testing electronic card performance
CN110120693A (en) Mobile device and its charging method
CN108923994A (en) A kind of communication fault detection method and device
CN110471807A (en) Hardware fault detection method, system, storage medium and integrated machine equipment
RU2298218C2 (en) System and method for diagnostics of peripheral devices
CN207559599U (en) A kind of power-supplying circuit and terminal
WO2016045350A1 (en) Rechargeable battery, method for using rechargeable battery, and charging system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20181218

RJ01 Rejection of invention patent application after publication