CN107153456A - OTG connections control method, OTG connection control devices and electronic equipment - Google Patents

OTG connections control method, OTG connection control devices and electronic equipment Download PDF

Info

Publication number
CN107153456A
CN107153456A CN201710466586.4A CN201710466586A CN107153456A CN 107153456 A CN107153456 A CN 107153456A CN 201710466586 A CN201710466586 A CN 201710466586A CN 107153456 A CN107153456 A CN 107153456A
Authority
CN
China
Prior art keywords
electronic equipment
otg
electricity
equipment
connections
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
CN201710466586.4A
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.)
Shenzhen Tai Heng Connaught Technology Co Ltd Shanghai Branch
Original Assignee
Shenzhen Tai Heng Connaught Technology Co Ltd Shanghai Branch
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 Shenzhen Tai Heng Connaught Technology Co Ltd Shanghai Branch filed Critical Shenzhen Tai Heng Connaught Technology Co Ltd Shanghai Branch
Priority to CN201710466586.4A priority Critical patent/CN107153456A/en
Publication of CN107153456A publication Critical patent/CN107153456A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3212Monitoring battery levels, e.g. power saving mode being initiated when battery voltage goes below a certain level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3253Power saving in bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

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

Abstract

The application provides a kind of OTG connections control method, OTG connection control devices and electronic equipment.The OTG connections control method includes:Detect the first electronic equipment is connected with whether the second electronic equipment sets up OTG;When first electronic equipment and second electronic equipment, which set up OTG, to be connected, judge whether be less than or equal to predetermined threshold value as the electricity of the first electronic equipment of power supply unit;When the electricity of first electronic equipment is less than or equal to predetermined threshold value, disconnects first electronic equipment and be connected with the OTG of second electronic equipment.OTG connections control method, OTG connection control devices and the electronic equipment of the application by the electric power detection to power supply unit effectively avoid due to cross put caused by power supply unit shorter battery life the problem of, substantially increase the practicality of electronic equipment.

Description

OTG connections control method, OTG connection control devices and electronic equipment
Technical field
The application is related to mobile communication technology field, more particularly to a kind of OTG connections control method, OTG connections control Device and electronic equipment.
Background technology
With the popularization of the consumer products such as PDA, mobile phone, digital camera, printer, for these equipment and electricity Highspeed Data Transmission Technology between brain, or equipment and equipment is increasingly paid close attention to by people, and IEEE1394 and USB are to be used for Two main standards of such transmission.The two standards all provide plug and play and warm connection function, can be provided out electricity Source, also all supports the connection of multiple equipment.Wherein IEE1394 supports higher data transmission bauds, but relatively complicated, valency Lattice are higher, are mainly used in needing the AV products of high-speed communication;And initial USB standard is mainly directed towards answering for slow data transmission With wherein USB1.1 supports 1.5Mbps and 12Mbps transmission rate, is widely used in outside the not high PC of transmission rate request If, such as:Keyboard, mouse etc..
From after USB1.0 specifications in 1996, USB-IF (Universal Serial Bus Implementers Forums several specifications such as USB1.0, USB2.0 and USB OTG are disclosed) and successively, wherein USB2.0 transmission bandwidth reaches 480Mbps, and USB OTG more make USB device break away from the limitation of original client/server, realize end-to-end transmission mode, With the constantly improve of USB, USB application field is also expanded.USB be born original intention be simplified computer and its outside If connection, be used in earliest on keyboard and mouse, and present, USB application has crossed consumer electronics from PC peripheral hardwares Product and communications electronics product scope, most significant application is on the consumption electronic products such as digital camera.
Since the birth of USB transport protocol in 1996, and with its advantage fashionable all computer peripheral equipments quickly and Digital equipment, as you know USB device be divided into HOST (main equipment) and SLAVE (slave unit), only as a HOST and one The transmission of data could be realized during platform SLAVE connections, and the release of USB OTG (USB On-The-Go) technology then can be achieved not Data transfer when having main frame between equipment and equipment.For example:Digital camera directly can be connected and photograph print with printer, So as to expand the application of USB technologies.That is, OTG equipment is exactly our " EX " is served as HOST, also can Serve as SLAVE.
USB OTG are the technologies that developed recently gets up, and on December 18th, 2001 is public by USB Implementers Forum Cloth, is mainly used in the connection between a variety of equipment or mobile device, carries out data exchange.Particularly PAD, mobile electricity Words, consumer devices.
OTG technologies are exactly in the case of there are currently no Host in fact, to realize the data transmission between slave unit.For example USB flash disk is direct It is connected on mobile phone, by OTG technologies, connects the USB interface of two equipment rooms, will comes in the data copy of USB flash disk to mobile phone; It can be sent to the data in mobile phone by OTG on the USB flash disk of USB interface.Mobile phone OTG functions are to facilitate user by mobile phone and U Disk, mobile hard disk, key mouse or other digital equipments etc. are connected, and can normally use its function.
But current OTG equipment is upon connection, will not check the state of current master.As long as inserting OTG lines, master sets Standby to be powered to external equipment, the equipment that master polls find insertion will load correspondence driving, the equipment just can be just Often operation.Even if that is, the not enough power supply of main equipment or too low, still can so be easy for by OTG to externally fed Causing the electricity rapid decrease of main equipment causes shutdown, is shut down if powered always using OTG to slave unit to main equipment, easily Cause the battery of main equipment to be crossed to put, influence battery life and Consumer's Experience.
The content of the invention
The shortcoming of prior art in view of the above, the purpose of the application be to provide a kind of OTG connections control method, OTG connection control devices and electronic equipment, easily occur electricity mistake for solving main equipment after being connected in the prior art by OTG The problem of putting.
In order to achieve the above objects and other related objects, the first aspect of the application provides a kind of OTG connections control method, The OTG connections control method includes:Detect the first electronic equipment is connected with whether the second electronic equipment sets up OTG;When described When first electronic equipment is set up OTG with second electronic equipment and is connected, the first electronic equipment as power supply unit is judged Whether electricity is less than or equal to predetermined threshold value;When the electricity of first electronic equipment is less than or equal to predetermined threshold value, disconnect First electronic equipment is connected with the OTG of second electronic equipment.
In some embodiments of first aspect, the OTG connections control method also includes:Disconnect first electricity When sub- equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
In some embodiments of first aspect, the OTG connections control method also includes:When first electronics is set When standby electricity is more than predetermined threshold value, by the first electronic equipment as power supply unit to second power electronic equipment.
In some embodiments of first aspect, the OTG connections control method, in addition to:When first electronics After equipment is to second power electronic equipment, OTG agreements are installed, first electronic equipment enters with second electronic equipment Row data transfer.
In some embodiments of first aspect, the OTG connections control method also includes:Set in first electronics During to second power electronic equipment, judge whether the electricity of first electronic equipment is less than or equal in advance If threshold value;When the electricity of first electronic equipment is less than or equal to predetermined threshold value, first electronic equipment and institute are disconnected State the OTG connections of the second electronic equipment.
In some embodiments of first aspect, the OTG connections control method also includes:Disconnect first electricity When sub- equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
The second aspect of the application includes there is provided a kind of OTG connections control device, the OTG connections control device:OTG Interface, for being connected with the second electronic equipment;OTG connecting detection units, are connected with the OTG interfaces, for detecting the first electricity Sub- equipment is connected with whether the second electronic equipment sets up OTG;Electricity judging unit, is connected with OTG connecting detection units, for working as When setting up OTG connections of OTG connecting detection units is received, judging the electricity of the first electronic equipment as power supply unit is It is no to be less than or equal to predetermined threshold value;Switching units, are connected with the electricity judging unit and OTG interfaces, for when described first When the electricity of electronic equipment is less than or equal to predetermined threshold value, first electronic equipment and second electronic equipment are disconnected OTG connections.
In some embodiments of second aspect, the OTG connections control device also includes:Tip element, it is and described Switching units are connected, for when disconnection first electronic equipment is connected with the OTG of second electronic equipment, carrying out OTG Connect the prompting disconnected.
In some embodiments of second aspect, when the electricity of first electronic equipment is more than predetermined threshold value, institute State by the first electronic equipment from the OTG interfaces to the second power electronic equipment.
In some embodiments of second aspect, the OTG connections control device also includes:Installation unit, it is and described OTG interfaces are connected, for after first electronic equipment is to second power electronic equipment, installing OTG agreements;Described One electronic equipment carries out data transmission with second electronic equipment.
In some embodiments of second aspect, the electricity judging unit is additionally operable in first electronic equipment pair During second power electronic equipment, judge whether the electricity of first electronic equipment is less than or equal to default threshold Value;The switching units are additionally operable to, when the electricity of first electronic equipment is less than or equal to predetermined threshold value, disconnect described the One electronic equipment is connected with the OTG of second electronic equipment.
In some embodiments of second aspect, Tip element be additionally operable to disconnect first electronic equipment with it is described During the OTG connections of the second electronic equipment, the prompting that OTG connections have disconnected is carried out.
The third aspect of the application includes the OTG described in foregoing any one there is provided a kind of electronic equipment, the electronic equipment Connect control device.
As described above, OTG connections control method, OTG connection control devices and the electronic equipment of the application, have with following Beneficial effect:
After the first electronic equipment and the second electronic equipment, which carry out OTG, to be connected, detection in time is used as the first of power supply unit The electricity of electronic equipment, if the electricity of the first electronic equipment is less than or equal to predetermined threshold value, by the first electronic equipment and second Electronic equipment disconnects OTG connections, so that the problem of effectively avoiding under low battery to the second power electronic equipment, so as to have The battery for protecting the first electronic equipment of effect, greatly improves the battery life of the first electronic equipment as power supply unit, Greatly improve the experience of user.
In addition, disconnect the first electronic equipment be connected with the OTG of the second electronic equipment when, pointed out, by it is this just Prompt intuitively man-machine interaction mode effectively raises the practicality of equipment.
In addition, during the first electronic equipment is to the second electronic equipment continued power, still persistently detection first is electric The electricity of sub- equipment, when the electricity of the first electronic equipment is less than or equal to predetermined threshold value, disconnects first electronics and sets in time It is standby to be connected with the OTG of the second electronic equipment, so, the battery of the first electronic equipment is more efficiently protected, is substantially increased The experience of user.
Brief description of the drawings
Fig. 1 is shown as the structural representation of the electronic equipment of the embodiment of the application one.
Fig. 2 is shown as the structural representation of the application OTG interfaces.
Fig. 3 is shown as schematic flow sheet of the application OTG connection control methods in an implementation.
Fig. 4 is shown as schematic flow sheet of the application OTG connection control methods in another implementation.
Embodiment
Presently filed embodiment is illustrated by particular specific embodiment below, those skilled in the art can be by this explanation Content disclosed by book understands other advantages and effect of the application easily.
In described below, refer to the attached drawing, accompanying drawing describes some embodiments of the application.It should be appreciated that it is also possible to use Other embodiment, and can be carried out in the case of without departing substantially from spirit and scope of the present disclosure mechanical composition, structure, electrically with And the detailed description below operational change should not be considered limiting, and the scope of embodiments herein Only terms used herein are limited by the claims for the patent announced merely to describing specific embodiment, and not It is intended to limit the application.The term of space correlation, such as " on ", " under ", "left", "right", " following ", " lower section ", " bottom ", " top ", " top " etc., can use to illustrate an element or feature shown in figure and another element or spy in the text The relation levied.
Although the grade of term first, second is used for describing various elements herein in some instances, these elements It should not be limited by these terms.These terms are only used for making a distinction an element and another element.For example, the first electricity Sub- equipment can be referred to as the second electronic equipment, and similarly, the second electronic equipment can be referred to as the first electronic equipment, and The scope of various described embodiments is not departed from.First electronic equipment and the second electronic equipment are to describe an equipment, But unless context is otherwise explicitly pointed out, otherwise they are not same electronic equipments.Similar situation also includes A Equipment and B device;In addition, predetermined threshold value is to describe a threshold value, the predetermined threshold value can be made in advance according to the actual requirements Setting.
Furthermore, as used in herein, singulative " one ", " one " and "the" are intended to also include plural shape Formula, unless had opposite instruction in context it will be further understood that term "comprising", " comprising " show there is described spy Levy, step, operation, element, component, project, species, and/or group, but be not excluded for other one or more features, step, behaviour Work, element, component, project, the presence of species, and/or group, occur or addition term "or" used herein and "and/or" quilt It is construed to inclusive, or means any one or any combinations.Therefore, " A, B or C " or " A, B and/or C " mean " with Descend any one:A;B;C;A and B;A and C;B and C;A, B and C " are only when element, function, step or the combination of operation are in some sides When inherently mutually exclusive under formula, the exception of this definition just occurs.
Referring to Fig. 1, Fig. 1 is shown as the electronic equipment of the embodiment of the application one, as illustrated, the electronic equipment 10 is wrapped Include:OTG connections control device 100.
The electronic equipment includes but is not limited to tablet personal computer, mobile phone, smart mobile phone, media player, individual number Word assistant (PDA), digital camera, digital-code printer etc. carry the terminal device of operating system, in addition to wherein two or multinomial Combination.In some embodiments, the electronic equipment is the smart machine based on Android (Android) operating system, This, the Android operation system includes:Primary operating systems of Android and based on the improved operating system of Android kernels.Its In, illustrate but be not limited to based on the improved operating system of Android kernels:EMUI of Huawei's exploitation, the MIUI of millet exploitation etc..
The electronic equipment citing includes memory, Memory Controller, one or more processing units (CPU), peripheral hardware Interface, RF circuits, voicefrequency circuit, loudspeaker, microphone, input/output (I/O) subsystem, touch-screen, other outputs are controlled Equipment, and outside port.These components are communicated by one or more communication bus or signal wire.The electronic equipment Also include the power-supply system for being used to power for various assemblies.The power-supply system can include power-supply management system, one or more Power supply (such as battery, alternating current (AC)), charging system, power failure detection circuit, power supply changeover device or inverter, power supply shape State indicator (such as light emitting diode (LED)), and it is associated with electric energy generation, management and the distribution in portable set Other any components.
Following description for convenience, the electronic equipment including OTG connections control device 100 is set as the first electronics Standby, first electronic equipment is mutually distinguished with the second electronic equipment 20.Wherein, the second electronic equipment 20 can be tablet personal computer, shifting Mobile phone, smart mobile phone, media player, personal digital assistant (PDA), digital camera, digital-code printer etc. are with operation The terminal device of system, the generally terminal device with operating system possess main frame and slave dual capability.Second electricity Sub- equipment can also need non intelligent the setting of the first power electronic equipment operation for external connection keyboard, mouse, mobile hard disk, USB flash disk etc. It is standby, wherein, the latter is generally accessed in the first electronic equipment with slave unit.
Can be dual-purpose OTG equipment (Dualrole device) for first electronic equipment and the second electronic equipment, When second electronic equipment is connected into first electronic equipment, first electronic equipment can be by recognizing that OTG connects Mouth sets and is determined as main equipment to second power electronic equipment.Certainly, according to USB otg standards, set according to OTG interfaces Put and the first electronic equipment can also be powered using second electronic equipment as main equipment.Wherein, in OTG interfaces Comprising a PIN for being labeled as ID, when the PIN is grounded, the end is HPI, and otherwise, the OTG interfaces connect for slave unit Mouthful.
Referring to Fig. 2, Fig. 2 is shown as USB OTG interface structure schematic diagrams in the application, as illustrated, being connect in USB OTG Mouth includes five pins, and wherein pin 1 connects+5V voltages as power end VCC;Pin 2 and pin are, as data wire, to use In transmission data;Pin 4 is ID pin, and pin 5 is ground terminal.Default host is determined by pin 4, double-duty plant uses new Mini-AB sockets so that mini-A plugs, mini-B plugs and mini-AB sockets add the 5th pin (ID), with In the different cable end points of identification.ID pin floatings in ID pins ground connection in mini-A plugs, mini-B plugs.Work as OTG When equipment detects the ID pins of ground connection, represent acquiescence is A equipment (main frame), and the equipment for detecting ID pin floatings is then recognized To be B device (peripheral hardware).During as host work, dual-purpose OTG equipment can provide 8mA electric current in bus, and mark in the past Quasi- main frame then needs 100~500mA of offer electric current.OTG main frames are responsible for the task of initialization data communication, such as:Bus is answered Position, the acquisition various descriptors of USB and configuration equipment.These configuration after the completion of, 2 OTG equipment just can respectively with main frame and from Machine mode transmits information, and the process of 2 equipment principal and subordinate's role swaps is defined by main frame host-host protocol (HNP).
System is Yi Dan after connection, and OTG role can also change.Main frame uses new HNP with peripheral hardware, and A equipment is as silent Recognize main frame and VBUS power supplys be provided, and when having detected equipment connection reset bus, enumerate and configure B device.Otg standard is Second new agreement that USB increases is referred to as session request agreement (SRP).SRP allows B device to ask A equipment to open VBUS power supplys And startup is once talked with.OTG dialogue can provide the time of VBUS power supplys by A equipment to determine (note:A equipment is always VBUS powers, even if being used as peripheral hardware).Also it can close VBUS power supplys to terminate a session to save power consumption by A equipment, this is in electricity It is very important in the powered products of pond.
With continued reference to Fig. 1, the OTG connections control device 100 in the application can also include:OTG connecting detection units 101st, electricity judging unit 102 and switching units 103.
The OTG connecting detections unit 101 is used to detect whether the first electronic equipment and the second electronic equipment set up OTG companies Connect.It is described, it is necessary to realize the detection operation for whether setting up OTG connections by event detector in some specific embodiments Event monitor receives event information from peripheral interface.Event information is included on subevent (for example, being used as OTG interfaces Pin be triggered) information.
In some embodiments, the OTG connecting detections unit 101 includes ID PINs, Vcc in connection OTG interfaces The detection circuit of PIN, when the detection electric circuit inspection to ID PINs is 0 level and Vcc PIN output currents, determines the One electronic equipment is OTG main frames.Wherein, included in the detection circuit:The voltage sample sub-circuit being connected with ID PINs, with The current sample sub-circuit of Vcc PINs connection, and detection sub-circuit;Wherein, the detection sub-circuit is respectively compared sampling electricity Pressure and sample rate current simultaneously determine that the first electronic equipment is OTG main frames after OTG connections are carried out based on two comparative results.Detection electricity Road citing includes the sampling resistor being connected respectively with ID PINs and Vcc PINs, and individually sample rate current and sampled voltage are entered The comparator that compares of row, and be connected with the output end of two comparators with door, the output high level of this and door illustrate First electronic equipment is OTG main frames in OTG connections.Here, the detection circuit can be integrated in power management chip or be list Only integrated circuit.
The electricity judging unit 102 is used for when first electronic equipment and second electronic equipment set up OTG companies When connecing, judge whether be less than or equal to predetermined threshold value as the electricity of the first electronic equipment of power supply unit.First electronics Equipment is determined to refer to the confirmation description previously with regard to OTG master-slave equipments as power supply unit, will not be repeated here.When confirmation institute When stating the first electronic equipment as power supply unit, OTG connecting detections unit 101 indicates that electricity judging unit 102 detects described the The current electricity of one electronic equipment, and the electricity judging unit 102 compared the current electric quantity detected with predetermined threshold value Compared with.
In some embodiments, the electricity judging unit 102 can be separately configured.Increase for example in mobile phone single Electric power detection chip.
In a certain embodiment, the electricity judging unit 102 can include electric power detection unit and comparing unit.Mesh There is electric quantity detecting circuit on preceding electronic equipment, particularly smart mobile phone, to carry out electric power detection when being connected without peripheral hardware.Cause This, the electric power detection unit can be realized by detection circuit of the prior art.
The comparing unit can be a comparison circuit, comparator or the calculating with conditional statement performed by CPU Machine program.The comparing unit can also be by the comparision of quantity of electricity circuit being connected in smart mobile phone with electric quantity detecting circuit.When this When comparision of quantity of electricity electric circuit inspection is to less than predetermined threshold value, low battery signal (a such as high level) is exported, conversely, then not exporting low Electric quantity signal.
When borrowing existing detection circuit progress OTG power supply controls, detected from existing unlike circuit, the electricity inspection Survey unit and also include an input, be connected with OTG connecting detections unit 101.The comparing unit also includes a control end and defeated Go out end, wherein the control end is also connected with OTG connecting detections unit 101, the output end connects the switching units 103.Specifically Ground, the OTG connecting detections unit 101 starts electricity inspection when identifying with OTG HPIs the second electronic equipment of connection Unit is surveyed to export detected charge value, and indicates that control end exports comparative result from the output end.The charge value quilt Electric power detection unit is exported to comparing unit, makes whether its determination current electric quantity is less than predetermined threshold value, when being not below the threshold value When, cut-offing instruction is not exported, conversely, then exporting cut-offing instruction to switching units 103.Wherein, the cut-offing instruction can be One enables signal (such as high level) or a command information (such as command information based on bus protocol).
The predetermined threshold value is stored in a memory, in specific implementation, the memory may include at a high speed with Machine accesses memory, and may also include nonvolatile memory, such as one or more disk storage equipments, flash memory device or Other non-volatile solid-state memory devices.The low battery that the threshold value can borrow mobile phone reminds threshold value, or the OTG being separately provided Power supply threshold value.
The switching units 103 are used to work as determines that first electronics is set according to the comparative result of electricity judging unit 102 When standby electricity is less than or equal to predetermined threshold value, disconnects first electronic equipment and be connected with the OTG of second electronic equipment.
In a certain embodiment, the switching units 103 can be an on-off circuit, breaker or be performed by CPU One section of computer program realize.In a particular application, the OTG for disconnecting first electronic equipment and the second electronic equipment connects The mode connect can be:1) when the electricity of the first electronic equipment is less than or equal to predetermined threshold value, disconnection control letter is directly transmitted Number to the switching units 103, by the switching units 103 directly by the first electronic equipment and the second electronic equipment disconnection OTG Connection;2) when the electricity of the first electronic equipment is less than or equal to predetermined threshold value, pointed out by display device (as pointed out For " current electric quantity is low "), if the disconnection control signal of outside input is received, then by the switching units 103 by the first electronics Equipment disconnects OTG with the second electronic equipment and is connected, or in prompting automatic disconnection OTG connections simultaneously.
The display device can be realized for the display screen in existing electronic equipment.For example when electronic equipment is intelligence During mobile phone, the display device refers to the touch display screen on smart mobile phone, described for another example when electronic equipment is camera What display device referred to is exactly the display screen of camera.
In second of disconnection mode, the disconnection control signal of the outside input can be that user is based in display device Prompting, then produced by being confirmed via human-computer interaction interface.For example, when smart mobile phone is as the first electronic equipment, The prompting of " current electric quantity is low, if disconnect OTG connections " can be carried out in touch display screen, and select button (choosing is provided Selecting button includes:"Yes" or "No"), when user selects "Yes", produce and disconnect control signal, the switching units 103 are based on First electronic equipment and the second electronic equipment are disconnected OTG and are connected by the disconnection control signal.
It should be noted that OTG connection control devices can also be included in second electronic equipment 20, so, when the When two electronic equipments need to be powered other equipment as main equipment, electric power detection can be equally carried out, so as to ensure During low battery, no longer power, and then be effectively protected the battery of the second electronic equipment, improve the battery longevity of the second electronic equipment Life.
Similarly, second electronic equipment can also include memory, Memory Controller, one or more processing lists First (CPU), Peripheral Interface, RF circuits, voicefrequency circuit, loudspeaker, microphone, input/output (I/O) subsystem, touch-screen, its He exports or control device, and outside port.These components are communicated by one or more communication bus or signal wire. The electronic equipment also includes the power-supply system for being used to power for various assemblies.The power-supply system can include power management system System, one or more power supplys (such as battery, alternating current (AC)), charging system, power failure detection circuit, power supply changeover device or Inverter, power supply status indicator (such as light emitting diode (LED)), and with portable set electric energy generation, management Other associated any components with distribution.
In some embodiments, the OTG connections control device also includes:Tip element, for disconnecting described the When one electronic equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
In a certain embodiment, the Tip element can be realized for the display screen in existing electronic equipment.Example Such as when electronic equipment is smart mobile phone, the display device refers to the touch display screen on smart mobile phone, and electricity is worked as another example When sub- equipment is camera, what the display device referred to is exactly the display screen of camera.
With continued reference to Fig. 1, in some embodiments, when electricity judging unit 102 detects first electronic equipment Electricity be more than predetermined threshold value when, second electronic equipment 20 is powered by the first electronic equipment as power supply unit.
Correspondingly, the OTG connections control device also includes installation unit (Fig. 1 is not shown).The installation unit is used for After first electronic equipment is powered to second electronic equipment 20, OTG agreements are installed;First electronic equipment and institute The second electronic equipment is stated to carry out data transmission.
It is different from PC main frames, there is no easily mode in the first electronic equipment and enough spaces load new driving journey Sequence.Therefore, the list for the peripheral hardware formula OTG target devices that can be supported is preset with the installation unit, the list includes setting The information such as standby type and manufacturer.
Different from PC, the driver stack in the first electronic equipment can be made up of usb host stack and USB device stack with full The need for two kinds of working methods of foot.The works that are different or whether having NHP switching equipment that wherein OTG drivers pass through connector Determine to use usb host stack or USB device stack as mode.
Therefore, the installation unit shares the memory and CPU in the first electronic equipment, with store driver and row Table, and when OTG connecting detections unit 101 detects and needs to use usb host stack or USB device stack, respective drive journey is installed Sequence.
When OTG double-duty plants are worked with host mode, the work of usb host stack.Host controller driver therein It is responsible for the data exchange of usb host stack and hardware end points, USB device driver is enumerated and preserves the information of equipment, target peripheral master Machine class driver supports the equipment in target device list.Main frame class driver is provided by chip manufacturer, meanwhile, OTG General main frame class driver (can change for non-universal equipment) is provided.
When OTG double-duty plants are worked in slave mode, the work of USB device stack.Device controller driver therein It is responsible for the data exchange of USB device stack and hardware end points, USB protocol layer is responsible for handling usb protocol specification, equipment class driver Function depend on the double-duty plant function (such as digital camera, storage device, printer).
OTG drivers are responsible for handling the working method conversion of dual-purpose OTG equipment, meanwhile, it can also return to its result (such as whether equipment supports HNP) and handle bus error.Application layer program is started or terminated a biography by OTG drivers Defeated affairs, data are exchanged by usb host stack or device stack with hardware layer.
OTG main frames and equipment are divided into functional layer, USB device layer and USB interface 3 different levels of layer, USB interface layer It is that OTG main frames and OTG equipment provide physical connection;USB system software comes managing main frame and USB device using console controller Data transfer.USB system software is for console controller, and processing is the data transfer and visitor observed with customer perspective Family is interacted with equipment.USB device layer provides an available logical device for USB host system software.Main frame passes through therewith The client software of function match realizes its various functions.
OTG equipment has two kinds of passages as conventional USB device:Data flow path and message channel.Data flow path The result not defined, and message channel then has fixed structure.But, each passage has certain bandwidth, transmission class Type, transmission direction and buffer size.Self Powered Device configures the control passage of an acquiescence, and the configuration of the equipment is provided by him With the information such as state.
When double-duty plant is connected to a Mini-A plug or Mini-B plugs, it accordingly just with OTG main frames or The default behavior work of person's OTG peripheral hardwares.A-device is default host, so providing VBUS power supplys by it, and is being detected Equipment access when reset bus, enumerate and configure B-device.
A-device, can be by inquiring about B-device OTG performance descriptors after use to B-device is completed To judge whether to support HNP agreements (whether being dual-purpose OTG equipment).HNP, B-device is such as supported to return to effective OTG Performance descriptor, Adevice then produces a Set_feature order (i.e. HNP_Enable) to notify that B-device can be Worked when bus suspension with host mode, subsequent A-device hanging up bus.
B-device drags down D+ to show that connection disconnects by pull-up resistor (during full speed) or pull down resistor (during high speed).With Afterwards, as the response disconnected to Bdevice, A-device is enabled its data wire and starts to be worked in slave mode.Complete this After a little conversions, B-device and Adevice just each use bus with host role and peripheral role.If the B-device belongs to In dual-purpose OTG equipment and A-device does not use it, A-device just retransmits Set_feature orders and hanging up bus. If B-device applies malfunctioning during role transforming, A-device then drags down VBUS to terminate the affairs.When B-device is normally tied Just VBUS is hung up during beam transmission transaction and enables its pull-up resistor, is run again in slave mode.A-device detects bus extension After rising, send a connection cut-off signal and worked again with host mode.
HNP is that a kind of agreement for being used for realizing Adevice and Bdevice main frames/slave conversion (is actually the anti-of cable Turn).The master/slave permutable result performance of machine work(is in the following procedure:
(1) slave is sent a signal to using pull-up resistor.
(2) Adevice can set " HNP Enable " characteristic on Bdevice.
(3) Bdevice disconnects pull-up.
(4) ADevice is connected with pull-up resistor, shows that Adevice is subordinated to slave.
(5) Adevice powers to Vbus.
(6) Bdevice detects Adevice pull-up.
(7) reset/enumerate/use Adevice.
OTG descriptors
In enumeration stage, OTG A-device will ask OTG configures descriptors from B-device.This three bytes descriptor It is made up of three parts:BLength, bDescriptorType, and bmAttributes.
srp_support:If equipment supports SRP, this position is set to TRUE.
hnp_support:If equipment supports HNP, this position is set to TRUE.
Set Feature Commands:A-device can use the characteristics of SetFeature orders enable B-device row For, or show A-device to B-device certain capabilities.
b_hnp_enable:This characteristic is set to show that B-device has been able to perform HNP.This characteristic is only in bus reset Or removed during conversation end, it is impossible to ordered and removed by ClearFeature (b_hnp_enable).
a_hnp_support:This characteristic is set to show that HNP is supported in the A-device ports of B-device connections.A- Device can be in session start, and any B-device configurations set this characteristic before being chosen.
a_alt_hnp_support:This characteristic is set to show that the A-device ports of B-device connections do not have HNP work( Can, but this A-device has standby port to possess HNP functions.This characteristic is only removed in bus reset or conversation end, It can not be ordered and removed by ClearFeature (b_hnp_enable).
In some embodiments, the electricity judging unit 102 is additionally operable in first electronic equipment to described During two power electronic equipments, judge whether the electricity of first electronic equipment is less than or equal to predetermined threshold value;Institute Switching units 103 are stated to be additionally operable to, when the electricity of first electronic equipment is less than or equal to predetermined threshold value, disconnect described first Electronic equipment is connected with the OTG of second electronic equipment.
The detection of the electricity judging unit 102 and deterministic process are identical with foregoing detection and deterministic process, correspondingly, institute The process for stating the disconnection OTG connections of switching units 103 is identical with foregoing disconnection mode, will not be repeated here.
In some embodiments, Tip element is additionally operable to set with second electronics in disconnection first electronic equipment During standby OTG connections, the prompting that OTG connections have disconnected is carried out.
In a certain embodiment, the Tip element can be realized for the display screen in existing electronic equipment.Example Such as when electronic equipment is smart mobile phone, the display device refers to the touch display screen on smart mobile phone, and electricity is worked as another example When sub- equipment is camera, what the display device referred to is exactly the display screen of camera.
In some embodiments, the OTG connecting detections unit 101 is additionally operable in first electronic equipment to described During second power electronic equipment, the OTG connection status of first electronic equipment and second electronic equipment is detected; First electronic equipment is additionally operable to, when being connected with second electronic equipment disconnection OTG, stop power supply.
In a certain embodiment, the OTG connection status of first electronic equipment and second electronic equipment includes: First electronic equipment is connected with the OTG of the second electronic equipment have been disconnected, that is to say, that the first electronic equipment and the second electronic equipment Between off-state is converted to by connection status;The process of detection state now and foregoing detection the first electronic equipment and second The process whether electronic equipment sets up OTG connections is similar or opposite.
, it is necessary to realize the detection operation for whether setting up OTG connections by event detector in some specific embodiments, The event monitor receives event information from peripheral interface.Event information is included on subevent (for example, being used as OTG The pin of interface is triggered) information.
The application also provides a kind of OTG connections control method, and the OTG connections control method is applied to two electronic equipments Set up the mode of OTG connections.Referring to Fig. 3, the flow that Fig. 3 is shown as an embodiment of the application OTG connection control methods is shown It is intended to, as illustrated, OTG connections control method includes:
Step S10, two OTG equipment are connected;In a particular application, user can be carried out two dual-purpose OTG equipment It is connected, a dual-purpose OTG equipment can also be connected with a peripheral hardware OTG equipment, the application is without limitation.
Wherein, the dual-purpose OTG equipment includes but is not limited to tablet personal computer, mobile phone, smart mobile phone, media play Device, personal digital assistant (PDA), digital camera, digital-code printer etc. carry the terminal device of operating system, in addition to wherein two Item or multinomial combination.In some embodiments, the electronic equipment is the intelligence based on Android (Android) operating system Equipment, here, the Android operation system includes:Primary operating systems of Android and based on the improved operation of Android kernels System.Wherein, illustrate but be not limited to based on the improved operating system of Android kernels:The EMUI of Huawei's exploitation, millet exploitation MIUI etc..In addition, the peripheral hardware OTG equipment, which is exemplified as external connection keyboard, mouse, mobile hard disk, USB flash disk etc., needs the first electronic equipment The unintelligent device of powered operation, wherein, the latter is generally accessed in dual-purpose OTG electronic equipments with slave unit.
For convenience of describing and distinguishing, two OTG equipment are respectively defined as the first electronic equipment and the second electronic equipment, institute State the first electronic equipment and the second electronic equipment may each be dual-purpose OTG equipment, or one of them is dual-purpose OTG equipment, separately One is peripheral hardware OTG equipment.In the present embodiment, first electronic equipment is assumed to be power supply unit.
Step S20, the first electronic equipment of detection is connected with whether the second electronic equipment sets up OTG;When first electronics When equipment is set up OTG with second electronic equipment and is connected, step S30 is performed, judges to set as the first electronics of power supply unit Whether standby electricity is less than or equal to predetermined threshold value.
In some specific embodiments, first electronic equipment needs to realize whether set up by event detector The detection operation of OTG connections, the event monitor receives event information from peripheral interface.Event information is included on son The information of event (for example, being triggered as the pin of OTG interfaces).
Can be that dual-purpose OTG is set for first electronic equipment and the second electronic equipment in some specific embodiments Standby (Dualrole device), when second electronic equipment is connected into first electronic equipment, first electronics Equipment can be determined as main equipment to second power electronic equipment by recognizing that OTG interfaces are set.Certainly, according to USB Otg standard, sets according to OTG interfaces and the first electronic equipment can also be carried out using second electronic equipment as main equipment Power supply.Wherein, comprising a PIN for being labeled as ID in OTG interfaces, when the PIN is grounded, the end is HPI, no Then, the OTG interfaces are slave unit interface.
Here, first electronic equipment includes ID PINs, the detection circuit of Vcc PINs in connection OTG interfaces, when The detection electric circuit inspection to ID PINs be 0 level and Vcc PIN output currents when, determine the first electronic equipment be OTG master Machine.Wherein, included in the detection circuit:The voltage sample sub-circuit being connected with ID PINs, the electric current being connected with Vcc PINs Sampling sub-circuit, and detection sub-circuit;Wherein, the detection sub-circuit is respectively compared sampled voltage and sample rate current and based on two Comparative result determines that the first electronic equipment is OTG main frames after OTG connections are carried out.The detection circuit citing comprising respectively with ID PIN and the sampling resistor of Vcc PINs connection, the comparator being individually compared to sample rate current and sampled voltage, and Be connected with the output end of two comparators with door, should and door output high level illustrate the first electronic equipment OTG connect It is OTG main frames when connecing.Here, the detection circuit can be integrated in power management chip or be independent integrated circuit.
When it is determined that after OTG connections, the first electronic equipment perform step S30 with judge battery electric quantity whether be less than be equal to it is default Threshold value, if so, step S40 is then performed, conversely, then detection of end or return perform step S30 until satisfaction performs step S40's Condition.In some embodiments, the step S30 can be performed by foregoing electricity judging unit 102.The predetermined threshold value is root According to actual demand or empirical value a charge value set in advance, and the predetermined threshold value can be stored in a memory, institute High-speed random access memory can be included by stating memory, and may also include nonvolatile memory, such as one or more Disk storage equipment, flash memory device or other non-volatile solid-state memory devices.
With continued reference to Fig. 3, when the electricity of first electronic equipment is less than or equal to predetermined threshold value, step S40 is performed, The OTG for disconnecting first electronic equipment with second electronic equipment is connected.
Specifically, the switching units 103 that the step S40 can be as shown in Figure 1 realize, the switching units 103 can be with Break function is realized for an on-off circuit, breaker or by one section of computer program.In a particular application, described the is disconnected The mode that one electronic equipment is connected with the OTG of the second electronic equipment can be:1) when the electricity of the first electronic equipment is less than or Equal to predetermined threshold value, disconnection control signal is directly transmitted to the switching units 103, by the switching units 103 directly by the One electronic equipment disconnects OTG with the second electronic equipment and is connected;2) when the electricity of the first electronic equipment is less than or equal to default threshold During value, pointed out and (such as prompted for " current electric quantity is low ") by display device, if receiving the disconnection control letter of outside input Number, then be connected the first electronic equipment and the second electronic equipment disconnection OTG by the switching units 103.
Step S40 is disconnected after the OTG connections of two equipment, can also carry out step S60, is carried out OTG connections and has been disconnected Prompting.
Above-mentioned prompting step may be displayed in display device, and the display device can be in existing electronic equipment Display screen is realized.For example when electronic equipment is smart mobile phone, the display device refers to that the touch on smart mobile phone shows Display screen, for another example when electronic equipment is camera, what the display device referred to is exactly the display screen of camera.
In foregoing second of disconnection mode, the disconnection control signal of the outside input can be that user is based on display dress The prompting put, then produced by being confirmed via human-computer interaction interface.For example, when smart mobile phone is used as the first electronic equipment When, the prompting of " current electric quantity is low, if disconnect OTG connections " can be carried out in touch display screen, and provide select button (select button includes:"Yes" or "No"), when user selects "Yes", produce and disconnect control signal, the base of switching units 103 The first electronic equipment and the second electronic equipment are disconnected into OTG in the disconnection control signal to be connected.
With continued reference to Fig. 3, the OTG connections control method can also include:Step S50, when first electronic equipment Electricity be more than predetermined threshold value when, by the first electronic equipment as power supply unit to second power electronic equipment.
Fig. 4 is refer to, Fig. 4 is shown as the schematic flow sheet of another embodiment of the application OTG connection control methods, such as schemed Shown, the OTG connections control method can also perform S50, i.e., preset when the electricity of first electronic equipment is more than During threshold value, by the first electronic equipment as power supply unit to second power electronic equipment after, perform step S70, peace OTG agreements are filled, so as to realize the data transfer between the first electronic equipment and the second electronic equipment.
Installing the process of OTG agreements (driving) can be realized by installation unit.The process and two electricity of OTG agreements are installed Data transmission procedure between sub- equipment can be realized by mode in detail below:
It is different from PC main frames, there is no easily mode in the first electronic equipment and enough spaces load new driving journey Sequence.Therefore, the list for the peripheral hardware formula OTG target devices that can be supported is preset with first electronic equipment, is wrapped in the list Include the information such as type and the manufacturer of equipment.
Different from PC, the driver stack in the first electronic equipment is made up of to meet usb host stack and USB device stack The need for two kinds of working methods.The working methods that are different or whether having NHP switching equipment that OTG drivers pass through connector To determine to use usb host stack or USB device stack.
When OTG double-duty plants are worked with host mode, the work of usb host stack.Host controller driver therein It is responsible for the data exchange of usb host stack and hardware end points, USB device driver is enumerated and preserves the information of equipment, target peripheral master Machine class driver supports the equipment in target device list.Main frame class driver is provided by chip manufacturer, meanwhile, OTG General main frame class driver (can change for non-universal equipment) is provided.
When OTG double-duty plants are worked in slave mode, the work of USB device stack.Device controller driver therein It is responsible for the data exchange of USB device stack and hardware end points, USB protocol layer is responsible for handling usb protocol specification, equipment class driver Function depend on the double-duty plant function (such as digital camera, storage device, printer).
OTG drivers are responsible for handling the working method conversion of dual-purpose OTG equipment, meanwhile, it can also return to its result (such as whether equipment supports HNP) and handle bus error.Application layer program is started or terminated a biography by OTG drivers Defeated affairs, data are exchanged by usb host stack or device stack with hardware layer.
OTG main frames and equipment are divided into functional layer, USB device layer and USB interface 3 different levels of layer, USB interface layer It is that OTG main frames and OTG equipment provide physical connection;USB system software comes managing main frame and USB device using console controller Data transfer.USB system software is for console controller, and processing is the data transfer and visitor observed with customer perspective Family is interacted with equipment.USB device layer provides an available logical device for USB host system software.Main frame passes through therewith The client software of function match realizes its various functions.
OTG equipment has two kinds of passages as conventional USB device:Data flow path and message channel.Data flow path The result not defined, and message channel then has fixed structure.But, each passage has certain bandwidth, transmission class Type, transmission direction and buffer size.Self Powered Device configures the control passage of an acquiescence, and the configuration of the equipment is provided by him With the information such as state.
When double-duty plant is connected to a Mini-A plug or Mini-B plugs, it accordingly just with OTG main frames or The default behavior work of person's OTG peripheral hardwares.A-device is default host, so providing VBUS power supplys by it, and is being detected Equipment access when reset bus, enumerate and configure B-device.
A-device, can be by inquiring about B-device OTG performance descriptors after use to B-device is completed To judge whether to support HNP agreements (whether being dual-purpose OTG equipment).HNP, B-device is such as supported to return to effective OTG Performance descriptor, Adevice then produces a Set_feature order (i.e. HNP_Enable) to notify that B-device can be Worked when bus suspension with host mode, subsequent A-device hanging up bus.
B-device drags down D+ to show that connection disconnects by pull-up resistor (during full speed) or pull down resistor (during high speed).With Afterwards, as the response disconnected to Bdevice, A-device is enabled its data wire and starts to be worked in slave mode.Complete this After a little conversions, B-device and Adevice just each use bus with host role and peripheral role.If the B-device belongs to In dual-purpose OTG equipment and A-device does not use it, A-device just retransmits Set_feature orders and hanging up bus. If B-device applies malfunctioning during role transforming, A-device then drags down VBUS to terminate the affairs.When B-device is normally tied Just VBUS is hung up during beam transmission transaction and enables its pull-up resistor, is run again in slave mode.A-device detects bus extension After rising, send a connection cut-off signal and worked again with host mode.
With continued reference to Fig. 4, the OTG connections control method can also include step S80, i.e., in first electronic equipment During second power electronic equipment, detect that the OTG of first electronic equipment and second electronic equipment connects Connect state;When first electronic equipment and second electronic equipment, which disconnect OTG, be connected, execution step S90, i.e., described the One electronic equipment is stopped power supply.
In a certain embodiment, the OTG connection status of first electronic equipment and second electronic equipment includes: First electronic equipment is connected with the OTG of the second electronic equipment have been disconnected, that is to say, that the first electronic equipment and the second electronic equipment Between off-state is converted to by connection status;The process of detection state now and foregoing detection the first electronic equipment and second The process whether electronic equipment sets up OTG connections is similar or opposite.
, it is necessary to realize the detection operation for whether setting up OTG connections by event detector in some specific embodiments, The event monitor receives event information from peripheral interface.Event information is included on subevent (for example, being used as OTG The pin of interface is triggered) information.
Correspondingly, can also be during first electronic equipment be to second power electronic equipment, i.e., two When electronic equipment OTG states do not change, perform step S30, judge first electronic equipment electricity whether be less than or Person is equal to predetermined threshold value;When the electricity of first electronic equipment is less than or equal to predetermined threshold value, step S40 is performed, is disconnected First electronic equipment is connected with the OTG of second electronic equipment.
That is, in data transmission procedure, still being detected to the electricity of power supply unit, so, it can supply The OTG connections of two electronic equipments are timely disconnected during low battery (when i.e. less than or equal to predetermined threshold value) of electric equipment, are stopped Only power, so as to be effectively protected the battery of electronic equipment, improve the service life of the battery of electronic equipment, improve simultaneously The experience of user.
In some embodiments, the OTG connections control method also includes:Disconnect first electronic equipment and institute When stating the OTG connections of the second electronic equipment, the prompting that OTG connections have disconnected is carried out.
In a certain embodiment, the Tip element can be realized for the display screen in existing electronic equipment.Example Such as when electronic equipment is smart mobile phone, the display device refers to the touch display screen on smart mobile phone, and electricity is worked as another example When sub- equipment is camera, what the display device referred to is exactly the display screen of camera.
In some embodiments, the OTG connections control method also includes:In first electronic equipment to described During two power electronic equipments, the OTG connection status of first electronic equipment and second electronic equipment is detected;Institute The first electronic equipment is stated to be additionally operable to, when being connected with second electronic equipment disconnection OTG, stop power supply.
In a certain embodiment, the OTG connection status of first electronic equipment and second electronic equipment includes: First electronic equipment is connected with the OTG of the second electronic equipment have been disconnected, that is to say, that the first electronic equipment and the second electronic equipment Between off-state is converted to by connection status;The process of detection state now and foregoing detection the first electronic equipment and second The process whether electronic equipment sets up OTG connections is similar or opposite.
, it is necessary to realize the detection operation for whether setting up OTG connections by event detector in some specific embodiments, The event monitor receives event information from peripheral interface.Event information is included on subevent (for example, being used as OTG The pin of interface is triggered) information.
In summary, the application OTG connections control method, OTG connection control devices and electronic equipment, are detecting power supply When the electricity of equipment is less than or equal to predetermined threshold value, the OTG connections of two electronic equipments are disconnected, so as to effectively avoid power supply There is the problem of putting in equipment, so as to influence the battery life of power supply unit;In addition, in the low battery of power supply unit, carrying out Prompting, so as to substantially increase the practicality of equipment and the experience of user.So, the application effectively overcomes of the prior art Various shortcoming and have high industrial utilization.
The principle and its effect of above-described embodiment only illustrative the application, not for limitation the application.It is any ripe Know the personage of this technology all can without prejudice to spirit herein and under the scope of, modifications and changes are carried out to above-described embodiment.Cause This, those of ordinary skill in the art is complete without departing from spirit disclosed herein and institute under technological thought such as Into all equivalent modifications or change, should be covered by claims hereof.

Claims (13)

1. a kind of OTG connections control method, it is characterised in that including:
Detect the first electronic equipment is connected with whether the second electronic equipment sets up OTG;
When first electronic equipment and second electronic equipment, which set up OTG, to be connected, first as power supply unit is judged Whether the electricity of electronic equipment is less than or equal to predetermined threshold value;
When the electricity of first electronic equipment is less than or equal to predetermined threshold value, first electronic equipment and described the are disconnected The OTG connections of two electronic equipments.
2. OTG connections control method according to claim 1, it is characterised in that also include:Disconnect first electronics When equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
3. OTG connections control method according to claim 1, it is characterised in that also include:When first electronic equipment Electricity be more than predetermined threshold value when, by the first electronic equipment as power supply unit to second power electronic equipment.
4. OTG connections control method according to claim 3, it is characterised in that also include:When first electronic equipment After second power electronic equipment, OTG agreements are installed, first electronic equipment enters line number with second electronic equipment According to transmission.
5. OTG connections control method according to claim 3, it is characterised in that also include:In first electronic equipment During to second power electronic equipment, judge whether the electricity of first electronic equipment is less than or equal to and preset Threshold value;
When the electricity of first electronic equipment is less than or equal to predetermined threshold value, first electronic equipment and described the are disconnected The OTG connections of two electronic equipments.
6. OTG connections control method according to claim 5, it is characterised in that also include:Disconnect first electronics When equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
7. a kind of OTG connections control device, it is characterised in that including:
OTG interfaces, for being connected with the second electronic equipment;
OTG connecting detection units, are connected with the OTG interfaces, for whether detecting the first electronic equipment and the second electronic equipment Set up OTG connections;
Electricity judging unit, is connected with OTG connecting detection units, for connecting as the OTG that sets up for receiving OTG connecting detection units When connecing, judge whether be less than or equal to predetermined threshold value as the electricity of the first electronic equipment of power supply unit;
Switching units, are connected with the electricity judging unit and OTG interfaces, for being less than when the electricity of first electronic equipment Or during equal to predetermined threshold value, disconnect first electronic equipment and be connected with the OTG of second electronic equipment.
8. OTG connections control device according to claim 7, it is characterised in that also include:Tip element, breaks with described Unit connection is opened, for when disconnection first electronic equipment is connected with the OTG of second electronic equipment, carrying out OTG companies Connect the prompting disconnected.
9. OTG connections control device according to claim 7, it is characterised in that when the electricity of first electronic equipment During more than predetermined threshold value, first electronic equipment is from the OTG interfaces to the second power electronic equipment.
10. OTG connections control device according to claim 9, it is characterised in that also include:Installation unit, it is and described OTG interfaces are connected, for after first electronic equipment is to second power electronic equipment, installing OTG agreements;Described One electronic equipment carries out data transmission with second electronic equipment.
11. OTG connections control device according to claim 9, it is characterised in that the electricity judging unit is additionally operable to During first electronic equipment is to second power electronic equipment, judge first electronic equipment electricity whether Less than or equal to predetermined threshold value;The switching units are additionally operable to preset when the electricity of first electronic equipment is less than or equal to During threshold value, disconnect first electronic equipment and be connected with the OTG of second electronic equipment.
12. OTG connections control device according to claim 11, it is characterised in that Tip element is used for described in disconnection When first electronic equipment is connected with the OTG of second electronic equipment, the prompting that OTG connections have disconnected is carried out.
13. a kind of electronic equipment, it is characterised in that including:OTG connections control dress as described in claim any one of 7-12 Put.
CN201710466586.4A 2017-06-20 2017-06-20 OTG connections control method, OTG connection control devices and electronic equipment Pending CN107153456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710466586.4A CN107153456A (en) 2017-06-20 2017-06-20 OTG connections control method, OTG connection control devices and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710466586.4A CN107153456A (en) 2017-06-20 2017-06-20 OTG connections control method, OTG connection control devices and electronic equipment

