CN109101447A - A kind of method and terminal that OTG function executes parallel with charge function - Google Patents
A kind of method and terminal that OTG function executes parallel with charge function Download PDFInfo
- Publication number
- CN109101447A CN109101447A CN201810785474.XA CN201810785474A CN109101447A CN 109101447 A CN109101447 A CN 109101447A CN 201810785474 A CN201810785474 A CN 201810785474A CN 109101447 A CN109101447 A CN 109101447A
- Authority
- CN
- China
- Prior art keywords
- interface
- otg
- data
- connection
- management module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
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)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
The present embodiments relate to power technique fields, a kind of method and terminal executed parallel more particularly to OTG function and charge function, the connection direction of OTG cable is detected by power management module, and then power management module is separately connected the preset OTG power supply interface of OTG cable and OTG communication interface according to the data-interface of the preset OTG power supply interface of connection direction controlling itself and CPU, to which the equipment with OTG function for realizing that terminal is connect with OTG cable carries out OTG communication, namely realize OTG function, in addition, power management module connects the preset charging interface of OTG cable also according to the preset charging interface of connection direction controlling itself, realize charge function, so that the OTG function and charge function of terminal can be performed simultaneously, solve terminal can not support OTG function and The problem of charge function is performed simultaneously.
Description
Technical field
The present embodiments relate to power technique fields, and in particular to what a kind of OTG function and charge function executed parallel
Method and terminal.
Background technique
With the development of science and technology, the mobile terminals such as smart phone, tablet computer or other portable products already become personal
The center of information, mobile terminal is functionally stronger and stronger, and OTG (On The Go) function is also primary demand, OTG function
I.e. in the case where no computer is as transfer, mobile terminal is directly connected into USB flash disk, card reader, keyboard, camera and/or printer
Equal external equipments carry out data exchange, and therefore, mobile terminal is supported the identification of storage equipment and used.
Currently, charge function is not supported when OTG function is used in mobile terminal, alternatively, mobile terminal is charging
When, OTG function is not supported.
The description of the above-mentioned discovery procedure to problem, is only used to facilitate the understanding of the technical scheme, and does not represent and holds
Recognizing above content is the prior art.
Summary of the invention
In order to solve the above-mentioned technical problem or it at least is partially solved above-mentioned technical problem, the embodiment of the invention provides
A kind of method and terminal that OTG function executes parallel with charge function.
In view of this, in a first aspect, the embodiment of the present invention provides a kind of side that OTG function executes parallel with charge function
Method is applied to terminal, which includes: power management module and interface module, which comprises
Whether the interface module of power management module detection terminal connects OTG cable;
If the power management module detects the interface module connection OTG cable of terminal, the OTG cable is judged
Connect direction;
The power management module according to the connection direction, control itself preset first OTG power supply interface with it is described
The preset 2nd OTG power supply interface connection of OTG cable, and control CPU data-interface and the preset OTG of OTG cable it is logical
Believe interface connection, and controls itself preset first charging interface and connect with preset second charging interface of the OTG cable.
Optionally, the method also includes:
The power management module controls itself preset data-interface and the OTG cable according to the connection direction
Preset charging communication interface connection.
Optionally, the method also includes:
The power management module detects whether the OTG cable connects equipment for charging;
If detecting equipment of the OTG cable connection for charging, the power management module determines charge type;
If it is determined that charge type is USB charging, then the power management module judges that the current data of the OTG cable are logical
Believe whether type is usb communication, if usb communication, then according to the connection direction, controls data-interface and the institute of the CPU
The connection stated between the preset OTG communication interface of OTG cable disconnects, and controls the data-interface and the OTG cable of the CPU
Preset charging communication interface is connected.
Optionally, the method also includes:
If it is determined that charge type is USB charging, then the data communications requests queue of the OTG cable is obtained;
Correspondingly, the power management module judges whether the current type of data communication of the OTG cable is USB logical
Letter, comprising: the power management module judges that the data to make number one in the data communications requests queue of the OTG cable are logical
Whether letter request is usb communication request, if so, determining that current type of data communication is usb communication.
Optionally, the interface module is TypeC USB socket;
Correspondingly, whether the interface module of the power management module detection terminal connects OTG cable, comprising: the electricity
Whether the TypeC USB plug of OTG cable is inserted into the TypeC USB socket of source control module detection terminal;
Correspondingly, the method also includes: if detecting, terminal connects OTG cable, power management module detection
The first passage configuration CC1 interface voltage and second channel of the TypeC USB socket configure CC2 interface voltage;
Correspondingly, the power management module judges the connection direction of the OTG cable, comprising: the power management mould
Block is based on the CC1 interface voltage and the CC2 interface voltage, judges the connection direction of the TypeC USB plug.
Optionally, the power management module is based on the CC1 interface voltage and the CC2 interface voltage, judges institute
State the connection direction of TypeC USB plug, comprising:
If the CC1 interface voltage is in preset first voltage range, the company of the TypeC USB plug is determined
Direction is connect as forward direction;
If the CC2 interface voltage is in the first voltage range, the connection of the TypeC USB plug is determined
Direction is reversed.
Optionally, the power management module controls itself preset first OTG power supply interface according to the connection direction
Connect with the preset 2nd OTG power supply interface of the OTG cable, and control CPU data-interface and the OTG cable it is preset
The connection of OTG communication interface, and control itself preset first charging interface and preset second charging interface of the OTG cable
Connection, comprising:
The power management module adjusts the connection side inside the switch module Switch of terminal according to the connection direction
Formula so that the first OTG power supply interface is connected by the Switch with the 2nd OTG power supply interface, and makes described
The data-interface of CPU is connected by the Switch with the OTG communication interface, and first charging interface is made to pass through institute
Switch is stated to be connected with second charging interface.
Optionally, the power management module adjusts inside the switch module Switch of terminal according to the connection direction
Connection type, comprising:
If the connection direction is positive to the power management module controls itself preset switch module control interface
The universal input/output interface for exporting low level and the control CPU exports low level, so that the connection inside the Switch
Mode is the first connection type;
Wherein, the switch module control interface is connect with the preset first switch interface SW0 of the Switch, described
The universal input/output interface of CPU is connect with the preset second switch interface SW3 of the Switch;The Switch includes:
One power interface Vbus1a, the first data-interface, second source interface Vbus2a, the second data-interface, third power interface
Vbus1, third data-interface, the 4th power interface Vbus2 and the 4th data-interface;
Wherein, the first power interface Vbus1a is connected with the first charging interface of the power management module, institute
The first data-interface is stated to be connected with the preset data-interface of the power management module, the second source interface Vbus2a with
First OTG power supply interface of the power management module is connected, the data-interface phase of second data-interface and the CPU
Connection, the third power interface Vbus1 is connected with the first power interface Vbus1 of the TypeC USB socket, and described the
Three data-interfaces are connected with the first data-interface of the TypeC USB socket, the 4th power interface Vbus2 with it is described
The second source interface Vbus2 of TypeC USB socket is connected, the 4th data-interface and the TypeC USB socket
Second data-interface is connected;
Wherein, first connection type are as follows: the first power interface Vbus1a connection the 4th power interface
Vbus2, first data-interface connect the 4th data-interface, the second source interface Vbus2a connection third
Power interface Vbus1, second data-interface connect the third data-interface;
Wherein, the first power interface Vbus1 of the TypeC USB socket and preset 2nd OTG of the OTG cable are supplied
Electrical interface connection, the first data-interface of the TypeC USB socket are connect with the preset OTG communication interface of the OTG cable,
The second source interface Vbus2 of the TypeC USB socket is connect with preset second charging interface of the OTG cable, described
Second data-interface of TypeC USB socket is connect with the preset charging communication interface of the OTG cable.
Optionally, the power management module adjusts inside the switch module Switch of terminal according to the connection direction
Connection type, further includes:
If the connection direction be it is reversed, the power management module controls itself preset switch module control interface
The universal input/output interface for exporting high level and the control CPU exports low level, so that the connection inside the Switch
Mode is the second connection type;
Wherein, second connection type are as follows: the first power interface Vbus1a connection third power interface
Vbus1, first data-interface connect the third data-interface, the second source interface Vbus2a connection the described 4th
Power interface Vbus2, second data-interface connect the 4th data-interface;
Wherein, the first power interface Vbus1 of the TypeC USB socket and preset second charging of the OTG cable
Interface connection, the first data-interface of the TypeC USB socket are connect with the preset charging communication interface of the OTG cable,
The second source interface Vbus2 of the TypeC USB socket is connect with the preset 2nd OTG power supply interface of the OTG cable, institute
The second data-interface for stating TypeC USB socket is connect with the preset OTG communication interface of the OTG cable.
Optionally, the method also includes:
The power management module detects whether the OTG cable connects equipment for charging;
If detecting equipment of the OTG cable connection for charging, the power management module determines charge type;
If it is determined that charge type is USB charging, then the power management module judges that the current data of the OTG cable are logical
Believe whether type is usb communication, if usb communication and the connection direction is positive to then the power management module controls certainly
The universal input/output interface of the preset switch module control interface output low level of body and the control CPU export high level,
So that the connection type inside the Switch is third connection type;
Wherein, the third connection type are as follows: the first power interface Vbus1a connection the 4th power interface
Vbus2, first data-interface connect the 4th data-interface, the second source interface Vbus2a connection third
Power interface Vbus1, second data-interface connect the 4th data-interface.
Optionally, the power management module detects whether the OTG cable connects equipment for charging, comprising:
The power management module detects the voltage of itself preset first charging interface;
The power management module judges whether the voltage is within the scope of preset second voltage, if so, determining
Equipment of the OTG cable connection for charging.
Optionally, the method also includes:
If it is determined that charge type is USB charging, then the power management module judges that the current data of the OTG cable are logical
Believe whether type is usb communication, if usb communication and the connection direction be it is reversed, then the power management module controls oneself
The universal input/output interface of the preset switch module control interface output high level of body and the control CPU export high level,
So that the connection type inside the Switch is the 4th connection type;
Wherein, the 4th connection type are as follows: the first power interface Vbus1a connection third power interface
Vbus1, first data-interface connect the third data-interface, the second source interface Vbus2a connection the described 4th
Power interface Vbus2, second data-interface connect the third data-interface.
Second aspect, the embodiment of the present invention also provide a kind of terminal, comprising: power management module, CPU and interface mould
Block;
The power management module includes: the first OTG power supply interface and the first charging interface;
The power management module, is used for: detecting whether the interface module connects OTG cable;If detecting described connect
Mouth mold block connects OTG cable, then judges the connection direction of the OTG cable;According to the connection direction, control described first
OTG power supply interface is connect with the preset 2nd OTG power supply interface of the OTG cable, and controls data-interface and the institute of the CPU
State the preset OTG communication interface connection of OTG cable, and control first charging interface and the OTG cable preset the
The connection of two charging interfaces.
Optionally, the power management module is also used to control itself preset data-interface according to the connection direction
It is connect with the preset charging communication interface of the OTG cable.
Optionally, the power management module, is also used to:
Detect whether the OTG cable connects equipment for charging;If detecting the OTG cable connection for charging
Equipment, it is determined that charge type;If it is determined that charge type is USB charging, then the current data communication of the OTG cable is judged
Whether type is usb communication, if usb communication, then according to the connection direction, control the data-interface of the CPU with it is described
Connection between the preset OTG communication interface of OTG cable disconnects, and control the CPU data-interface and the OTG cable it is pre-
If charging communication interface be connected.
Optionally, the power management module, is also used to: if it is determined that charge type is USB charging, then obtaining the OTG
The data communications requests queue of cable;
Correspondingly, the power management module judges whether the current type of data communication of the OTG cable is USB logical
Letter, comprising: the power management module judges that the data to make number one in the data communications requests queue of the OTG cable are logical
Whether letter request is usb communication request, if so, determining that current type of data communication is usb communication.
Optionally, the interface module is TypeC USB socket;
Correspondingly, the power management module detects whether the interface module connects OTG cable, comprising: the power supply
Whether the TypeC USB plug of OTG cable is inserted into the TypeC USB socket of management module detection terminal;
Correspondingly, the power management module, is also used to: if detecting the interface module connection OTG cable, detecting
The first passage configuration CC1 interface voltage and second channel of the TypeC USB socket configure CC2 interface voltage;
Correspondingly, the power management module judges the connection direction of the OTG cable, comprising: the power management mould
Block is based on the CC1 interface voltage and the CC2 interface voltage, judges the connection direction of the TypeC USB plug.
Optionally, the power management module is based on the CC1 interface voltage and the CC2 interface voltage, judges institute
State the connection direction of TypeC USB plug, comprising:
If the CC1 interface voltage is in preset first voltage range, the company of the TypeC USB plug is determined
Direction is connect as forward direction;
If the CC2 interface voltage is in the first voltage range, the connection of the TypeC USB plug is determined
Direction is reversed.
Optionally, the terminal further include: switch module Switch;
Correspondingly, the power management module is according to the connection direction, control the first OTG power supply interface with it is described
The preset 2nd OTG power supply interface connection of OTG cable, and control CPU data-interface and the preset OTG of OTG cable it is logical
Believe that interface connection, and control first charging interface are connect with preset second charging interface of the OTG cable, comprising:
The power management module adjusts the connection type inside the Switch according to the connection direction, so that institute
It states the first OTG power supply interface and is connected by the Switch with the 2nd OTG power supply interface, and make the data of the CPU
Interface is connected by the Switch with the OTG communication interface, and first charging interface is made to pass through the Switch
It is connected with second charging interface.
Optionally, the power management module includes: switch module control interface;
The Switch includes: first switch interface SW0, second switch interface SW3, the first power interface Vbus1a,
One data-interface, second source interface Vbus2a, the second data-interface, third power interface Vbus1, third data-interface,
Four power interface Vbus2 and the 4th data-interface;
The switch module control interface is connect with the first switch interface SW0, and the universal input output of the CPU connects
Mouth is connect with the second switch interface SW3;The first power interface Vbus1a is filled with the first of the power management module
Electrical interface is connected, and first data-interface is connected with the preset data-interface of the power management module, and described second
Power interface Vbus2a is connected with the first OTG power supply interface of the power management module, second data-interface and institute
The data-interface for stating CPU is connected, the first power interface of the third power interface Vbus1 and the TypeC USB socket
Vbus1 is connected, and the third data-interface is connected with the first data-interface of the TypeC USB socket, and the described 4th
Power interface Vbus2 is connected with the second source interface Vbus2 of the TypeC USB socket, the 4th data-interface with
Second data-interface of the TypeC USB socket is connected;
If the connection direction is positive to the first power interface Vbus1 and the OTG of the TypeC USB socket
The preset 2nd OTG power supply interface connection of cable, the first data-interface of the TypeC USB socket and the OTG cable are pre-
If the connection of OTG communication interface, the second source interface Vbus2 of the TypeC USB socket and the OTG cable preset the
The connection of two charging interfaces, the second data-interface of the TypeC USB socket and the preset charging communication interface of the OTG cable
Connection;
Correspondingly, the power management module adjusts inside the switch module Switch of terminal according to the connection direction
Connection type, comprising: if the connection direction is positive to the power management module controls the switch module control and connects
The universal input/output interface of mouth output low level and the control CPU export low level, so that the company inside the Switch
Connecing mode is the first connection type;
Wherein, first connection type are as follows: the first power interface Vbus1a connection the 4th power interface
Vbus2, first data-interface connect the 4th data-interface, the second source interface Vbus2a connection third
Power interface Vbus1, second data-interface connect the third data-interface.
Optionally, if the connection direction be it is reversed, the first power interface Vbus1 of the TypeC USB socket with
The preset second charging interface connection of OTG cable, the first data-interface of the TypeC USB socket and the OTG line
The preset charging communication interface connection of cable, the second source interface Vbus2 of the TypeC USB socket and the OTG cable are pre-
If the connection of the 2nd OTG power supply interface, the second data-interface of the TypeC USB socket and the preset OTG of OTG cable
Communication interface connection;
Correspondingly, the power management module adjusts inside the switch module Switch of terminal according to the connection direction
Connection type, further includes:
If the connection direction be it is reversed, the power management module controls itself preset switch module control interface
The universal input/output interface for exporting high level and the control CPU exports low level, so that the connection inside the Switch
Mode is the second connection type;
Wherein, second connection type are as follows: the first power interface Vbus1a connection third power interface
Vbus1, first data-interface connect the third data-interface, the second source interface Vbus2a connection the described 4th
Power interface Vbus2, second data-interface connect the 4th data-interface.
Optionally, the power management module, is also used to: detecting whether the OTG cable connects equipment for charging;
If detecting equipment of the OTG cable connection for charging, it is determined that charge type;If it is determined that charge type is USB charging,
Then judge whether the current type of data communication of the OTG cable is usb communication, if usb communication and the connection direction is
Forward direction, then the universal input output for controlling itself preset switch module control interface output low level and the control CPU connect
Mouth output high level, so that the connection type inside the Switch is third connection type;
Wherein, the third connection type are as follows: the first power interface Vbus1a connection the 4th power interface
Vbus2, first data-interface connect the 4th data-interface, the second source interface Vbus2a connection third
Power interface Vbus1, second data-interface connect the 4th data-interface.
Optionally, the power management module detects whether the OTG cable connects equipment for charging, comprising:
The power management module detects the voltage of itself preset first charging interface;
The power management module judges whether the voltage is within the scope of preset second voltage, if so, determining
Equipment of the OTG cable connection for charging.
Optionally, the power management module, is also used to: if it is determined that charge type is USB charging, then judging the OTG
Whether the current type of data communication of cable is usb communication, if usb communication and the connection direction be it is reversed, then control from
The universal input/output interface of the preset switch module control interface output high level of body and the control CPU export high level,
So that the connection type inside the Switch is the 4th connection type;
Wherein, the 4th connection type are as follows: the first power interface Vbus1a connection third power interface
Vbus1, first data-interface connect the third data-interface, the second source interface Vbus2a connection the described 4th
Power interface Vbus2, second data-interface connect the third data-interface.
Compared with prior art, the method and terminal that the OTG function and charge function that the embodiment of the present invention proposes execute parallel,
The connection direction of OTG cable is detected by power management module, and then power management module is pre- according to connection direction controlling itself
If OTG power supply interface and the data-interface of CPU be separately connected the preset OTG power supply interface of OTG cable and OTG communication interface,
To which the equipment with OTG function for realizing that terminal is connect with OTG cable carries out OTG communication, namely OTG function is realized, separately
Outside, power management module connects the preset charging interface of OTG cable also according to the preset charging interface of connection direction controlling itself,
Realize charge function so that the OTG function and charge function of terminal can be performed simultaneously, solve terminal can not support OTG function and
The problem of charge function is performed simultaneously.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be in embodiment or description of the prior art
Required attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some realities of the invention
Example is applied, it for those of ordinary skill in the art, without any creative labor, can also be attached according to these
Figure obtains other attached drawings.
The hardware configuration signal of Fig. 1 each embodiment one optional mobile terminal to realize the present invention;
Fig. 2 is the communication system schematic diagram of mobile terminal in Fig. 1;
Fig. 3 is the process for the method that a kind of OTG function provided by one embodiment of the present invention executes parallel with charge function
Figure;
Fig. 4 is a kind of terminal structure schematic diagram that another embodiment of the present invention provides;
Fig. 5 is a kind of terminal structure schematic diagram that another embodiment of the invention provides;
Fig. 6 is the end that connection type inside a kind of Switch provided by one embodiment of the present invention is the first connection type
End structure schematic diagram;
Fig. 7 is the end that connection type inside a kind of Switch provided by one embodiment of the present invention is third connection type
End structure schematic diagram;
Fig. 8 is the end that connection type inside a kind of Switch provided by one embodiment of the present invention is the second connection type
End structure schematic diagram;
Fig. 9 is the end that connection type inside a kind of Switch provided by one embodiment of the present invention is the 4th connection type
End structure schematic diagram.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiments of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The executing subject for the method that OTG function disclosed in the present embodiment and charge function execute parallel is power management mould
Block, the power management module can be set in the terminal, and terminal may include such as mobile phone, smart phone, notebook electricity
Brain, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), is led at digit broadcasting receiver
Navigate the mobile terminal of device etc. and the fixed terminal of such as number TV, desktop computer, printer etc..Hereinafter it is assumed that
Terminal is mobile terminal.However, it will be understood by those skilled in the art that other than the element for being used in particular for mobile purpose,
The construction of embodiment according to the present invention can also apply to the terminal of fixed type.
The hardware structural diagram of Fig. 1 mobile terminal of each embodiment to realize the present invention.
Mobile terminal 100 may include wireless communication unit 110, A/V (audio/video) input unit 120, user's input
Unit 130, sensing unit 140, output unit 150, memory 160, interface unit 170, controller 180 and power supply unit 190
Etc..Fig. 1 shows the mobile terminal with various assemblies, it should be understood that being not required for implementing all groups shown
Part.More or fewer components can alternatively be implemented.The element of mobile terminal will be discussed in more detail below.
Wireless communication unit 110 generally includes one or more components, allows mobile terminal 100 and wireless communication system
Or the radio communication between network.For example, wireless communication unit may include broadcasting reception module 111, mobile communication module
112, at least one of wireless Internet module 113, short range communication module 114 and location information module 115.
Broadcasting reception module 111 receives broadcast singal and/or broadcast from external broadcast management server via broadcast channel
Relevant information.Broadcast channel may include satellite channel and/or terrestrial channel.Broadcast management server, which can be, to be generated and sent
The broadcast singal and/or broadcast related information generated before the server or reception of broadcast singal and/or broadcast related information
And send it to the server of terminal.Broadcast singal may include TV broadcast singal, radio signals, data broadcasting
Signal etc..Moreover, broadcast singal may further include the broadcast singal combined with TV or radio signals.Broadcast phase
Closing information can also provide via mobile communications network, and in this case, broadcast related information can be by mobile communication mould
Block 112 receives.Broadcast singal can exist in a variety of manners, for example, it can be with the electronics of digital multimedia broadcasting (DMB)
Program guide (EPG), digital video broadcast-handheld (DVB-H) electronic service guidebooks (ESG) etc. form and exist.Broadcast
Receiving module 111 can receive signal broadcast by using various types of broadcast systems.Particularly, broadcasting reception module 111
It can be wide by using such as multimedia broadcasting-ground (DMB-T), digital multimedia broadcasting-satellite (DMB-S), digital video
It broadcasts-holds (DVB-H), the Radio Data System of forward link media (MediaFLO), received terrestrial digital broadcasting integrated service
(ISDB-T) etc. digit broadcasting system receives digital broadcasting.Broadcasting reception module 111, which may be constructed such that, to be adapted to provide for extensively
Broadcast the various broadcast systems and above-mentioned digit broadcasting system of signal.Via the received broadcast singal of broadcasting reception module 111 and/
Or broadcast related information can store in memory 160 (or other types of storage medium).
Mobile communication module 112 sends radio signals to base station (for example, access point, node B etc.), exterior terminal
And at least one of server and/or receive from it radio signal.Such radio signal may include that voice is logical
Talk about signal, video calling signal or according to text and/or Multimedia Message transmission and/or received various types of data.
The Wi-Fi (Wireless Internet Access) of the support mobile terminal of wireless Internet module 113.The module can be internally or externally
It is couple to terminal.Wi-Fi (Wireless Internet Access) technology involved in the module may include WLAN (Wireless LAN) (Wi-Fi), Wibro
(WiMAX), Wimax (worldwide interoperability for microwave accesses), HSDPA (high-speed downlink packet access) etc..
Short range communication module 114 is the module for supporting short range communication.Some examples of short-range communication technology include indigo plant
Tooth TM, radio frequency identification (RFID), Infrared Data Association (IrDA), ultra wide band (UWB), purple honeybee TM etc..
Location information module 115 is the module for checking or obtaining the location information of mobile terminal.Location information module
Typical case be GPS (global positioning system).According to current technology, the calculating of location information module 115 is from three or more
The range information and correct time information of more satellites and Information application triangulation for calculating, thus according to warp
Degree, latitude and highly accurately calculate three-dimensional current location information.Currently, it is used for the method for calculating position and temporal information
Three satellites and the error that calculated position and temporal information are corrected by using an other satellite.In addition, position
Information module 115 can be by Continuous plus current location information in real time come calculating speed information.
A/V input unit 120 is for receiving audio or video signal.A/V input unit 120 may include 121 He of camera
Microphone 122, camera 121 is to the static images obtained in video acquisition mode or image capture mode by image capture apparatus
Or the image data of video is handled.Treated, and picture frame may be displayed on display unit 151.It is handled through camera 121
Picture frame afterwards can store in memory 160 (or other storage mediums) or be sent out via wireless communication unit 110
It send, two or more cameras 121 can be provided according to the construction of mobile terminal.Microphone 122 can telephone calling model,
Sound (audio data) is received via microphone 122 in logging mode, speech recognition mode etc. operational mode, and can be incited somebody to action
Such acoustic processing is audio data.Audio that treated (voice) data can be converted in the case where telephone calling model
For the format output that can be sent to mobile communication base station via mobile communication module 112.Various types can be implemented in microphone 122
Noise eliminate (or inhibit) algorithm with eliminate noise that (or inhibition) generates during sending and receiving audio signal or
Person's interference.
The order that user input unit 130 can be inputted according to user generates key input data to control each of mobile terminal
Kind operation.User input unit 130 allows user to input various types of information, and may include keyboard, metal dome, touch
Plate (for example, the sensitive component of detection due to the variation of resistance, pressure, capacitor etc. caused by being contacted), idler wheel, rocking bar etc.
Deng.Particularly, when touch tablet is superimposed upon in the form of layer on display unit 151, touch screen can be formed.
Sensing unit 140 detects the current state of mobile terminal 100, (for example, mobile terminal 100 opens or closes shape
State), the position of mobile terminal 100, user is for the presence or absence of contact (that is, touch input) of mobile terminal 100, mobile terminal
100 orientation, the acceleration or deceleration movement of mobile terminal 100 and direction etc., and generate for controlling mobile terminal 100
The order of operation or signal.For example, sensing unit 140 can sense when mobile terminal 100 is embodied as sliding-type mobile phone
The sliding-type phone is to open or close.In addition, sensing unit 140 be able to detect power supply unit 190 whether provide electric power or
Whether person's interface unit 170 couples with external device (ED).Sensing unit 140 may include proximity sensor 141.
Interface unit 170 is used as mobile terminal 100 and connect at least one external device (ED).For example, external device (ED) can wrap
Include wired or wireless headphone port, external power supply (or battery charger) port, wired or wireless data port, storage
Card port, port, the port audio input/output (I/O), video i/o port, ear for connecting the device with identification module
Generator terminal mouth etc..Identification module can be storage for verifying user using the various information of mobile terminal 100 and can wrap
Include subscriber identification module (UIM), client identification module (SIM), Universal Subscriber identification module (USIM) etc..Know in addition, having
The device (hereinafter referred to as " identification device ") of other module can take the form of smart card, and therefore, identification device can be via end
Mouth or other attachment devices are connect with mobile terminal 100.Interface unit 170 can be used for receiving the input from external device (ED)
(for example, data information, electric power etc.) and the input received is transferred to one or more elements in mobile terminal 100
Or it can be used for transmitting data between mobile terminal and external device (ED).In addition, when mobile terminal 100 is connect with external base
When, interface unit 170 may be used as allowing by its by electric power from pedestal provide to mobile terminal 100 path or can use
Make the various command signals for allowing to input from pedestal and passes through its path for being transferred to mobile terminal.The various orders inputted from pedestal
Signal or electric power may be used as whether mobile terminal for identification is accurately fitted within the signal on pedestal.
Output unit 150 is configured to provide output signal with vision, audio and/or tactile manner (for example, audio is believed
Number, vision signal, alarm signal, vibration signal etc.).Output unit 150 may include display unit 151, audio output mould
Block 152, alarm unit 153 etc..
Display unit 151 may be displayed on the information handled in mobile terminal 100.For example, when mobile terminal 100 is in electricity
When talking about call mode, display unit 151 can show and converse or other communicate (for example, text messaging, multimedia file
Downloading etc.) relevant user interface (UI) or graphic user interface (GUI).When mobile terminal 100 is in video calling mode
Or when image capture mode, display unit 151 can show captured image and/or received image, show video or figure
Picture and the UI or GUI of correlation function etc..
Meanwhile when display unit 151 and touch tablet in the form of layer it is superposed on one another to form touch screen when, display unit
151 may be used as input unit and output device.Display unit 151 may include liquid crystal display (LCD), thin film transistor (TFT)
In LCD (TFT-LCD), Organic Light Emitting Diode (OLED) display, flexible display, three-dimensional (3D) display etc. at least
It is a kind of.Some in these displays may be constructed such that transparence to allow user to watch from outside, this is properly termed as transparent
Display, typical transparent display can be, for example, TOLED (transparent organic light emitting diode) display etc..According to specific
Desired embodiment, mobile terminal 100 may include two or more display units (or other display devices), for example, moving
Dynamic terminal may include outernal display unit (not shown) and inner display unit (not shown).Touch screen can be used for detecting touch
Input pressure and touch input position and touch input area.
Audio output module 152 can mobile terminal be in call signal reception pattern, call mode, logging mode,
It is when under the isotypes such as speech recognition mode, broadcast reception mode, wireless communication unit 110 is received or in memory 160
The audio data transducing audio signal of middle storage and to export be sound.Moreover, audio output module 152 can provide and movement
The relevant audio output of specific function (for example, call signal receives sound, message sink sound etc.) that terminal 100 executes.
Audio output module 152 may include loudspeaker, buzzer etc..
Alarm unit 153 can provide output, and event is notified to mobile terminal 100.Typical event can
To include calling reception, message sink, key signals input, touch input etc..Other than audio or video output, alarm list
Member 153 can provide output in different ways with the generation of notification event.For example, alarm unit 153 can be with the shape of vibration
Formula provides output, when receiving calling, message or some other entrance communications (incoming communication), alarm
Unit 153 can provide tactile output (that is, vibration) to notify to user.By providing such tactile output, even if
When the mobile phone of user is in the pocket of user, user also can recognize that the generation of various events.Alarm unit 153
The output of the generation of notification event can also be provided via display unit 151 or audio output module 152.
Memory 160 can store the software program etc. of the processing and control operation that are executed by controller 180, Huo Zheke
Temporarily to store oneself data (for example, telephone directory, message, still image, video etc.) through exporting or will export.And
And memory 160 can store about the vibrations of various modes and audio signal exported when touching and being applied to touch screen
Data.
Memory 160 may include the storage medium of at least one type, and the storage medium includes flash memory, hard disk, more
Media card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random-access storage
Device (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read only memory
(PROM), magnetic storage, disk, CD etc..Moreover, mobile terminal 100 can execute memory with by network connection
The network storage device of 160 store function cooperates.
The overall operation of the usually control mobile terminal of controller 180.For example, controller 180 executes and voice communication, data
Communication, video calling etc. relevant control and processing.In addition, controller 180 may include for reproducing (or playback) more matchmakers
The multi-media module 181 of volume data, multi-media module 181 can construct in controller 180, or can be structured as and control
Device 180 separates.Controller 180 can be with execution pattern identifying processing, by the handwriting input executed on the touchscreen or picture
It draws input and is identified as character or image.
Power supply unit 190 receives external power or internal power under the control of controller 180 and provides operation each member
Electric power appropriate needed for part and component.
Various embodiments described herein can be to use the calculating of such as computer software, hardware or any combination thereof
Machine readable medium is implemented.Hardware is implemented, embodiment described herein can be by using application-specific IC
(ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), scene can
Programming gate array (FPGA), controller, microcontroller, microprocessor, is designed to execute function described herein processor
At least one of electronic unit is implemented, and in some cases, such embodiment can be implemented in controller 180.
For software implementation, the embodiment of such as process or function can with allow to execute the individual of at least one functions or operations
Software module is implemented.Software code can by the software application (or program) write with any programming language appropriate Lai
Implement, software code can store in memory 160 and be executed by controller 180.
So far, oneself is through describing mobile terminal according to its function.In the following, for the sake of brevity, will description such as folded form,
Slide type mobile terminal in various types of mobile terminals of board-type, oscillating-type, slide type mobile terminal etc., which is used as, to be shown
Example.Therefore, the present invention can be applied to any kind of mobile terminal, and be not limited to slide type mobile terminal.
Mobile terminal 100 as shown in Figure 1 may be constructed such that using via frame or grouping send data it is all if any
Line and wireless communication system and satellite-based communication system operate.
Referring now to Fig. 2 description communication system that wherein mobile terminal according to the present invention can operate.
Different air interface and/or physical layer can be used in such communication system.For example, used by communication system
Air interface includes such as frequency division multiple access (FDMA), time division multiple acess (TDMA), CDMA (CDMA) and universal mobile communications system
System (UMTS) (particularly, long term evolution (LTE)), global system for mobile communications (GSM) etc..As non-limiting example, under
The description in face is related to cdma communication system, but such introduction is equally applicable to other types of system.
With reference to Fig. 2, cdma wireless communication system may include multiple mobile terminals 100, multiple base stations (BS) 270, base station
Controller (BSC) 275 and mobile switching centre (MSC) 280.MSC280 is configured to and Public Switched Telephony Network (PSTN)
290 form interface.MSC280 is also structured to form interface with the BSC275 that can be couple to base station 270 via back haul link.
Back haul link can be constructed according to any in several known interfaces, and the interface includes such as E1/T1, ATM, IP,
PPP, frame relay, HDSL, ADSL or xDSL.It will be appreciated that system may include multiple BSC275 as shown in Figure 2.
Each BS270 can service one or more subregions (or region), by multidirectional antenna or the day of direction specific direction
Each subregion of line covering is radially far from BS270.Alternatively, each subregion can be by two or more for diversity reception
Antenna covering.Each BS270, which may be constructed such that, supports multiple frequency distribution, and the distribution of each frequency has specific frequency spectrum
(for example, 1.25MHz, 5MHz etc.).
What subregion and frequency were distributed, which intersects, can be referred to as CDMA Channel.BS270 can also be referred to as base station transceiver
System (BTS) or other equivalent terms.In this case, term " base station " can be used for broadly indicating single
BSC275 and at least one BS270.Base station can also be referred to as " cellular station ".Alternatively, each subregion of specific BS270 can be claimed
For multiple cellular stations.
As shown in Figure 2, broadcast singal is sent to the mobile terminal operated in system by broadcsting transmitter (BT) 295
100.Broadcasting reception module 111 as shown in Figure 1 is arranged at mobile terminal 100 to receive the broadcast sent by BT295
Signal.In fig. 2 it is shown that several global positioning system (GPS) satellites 300.The help of satellite 300 positions multiple mobile terminals
At least one of 100.
In Fig. 2, multiple satellites 300 are depicted, it is understood that, it is useful to can use any number of satellite acquisition
Location information.Location information module 115 as shown in Figure 1 is generally configured to cooperate with satellite 300 desired to obtain
Location information.It substitutes GPS tracking technique or except GPS tracking technique, the position that can track mobile terminal can be used
Other technologies.In addition, at least one 300 property of can choose of satellite or extraly processing satellite dmb transmission.
As a typical operation of wireless communication system, BS270 receives the reverse link from various mobile terminals 100
Signal.Mobile terminal 100 usually participates in call, information receiving and transmitting and other types of communication.Specific BS270 is received each reversed
Link signal is handled in specific BS270.The data of acquisition are forwarded to relevant BSC275.BSC275 provides call money
The mobile management function of source distribution and the coordination including the soft switching process between BS270.The data that BSC275 will also be received
It is routed to MSC280, the additional route service for forming interface with PSTN290 is provided.Similarly, PSTN290 with
MSC280 forms interface, and MSC280 and BSC275 form interface, and BSC275 controls BS270 correspondingly to believe forward link
Number it is sent to mobile terminal 100.
Based on above-mentioned mobile terminal hardware configuration and communication system, each embodiment of the method for the present invention is proposed.
In a first aspect, the embodiment of the invention provides the sides that a kind of OTG function and charge function execute parallel referring to Fig. 3
Method, this method can be applied to terminal, which includes but is not limited to: power management module and interface module, this method may include
Following steps 101~103:
101, whether the interface module of power management module detection terminal connects OTG cable.
In the present embodiment, OTG cable includes: interface module plug, OTG apparatus socket and charging equipment socket, wherein is connect
Mouth module plug can be inserted into the interface module of terminal, so that OTG cable connects terminal, OTG apparatus socket, which can connect, to be had
The equipment of OTG function, charging equipment socket can connect the equipment with charge function.
If 102, power management module detects the interface module connection OTG cable of terminal, the connection of OTG cable is judged
Direction.
In the present embodiment, if detecting the interface module of the interface module plug insertion terminal of OTG cable, it is determined that terminal
Interface module connect OTG cable.
In the present embodiment, the connection direction of OTG cable can be understood as the interface module plug insertion terminal of OTG cable
The direction of insertion of interface module, there are two types of direction of insertion, and one is forward directions, and one is reversed.Power management module should be according to OTG
The different connection direction of cable, control interface connection while being supported with meeting terminal in the different connection direction of OTG route
OTG function and charge function.Control interface connects following steps 103.
103, power management module controls itself preset first OTG power supply interface and the OTG line according to connection direction
The preset 2nd OTG power supply interface connection of cable, and control the number of central processing unit (CPU, Central Processing Unit)
It is connect according to interface with the preset OTG communication interface of OTG cable, and controls itself preset first charging interface and OTG cable
Preset second charging interface connection.
In the present embodiment, in order to make terminal while support OTG function and charge function, therefore, power management module is pre-
Equipped with the first OTG power supply interface and the first charging interface, CPU then has data-interface.Power management module passes through the first OTG
The equipment power supply with OTG function that power supply interface is connected to OTG cable, supply voltage 5V, so that setting with OTG function
It is standby to work normally, and CPU can carry out OTG communication with the equipment with OTG function by itself preset data-interface.
The equipment with charge function of OTG cable connection can be by preset first charging interface of power management module to power management
Module charging.
In the present embodiment, since OTG cable includes OTG apparatus socket and charging equipment socket, OTG cable is default
There are the 2nd OTG power supply interface, the 2nd OTG communication interface and the second charging interface.Power management module is according to connection direction, control
It makes itself preset first OTG power supply interface to connect with the preset 2nd OTG power supply interface of OTG cable, and controls the data of CPU
Interface is connect with the preset OTG communication interface of the OTG cable, and control itself preset first charging interface with it is described
The preset second charging interface connection of OTG cable, so that terminal supports OTG function and charge function simultaneously.
As it can be seen that the method that OTG function disclosed in the present embodiment and charge function execute parallel, is examined by power management module
Survey OTG cable connection direction, and then power management module according to connection the preset OTG power supply interface of direction controlling itself and
The data-interface of CPU is separately connected the preset OTG power supply interface of OTG cable and OTG communication interface, to realize terminal and OTG
The equipment with OTG function of cable connection carries out OTG communication, namely realizes OTG function, in addition, power management module is also
The preset charging interface of OTG cable is connected according to the preset charging interface of connection direction controlling itself, realizes charge function, so that
The OTG function and charge function of terminal can be performed simultaneously, and solving terminal can not support what OTG function and charge function were performed simultaneously
Problem.
In a specific example, this method may also include step 104:
104, power management module controls itself preset data-interface and OTG cable is preset fills according to connection direction
Electrical communication interface connection.
In the present embodiment, it is contemplated that charging current provided by the distinct device with charge function and charging voltage may
Difference, in order to enable charging effect is best, the equipment with charge function can carry out charge protocol communication with power management module,
And then it may make the equipment with charge function that can provide the optimal charge electric current that itself can be provided and charging voltage to electricity
Source control module.For this purpose, power management module is preset with data-interface, and OTG cable is preset with charging communication interface, power supply pipe
Module is managed according to connection direction, itself preset data-interface is controlled and is connect with the preset charging communication interface of OTG cable, so that
The equipment with charge function of OTG cable connection can pass through the preset charging communication interface of OTG cable and power management module
Preset data-interface carries out charge protocol communication.
Based on upper one embodiment, in the present embodiment, this method may also include step 105~107:
105, whether power management module detection OTG cable connects the equipment for charging.
In the present embodiment, it is contemplated that charge type include wall fill with USB charging and OTG cable type of data communication
Including OTG communication and usb communication, wherein the equipment of USB charging is, for example, that personal computer (PC) is therefore filled for different
Electric type, power management module should adjust the preset OTG communication interface of the data-interface of CPU, OTG cable and OTG cable is pre-
If charging communication interface between connection relationship, to meet the demand of the different data communication type of OTG cable.For this purpose, electric
Source control module need to first detect whether OTG cable connects equipment for charging.
If 106, detecting equipment of the OTG cable connection for charging, power management module determines charge type.
In the present embodiment, determine that the mode of charge type can continue to use existing way, this embodiment is not repeated.
107, if it is determined that charge type is USB charging, then power management module judges the current data communication class of OTG cable
Whether type is usb communication, and if usb communication, then according to connection direction, data-interface and the OTG cable for controlling CPU are preset
Connection between OTG communication interface disconnects, and the data-interface for controlling CPU is connected with the preset charging communication interface of OTG cable
It connects.After the data-interface of CPU is connected with the preset charging communication interface of OTG cable, CPU can by data-interface with
The charging communication interface of OTG cable carries out usb communication.
In the present embodiment, however, it is determined that charge type is USB charging, then the equipment with charge function of OTG cable connection
It is logical without carrying out charge protocol by the preset charging communication interface of OTG cable and the preset data-interface of power management module
Letter, the equipment with charge function can pass through preset second charging of OTG cable according to preset USB charging current and voltage
Mouth directly answers Current Voltage to the preset first charging interface output phase of power management module, realizes the execution of charge function.
In the present embodiment, however, it is determined that charge type is USB charging, and power management module determines the current number of OTG cable
It is OTG communication according to communication type, then for power management module according to connection direction, the data-interface for controlling CPU is only pre- with OTG cable
If OTG communication interface connection.
In the present embodiment, when being filled due to charge type for wall, there is only OTG to communicate between CPU and OTG cable, therefore, if
Power management module determines that charge type fills for wall, then power management module controls the data-interface of CPU only according to connection direction
It is connect with the preset OTG communication interface of OTG cable.
In the present embodiment, however, it is determined that charge type fills for wall, then the equipment with charge function of OTG cable connection passes through
The preset charging communication interface of OTG cable and the preset data-interface of power management module carry out charge protocol communication, are charging
After protocol communication is completed, the equipment with charge function passes through preset second charging of OTG cable according to charge protocol content
Interface answers Current Voltage to the preset first charging interface output phase of power management module, realizes the execution of charge function.
Based on upper one embodiment, in the present embodiment, this method may also include step 107 ':
107 ', if it is determined that charge type is USB charging, then power management module obtains the data communications requests of OTG cable
Queue.
In the present embodiment, if charge type is USB charging, illustrate that the equipment with charge function of OTG cable connection can
Usb communication is carried out with CPU, and since the equipment with OTG function of OTG cable connection can carry out OTG communication with CPU, no matter
Usb communication or OTG communication, are both needed to send communication request to CPU, therefore, communication request sequencing is arranged to make up OTG line
The data communications requests queue of cable.
Correspondingly, power management module described in step 107 judge the current type of data communication of OTG cable whether be
Usb communication, comprising: power management module judges the data communication to make number one in the data communications requests queue of OTG cable
Whether request is usb communication request, if so, determining that current type of data communication is usb communication.
In a specific example, the interface module of terminal is Type C USB socket, and the interface module of OTG cable is inserted
Head is Type C USB plug.It is " positive and negative that Type C USB socket supports that Type C USB plug can be inserted into from tow sides
Insert " function.
Correspondingly, whether the interface module of the detection of power management module described in step 101 terminal connects OTG cable, comprising:
Whether the Type C USB plug of OTG cable is inserted into the Type C USB socket of power management module detection terminal.
Correspondingly, this method may also include step 101 ': if detecting, terminal connects OTG cable, power management module
First passage configuration (Configuration Channel) the CC1 interface voltage and second for detecting Type C USB socket lead to
Road configures CC2 interface voltage.In the present embodiment, power management module includes CC1 interface and CC2 interface, for being separately connected
The CC1 interface and CC2 interface of Type C USB socket.
Correspondingly, power management module described in step 102 judges the connection direction of OTG cable, comprising: power management module
Based on CC1 interface voltage and CC2 interface voltage, the connection direction of Type C USB plug is judged.
In the present embodiment, the CC1 interface and CC2 interface of Type C USB socket, be also used to connect discovery, configuration,
Management and capability negotiation, capability negotiation include: function of supplying power, alternating pattern and the peripheral mode negotiated on interface.CC1 interface with
And only one interface signal is used as collocation channel in CC2 interface, another is in upstream data port for supplying for USB logic
Electricity.
Based on upper one embodiment, in the present embodiment, power management module described in step 102 be based on CC1 interface voltage with
And CC2 interface voltage, judge the connection direction of TypeC USB plug, specifically include step 1021 and 1022:
If 1021, CC1 interface voltage is in preset first voltage range, the connection of TypeC USB plug is determined
Direction is forward direction.
If 1022, CC2 interface voltage is in first voltage range, determine that the connection direction of TypeC USB plug is
Reversely.
In the present embodiment, preset first voltage range is, for example, 0.35V~0.45V.
In a specific example, it is preset to control itself according to connection direction for power management module described in step 103
First OTG power supply interface is connect with the preset 2nd OTG power supply interface of OTG cable, and controls the data-interface and OTG line of CPU
The preset OTG communication interface connection of cable, and control itself preset first charging interface and preset second charging of OTG cable
Interface connection, specific as follows:
103, power management module adjusts the internal connection side of the switch module (Switch) of terminal according to connection direction
Formula so that the first OTG power supply interface is connected by Switch with the 2nd OTG power supply interface, and passes through the data-interface of CPU
Switch is connected with OTG communication interface, and the first charging interface is made to be connected by Switch with the second charging interface.
In the present embodiment, since switch module (Switch) is arranged in terminal, power management module passes through control
Connection type inside Switch realizes control interface connection.
Based on upper one embodiment, in the present embodiment, power management module described in step 103 is according to connection direction, adjustment
The internal connection type of the switch module (Switch) of terminal, including step 1031:
If 1031, connection direction is positive to it is defeated that power management module controls itself preset switch module control interface
The universal input/output interface of low level and control CPU export low level out, so that the connection type inside Switch is first
Connection type.
In the present embodiment, referring to Fig. 6, power management module is power management integrated circuit (Power Management
IC, PMIC).
In the present embodiment, referring to Fig. 6, switch module control interface is USB PLUG (USB plug) interface.Switch module control
Interface processed is connect with the preset first switch interface SW0 of Switch, and the universal input of CPU exports (General Purpose
Input Output, GPIO) interface connect with the preset second switch interface SW3 of Switch.
Further include with lower interface referring to Fig. 6, Switch in the present embodiment: the first power supply (Voltage bus, Vbus) connects
Mouthful Vbus1a, the first data-interface (including data positive port DP1a and data negative terminal mouth DM1a), second source interface Vbus2a,
Second data-interface (including data positive port DP2a and data negative terminal mouth DM2a), third power interface Vbus1, third data connect
Mouthful (including data positive port DP1 and data negative terminal mouth DM1), the 4th power interface Vbus2 and the 4th data-interface (including number
According to positive port DP2 and data negative terminal mouth DM2).
In the present embodiment, DM is the abbreviation of Data Minus, indicates data negative signal;DP is USB Data Positive,
Indicate data positive signal.
In the present embodiment, referring to Fig. 6, each interface company of power management module, CPU, Type C USB socket and Switch
It is as follows to connect relationship: the first charging interface (Vbus2) of power management module is connected with the first power interface Vbus1a of Switch
It connects, the first of the preset data-interface of power management module (including data positive port DP2 and data negative terminal mouth DM2) and Switch
Data-interface is connected, and the second source of the first OTG power supply interface (i.e. Vbus_OTG) and Switch of power management module connects
Mouth Vbus2a is connected, the data-interface (including data positive port DP2 and data negative terminal mouth DM2) of CPU and the second of Switch
Data-interface is connected, the third power interface Vbus1 phase of the first power interface Vbus1 and Switch of TypeC USB socket
Connection, the first data-interface (including data positive port DP1 and data negative terminal mouth DM1) of TypeC USB socket is with Switch's
Third data-interface is connected, the 4th power interface of second source the interface Vbus2 and Switch of TypeC USB socket
Vbus2 is connected, the second data-interface (including data positive port DP2 and data negative terminal mouth DM2) of TypeC USB socket with
The 4th data-interface of Switch is connected.
In the present embodiment, referring to Fig. 6, the first connection type are as follows: the first power interface Vbus1a connection of Switch
The 4th data-interface of the first data-interface connection Switch of the 4th power interface Vbus2 of Switch, Switch, Switch
Second source interface Vbus2a connection Switch third power interface Vbus1, Switch the second data-interface connection
The third data-interface of Switch.
In the present embodiment, referring to Fig. 6, if connection direction is positive to connecing between TypeC USB socket and OTG cable
Mouth connection relationship is as follows: the first power interface Vbus1 and the preset 2nd OTG power supply interface of OTG cable of TypeC USB socket
(i.e. the Vbus1 of TypeC USB plug) connection, the first data-interface and the preset OTG of OTG cable of TypeC USB socket are logical
Believe interface (i.e. the DP1 and DM1 of TypeC USB plug) connection, the second source interface Vbus2 and OTG line of TypeC USB socket
Preset second charging interface of cable (i.e. the Vbus2 of TypeC USB plug) connection, the second data-interface of TypeC USB socket
It is connect with the preset charging communication interface (i.e. the DP2 and DM2 of TypeC USB plug) of OTG cable.
In the present embodiment, referring to Fig. 6, the OTG apparatus socket that OTG cable includes is, for example, Micro USB female seat, OTG line
The charging equipment socket that cable includes is for example are as follows: TypeC USB socket, the Vbus1 and Vbus2 of the TypeC USB socket are all connected with
The Vbus2 of the TypeC USB socket of OTG cable, the DP1 and DP2 of the TypeC USB socket are all connected with the TypeC of OTG cable
The DP2 of USB socket, the DM1 and DM2 of the TypeC USB socket are all connected with the DM2 of the TypeC USB socket of OTG cable, should
The CC1 and CC2 of TypeC USB socket are separately connected the CC1 and CC2 of the TypeC USB socket of OTG cable, which inserts
The SBU1 and SBU2 of seat are hanging.
Based on upper one embodiment, in the present embodiment, power management module described in step 103 is according to connection direction, adjustment
The internal connection type of the switch module (Switch) of terminal, further includes step 1032:
If 1032, connection direction is reversed, it is defeated that power management module controls itself preset switch module control interface
The universal input/output interface of high level and control CPU export low level out, so that the connection type inside Switch is second
Connection type.
In the present embodiment, referring to Fig. 8, the second connection type are as follows: the first power interface Vbus1a connection of Switch
The third data-interface of the first data-interface connection Switch of third the power interface Vbus1, Switch of Switch, Switch
Second source interface Vbus2a connection Switch the 4th power interface Vbus2, Switch the second data-interface connection
The 4th data-interface of Switch.
In the present embodiment, referring to Fig. 8, if connection direction is reversed, connecing between TypeC USB socket and OTG cable
Mouth connection relationship is as follows: the first power interface Vbus1 of TypeC USB socket and preset second charging of the OTG cable
Mouth (i.e. the Vbus2 of TypeC USB plug) connection connection, the first data-interface and OTG cable of TypeC USB socket are preset
Charging communication interface (i.e. the DP2 and DM2 of TypeC USB plug) connection, the second source interface Vbus2 of TypeC USB socket
It is connect with the preset 2nd OTG power supply interface (i.e. the Vbus1 of TypeC USB plug) of OTG cable, the of TypeC USB socket
Two data-interfaces are connect with the preset OTG communication interface of OTG cable (i.e. the DP1 and DM1 of TypeC USB plug).
In the present embodiment, SBU1 and SUB2 are the interface of sideband use (Side Band Use) signal, are suitable for transmitting non-
Usb signal, they are used for analogue audio frequency mode, it can also be used to optional (Alternate) mode, alternating pattern (Alternate
Mode, referred to as " Alt Mode ") and peripheral mode (Accessory Mode).
Based on upper one embodiment, in the present embodiment, this method may also include step 105~107:
105, whether power management module detection OTG cable connects the equipment for charging.
In the present embodiment, step 105 may include following steps 1051 and 1052:
1051, power management module detects the voltage of itself preset first charging interface (i.e. Vbus2).
1052, power management module judges whether voltage is within the scope of preset second voltage, if so, determining OTG
Equipment of the cable connection for charging.In the present embodiment, preset second voltage range is, for example, 4.2V~10V.
If 106, detecting equipment of the OTG cable connection for charging, power management module determines charge type.
107, if it is determined that charge type is USB charging, then power management module judges the current data communication class of OTG cable
Whether type is usb communication, and if usb communication, then according to connection direction, data-interface and the OTG cable for controlling CPU are preset
Connection between OTG communication interface disconnects, and the data-interface for controlling CPU is connected with the preset charging communication interface of OTG cable
It connects.
In the present embodiment, step 107 includes: if it is determined that charge type is USB charging, then power management module judges OTG
Whether the current type of data communication of cable is usb communication, and if usb communication and connection direction is positive to then power management mould
Block controls itself preset switch module control interface output low level and controls the high electricity of universal input/output interface output of CPU
It is flat, so that the connection type inside Switch is third connection type.
In the present embodiment, referring to Fig. 7, third connection type are as follows: the first power interface Vbus1a connection of Switch
The 4th data-interface of the first data-interface connection Switch of the 4th power interface Vbus2 of Switch, Switch, Switch
Second source interface Vbus2a connection Switch third power interface Vbus1, Switch the second data-interface connection
The 4th data-interface of Switch.
Based on upper one embodiment, in the present embodiment, step 107 further include: if it is determined that charge type is USB charging, then
Power management module judges whether the current type of data communication of OTG cable is usb communication, if usb communication and connection direction
To be reversed, then power management module controls itself preset switch module control interface output high level and controls the general of CPU
Input/output interface exports high level, so that the connection type inside Switch is the 4th connection type.
In the present embodiment, referring to Fig. 9, the 4th connection type are as follows: the first power interface Vbus1a connection of Switch
The third data-interface of the first data-interface connection Switch of third the power interface Vbus1, Switch of Switch, Switch
Second source interface Vbus2a connection Switch the 4th power interface Vbus2, Switch the second data-interface connection
The third data-interface of Switch.
As it can be seen that the method that OTG function disclosed in the present embodiment and charge function execute parallel, is examined by power management module
Survey OTG cable connection direction, and then power management module according to connection the preset OTG power supply interface of direction controlling itself and
The data-interface of CPU is separately connected the preset OTG power supply interface of OTG cable and OTG communication interface, to realize terminal and OTG
The equipment with OTG function of cable connection carries out OTG communication, namely realizes OTG function, in addition, power management module is also
The preset charging interface of OTG cable is connected according to the preset charging interface of connection direction controlling itself, realizes charge function, so that
The OTG function and charge function of terminal can be performed simultaneously, and solving terminal can not support what OTG function and charge function were performed simultaneously
Problem.
A kind of terminal 2 is also disclosed in second aspect, the embodiment of the present invention, referring to fig. 4, it may include: power management module 21,
CPU22 and interface module 23.
In the present embodiment, OTG cable 3 includes: interface module plug 31, OTG apparatus socket 32 and charging equipment socket 33,
Wherein, interface module plug 31 can be inserted into the interface module 23 of terminal, so that OTG cable connects terminal, OTG apparatus socket
The equipment with OTG function can be connected, charging equipment socket can connect the equipment with charge function.
In the present embodiment, connected two-by-two between power management module 21, CPU22 and interface module 23.
In the present embodiment, power management module 21 includes: the first OTG power supply interface and the first charging interface.
In the present embodiment, power management module 21 is used for: whether detection interface module 23 connects OTG cable;If detecting
Interface module 23 connects OTG cable, then judges the connection direction of OTG cable;According to connection direction, control the first OTG power supply is connect
Mouth is connect with the preset 2nd OTG power supply interface of OTG cable, and controls the data-interface and the preset OTG of OTG cable of CPU22
Communication interface connection, and the first charging interface of control are connect with preset second charging interface of OTG cable.
In the present embodiment, power management module 21 and CPU22 can carry out data interaction.
As it can be seen that the present embodiment discloses terminal, the connection direction of OTG cable, Jin Er electricity are detected by power management module 21
Source control module 21 is separately connected OTG according to the data-interface of the preset OTG power supply interface of connection direction controlling itself and CPU22
The preset OTG power supply interface of cable and OTG communication interface, to realize the setting with OTG function that terminal is connect with OTG cable
It is standby to carry out OTG communication, namely OTG function is realized, in addition, power management module 21 is default also according to connection direction controlling itself
Charging interface connect the preset charging interface of OTG cable, realize charge function so that the OTG function and charge function of terminal
It can be performed simultaneously, solve the problems, such as that terminal can not support OTG function and charge function to be performed simultaneously.
In a specific example, power management module 21 is also used to: according to connection direction, it is preset to control itself
Data-interface is connect with the preset charging communication interface of OTG cable.
Based on upper one embodiment, in the present embodiment, power management module 21 is also used to: whether detection OTG cable connects
Equipment for charging;If detecting equipment of the OTG cable connection for charging, it is determined that charge type;If it is determined that charge type
Type is USB charging, then judges whether the current type of data communication of OTG cable is usb communication, if usb communication, then according to even
Direction is connect, the connection controlled between the data-interface of CPU22 and the preset OTG communication interface of OTG cable disconnects, and controls
The data-interface of CPU22 is connected with the preset charging communication interface of OTG cable.
Based on upper one embodiment, in the present embodiment, power management module 21 is also used to: if it is determined that charge type is USB
Charging, then obtain the data communications requests queue of OTG cable;
Correspondingly, power management module 21 judges whether the current type of data communication of OTG cable is usb communication, comprising:
Power management module 21 judge the data communications requests to make number one in the data communications requests queue of OTG cable whether be
Usb communication request, if so, determining that current type of data communication is usb communication.
In a specific example, interface module 23 is TypeC USB socket;
Correspondingly, power management module 21 detects whether interface module 23 connects OTG cable, comprising: power management module
Whether the TypeC USB plug of OTG cable is inserted into the TypeC USB socket of 21 detection terminals;
Correspondingly, power management module 21 are also used to: if detecting, interface module 23 connects OTG cable, detects
The first passage configuration CC1 interface voltage and second channel of TypeC USB socket configure CC2 interface voltage;
Correspondingly, power management module 21 judges the connection direction of OTG cable, comprising: power management module 21 is based on CC1
Interface voltage and CC2 interface voltage judge the connection direction of TypeC USB plug.
Based on upper one embodiment, in the present embodiment, power management module 21 is based on CC1 interface voltage and CC2 interface
Voltage judges the connection direction of TypeC USB plug, comprising:
If CC1 interface voltage is in preset first voltage range, determine that the connection direction of TypeC USB plug is
It is positive;
If CC2 interface voltage is in first voltage range, determine that the connection direction of TypeC USB plug is reversed.
In a specific example, referring to Fig. 5, terminal 2 may also include that switch module (Switch) 24;
Correspondingly, power management module 21 controls the first OTG power supply interface and OTG cable is preset according to connection direction
The connection of 2nd OTG power supply interface, and the data-interface for controlling CPU22 is connect with the preset OTG communication interface of OTG cable, and
The first charging interface is controlled to connect with preset second charging interface of OTG cable, comprising:
Power management module 21 adjusts the connection type inside Switch according to connection direction, so that the first OTG power supply connects
Mouth is connected by Switch with the 2nd OTG power supply interface, and is communicated the data-interface of CPU22 with OTG by Switch and connect
Mouth is connected, and the first charging interface is made to be connected by Switch with the second charging interface.
In a specific example, power management module 21 includes: switch module control interface;
Switch includes: first switch interface SW0, second switch interface SW3, the first power interface Vbus1a, the first number
According to interface, second source interface Vbus2a, the second data-interface, third power interface Vbus1, third data-interface, the 4th electricity
Source interface Vbus2 and the 4th data-interface;
Switch module control interface is connect with first switch interface SW0, and the universal input/output interface of CPU22 is opened with second
Close interface SW3 connection;First power interface Vbus1a is connected with the first charging interface of power management module 21, the first data
Interface is connected with the preset data-interface of power management module 21, second source interface Vbus2a and power management module 21
First OTG power supply interface is connected, and the second data-interface is connected with the data-interface of CPU22, third power interface Vbus1 with
First power interface Vbus1 of TypeC USB socket is connected, the first data of third data-interface and TypeC USB socket
Interface is connected, and the 4th power interface Vbus2 is connected with the second source interface Vbus2 of TypeC USB socket, the 4th data
Interface is connected with the second data-interface of TypeC USB socket;
The first power interface Vbus1 and OTG cable to, TypeC USB socket preset the if connection direction is positive
The connection of two OTG power supply interfaces, the first data-interface of TypeC USB socket are connect with the preset OTG communication interface of OTG cable,
The second source interface Vbus2 of TypeC USB socket is connect with preset second charging interface of OTG cable, TypeC USB socket
The second data-interface connect with the preset charging communication interface of OTG cable;
Correspondingly, power management module 21 adjusts the connection inside the switch module Switch of terminal according to connection direction
Mode, comprising: if connection direction is positive to 21 control switch module control interface of power management module exports low level and control
The universal input/output interface of CPU22 processed exports low level, so that the connection type inside Switch is the first connection type;
Wherein, the first connection type are as follows: the 4th power interface Vbus2 of the first power interface Vbus1a connection, the first data
Interface connects the 4th data-interface, second source interface Vbus2a connection third power interface Vbus1, the connection of the second data-interface
Third data-interface.
Based on upper one embodiment, in the present embodiment, if connection direction be it is reversed, the first of TypeC USB socket is electric
Source interface Vbus1 is connect with preset second charging interface of OTG cable, the first data-interface and OTG line of TypeC USB socket
The preset charging communication interface connection of cable, the second source interface Vbus2 and OTG cable preset second of TypeC USB socket
The connection of OTG power supply interface, the second data-interface of TypeC USB socket are connect with the preset OTG communication interface of OTG cable;
Correspondingly, power management module 21 adjusts the connection inside the switch module Switch of terminal according to connection direction
Mode, further includes:
If connection direction is reversed, the preset switch module control interface output height of the control of power management module 21 itself
Level and the universal input/output interface output low level for controlling CPU22, so that the connection type inside Switch is the second company
Connect mode;
Wherein, the second connection type are as follows: the first power interface Vbus1a connection third power interface Vbus1, the first data
Interface connects third data-interface, the 4th power interface Vbus2 of second source interface Vbus2a connection, the connection of the second data-interface
4th data-interface.
Based on upper one embodiment, in the present embodiment, power management module 21 is also used to: whether detection OTG cable connects
Equipment for charging;If detecting equipment of the OTG cable connection for charging, it is determined that charge type;If it is determined that charge type
Type is USB charging, then judges whether the current type of data communication of OTG cable is usb communication, if usb communication and connection side
To for forward direction, then the universal input for controlling itself preset switch module control interface output low level and control CPU22 exports
Interface exports high level, so that the connection type inside Switch is third connection type;
Wherein, third connection type are as follows: the 4th power interface Vbus2 of the first power interface Vbus1a connection, the first data
Interface connects the 4th data-interface, second source interface Vbus2a connection third power interface Vbus1, the connection of the second data-interface
4th data-interface.
Based on upper one embodiment, in the present embodiment, whether power management module 21, which detects the OTG cable and connect, is used for
The equipment of charging, comprising:
The voltage of itself preset first charging interface of the detection of power management module 21;
Power management module 21 judges whether the voltage is within the scope of preset second voltage, if so, determining OTG
Equipment of the cable connection for charging.
In a specific example, power management module 21 is also used to: if it is determined that charge type is USB charging, then being sentenced
Whether the current type of data communication of disconnected OTG cable is usb communication, if usb communication and connection direction be it is reversed, then control oneself
The preset switch module control interface output high level of body and the universal input/output interface output high level for controlling CPU22, with
Make the 4th connection type of connection type inside Switch;
Wherein, the 4th connection type are as follows: the first power interface Vbus1a connection third power interface Vbus1, the first data
Interface connects third data-interface, the 4th power interface Vbus2 of second source interface Vbus2a connection, the connection of the second data-interface
Third data-interface.
It should be noted that terminal disclosed in second aspect can be realized the step of each method embodiment disclosed in first aspect
Suddenly, to avoid repeating, which is not described herein again.
Terminal disclosed in second aspect detects the connection direction of OTG cable, and then power management by power management module
It is preset that module according to the data-interface of the preset OTG power supply interface of connection direction controlling itself and CPU is separately connected OTG cable
OTG power supply interface and OTG communication interface, so that the equipment with OTG function for realizing that terminal is connect with OTG cable carries out OTG
Communication, namely OTG function is realized, in addition, power management module is also according to the connection preset charging interface of direction controlling itself
The preset charging interface of OTG cable is connected, realizes charge function, so that the OTG function and charge function of terminal can be performed simultaneously,
Solve the problems, such as that terminal can not support OTG function and charge function to be performed simultaneously.
Those of ordinary skill in the art may be aware that step described in conjunction with the examples disclosed in the embodiments of the present disclosure
Rapid and module can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually with hard
Part or software mode execute, the specific application and design constraint depending on technical solution.Professional technician can be with
Each specific application is used different methods to achieve the described function, but this realization is it is not considered that exceed this hair
Bright range.
It should be noted that, in this document, term " includes " is intended to non-exclusive inclusion.
It should be noted that, in this document, the relational terms of such as " first " and " second " or the like are used merely to one
A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it
Between there are any actual relationship or orders.
Through the above description of the embodiments, those skilled in the art can be understood that each reality of the present invention
Applying method described in example can realize by means of software and necessary general hardware platform, naturally it is also possible to by hardware,
But the former is more preferably embodiment in many cases.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (13)
1. a kind of method that OTG function and charge function execute parallel is applied to terminal, which includes: power management module
And interface module, which is characterized in that the described method includes:
Whether the interface module of power management module detection terminal connects OTG cable;
If the power management module detects the interface module connection OTG cable of terminal, the connection of the OTG cable is judged
Direction;
The power management module controls itself preset first OTG power supply interface and the OTG line according to the connection direction
The preset 2nd OTG power supply interface connection of cable, and control the data-interface and the preset OTG communication interface of the OTG cable of CPU
Connection, and control itself preset first charging interface and connect with preset second charging interface of the OTG cable.
2. the method according to claim 1, wherein the method also includes:
The power management module controls itself preset data-interface and the OTG cable is default according to the connection direction
Charging communication interface connection.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
The power management module detects whether the OTG cable connects equipment for charging;
If detecting equipment of the OTG cable connection for charging, the power management module determines charge type;
If it is determined that charge type is USB charging, then the power management module judges the current data communication class of the OTG cable
Whether type is usb communication, if usb communication, then according to the connection direction, controls the data-interface and the OTG of the CPU
Connection between the preset OTG communication interface of cable disconnects, and control the CPU data-interface and the OTG cable it is default
Charging communication interface be connected.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
If it is determined that charge type is USB charging, then the data communications requests queue of the OTG cable is obtained;
Correspondingly, the power management module judges whether the current type of data communication of the OTG cable is usb communication, packet
Include: the power management module judges that the data communication to make number one in the data communications requests queue of the OTG cable is asked
Seeking Truth is no to request for usb communication, if so, determining that current type of data communication is usb communication.
5. the method according to claim 1, wherein the interface module is TypeC USB socket;
Correspondingly, whether the interface module of the power management module detection terminal connects OTG cable, comprising: the power supply pipe
Whether the TypeC USB plug of OTG cable is inserted into the TypeC USB socket of reason module detection terminal;
Correspondingly, the method also includes: if detecting, terminal connects OTG cable, described in power management module detection
The first passage configuration CC1 interface voltage and second channel of TypeC USB socket configure CC2 interface voltage;
Correspondingly, the power management module judges the connection direction of the OTG cable, comprising: the power management module base
In the CC1 interface voltage and the CC2 interface voltage, the connection direction of the TypeC USB plug is judged.
6. according to the method described in claim 5, it is characterized in that, the power management module is based on the CC1 interface voltage
And the CC2 interface voltage, judge the connection direction of the TypeC USB plug, comprising:
If the CC1 interface voltage is in preset first voltage range, the connection side of the TypeC USB plug is determined
To being positive;
If the CC2 interface voltage is in the first voltage range, the connection direction of the TypeC USB plug is determined
It is reversed.
7. according to the method described in claim 5, it is characterized in that, the power management module is according to the connection direction, control
It makes itself preset first OTG power supply interface to connect with the preset 2nd OTG power supply interface of the OTG cable, and controls CPU's
Data-interface is connect with the preset OTG communication interface of the OTG cable, and controls itself preset first charging interface and institute
State the preset second charging interface connection of OTG cable, comprising:
The power management module adjusts the connection type inside the switch module Switch of terminal according to the connection direction,
So that the first OTG power supply interface is connected by the Switch with the 2nd OTG power supply interface, and make the CPU
Data-interface be connected by the Switch with the OTG communication interface, and it is described to pass through first charging interface
Switch is connected with second charging interface.
8. the method according to the description of claim 7 is characterized in that the power management module is adjusted according to the connection direction
Connection type inside the switch module Switch of whole terminal, comprising:
If the connection direction is positive to the power management module controls itself preset switch module control interface output
The universal input/output interface of low level and the control CPU export low level, so that the connection type inside the Switch
For the first connection type;
Wherein, the switch module control interface is connect with the preset first switch interface SW0 of the Switch, the CPU's
Universal input/output interface is connect with the preset second switch interface SW3 of the Switch;The Switch includes: the first power supply
Interface Vbus1a, the first data-interface, second source interface Vbus2a, the second data-interface, third power interface Vbus1,
Three data-interfaces, the 4th power interface Vbus2 and the 4th data-interface;
Wherein, the first power interface Vbus1a is connected with the first charging interface of the power management module, and described
One data-interface is connected with the preset data-interface of the power management module, the second source interface Vbus2a with it is described
First OTG power supply interface of power management module is connected, and second data-interface is connected with the data-interface of the CPU
It connects, the third power interface Vbus1 is connected with the first power interface Vbus1 of the TypeC USB socket, the third
Data-interface is connected with the first data-interface of the TypeC USB socket, the 4th power interface Vbus2 with it is described
The second source interface Vbus2 of TypeC USB socket is connected, the 4th data-interface and the TypeC USB socket
Second data-interface is connected;
Wherein, first connection type are as follows: the first power interface Vbus1a connection the 4th power interface Vbus2,
First data-interface connects the 4th data-interface, and the second source interface Vbus2a connection third power supply connects
Mouth Vbus1, second data-interface connect the third data-interface;
Wherein, the first power interface Vbus1 of the TypeC USB socket connects with the preset 2nd OTG power supply of the OTG cable
Mouth connection, the first data-interface of the TypeC USB socket is connect with the preset OTG communication interface of the OTG cable, described
The second source interface Vbus2 of TypeC USB socket is connect with preset second charging interface of the OTG cable, the TypeC
Second data-interface of USB socket is connect with the preset charging communication interface of the OTG cable.
9. according to the method described in claim 8, it is characterized in that, the power management module is adjusted according to the connection direction
Connection type inside the switch module Switch of whole terminal, further includes:
If the connection direction be it is reversed, the power management module controls the output of itself preset switch module control interface
The universal input/output interface of high level and the control CPU export low level, so that the connection type inside the Switch
For the second connection type;
Wherein, second connection type are as follows: the first power interface Vbus1a connection third power interface Vbus1,
First data-interface connects the third data-interface, and second source interface Vbus2a connection the 4th power supply connects
Mouth Vbus2, second data-interface connect the 4th data-interface;
Wherein, the first power interface Vbus1 of the TypeC USB socket and preset second charging interface of the OTG cable
Connection, the first data-interface of the TypeC USB socket is connect with the preset charging communication interface of the OTG cable, described
The second source interface Vbus2 of TypeC USB socket is connect with the preset 2nd OTG power supply interface of the OTG cable, described
Second data-interface of TypeC USB socket is connect with the preset OTG communication interface of the OTG cable.
10. according to the method described in claim 9, it is characterized in that, the method also includes:
The power management module detects whether the OTG cable connects equipment for charging;
If detecting equipment of the OTG cable connection for charging, the power management module determines charge type;
If it is determined that charge type is USB charging, then the power management module judges the current data communication class of the OTG cable
Whether type is usb communication, and if usb communication and the connection direction is positive to then it is pre- to control itself for the power management module
If switch module control interface output low level and the universal input/output interface of the control CPU export high level so that
Connection type inside the Switch is third connection type;
Wherein, the third connection type are as follows: the first power interface Vbus1a connection the 4th power interface Vbus2,
First data-interface connects the 4th data-interface, and the second source interface Vbus2a connection third power supply connects
Mouth Vbus1, second data-interface connect the 4th data-interface.
11. according to the method described in claim 10, it is characterized in that, the power management module detection OTG cable is
Equipment of the no connection for charging, comprising:
The power management module detects the voltage of itself preset first charging interface;
The power management module judges whether the voltage is within the scope of preset second voltage, if so, described in determining
Equipment of the OTG cable connection for charging.
12. according to the method described in claim 10, it is characterized in that, the method also includes:
If it is determined that charge type is USB charging, then the power management module judges the current data communication class of the OTG cable
Whether type is usb communication, if usb communication and the connection direction be it is reversed, then it is pre- to control itself for the power management module
If switch module control interface output high level and the universal input/output interface of the control CPU export high level so that
Connection type inside the Switch is the 4th connection type;
Wherein, the 4th connection type are as follows: the first power interface Vbus1a connection third power interface Vbus1,
First data-interface connects the third data-interface, and second source interface Vbus2a connection the 4th power supply connects
Mouth Vbus2, second data-interface connect the third data-interface.
13. a kind of terminal characterized by comprising power management module, CPU and interface module;
The power management module includes: the first OTG power supply interface and the first charging interface;
The power management module, is used for: detecting whether the interface module connects OTG cable;If detecting the interface mould
Block connects OTG cable, then judges the connection direction of the OTG cable;According to the connection direction, controls the first OTG and supply
Electrical interface is connect with the preset 2nd OTG power supply interface of the OTG cable, and controls the data-interface and the OTG of the CPU
The preset OTG communication interface connection of cable, and control first charging interface and preset second charging of the OTG cable
Interface connection.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810785474.XA CN109101447B (en) | 2018-07-17 | 2018-07-17 | Method and terminal for parallel execution of OTG function and charging function |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810785474.XA CN109101447B (en) | 2018-07-17 | 2018-07-17 | Method and terminal for parallel execution of OTG function and charging function |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109101447A true CN109101447A (en) | 2018-12-28 |
CN109101447B CN109101447B (en) | 2021-09-14 |
Family
ID=64846628
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810785474.XA Active CN109101447B (en) | 2018-07-17 | 2018-07-17 | Method and terminal for parallel execution of OTG function and charging function |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109101447B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110062186A (en) * | 2019-05-29 | 2019-07-26 | 北京硬壳科技有限公司 | A kind of data transmission method, system and touch control display |
CN110597375A (en) * | 2019-11-13 | 2019-12-20 | 亮风台(上海)信息科技有限公司 | External equipment power supply device |
WO2020192376A1 (en) * | 2019-03-27 | 2020-10-01 | 上海爻火微电子有限公司 | Determination circuit for positive and negative ends of earphone mic, method, and electronic device |
CN112148104A (en) * | 2020-09-30 | 2020-12-29 | 维沃移动通信有限公司 | Control method of electronic equipment |
WO2021238806A1 (en) * | 2020-05-25 | 2021-12-02 | 维沃移动通信有限公司 | Interface circuit and electronic device |
EP4105786A1 (en) * | 2021-06-14 | 2022-12-21 | Samsung Electronics Co., Ltd. | Host system and device for performing environment setting based on connection direction of connector and operating method of host system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20170098467A (en) * | 2016-02-22 | 2017-08-30 | 에스케이텔레콤 주식회사 | Apparatus and method for providing usb interface between potable device and external device |
CN107180004A (en) * | 2017-05-11 | 2017-09-19 | 深圳市金立通信设备有限公司 | It is a kind of at the same realize OTG communication and charging method and terminal |
CN107707000A (en) * | 2017-11-16 | 2018-02-16 | 珠海市魅族科技有限公司 | A kind of OTG power supplies and wireless charging compatible circuit and correlation technique and terminal device |
-
2018
- 2018-07-17 CN CN201810785474.XA patent/CN109101447B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20170098467A (en) * | 2016-02-22 | 2017-08-30 | 에스케이텔레콤 주식회사 | Apparatus and method for providing usb interface between potable device and external device |
CN107180004A (en) * | 2017-05-11 | 2017-09-19 | 深圳市金立通信设备有限公司 | It is a kind of at the same realize OTG communication and charging method and terminal |
CN107707000A (en) * | 2017-11-16 | 2018-02-16 | 珠海市魅族科技有限公司 | A kind of OTG power supplies and wireless charging compatible circuit and correlation technique and terminal device |
Non-Patent Citations (1)
Title |
---|
QINGHUA YAO等: "Research of data bidirectional USB transfer technology based on MicroBlaze", 《 2010 INTERNATIONAL CONFERENCE ON COMPUTER, MECHATRONICS, CONTROL AND ELECTRONIC ENGINEERING》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020192376A1 (en) * | 2019-03-27 | 2020-10-01 | 上海爻火微电子有限公司 | Determination circuit for positive and negative ends of earphone mic, method, and electronic device |
CN110062186A (en) * | 2019-05-29 | 2019-07-26 | 北京硬壳科技有限公司 | A kind of data transmission method, system and touch control display |
CN110597375A (en) * | 2019-11-13 | 2019-12-20 | 亮风台(上海)信息科技有限公司 | External equipment power supply device |
WO2021238806A1 (en) * | 2020-05-25 | 2021-12-02 | 维沃移动通信有限公司 | Interface circuit and electronic device |
US12013803B2 (en) | 2020-05-25 | 2024-06-18 | Vivo Mobile Communication Co., Ltd. | Interface circuit and electronic device |
CN112148104A (en) * | 2020-09-30 | 2020-12-29 | 维沃移动通信有限公司 | Control method of electronic equipment |
EP4105786A1 (en) * | 2021-06-14 | 2022-12-21 | Samsung Electronics Co., Ltd. | Host system and device for performing environment setting based on connection direction of connector and operating method of host system |
Also Published As
Publication number | Publication date |
---|---|
CN109101447B (en) | 2021-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109101447A (en) | A kind of method and terminal that OTG function executes parallel with charge function | |
US9456265B2 (en) | Electronic device and control method thereof | |
CN104918208B (en) | Mobile terminal matching method and mobile terminal | |
CN104935044B (en) | Charging method and charging unit | |
CN104917879B (en) | A kind of method, device and mobile terminal for cancelling alarm clock calling | |
CN106655358B (en) | Battery charge controller and method between a kind of mobile terminal | |
CN105790349A (en) | Mutual charging control method and device for mobile terminals | |
CN106657458A (en) | Terminal and hot-plug camera device for terminal | |
CN104917233B (en) | Charging control method, device and system | |
CN106850976B (en) | Using update method and terminal | |
CN104735255A (en) | Split screen display method and system | |
CN106873855A (en) | A kind of suspension icon control method, device and terminal | |
CN106569678A (en) | Display adjusting method and device of suspending operation board and terminal | |
CN106909851A (en) | A kind of secure storage method of data and device | |
CN106791238A (en) | The call control method and device of MPTY conference system | |
CN107122186A (en) | The management method and managing device of suspended window | |
CN107360214A (en) | A kind of message push processing method, message sink processing method and processing device | |
CN106793159A (en) | A kind of screen prjection method and mobile terminal | |
CN105100408B (en) | A kind of method and apparatus controlling mobile terminal | |
CN106550133A (en) | Calling identification device and method | |
CN106412878A (en) | Device and method for activating subscriber identity module card | |
CN105807882B (en) | Adaptive charging method and intelligent terminal based on fingerprint | |
CN105357364B (en) | Mobile terminal is answered or the method, device and mobile terminal of hanging up calling | |
CN108964188A (en) | A kind of mobile terminal charging control circuit, charging circuit and electronic equipment | |
CN109165487A (en) | A kind of method, mobile terminal and the computer readable storage medium of face unlock |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |