CN108563537A - A kind of USB principals and subordinates detection device and method - Google Patents

A kind of USB principals and subordinates detection device and method Download PDF

Info

Publication number
CN108563537A
CN108563537A CN201810205864.5A CN201810205864A CN108563537A CN 108563537 A CN108563537 A CN 108563537A CN 201810205864 A CN201810205864 A CN 201810205864A CN 108563537 A CN108563537 A CN 108563537A
Authority
CN
China
Prior art keywords
usb
data lines
equipment
gpio
subordinates
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
CN201810205864.5A
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.)
Zhuhai Hui Lian Technology Co Ltd
Original Assignee
Zhuhai Hui Lian 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 Zhuhai Hui Lian Technology Co Ltd filed Critical Zhuhai Hui Lian Technology Co Ltd
Priority to CN201810205864.5A priority Critical patent/CN108563537A/en
Publication of CN108563537A publication Critical patent/CN108563537A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults

Abstract

The invention discloses a kind of USB principals and subordinates detection devices, including:USB port comprising DP data lines and DM data lines;USB function modules, connect the DP data lines and DM data lines of the USB port, and can be operated in main equipment pattern or from equipment mode;GPIO function modules, it can connect to break-make the USB port DP data lines and DM data lines, and DP data lines can be configured to low potential and configure DM data lines to high potential, and the level pull-up on DP data lines and DM data lines or level drop-down can be detected;Pattern switching control module, the level pull-up for being used to be received according to GPIO function modules or level drop-down configure USB principal and subordinate's detection devices to main equipment pattern, from equipment mode or GPIO patterns.USB principal and subordinate's detection methods are also disclosed, the detection and switching of USB master-slave equipments can be realized in the case where not increasing ID pins.

Description

A kind of USB principals and subordinates detection device and method
Technical field
The present invention relates to universal serial bus technology field, more particularly to a kind of USB principals and subordinates detection device and method.
Background technology
Universal serial bus (Universal Serial Bus, abbreviation USB) is an external bus standard, is used for specification Computer and external equipment are connected and communicate with.It is the interfacing applied in the fields PC.The plug and play of USB interface holding equipment And warm connection function, since birth, with fashionable all computer peripheral equipments and the number of its opening and convenient advantage quickly Decoding apparatus.It is well known that USB device is divided into HOST (main equipment) and SLAVE (from equipment), only when one HOST and one The transmission of data could be realized when SLAVE connections.On December 18th, 2001 is further public by USB Implementers Forum Cloth USB OTG (USB On-The-Go) agreement, the connection being mainly used between a variety of different equipment or mobile device carry out Data exchange, especially PAD, mobile phone, consumer devices.Equipment and equipment when USB OTG technologies can realize no host Between data transmission.Such as:Digital camera can directly be connect with printer and photograph print, can be between mobile phone and mobile phone Directly transmission data etc., to expand the application range of USB technologies.Traditional USB standard interface defines 4 leads, packet Include 2 data lines (D+ and D-, also known as DP and DM), 1 power cord (VBUS) and 1 ground wire (GND).USB OTG interfaces exist 1 lead, i.e. ID lines are increased on the basis of traditional USB standard interface, for identifying different cable endpoints, main equipment In ID pins ground connection, ID pin floatings from the device.When OTG equipment detects the ID pins of ground connection, acquiescence is indicated It is main equipment, and the equipment for detecting ID pin floatings is then considered from equipment.
With the continuous development of contemporary electronic technology and universal, the consumer electronics product with USB interface is in each neck The application in domain is quite extensive.At the same time, user is also higher and higher to the power consumption of consumer product and volume requirement.USB Many convenience that OTG functions are brought to consumer electronics product, but but also consumer product needs additionally to use one more A ID signal pins, this is a stubborn problem for inherently very small internet of things equipment.Both want to support OTG work( Can, but be not desired to increase this pin.In addition, USB OTG equipment needs to use dedicated OTG lines, the cost used is increased.
Invention content
It is an object of the invention to solve at least one of problems with:
1. in the case where not increasing ID pins, the detection and switching of USB master-slave equipments can be also realized;
2. efficiency is high when detecting USB master-slave equipments, hardly increase additional power consumption.
According to the first aspect of the invention, a kind of USB principals and subordinates detection device is provided, including:USB port comprising DP Data line and DM data lines;USB function modules, connect the DP data lines and DM data lines of the USB port, and can work In main equipment pattern or from equipment mode;GPIO function modules can connect to break-make the USB port DP data lines and DM Data line, and DP data lines can be configured to low potential and configure DM data lines to high potential, and DP numbers can be detected It is pulled up according to the level on line and DM data lines or level pulls down;Pattern switching control module is used for according to GPIO function modules The level pull-up received or level drop-down, configure USB principal and subordinate's detection devices to main equipment pattern, from equipment mode or GPIO patterns.
Further, the level pull-up of DP data lines or the level drop-down of DM data lines are detected when GPIO function modules When, GPIO function modules disconnect and the connection between DP data lines and DM data lines.
Further, when GPIO function modules receive the level pull-up on DP data lines, pattern switching control module will USB function modules are configured to main equipment pattern;When GPIO function modules receive the level drop-down on DM data lines, pattern switching Control module configures from equipment mode USB function modules to.
Further, when the USB principals and subordinates detection device is configured to main equipment pattern or from equipment mode, the ends USB Mouth connection USB function modules;When the USB principals and subordinates detection device is configured to GPIO patterns, USB port connects GPIO functions Module.
Further, USB port includes VBUS lines;USB principal and subordinate's detection devices further include PMU control modules, and PMU controls mould Block is separately connected the VBUS lines and pattern switching control module of USB port, for being detected according to the potential change of VBUS lines It whether is inserted into external USB equipment on USB port and/or extracts external USB equipment, and the result of detection is fed back into pattern switching Control module
According to the second aspect of the invention, a kind of USB principals and subordinates detection method is provided, for the described of first aspect present invention USB principal and subordinate's detection devices comprising following steps:A. USB principal and subordinate's detection devices are configured to GPIO patterns;B. USB is detected Whether principal and subordinate's detection device, which connects, is connected to external USB equipment;C. it is set when USB principal and subordinate's detection devices are connected to external USB When standby, judge that the external USB equipment is USB main equipment or USB from equipment, it, will if external USB equipment is USB main equipment USB principal and subordinate's detection devices are configured to main equipment pattern;If external USB equipment is USB from equipment, by USB principal and subordinate's detection devices It is configured to from equipment mode.
Further, step C includes following sub-step:Configure DP data lines to low potential, DM data lines are configured to height Current potential;Judge the potential change on DP data lines and DM data lines, when the current potential pull-up on DP data lines, USB principals and subordinates are examined It surveys device and switches to main equipment pattern, when the current potential drop-down on DM data lines, USB principal and subordinate's detection devices are switched to from equipment Pattern.
Further, USB principal and subordinate's detection methods are further comprising the steps of:D. it is detected when according to the potential change of VBUS lines When being disconnected to USB principals and subordinates detection device and external USB equipment, it configures USB principal and subordinate's detection devices to GPIO patterns.
The beneficial effects of the present invention are:By detecting the potential change of DP data lines or DM data lines, can not increase In the case of adding ID pins, the detection and switching of USB master-slave equipments are realized.Since detection is real by the interruption of GPIO function modules Existing, efficiency is high when not needing the repeated multiple times inquiry potential state of master controller, therefore detecting USB master-slave equipments, hardly increases Additional power consumption.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, embodiment will be described below Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these Figure obtains other attached drawings.
Fig. 1 shows the circuit theory schematic diagrams according to one or more embodiments of the invention;
Fig. 2 indicates the flow chart according to one or more embodiments of the invention;
Fig. 3 indicates the circuit theory schematic diagram according to further embodiment of this invention.
Specific implementation mode
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, depends on the specific application and design constraint of technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or The mutual coupling that discusses or to be directly harmonious or communicate to connect can be indirect coupling by some interfaces, device or unit It closes or communicates to connect, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in two processing units, it can also It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in two computer read/write memory mediums.Based on this understanding, technical scheme of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be expressed in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
It will be appreciated by those skilled in the art that in the description of the present application, " first ", " secondly ", " first ", " Two ", the terms such as " first step ", " second step ", are not offered as the limitation to sequencing unless otherwise stated.For example, " step Three " can be before " step 1 ", and " the 4th step " can be carried out at the same time with " second step ".
Referring to Fig.1, according to the first aspect of the disclosure, a kind of USB principals and subordinates detection device is provided, including:The ends USB Mouthful comprising VBUS power cords, GND ground wires, DP data lines (also referred to as D+ data lines) and DM data lines (also referred to as D- data Line), for connecting external equipment, which can be standard USB, Mini-USB or the ports Micro-USB or expansion The port of USB OTG agreements;USB function modules, connect the DP data lines and DM data lines of USB port, and can be operated in Main equipment (HOST) pattern or from equipment (DEVICE) pattern;GPIO function modules can connect to break-make USB port DP numbers According to line and DM data lines, and DP data lines can be configured to high potential and configure DM data lines to low potential, and can Detect the level drop-down on level pull-up and the DM data lines on DP data lines;Pattern switching control module, is used for basis The level pull-up or level drop-down that GPIO function modules receive, configure USB function modules to main equipment pattern or from equipment mould Formula, wherein DP data lines and DM data lines are configured as the multiplex data line of GPIO and USB-DP/DM;In DP data lines and DM When data line is configured as GPIO functional modes, GPIO function modules configure DP data lines to low potential and match DM data lines It is set to high potential, (i.e. when GPIO function modules detect the level pull-up of DP data lines or the level of DM data lines pulls down Insert external equipment), GPIO function modules disconnect and the connection between DP data lines and DM data lines, by USB function modules Control and read-write DP data lines and DM data lines, DP data lines and DM data lines are configured as USB-DP and USB-DM data at this time Line.Wherein, above-mentioned each module is either the function module of one chip or the module of software and hardware of SOC systems, can also be It is built by seperated chip.It is possible thereby in the case where not increasing ID pins, the detection of USB master-slave equipments can be also realized And switching.
For example, when GPIO function modules receive the level pull-up on DP data lines, pattern switching control module is by USB work( Energy module is configured to main equipment pattern;When GPIO function modules receive the level drop-down on DM data lines, pattern switching control Module configures from equipment mode USB function modules to.
In one or more embodiments, USB function modules and GPIO function modules multiplexing DP data lines and with DM data Line.In a unrestricted example, USB port can also include VBUS power cords;USB principal and subordinate's detection devices are set including outside Standby connecting detection module, connects the VBUS power cords of USB port, to detect whether USB port is connected to external equipment.Its In, it is not connected between external equipment or disconnection and external equipment when external equipment connecting detection module detects the USB port Connection when so that the GPIO function modules are connected with the connection between DP data lines and DM data lines.In addition it is also possible to logical It crosses USB function modules detection DP data lines and whether is connect with external equipment with the electrical level judging USB port on DM data lines, from And it determines the connection between the GPIO function modules and DP data lines and DM data lines and is switched on or off.
USB principal and subordinate's detection devices are first configured to GPIO patterns so that GPIO function modules and DP data lines and DM Connection conducting between data line, when GPIO function modules receive the level pull-up on DP data lines, pattern switching controls mould Block configures USB function modules to main equipment pattern;When GPIO function modules receive the level drop-down on DM data lines, pattern Switching control module configures from equipment mode USB function modules to.Line quilt between DP data lines and GPIO function modules Labeled as GPIOb, the line between DM data lines and GPIO function modules is marked as GPIOa.GPIO function modules will at this time DP data lines are pulled down to low potential and DM data lines are pulled to high potential, i.e. DP data lines and DM data lines is configured as GPIO Input functional modes.
GPIO/USB-DP multiplex data lines are being configured to GPIO patterns (GPIO Input, Pull up/down Interrupt Enable) after, the one end of the multiplex data line far from USB port is connected to through resistor under this functional mode Low potential (such as 0V), and the resistance value for the resistor of GP configuring I/O mode being located on GPIOa and GPIOb, the resistance value (example Such as 100K ohm) can be so that when this pin be connected to USB from equipment, triggering pull-up interrupts (Pull up Interrupt). Meanwhile GPIO/USB-DM multiplex data lines are configured to GPIO input functional modes (GPIO Input, Pull up Interrupt Enable), the one end of the multiplex data line far from USB port connects supreme through resistor under this functional mode Current potential (such as 3.3V), and the resistance value of the resistor of GP configuring I/O mode, the resistance value (such as 100K ohm) can make When this pin is connected to USB from equipment, (Pull Down Interrupt) is interrupted in triggering drop-down.Due to being not inserted into outside In the state of equipment, without electricity on GPIO/USB-DP multiplex datas line, GPIO/USB-DM multiplex datas line, GPIOa and GPIOb Stream flows through, therefore when detecting USB master-slave equipments, efficiency is high, hardly increases additional power consumption.
When GPIO function modules receive interruption, pattern switching control module makes the work of USB principal and subordinate's detection devices Pattern is switched to USB Normal Working Mode from USB Plug-in checking Mode.Interrupt processing is according to following Two kinds of interrupt types are handled:(1) when GPIO/USB-DP multiplex datas line (i.e. D+ data lines) occur pull-up interrupt after, GPIO/USB-DP multiplexing Pin feet are configured to USB-DP functional modes, and pattern switching control module matches USB principal and subordinate's detection devices It is set to main equipment pattern;(2) is after drop-down interruption occurs for GPIO/USB-DM multiplex datas line (i.e. D- data lines), GPIO/ USB-DM multiplexing Pin feet are configured to USB-DM functional modes, pattern switching control module USB principal and subordinate's detection devices be configured to from Equipment mode.For example, GPIO function modules are distinguished between DP data lines and DM data lines (i.e. on GPIOb and GPIOa) at it Equipped with first switch SW1 and second switch SW2, when GPIO function modules detect the level pull-up or DM data of DP data lines When the level drop-down of line, GPIO function modules are disconnected and DP data lines and DM data using first switch SW1 and second switch SW2 Connection between line stops DP data lines being pulled down to low potential by force and stops DM data lines being pulled to high potential by force, That is DP data lines and DM data lines is individually configured as USB-DP and USB-DM functional modes.Wherein, above-mentioned switch either Analog switch can also be digital switch.At this point, pattern switching control module receives the type interrupted from GPIO function modules, And USB function modules are switched to by main equipment pattern according to the type of the interruption or from equipment mode.In addition, when passing through USB When port receives the interruption of external equipment disconnection (extraction), pattern switching control module makes the work of USB principal and subordinate's detection devices Operation mode is switched to USB Plug-in checking Mode from USB Normal Working Mode, at this time first switch Its connection between DP data lines and DM data lines is connected in SW1 and second switch SW2 again.
In one or more embodiments, USB function modules include for when it is closed by DP data lines and DM data Line is configured to the third switch SW3 of low potential and the 4th switch for configuring DP data lines to when it is closed high potential SW4.Wherein, when GPIO function modules detect the level pull-up of DP data lines, third switch SW3 is closed and the 4th switch SW4 is disconnected, so that USB principal and subordinate's detection devices enter main equipment pattern;When GPIO function modules detect the electricity of DP data lines When flat drop-down, third switch SW3 is disconnected and the 4th switch SW4 is closed, so that USB principal and subordinate's detection devices enter from equipment mould Formula.In other words, when USB function modules are switched to main equipment pattern, two connect low potential by the resistance of 15K (GND) switch (i.e. third switch SW3) conducting, while the switch (i.e. the of low potential (GND) is connected by the resistance of 1.5K Four switch SW4) it disconnects;Be switched to from EM equipment module when, the switch (i.e. of low potential (GND) is connected by the resistance of 1.5K Four switch SW4) conducting, while two switches (i.e. third switch SW3) that low potential (GND) is connected by the resistance of 15K are disconnected It opens.
A kind of USB principals and subordinates detection method is provided according to the second aspect of the disclosure with reference to attached drawing 2, for the disclosure USB principal and subordinate's detection devices of first embodiment comprising following steps:Configure DP data lines to low potential, DM data lines are matched It is set to high potential;Judge the potential change on DP data lines and DM data lines, when the current potential pull-up on DP data lines, illustrates to connect The external equipment connect is slave, and USB principal and subordinate's detection devices are switched to main equipment pattern, to execute and slave (external equipment) Device communication functions;When the current potential drop-down on DM data lines, illustrates that the external equipment of connection is host, USB principals and subordinates are examined It surveys device to switch to from equipment mode, executes the Host communication functions with host (external equipment).
In one or more embodiments, USB principals and subordinates detection device is switched to main equipment pattern or from equipment mode When, stop configuring DP data lines to low potential, and stop configuring DM data lines to high potential, i.e., by DP data lines and DM numbers It is configured to USB-DP data lines and USB-DM data lines according to the multiplexing status of line.
In one or more embodiments, this method further includes step:When USB principals and subordinates detection device and external USB equipment Between when connecting, and when the current potential pull-up on DP data lines or current potential drop-down on DM data lines, disconnect GPIO function moulds Connection between block and DP data lines and DM data lines.
Optionally, this method further includes step:When connection (example of the USB principals and subordinates detection device not between external USB equipment Such as pass through external equipment connecting detection module), the connection between GPIO function modules and DP data lines and DM data lines is connected, with Etc. the master-slave equipment type of new external equipment to be detected.
A kind of USB principals and subordinates detection device, basic structure and sheet are provided according to the third of disclosure aspect with reference to Fig. 3 Disclosed first aspect is common, and the main distinction is to further comprise PMU (Power Management Unit, power management list Member) control module, PMU control modules are separately connected the VBUS lines and pattern switching control module of USB port, are mainly used for being responsible for Power supply relevant portion is managed, is such as charged, under-voltage, the management such as power supply.PMU control modules are additionally operable to detection VBUS lines in this example Potential state, which is brought, judges whether be inserted into or extracted external USB equipment on USB port, and by the outside on USB port The access situation of USB device feeds back to pattern switching control module.Preferably, PMU control modules are examined in a manner of receiving interruption The potential change for surveying the VBUS lines of USB port, to realize the advantageous effect of low energy consumption.For example, when PMU control modules according to When the potential change of VBUS lines detects that USB principals and subordinates detection device is disconnected with external USB equipment, pattern switching control module So that the operating mode of USB principal and subordinate's detection devices is switched to GPIO patterns from USB Normal Working Mode.
According to the 4th of the disclosure the aspect, a kind of USB principals and subordinates detection method is provided, for first aspect present invention USB principal and subordinate's detection devices comprising following steps:
A. USB principal and subordinate's detection devices are configured to GPIO patterns;
B. whether detection USB principals and subordinates detection device, which connects, is connected to external USB equipment;
C. when USB principal and subordinate's detection devices are connected to external USB equipment, judge that the external USB equipment is USB main equipment Or USB, if external USB equipment is USB main equipment, configures USB principal and subordinate's detection devices to main equipment pattern from equipment;If External USB equipment is USB from equipment, then configures from equipment mode USB principal and subordinate's detection devices to.
Further, step C includes following sub-step:Configure DP data lines to low potential, DM data lines are configured to height Current potential;Judge the potential change on DP data lines and DM data lines, when the current potential pull-up on DP data lines, USB principals and subordinates are examined It surveys device and switches to main equipment pattern, when the current potential drop-down on DM data lines, USB principal and subordinate's detection devices are switched to from equipment Pattern.
Further, USB principal and subordinate's detection methods are further comprising the steps of:D. it is detected when according to the potential change of VBUS lines When being disconnected to USB principals and subordinates detection device and external USB equipment, it configures USB principal and subordinate's detection devices to GPIO patterns.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. a kind of USB principals and subordinates detection device, it is characterised in that including:
USB port comprising DP data lines and DM data lines;
USB function modules, connect the DP data lines and DM data lines of the USB port, and can be operated in main equipment pattern Or from equipment mode;
GPIO function modules can connect to break-make the USB port DP data lines and DM data lines, and can be by DP data lines It is configured to low potential and configures DM data lines to high potential, and can detect on the level on DP data lines and DM data lines It draws or level pulls down;
Pattern switching control module, the level pull-up for being used to be received according to GPIO function modules or level drop-down, make USB principals and subordinates Detection device main equipment pattern switches between equipment mode or GPIO patterns.
2. USB principals and subordinates detection device according to claim 1, it is characterised in that:
When GPIO function modules detect the level pull-up of DP data lines or the level of DM data lines pulls down, GPIO function moulds Block disconnects and the connection between DP data lines and DM data lines.
3. USB principals and subordinates detection device according to claim 1, it is characterised in that:
When GPIO function modules receive the level on DP data lines pull up interrupt when, pattern switching control module is by USB function moulds Block is configured to main equipment pattern;When GPIO function modules, which receive the level on DM data lines, pulls down interruption, pattern switching control Module configures from equipment mode USB function modules to.
4. USB principals and subordinates detection device according to any one of claim 1-3, it is characterised in that:
When the USB principals and subordinates detection device is configured to main equipment pattern or when from equipment mode, USB port is connected to USB work( It can module;
When the USB principals and subordinates detection device is configured to GPIO patterns, USB port is connected to GPIO function modules.
5. USB principals and subordinates detection device according to claim 1, it is characterised in that:
USB port includes VBUS lines;
The USB principals and subordinates detection device further includes PMU control modules, and the PMU control modules are separately connected the VBUS of USB port Line and pattern switching control module, for whether being inserted into external USB on USB port according to the potential change of VBUS lines to detect Equipment and/or extraction external USB equipment, and the result of detection is fed back into pattern switching control module.
6. a kind of USB principals and subordinates detection method, special for USB principal and subordinate's detection devices described in any one of claim 1 to 5 Sign is to include the following steps:
A. USB principal and subordinate's detection devices are configured to GPIO patterns;
B. whether detection USB principals and subordinates detection device, which connects, is connected to external USB equipment;
C. when USB principal and subordinate's detection devices are connected to external USB equipment, judge the external USB equipment be USB main equipment or USB is from equipment, if external USB equipment is USB main equipment, configures from equipment mode USB principal and subordinate's detection devices to;If external USB device is USB from equipment, then configures USB principal and subordinate's detection devices to main equipment pattern.
7. according to the method described in claim 6, it is characterized in that, step C includes following sub-step:
Configure DP data lines to low potential, DM data lines are configured to high potential;
The potential change on DP data lines and DM data lines is judged, when receiving the pull-up interruption on DP data lines, by USB master Main equipment pattern is switched to from detection device, when receiving the drop-down interruption on DM data lines, USB principal and subordinate's detection devices are switched Extremely from equipment mode.
8. the method described according to claim 6 or 7, which is characterized in that further comprising the steps of:
It D., will when detecting that USB principals and subordinates detection device is disconnected with external USB equipment according to the potential change of VBUS lines USB principal and subordinate's detection devices are configured to GPIO patterns.
CN201810205864.5A 2018-03-13 2018-03-13 A kind of USB principals and subordinates detection device and method Pending CN108563537A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810205864.5A CN108563537A (en) 2018-03-13 2018-03-13 A kind of USB principals and subordinates detection device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810205864.5A CN108563537A (en) 2018-03-13 2018-03-13 A kind of USB principals and subordinates detection device and method

Publications (1)

Publication Number Publication Date
CN108563537A true CN108563537A (en) 2018-09-21

Family

ID=63532511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810205864.5A Pending CN108563537A (en) 2018-03-13 2018-03-13 A kind of USB principals and subordinates detection device and method

Country Status (1)

Country Link
CN (1) CN108563537A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008163A (en) * 2019-04-04 2019-07-12 中科创达(重庆)汽车科技有限公司 Double ports TYPE-C time-sharing multiplexing method and equipment based on single USB physical interface
CN110750394A (en) * 2019-09-25 2020-02-04 深圳震有科技股份有限公司 Control method and terminal for realizing main and standby single boards based on GPIO pins
CN111698366A (en) * 2020-05-08 2020-09-22 北京连山时代科技有限公司 Mobile phone hardware extension mode based on USB interface
CN113168207A (en) * 2019-05-31 2021-07-23 华为技术有限公司 Interface assembly, chip and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226516A (en) * 2007-01-15 2008-07-23 奇岩电子股份有限公司 Device and method capable of automatically switching into USB host or peripherals
CN101369259A (en) * 2008-09-05 2009-02-18 深圳创维数字技术股份有限公司 Switch control method and apparatus and electronic equipment for USB interface master-salve equipment mode
CN101526930A (en) * 2008-10-13 2009-09-09 建荣集成电路科技(珠海)有限公司 USB interface master-slave machine detection device and detection method
CN104850512A (en) * 2014-02-13 2015-08-19 珠海全志科技股份有限公司 Method and apparatus for implementing USB OTG function without ID pin

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226516A (en) * 2007-01-15 2008-07-23 奇岩电子股份有限公司 Device and method capable of automatically switching into USB host or peripherals
CN101369259A (en) * 2008-09-05 2009-02-18 深圳创维数字技术股份有限公司 Switch control method and apparatus and electronic equipment for USB interface master-salve equipment mode
CN101526930A (en) * 2008-10-13 2009-09-09 建荣集成电路科技(珠海)有限公司 USB interface master-slave machine detection device and detection method
CN104850512A (en) * 2014-02-13 2015-08-19 珠海全志科技股份有限公司 Method and apparatus for implementing USB OTG function without ID pin

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110008163A (en) * 2019-04-04 2019-07-12 中科创达(重庆)汽车科技有限公司 Double ports TYPE-C time-sharing multiplexing method and equipment based on single USB physical interface
CN113168207A (en) * 2019-05-31 2021-07-23 华为技术有限公司 Interface assembly, chip and electronic equipment
CN110750394A (en) * 2019-09-25 2020-02-04 深圳震有科技股份有限公司 Control method and terminal for realizing main and standby single boards based on GPIO pins
CN111698366A (en) * 2020-05-08 2020-09-22 北京连山时代科技有限公司 Mobile phone hardware extension mode based on USB interface

Similar Documents

Publication Publication Date Title
CN108563537A (en) A kind of USB principals and subordinates detection device and method
CN109643265B (en) Universal Serial Bus (USB) C-port for automatically configuring computing devices
CN106716389B (en) Method for fast USB charging, electronic device and charger device
US7895386B2 (en) USB interface provided with host/device function and its control method
CN101601001B (en) Multiple connections to a single serial interface
TW565797B (en) Method and apparatus of controlling an operational mode of a USB device
US7765344B2 (en) Apparatus and method for dynamically providing hub or host operations
CN108259803A (en) Electric terminal equipment, television terminal, signal input circuit and method
CN108885601B (en) USB multi-host endpoint reflector hub
JP5903401B2 (en) Power distribution in the cable
CN104657313B (en) Detecting system and method for universal serial bus device
EP1139226A1 (en) Method of emulating an attachment and detachment of a USB device
CN108666826A (en) A kind of adapter, terminal device and switching head system
CN106104509A (en) Port for usb hub disconnects charge function
CN106502939A (en) A kind of USB adapters and data transmission set
CN104054064B (en) Flexible port configuration based on interface coupling
CN108009108A (en) Flexible mobile equipment and the connection of the automotive system with usb hub
CN204576500U (en) A kind of usb communication circuit of compatible I2C communication and system
CN108932049A (en) Host slot power supply circuit
CN104115138B (en) The configurable apolegamy plate interface of electricity
CN100476777C (en) USB interface having host machine/apparatus function and control method therefor
CN109062846A (en) Universal serial bus device and its operating method
CN107203483A (en) The interface circuit and electronic equipment of a kind of electronic equipment
CN107153456A (en) OTG connections control method, OTG connection control devices and electronic equipment
CN205983460U (en) Serial receiving and dispatching interface module and USB interface module sharing port circuit

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: 20180921

RJ01 Rejection of invention patent application after publication