Publications (1)

Publication Number Publication Date
CN107153456A true CN107153456A (en) 2017-09-12

Family

ID=59796747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710466586.4A Pending CN107153456A (en) 2017-06-20 2017-06-20 OTG connections control method, OTG connection control devices and electronic equipment

Country Status (1)

Country Link
CN (1) CN107153456A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108023376A (en) * 2017-11-08 2018-05-11 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108430000A (en) * 2018-04-13 2018-08-21 广东小天才科技有限公司 A kind of method, microphone apparatus and system based on electricity management and control microphone apparatus
CN112491562A (en) * 2020-11-18 2021-03-12 惠州Tcl移动通信有限公司 Communication control method and device and mobile terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
CN202076771U (en) * 2011-04-29 2011-12-14 比亚迪股份有限公司 USB OTG circuit and portable electronic device utilizing thereof
CN104777891A (en) * 2015-04-13 2015-07-15 广东欧珀移动通信有限公司 OTG (on-the-go) connecting control method applied to intelligent terminal and connecting control device
CN105680510A (en) * 2016-01-29 2016-06-15 宇龙计算机通信科技(深圳)有限公司 Charging control method and charging control device used for electronic equipment
CN105790349A (en) * 2016-01-27 2016-07-20 努比亚技术有限公司 Mutual charging control method and device for mobile terminals
CN106655358A (en) * 2016-11-29 2017-05-10 努比亚技术有限公司 Charging control apparatus and method used between mobile terminals

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
CN202076771U (en) * 2011-04-29 2011-12-14 比亚迪股份有限公司 USB OTG circuit and portable electronic device utilizing thereof
CN104777891A (en) * 2015-04-13 2015-07-15 广东欧珀移动通信有限公司 OTG (on-the-go) connecting control method applied to intelligent terminal and connecting control device
CN105790349A (en) * 2016-01-27 2016-07-20 努比亚技术有限公司 Mutual charging control method and device for mobile terminals
CN105680510A (en) * 2016-01-29 2016-06-15 宇龙计算机通信科技(深圳)有限公司 Charging control method and charging control device used for electronic equipment
CN106655358A (en) * 2016-11-29 2017-05-10 努比亚技术有限公司 Charging control apparatus and method used between mobile terminals

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘波文,黎胜容: "《ARM嵌入式项目开发三位一体实战精讲》", 北京航空航天大学出版社, pages: 157 - 159 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108023376A (en) * 2017-11-08 2018-05-11 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108023376B (en) * 2017-11-08 2021-10-22 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108430000A (en) * 2018-04-13 2018-08-21 广东小天才科技有限公司 A kind of method, microphone apparatus and system based on electricity management and control microphone apparatus
CN108430000B (en) * 2018-04-13 2021-07-23 广东小天才科技有限公司 Method for managing and controlling microphone equipment based on electric quantity, microphone equipment and system
CN112491562A (en) * 2020-11-18 2021-03-12 惠州Tcl移动通信有限公司 Communication control method and device and mobile terminal

Similar Documents

Publication Publication Date Title
TWI421670B (en) Interface unit,interfacing system method and power management controller
CN102662898B (en) Host-slave compatibility method, device and system for USB (universal serial bus) device
CN106786960B (en) Charge control method, device and terminal
CN105183679B (en) A kind of electronic equipment and information processing method
CN110231861A (en) For providing the method and apparatus of power to electronic equipment
CN108920397B (en) Device identification method and device, storage medium and electronic device
CN106571657A (en) Terminal, converter and connection conversion system and method
CN102981916B (en) A kind of mobile terminal and control method thereof and device
EP1139226A1 (en) Method of emulating an attachment and detachment of a USB device
US20140280960A1 (en) Methods and apparatus for dynamically allocating devices between multiple controllers
CN105677420A (en) Method and device for interface pin configuration
CN108228509A (en) A kind of USB interface switching device and electronic equipment
CN104054064B (en) Flexible port configuration based on interface coupling
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
CN112799985B (en) USB interface control method, USB control circuit and intelligent networking equipment mainboard
CN107153456A (en) OTG connections control method, OTG connection control devices and electronic equipment
CN108073537A (en) Usb circuit, the implementation method of USB interface and device
CN105677596B (en) Control method and electronic equipment
CN108563537A (en) A kind of USB principals and subordinates detection device and method
CN101339542B (en) Data transmission device, control circuit chip and operation mode control method
US8990461B2 (en) On-The-Go (OTG) USB devices configuration method for identifying configuration of other connected devices by reacting to change in resistance value on a resistive line
TW201327126A (en) Auto-detection control device and method thereof
WO2018004755A1 (en) Connection cable with voltage level indicator
CN106451628A (en) OTG charging control circuit and charging control method
CN206788792U (en) OTG connection control devices and electronic equipment

Legal Events

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