CN109101447B - Method and terminal for parallel execution of OTG function and charging function - Google Patents
Method and terminal for parallel execution of OTG function and charging function Download PDFInfo
- Publication number
- CN109101447B CN109101447B CN201810785474.XA CN201810785474A CN109101447B CN 109101447 B CN109101447 B CN 109101447B CN 201810785474 A CN201810785474 A CN 201810785474A CN 109101447 B CN109101447 B CN 109101447B
- Authority
- CN
- China
- Prior art keywords
- interface
- otg
- power
- management module
- charging
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
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 embodiment of the invention relates to the technical field of power supplies, in particular to a method and a terminal for executing an OTG function and a charging function in parallel.
Description
Technical Field
The embodiment of the invention relates to the technical field of power supplies, in particular to a method and a terminal for executing an OTG function and a charging function in parallel.
Background
With The development of science and technology, mobile terminals such as smart phones, tablet computers or other portable products have become centers of personal information, The mobile terminals are increasingly powerful in function, The OTG (on The go) function is also a basic requirement, and The OTG function is to directly connect The mobile terminals to external devices such as a usb disk, a card reader, a keyboard, a camera and/or a printer for data exchange without a computer as a relay, so that The mobile terminals support The identification and use of storage devices.
At present, when the mobile terminal is using the OTG function, the charging function is not supported, or when the mobile terminal is charging, the OTG function is not supported.
The above description of the discovery process of the problems is only for the purpose of assisting understanding of the technical solutions of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, embodiments of the present invention provide a method and a terminal for performing an OTG function and a charging function in parallel.
In view of this, in a first aspect, an embodiment of the present invention provides a method for performing an OTG function and a charging function in parallel, where the method is applied to a terminal, and the terminal includes: a power management module and an interface module, the method comprising:
the power management module detects whether an interface module of the terminal is connected with the OTG cable;
if the power management module detects that an interface module of the terminal is connected with an OTG cable, judging the connection direction of the OTG cable;
the power management module controls a first OTG power supply interface preset by the power management module according to the connection direction to be connected with a second OTG power supply interface preset by the OTG cable, controls a data interface of the CPU to be connected with an OTG communication interface preset by the OTG cable, and controls a first charging interface preset by the power management module to be connected with a second charging interface preset by the OTG cable.
Optionally, the method further includes:
and the power supply management module controls a self-preset data interface to be connected with a preset charging communication interface of the OTG cable according to the connection direction.
Optionally, the method further includes:
the power management module detects whether the OTG cable is connected with a device for charging;
if the OTG cable is connected with a device for charging, the power supply management module determines the charging type;
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type of the OTG cable is USB communication, the power management module controls the connection disconnection between the data interface of the CPU and the OTG communication interface preset by the OTG cable according to the connection direction, and controls the data interface of the CPU to be connected with the charging communication interface preset by the OTG cable.
Optionally, the method further includes:
if the charging type is determined to be USB charging, acquiring a data communication request queue of the OTG cable;
correspondingly, the power management module judges whether the current data communication type of the OTG cable is USB communication, including: the power supply management module judges whether the data communication request arranged at the first position in the data communication request queue of the OTG cable is a USB communication request, and if so, judges that the current data communication type is USB communication.
Optionally, the interface module is a TypeC USB socket;
correspondingly, the power management module detects whether the interface module of the terminal is connected with the OTG cable, including: the power management module detects whether a TypeC USB plug of an OTG cable is inserted into a TypeC USB socket of the terminal;
accordingly, the method further comprises: if the terminal is connected with the OTG cable, the power management module detects the first channel configuration CC1 interface voltage and the second channel configuration CC2 interface voltage of the TypeC USB socket;
correspondingly, the power management module determines the connection direction of the OTG cable, including: the power management module judges the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage.
Optionally, the determining, by the power management module, a connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage includes:
if the voltage of the CC1 interface is within a preset first voltage range, determining that the connection direction of the TypeC USB plug is a forward direction;
if the CC2 interface voltage is in the first voltage range, the connection direction of the TypeC USB plug is determined to be reverse.
Optionally, the power management module controls a first OTG power supply interface preset by itself and a second OTG power supply interface preset by the OTG cable to be connected according to the connection direction, controls a data interface of the CPU and a communication interface preset by the OTG cable to be connected, and controls a first charging interface preset by itself and a second charging interface preset by the OTG cable to be connected, including:
the power management module adjusts the connection mode inside a Switch module Switch of the terminal according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch.
Optionally, the adjusting, by the power management module, the connection mode inside the Switch module Switch of the terminal according to the connection direction includes:
if the connection direction is the forward direction, the power management module controls a self-preset Switch module control interface to output a low level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a first connection mode;
the Switch module control interface is connected with a first Switch interface SW0 preset by the Switch, and a general input/output interface of the CPU is connected with a second Switch interface SW3 preset by the Switch; the Switch includes: a first power interface Vbus1a, a first data interface, a second power interface Vbus2a, a second data interface, a third power interface Vbus1, a third data interface, a fourth power interface Vbus2, and a fourth data interface;
the first power interface Vbus1a is connected to a first charging interface of the power management module, the first data interface is connected to a data interface preset by the power management module, the second power interface Vbus2a is connected to a first OTG power supply interface of the power management module, the second data interface is connected to a data interface of the CPU, the third power interface Vbus1 is connected to a first power interface Vbus1 of the TypeC USB socket, the third data interface is connected to a first data interface of the TypeC USB socket, the fourth power interface Vbus2 is connected to a second power interface Vbus2 of the TypeC USB socket, and the fourth data interface is connected to a second data interface of the TypeC USB socket;
wherein, the first connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the third data interface;
the first power interface Vbus1 of the TypeC USB socket is connected with the preset second OTG power supply interface of the OTG cable, the first data interface of the TypeC USB socket is connected with the preset OTG communication interface of the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected with the preset second charging interface of the OTG cable, and the second data interface of the TypeC USB socket is connected with the preset charging communication interface of the OTG cable.
Optionally, the power management module adjusts a connection mode inside the Switch module Switch of the terminal according to the connection direction, and further includes:
if the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output a high level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a second connection mode;
wherein, the second connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the fourth data interface;
the first power interface Vbus1 of the TypeC USB socket is connected with the preset second charging interface of the OTG cable, the first data interface of the TypeC USB socket is connected with the preset charging communication interface of the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected with the preset second OTG power supply interface of the OTG cable, and the second data interface of the TypeC USB socket is connected with the preset OTG communication interface of the OTG cable.
Optionally, the method further includes:
the power management module detects whether the OTG cable is connected with a device for charging;
if the OTG cable is connected with a device for charging, the power supply management module determines the charging type;
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is positive, the power management module controls a Switch module control interface preset by the power management module to output low level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a third connection mode;
wherein, the third connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the fourth data interface.
Optionally, the power management module detects whether the OTG cable is connected to a device for charging, including:
the power supply management module detects the voltage of a first charging interface preset by the power supply management module;
the power management module judges whether the voltage is in a preset second voltage range, and if so, the OTG cable is connected with a charging device.
Optionally, the method further includes:
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output high level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a fourth connection mode;
wherein, the fourth connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the third data interface.
In a second aspect, an embodiment of the present invention further provides a terminal, including: the system comprises a power supply management module, a CPU and an interface module;
the power management module includes: the system comprises a first OTG power supply interface and a first charging interface;
the power management module is used for: detecting whether the interface module is connected with an OTG cable or not; if the interface module is detected to be connected with the OTG cable, judging the connection direction of the OTG cable; according to the connection direction, the first OTG power supply interface is controlled to be connected with a second OTG power supply interface preset by the OTG cable, the data interface of the CPU is controlled to be connected with an OTG communication interface preset by the OTG cable, and the first charging interface is controlled to be connected with a second charging interface preset by the OTG cable.
Optionally, the power management module is further configured to control a preset data interface of the power management module to be connected to a preset charging communication interface of the OTG cable according to the connection direction.
Optionally, the power management module is further configured to:
detecting whether the OTG cable is connected with a device for charging; if the OTG cable is detected to be connected with equipment for charging, determining a charging type; if the charging type is determined to be USB charging, judging whether the current data communication type of the OTG cable is USB communication, if so, controlling the connection disconnection between the data interface of the CPU and the OTG communication interface preset by the OTG cable according to the connection direction, and controlling the data interface of the CPU to be connected with the charging communication interface preset by the OTG cable.
Optionally, the power management module is further configured to: if the charging type is determined to be USB charging, acquiring a data communication request queue of the OTG cable;
correspondingly, the power management module judges whether the current data communication type of the OTG cable is USB communication, including: the power supply management module judges whether the data communication request arranged at the first position in the data communication request queue of the OTG cable is a USB communication request, and if so, judges that the current data communication type is USB communication.
Optionally, the interface module is a TypeC USB socket;
correspondingly, the power management module detects whether the interface module is connected to an OTG cable, including: the power management module detects whether a TypeC USB plug of an OTG cable is inserted into a TypeC USB socket of the terminal;
correspondingly, the power management module is further configured to: if the interface module is connected with the OTG cable, detecting the voltage of a first channel configuration CC1 interface and the voltage of a second channel configuration CC2 interface of the TypeC USB socket;
correspondingly, the power management module determines the connection direction of the OTG cable, including: the power management module judges the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage.
Optionally, the determining, by the power management module, a connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage includes:
if the voltage of the CC1 interface is within a preset first voltage range, determining that the connection direction of the TypeC USB plug is a forward direction;
if the CC2 interface voltage is in the first voltage range, the connection direction of the TypeC USB plug is determined to be reverse.
Optionally, the terminal further includes: a Switch module Switch;
correspondingly, the power management module controls the first OTG power supply interface and the preset second OTG power supply interface of the OTG cable according to the connection direction, controls the data interface of the CPU and the preset OTG communication interface of the OTG cable, and controls the first charging interface and the preset second charging interface of the OTG cable to be connected, including:
the power management module adjusts the connection mode inside the Switch according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch.
Optionally, the power management module includes: a switch module control interface;
the Switch includes: a first switch interface SW0, a second switch interface SW3, a first power interface Vbus1a, a first data interface, a second power interface Vbus2a, a second data interface, a third power interface Vbus1, a third data interface, a fourth power interface Vbus2, and a fourth data interface;
the switch module control interface is connected with the first switch interface SW0, and the general input/output interface of the CPU is connected with the second switch interface SW 3; the first power interface Vbus1a is connected to a first charging interface of the power management module, the first data interface is connected to a data interface preset by the power management module, the second power interface Vbus2a is connected to a first OTG power supply interface of the power management module, the second data interface is connected to a data interface of the CPU, the third power interface Vbus1 is connected to a first power interface Vbus1 of the TypeC USB socket, the third data interface is connected to a first data interface of the TypeC USB socket, the fourth power interface Vbus2 is connected to a second power interface Vbus2 of the TypeC USB socket, and the fourth data interface is connected to a second data interface of the TypeC USB socket;
if the connection direction is a forward direction, a first power interface Vbus1 of the TypeC USB socket is connected with a second OTG power supply interface preset by the OTG cable, a first data interface of the TypeC USB socket is connected with an OTG communication interface preset by the OTG cable, a second power interface Vbus2 of the TypeC USB socket is connected with a second charging interface preset by the OTG cable, and a second data interface of the TypeC USB socket is connected with a charging communication interface preset by the OTG cable;
correspondingly, the power management module adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, and the method includes: if the connection direction is the forward direction, the power management module controls the Switch module control interface to output a low level and controls the general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is the first connection mode;
wherein, the first connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the third data interface.
Optionally, if the connection direction is a reverse direction, the first power interface Vbus1 of the TypeC USB socket is connected to a second charging interface preset by the OTG cable, the first data interface of the TypeC USB socket is connected to a charging communication interface preset by the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected to a second OTG power supply interface preset by the OTG cable, and the second data interface of the TypeC USB socket is connected to an OTG communication interface preset by the OTG cable;
correspondingly, the power management module adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, and further includes:
if the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output a high level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a second connection mode;
wherein, the second connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the fourth data interface.
Optionally, the power management module is further configured to: detecting whether the OTG cable is connected with a device for charging; if the OTG cable is detected to be connected with equipment for charging, determining a charging type; if the charging type is determined to be USB charging, judging whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is positive, controlling a self-preset Switch module control interface to output low level and controlling a general input/output interface of the CPU to output high level so as to enable the connection mode inside the Switch to be a third connection mode;
wherein, the third connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the fourth data interface.
Optionally, the power management module detects whether the OTG cable is connected to a device for charging, including:
the power supply management module detects the voltage of a first charging interface preset by the power supply management module;
the power management module judges whether the voltage is in a preset second voltage range, and if so, the OTG cable is connected with a charging device.
Optionally, the power management module is further configured to: if the charging type is determined to be USB charging, judging whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is reverse, controlling a self-preset Switch module control interface to output high level and controlling a general input/output interface of the CPU to output high level so as to enable the connection mode inside the Switch to be a fourth connection mode;
wherein, the fourth connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the third data interface.
Compared with the prior art, the method and the terminal for executing the OTG function and the charging function in parallel provided by the embodiment of the invention detect the connection direction of the OTG cable through the power management module, and then the power management module controls the preset OTG power supply interface of the power management module and the data interface of the CPU to be respectively connected with the preset OTG power supply interface and the preset OTG communication interface of the OTG cable according to the connection direction, so that the OTG communication of the terminal and the device with the OTG function connected by the OTG cable is realized, that is, the OTG function is also realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic hardware structure of an alternative mobile terminal for implementing various embodiments of the present invention;
FIG. 2 is a diagram of a communication system of the mobile terminal of FIG. 1;
fig. 3 is a flowchart of a method for performing an OTG function and a charging function in parallel according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a terminal according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal in which a connection manner inside a Switch is a first connection manner according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a terminal in which a connection manner inside a Switch is a third connection manner according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal in which a connection manner inside a Switch is a second connection manner according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a terminal in which a connection manner inside a Switch is a fourth connection manner according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The execution subject of the method for executing the OTG function and the charging function in parallel disclosed in this embodiment is a power management module, which may be disposed in a terminal, which may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet), a PMP (portable multimedia player), a navigation device, and the like, and a fixed terminal such as a digital TV, a desktop computer, a printer, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for moving purposes.
Fig. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention.
The mobile terminal 100 may include a wireless communication unit 110, an a/V (audio/video) input unit 120, a user input unit 130, a sensing unit 140, an output unit 150, a memory 160, an interface unit 170, a controller 180, and a power supply unit 190, etc. Fig. 1 illustrates a mobile terminal having various components, but it is to be understood that not all illustrated components are required to be implemented. More or fewer components may alternatively be implemented. Elements of the mobile terminal will be described in detail below.
The wireless communication unit 110 typically includes one or more components that allow radio communication between the mobile terminal 100 and a wireless communication system or network. For example, the wireless communication unit may include at least one of a broadcast receiving module 111, a mobile communication module 112, a wireless internet module 113, a short-range communication module 114, and a location information module 115.
The broadcast receiving module 111 receives a broadcast signal and/or broadcast associated information from an external broadcast management server via a broadcast channel. The broadcast channel may include a satellite channel and/or a terrestrial channel. The broadcast management server may be a server that generates and transmits a broadcast signal and/or broadcast associated information or a server that receives a previously generated broadcast signal and/or broadcast associated information and transmits it to a terminal. The broadcast signal may include a TV broadcast signal, a radio broadcast signal, a data broadcast signal, and the like. Also, the broadcast signal may further include a broadcast signal combined with a TV or radio broadcast signal. The broadcast associated information may also be provided via a mobile communication network, and in this case, the broadcast associated information may be received by the mobile communication module 112. The broadcast signal may exist in various forms, for example, it may exist in the form of an Electronic Program Guide (EPG) of Digital Multimedia Broadcasting (DMB), an Electronic Service Guide (ESG) of digital video broadcasting-handheld (DVB-H), and the like. The broadcast receiving module 111 may receive a signal broadcast by using various types of broadcasting systems. In particular, the broadcast receiving module 111 may receive digital broadcasting by using a digital broadcasting system such as a digital broadcasting-terrestrial (DMB-T), digital multimedia broadcasting-satellite (DMB-S), digital video broadcasting-handheld (DVB-H), a data broadcasting system of forward link media (MediaFLO), a terrestrial digital broadcasting integrated service (ISDB-T), and the like. The broadcast receiving module 111 may be constructed to be suitable for various broadcasting systems that provide broadcast signals as well as the above-mentioned digital broadcasting systems. The broadcast signal and/or broadcast associated information received via the broadcast receiving module 111 may be stored in the memory 160 (or other type of storage medium).
The mobile communication module 112 transmits and/or receives radio signals to and/or from at least one of a base station (e.g., access point, node B, etc.), an external terminal, and a server. Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received according to text and/or multimedia messages.
The wireless internet module 113 supports wireless internet access of the mobile terminal. The module may be internally or externally coupled to the terminal. The wireless internet access technology to which the module relates may include WLAN (wireless LAN) (Wi-Fi), Wibro (wireless broadband), Wimax (worldwide interoperability for microwave access), HSDPA (high speed downlink packet access), and the like.
The short-range communication module 114 is a module for supporting short-range communication. Some examples of short-range communication technologies include bluetooth (TM), Radio Frequency Identification (RFID), infrared data association (IrDA), Ultra Wideband (UWB), zigbee (TM), and the like.
The location information module 115 is a module for checking or acquiring location information of the mobile terminal. A typical example of the location information module is a GPS (global positioning system). According to the current technology, the location information module 115 calculates distance information and accurate time information from three or more satellites and applies triangulation to the calculated information, thereby accurately calculating three-dimensional current location information according to longitude, latitude, and altitude. Currently, a method for calculating position and time information uses three satellites and corrects an error of the calculated position and time information by using another satellite. In addition, the position information module 115 can calculate the speed information by continuously calculating the current position information in real time.
The a/V input unit 120 is used to receive an audio or video signal. The a/V input unit 120 may include a camera 121 and a microphone 122, and the camera 121 processes image data of still pictures or video obtained by an image capturing apparatus in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 151. The image frames processed by the cameras 121 may be stored in the memory 160 (or other storage medium) or transmitted via the wireless communication unit 110, and two or more cameras 121 may be provided according to the construction of the mobile terminal. The microphone 122 may receive sounds (audio data) via the microphone 122 in a phone call mode, a recording mode, a voice recognition mode, or the like, and is capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the mobile communication module 112 in case of a phone call mode. The microphone 122 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The user input unit 130 may generate key input data according to a command input by a user to control various operations of the mobile terminal. The user input unit 130 allows a user to input various types of information, and may include a keyboard, dome sheet, touch pad (e.g., a touch-sensitive member that detects changes in resistance, pressure, capacitance, and the like due to being touched), scroll wheel, joystick, and the like. In particular, when the touch pad is superimposed on the display unit 151 in the form of a layer, a touch screen may be formed.
The sensing unit 140 detects a current state of the mobile terminal 100 (e.g., an open or closed state of the mobile terminal 100), a position of the mobile terminal 100, presence or absence of contact (i.e., touch input) by a user with the mobile terminal 100, an orientation of the mobile terminal 100, acceleration or deceleration movement and direction of the mobile terminal 100, and the like, and generates a command or signal for controlling an operation of the mobile terminal 100. For example, when the mobile terminal 100 is implemented as a slide-type mobile phone, the sensing unit 140 may sense whether the slide-type phone is opened or closed. In addition, the sensing unit 140 can detect whether the power supply unit 190 supplies power or whether the interface unit 170 is coupled with an external device. The sensing unit 140 may include a proximity sensor 141.
The interface unit 170 serves to connect the mobile terminal 100 with at least one external device. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The identification module may store various information for authenticating a user using the mobile terminal 100 and may include a User Identity Module (UIM), a Subscriber Identity Module (SIM), a Universal Subscriber Identity Module (USIM), and the like. In addition, a device having an identification module (hereinafter, referred to as an "identification device") may take the form of a smart card, and thus, the identification device may be connected with the mobile terminal 100 via a port or other connection means. The interface unit 170 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal and the external device. In addition, when the mobile terminal 100 is connected with an external cradle, the interface unit 170 may serve as a path through which power is supplied from the cradle to the mobile terminal 100 or may serve as a path through which various command signals input from the cradle are transmitted to the mobile terminal. Various command signals or power input from the cradle may be used as signals for recognizing whether the mobile terminal is accurately mounted on the cradle.
The output unit 150 is configured to provide output signals (e.g., audio signals, video signals, alarm signals, vibration signals, etc.) in a visual, audio, and/or tactile manner. The output unit 150 may include a display unit 151, an audio output module 152, an alarm unit 153, and the like.
The display unit 151 may display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in a phone call mode, the display unit 151 may display a User Interface (UI) or a Graphical User Interface (GUI) related to a call or other communication (e.g., text messaging, multimedia file downloading, etc.). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or an image and related functions, and the like.
Meanwhile, when the display unit 151 and the touch pad are overlapped with each other in the form of a layer to form a touch screen, the display unit 151 may serve as an input device and an output device. The display unit 151 may include at least one of a Liquid Crystal Display (LCD), a thin film transistor LCD (TFT-LCD), an Organic Light Emitting Diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like. Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as transparent displays, and a typical transparent display may be, for example, a TOLED (transparent organic light emitting diode) display or the like. Depending on the particular desired implementation, the mobile terminal 100 may include two or more display units (or other display devices), for example, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown). The touch screen may be used to detect a touch input pressure as well as a touch input position and a touch input area.
The audio output module 152 may convert audio data received by the wireless communication unit 110 or stored in the memory 160 into an audio signal and output as sound when the mobile terminal is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output module 152 may provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output module 152 may include a speaker, a buzzer, and the like.
The alarm unit 153 may provide an output to notify the mobile terminal 100 of the occurrence of an event. Typical events may include call reception, message reception, key signal input, touch input, and the like. In addition to audio or video output, the alarm unit 153 may provide output in different ways to notify the occurrence of an event. For example, the alarm unit 153 may provide an output in the form of vibration, and when a call, a message, or some other incoming communication (communicating communication) is received, the alarm unit 153 may provide a tactile output (i.e., vibration) to inform the user thereof. By providing such a tactile output, the user can recognize the occurrence of various events even when the user's mobile phone is in the user's pocket. The alarm unit 153 may also provide an output notifying the occurrence of an event via the display unit 151 or the audio output module 152.
The memory 160 may store software programs and the like for processing and controlling operations performed by the controller 180, or may temporarily store data (e.g., a phonebook, messages, still images, videos, and the like) that has been or will be output. Also, the memory 160 may store data regarding various ways of vibration and audio signals output when a touch is applied to the touch screen.
The memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. Also, the mobile terminal 100 may cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
The controller 180 generally controls the overall operation of the mobile terminal. For example, the controller 180 performs control and processing related to voice calls, data communications, video calls, and the like. In addition, the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, and the multimedia module 181 may be constructed within the controller 180 or may be constructed separately from the controller 180. The controller 180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
The power supply unit 190 receives external power or internal power and provides appropriate power required to operate various elements and components under the control of the controller 180.
The various embodiments described herein may be implemented in a computer-readable medium using, for example, computer software, hardware, or any combination thereof. For a hardware implementation, the embodiments described herein may be implemented using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, and in some cases, such embodiments may be implemented in the controller 180. For a software implementation, the implementation such as a process or a function may be implemented with a separate software module that allows performing at least one function or operation. The software codes may be implemented by software applications (or programs) written in any suitable programming language, which may be stored in the memory 160 and executed by the controller 180.
Up to this point, mobile terminals have been described in terms of their functionality. Hereinafter, a slide-type mobile terminal among various types of mobile terminals, such as a folder-type, bar-type, swing-type, slide-type mobile terminal, and the like, will be described as an example for the sake of brevity. Accordingly, the present invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
The mobile terminal 100 as shown in fig. 1 may be configured to operate with communication systems such as wired and wireless communication systems and satellite-based communication systems that transmit data via frames or packets.
A communication system in which a mobile terminal according to the present invention is operable will now be described with reference to fig. 2.
Such communication systems may use different air interfaces and/or physical layers. For example, the air interface used by the communication system includes, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)), global system for mobile communications (GSM), and the like. By way of non-limiting example, the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
Referring to fig. 2, the CDMA wireless communication system may include a plurality of mobile terminals 100, a plurality of Base Stations (BSs) 270, Base Station Controllers (BSCs) 275, and a Mobile Switching Center (MSC) 280. The MSC280 is configured to interface with a Public Switched Telephone Network (PSTN) 290. The MSC280 is also configured to interface with a BSC275, which may be coupled to the base station 270 via a backhaul. The backhaul may be constructed according to any of several known interfaces including, for example, E1/T1, ATM, IP, PPP, frame Relay, HDSL, ADSL, or xDSL. It will be understood that a system as shown in fig. 2 may include multiple BSCs 275.
Each BS270 may serve one or more sectors (or regions), each sector covered by a multi-directional antenna or an antenna pointing in a particular direction being radially distant from the BS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS270 may be configured to support multiple frequency allocations, with each frequency allocation having a particular frequency spectrum (e.g., 1.25MHz,5MHz, etc.).
The intersection of partitions with frequency allocations may be referred to as a CDMA channel. The BS270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology. In such a case, the term "base station" may be used to generically refer to a single BSC275 and at least one BS 270. The base stations may also be referred to as "cells". Alternatively, each sector of a particular BS270 may be referred to as a plurality of cell sites.
As shown in fig. 2, a Broadcast Transmitter (BT)295 transmits a broadcast signal to the mobile terminal 100 operating within the system. A broadcast receiving module 111 as shown in fig. 1 is provided at the mobile terminal 100 to receive a broadcast signal transmitted by the BT 295. In fig. 2, several Global Positioning System (GPS) satellites 300 are shown. The satellite 300 assists in locating at least one of the plurality of mobile terminals 100.
In fig. 2, a plurality of satellites 300 are depicted, but it is understood that useful positioning information may be obtained with any number of satellites. The location information module 115 as shown in fig. 1 is generally configured to cooperate with the satellites 300 to obtain desired positioning information. Other techniques that can track the location of the mobile terminal may be used instead of or in addition to GPS tracking techniques. In addition, at least one satellite 300 may selectively or additionally process satellite DMB transmission.
As a typical operation of the wireless communication system, the BS270 receives reverse link signals from various mobile terminals 100. The mobile terminal 100 is generally engaged in conversations, messaging, and other types of communications. Each reverse link signal received by a particular BS270 is processed within the particular BS 270. The obtained data is forwarded to the associated BSC 275. The BSC275 provides call resource allocation and mobility management functions including coordination of soft handoff procedures between the BSs 270. The BSCs 275 also route the received data to the MSC280, which provides additional routing services for interfacing with the PSTN 290. Similarly, the PSTN290 interfaces with the MSC280, the MSC280 interfaces with the BSCs 275, and the BSCs 275 accordingly control the BS270 to transmit forward link signals to the mobile terminal 100.
Based on the above mobile terminal hardware structure and communication system, the present invention provides various embodiments of the method.
In a first aspect, referring to fig. 3, an embodiment of the present invention provides a method for performing an OTG function and a charging function in parallel, where the method is applicable to a terminal, and the terminal includes but is not limited to: the method comprises the following steps of 101-103:
101. the power management module detects whether an interface module of the terminal is connected with the OTG cable.
In this embodiment, the OTG cable includes: interface module plug, OTG equipment socket and battery charging outfit socket, wherein, the interface module plug can insert the interface module at terminal to make OTG cable connection terminal, OTG equipment socket can connect the equipment that has the OTG function, and battery charging outfit socket can connect the equipment that has the function of charging.
102. And if the power management module detects that the interface module of the terminal is connected with the OTG cable, judging the connection direction of the OTG cable.
In this embodiment, if it is detected that the interface module plug of the OTG cable is inserted into the interface module of the terminal, it is determined that the interface module of the terminal is connected to the OTG cable.
In this embodiment, the connection direction of the OTG cable may be understood as an insertion direction of an interface module plug of the OTG cable being inserted into an interface module of the terminal, where the insertion direction includes two kinds, one is a forward direction, and the other is a reverse direction. The power management module should control interface connection according to the different connection direction of OTG cable to satisfy the terminal and all support the OTG function and charge the function simultaneously at the different connection direction of OTG circuit. The control interface is connected to step 103 as follows.
103. The power management module controls a first OTG power supply interface preset by the power management module according to the connection direction to be connected with a second OTG power supply interface preset by the OTG cable, controls a data interface of a Central Processing Unit (CPU) to be connected with an OTG communication interface preset by the OTG cable, and controls a first charging interface preset by the power management module to be connected with a second charging interface preset by the OTG cable.
In this embodiment, in order to enable the terminal to support the OTG function and the charging function at the same time, therefore, the power management module is preset with a first OTG power supply interface and a first charging interface, and the CPU has a data interface. The power management module supplies power to the OTG cable-connected equipment with the OTG function through the first OTG power supply interface, and the power supply voltage is 5V so that the OTG cable-connected equipment can normally work, and the CPU can carry out OTG communication with the OTG cable-connected equipment through the self-preset data interface. The device with the charging function connected by the OTG cable can charge the power management module through a first charging interface preset by the power management module.
In this embodiment, because the OTG cable includes the OTG device socket and the charging device socket, the OTG cable is preset with a second OTG power supply interface, a second OTG communication interface, and a second charging interface. The power management module controls a first OTG power supply interface preset by the power management module according to the connection direction to be connected with a second OTG power supply interface preset by the OTG cable, controls a data interface of the CPU to be connected with an OTG communication interface preset by the OTG cable, and controls a first charging interface preset by the power management module to be connected with a second charging interface preset by the OTG cable, so that the terminal can simultaneously support the OTG function and the charging function.
It can be seen that, in the method for concurrently executing the OTG function and the charging function disclosed in this embodiment, the connection direction of the OTG cable is detected by the power management module, and then the power management module controls the preset OTG power supply interface of the power management module and the data interface of the CPU to be respectively connected to the preset OTG power supply interface and the preset OTG communication interface of the OTG cable according to the connection direction, thereby implementing the OTG communication of the terminal and the device with the OTG function connected to the OTG cable, that is, implementing the OTG function.
In a specific example, the method may further include step 104:
104. and the power supply management module controls a self-preset data interface to be connected with a preset charging communication interface of the OTG cable according to the connection direction.
In this embodiment, considering that the charging current and the charging voltage provided by different devices with the charging function may be different, in order to optimize the charging effect, the device with the charging function may perform charging protocol communication with the power management module, and further, the device with the charging function may provide the optimal charging current and charging voltage that can be provided by itself to the power management module. Therefore, the power management module is preset with a data interface, the OTG cable is preset with a charging communication interface, the power management module controls the self-preset data interface to be connected with the preset charging communication interface of the OTG cable according to the connection direction, and the device connected with the OTG cable and having the charging function can perform charging protocol communication through the preset charging communication interface of the OTG cable and the preset data interface of the power management module.
Based on the previous embodiment, in this embodiment, the method may further include steps 105 to 107:
105. the power management module detects whether the OTG cable is connected with a device for charging.
In this embodiment, considering that the charging type includes wall charging and USB charging, and the data communication type of the OTG cable includes OTG communication and USB communication, where the USB charging device is, for example, a Personal Computer (PC), for different charging types, the power management module should adjust a connection relationship between the data interface of the CPU, the OTG communication interface preset by the OTG cable, and the charging communication interface preset by the OTG cable, so as to meet the requirements of different data communication types of the OTG cable. For this reason, the power management module needs to detect whether the OTG cable is connected to the device for charging.
106. If the OTG cable is connected with the charging equipment, the power management module determines the charging type.
In this embodiment, the manner of determining the charging type may follow the existing manner, and this embodiment is not described again.
107. If the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, and if the current data communication type of the OTG cable is USB communication, the power management module controls the connection disconnection between the data interface of the CPU and the OTG communication interface preset by the OTG cable according to the connection direction and controls the connection between the data interface of the CPU and the charging communication interface preset by the OTG cable. After the data interface of the CPU is connected with the preset charging communication interface of the OTG cable, the CPU can carry out USB communication with the charging communication interface of the OTG cable through the data interface.
In this embodiment, if it is determined that the charging type is USB charging, the device with the charging function connected to the OTG cable does not need to perform charging protocol communication with the data interface preset by the power management module through the charging communication interface preset by the OTG cable, and the device with the charging function can directly output corresponding current and voltage to the first charging interface preset by the power management module through the second charging interface preset by the OTG cable according to the preset USB charging current and voltage, so as to implement the execution of the charging function.
In this embodiment, if it is determined that the charging type is USB charging and the power management module determines that the current data communication type of the OTG cable is OTG communication, the power management module controls the data interface of the CPU to be connected only with the preset OTG communication interface of the OTG cable according to the connection direction.
In this embodiment, because there is only OTG communication between the CPU and the OTG cable when the charging type is wall charging, if the power management module determines that the charging type is wall charging, the power management module controls the data interface of the CPU to be connected only with the preset OTG communication interface of the OTG cable according to the connection direction.
In this embodiment, if it is determined that the charging type is wall charging, the device with the charging function connected to the OTG cable performs charging protocol communication with the data interface preset by the power management module through the charging communication interface preset by the OTG cable, and after the charging protocol communication is completed, the device with the charging function outputs corresponding current and voltage to the first charging interface preset by the power management module through the second charging interface preset by the OTG cable according to the contents of the charging protocol, so as to implement the execution of the charging function.
Based on the previous embodiment, in this embodiment, the method may further include the step 107':
107', if the charging type is determined to be USB charging, the power management module obtains a data communication request queue of the OTG cable.
In this embodiment, if the charging type is USB charging, it is described that the device with the charging function connected to the OTG cable can perform USB communication with the CPU, and since the device with the OTG function connected to the OTG cable can perform OTG communication with the CPU, a communication request needs to be sent to the CPU regardless of USB communication or OTG communication, so that the data communication request queue of the OTG cable is formed by arranging the communication requests in sequence.
Correspondingly, the step 107 of the power management module determining whether the current data communication type of the OTG cable is USB communication includes: the power management module judges whether the data communication request arranged at the first position in the data communication request queue of the OTG cable is a USB communication request, and if so, the current data communication type is judged to be USB communication.
In a specific example, the interface module of the terminal is a Type C USB socket, and the interface module plug of the OTG cable is a Type C USB plug. The Type C USB socket supports the function of inserting the Type C USB plug from the positive and negative sides and inserting the plug into the positive and negative sides.
Correspondingly, step 101 the power management module detects whether the interface module of the terminal is connected to the OTG cable, including: whether insert the Type C USB plug of OTG cable in the Type C USB socket at power management module test terminal.
Accordingly, the method may further comprise the step 101': if the terminal is detected to be connected with the OTG cable, the power management module detects a first Channel Configuration (Configuration Channel) CC1 interface voltage and a second Channel Configuration CC2 interface voltage of the Type C USB socket. In this embodiment, the power management module includes a CC1 interface and a CC2 interface, and is used to connect the CC1 interface and the CC2 interface of the Type C USB socket, respectively.
Correspondingly, the step 102 of the power management module determining the connection direction of the OTG cable includes: the power management module judges the connection direction of the Type C USB plug based on the CC1 interface voltage and the CC2 interface voltage.
In this embodiment, the CC1 interface and the CC2 interface of the Type C USB socket are further used for discovery, configuration, management, and function negotiation of connection, where the function negotiation includes: a power function, an alternative mode, and a peripheral mode on the interface are negotiated. Only one interface signal of the CC1 interface and the CC2 interface is used as a configuration channel, and the other interface signal of the CC1 interface and the CC2 interface is used for supplying power for USB logic in an uplink data port.
Based on the previous embodiment, in this embodiment, the power management module in step 102 determines the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage, and specifically includes steps 1021 and 1022:
1021. if the voltage of the CC1 interface is within a preset first voltage range, the connection direction of the TypeC USB plug is determined to be the positive direction.
1022. If the voltage of the CC2 interface is in the first voltage range, the connection direction of the TypeC USB plug is determined to be reverse.
In this embodiment, the preset first voltage range is, for example, 0.35V to 0.45V.
In a specific example, the power management module in step 103 controls a first OTG power supply interface preset by itself to be connected to a second OTG power supply interface preset by an OTG cable according to the connection direction, controls a data interface of the CPU to be connected to an OTG communication interface preset by the OTG cable, and controls a first charging interface preset by itself to be connected to a second charging interface preset by the OTG cable, which is specifically as follows:
103. the power management module adjusts the connection mode inside the Switch module (Switch) of the terminal according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch.
In this embodiment, since the terminal is provided with the Switch module (Switch), the power management module controls the connection of the control interface by controlling the connection mode inside the Switch.
Based on the previous embodiment, in this embodiment, the power management module in step 103 adjusts a connection manner inside a Switch module (Switch) of the terminal according to the connection direction, and includes step 1031:
1031. if the connection direction is the forward direction, the power management module controls the preset Switch module control interface to output the low level and controls the general input/output interface of the CPU to output the low level, so that the connection mode inside the Switch is the first connection mode.
In the present embodiment, referring to fig. 6, the Power Management module is a Power Management Integrated Circuit (PMIC).
In this embodiment, referring to fig. 6, the switch module control interface is a USB PLUG interface. The Switch module control interface is connected with a first Switch interface SW0 preset by Switch, and a General Purpose Input/Output (GPIO) interface of the CPU is connected with a second Switch interface SW3 preset by Switch.
In this embodiment, referring to fig. 6, the Switch further includes the following interfaces: a first power supply (Vbus) interface Vbus1a, a first data interface (including a data positive port DP1a and a data negative port DM1a), a second power supply interface Vbus2a, a second data interface (including a data positive port DP2a and a data negative port DM2a), a third power supply interface Vbus1, a third data interface (including a data positive port DP1 and a data negative port DM1), a fourth power supply interface Vbus2, and a fourth data interface (including a data positive port DP2 and a data negative port DM 2).
In this embodiment, DM is an abbreviation for Data Minus, indicating a Data negative signal; DP is USB Data Positive, representing a Data Positive signal.
In this embodiment, referring to fig. 6, the connection relationship between the power management module, the CPU, the Type C USB socket, and the Switch is as follows: the first charging interface (Vbus2) of the power management module is connected to the first power interface Vbus1a of Switch, the preset data interface (including the positive data port DP2 and the negative data port DM2) of the power management module is connected to the first data interface of Switch, the first OTG power interface (i.e., Vbus _ OTG) of the power management module is connected to the second power interface Vbus2a of Switch, the data interface (including the positive data port DP2 and the negative data port DM2) of the CPU is connected to the second data interface of Switch, the first power interface Vbus1 of the type c USB socket is connected to the third power interface Vbus1 of Switch, the first data interface (including the positive data port DP1 and the negative data port DM2) of the type c USB socket is connected to the third data interface of Switch, the second data interface Vbus2 of the type USB socket is connected to the fourth power interface Vbus 733 of Switch, and the fourth data interface Vbus 3884 of Switch is connected to the second power interface Vbus1 of Switch.
In this embodiment, referring to fig. 6, the first connection mode is: the first power interface Vbus1a of Switch is connected to the fourth power interface Vbus2 of Switch, the first data interface of Switch is connected to the fourth data interface of Switch, the second power interface Vbus2a of Switch is connected to the third power interface Vbus1 of Switch, and the second data interface of Switch is connected to the third data interface of Switch.
In this embodiment, referring to fig. 6, if the connection direction is the forward direction, the interface connection relationship between the TypeC USB socket and the OTG cable is as follows: the first power interface Vbus1 of the TypeC USB socket is connected with a preset second OTG power supply interface (namely Vbus1 of the TypeC USB plug) of the OTG cable, the first data interface of the TypeC USB socket is connected with a preset OTG communication interface (namely DP1 and DM1 of the TypeC USB plug) of the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected with a preset second charging interface (namely Vbus2 of the TypeC USB plug) of the OTG cable, and the second data interface of the TypeC USB socket is connected with a preset charging communication interface (namely DP2 and DM2 of the TypeC USB plug) of the OTG cable.
In this embodiment, referring to fig. 6, an OTG device socket included in the OTG cable is, for example, a Micro USB female socket, and a charging device socket included in the OTG cable is, for example: the cable connector comprises a TypeC USB socket, wherein Vbus1 and Vbus2 of the TypeC USB socket are connected with Vbus2 of the TypeC USB socket of the OTG cable, DP1 and DP2 of the TypeC USB socket are connected with DP2 of the TypeC USB socket of the OTG cable, DM1 and DM2 of the TypeC USB socket are connected with DM2 of the TypeC USB socket of the OTG cable, CC1 and CC2 of the TypeC USB socket are connected with CC1 and CC2 of the TypeC USB socket of the OTG cable respectively, and SBU1 and SBU2 of the TypeC USB socket are both suspended.
Based on the previous embodiment, in this embodiment, the power management module in step 103 adjusts a connection manner inside a Switch module (Switch) of the terminal according to the connection direction, and further includes step 1032:
1032. if the connection direction is reverse, the power management module controls the self-preset Switch module control interface to output high level and controls the general input/output interface of the CPU to output low level, so that the connection mode inside the Switch is the second connection mode.
In this embodiment, referring to fig. 8, the second connection mode is: the first power interface Vbus1a of Switch is connected to the third power interface Vbus1 of Switch, the first data interface of Switch is connected to the third data interface of Switch, the second power interface Vbus2a of Switch is connected to the fourth power interface Vbus2 of Switch, and the second data interface of Switch is connected to the fourth data interface of Switch.
In this embodiment, referring to fig. 8, if the connection direction is reverse, the interface connection relationship between the TypeC USB socket and the OTG cable is as follows: the first power interface Vbus1 of the TypeC USB socket is connected with a second charging interface preset by the OTG cable (namely Vbus2 of the TypeC USB plug), the first data interface of the TypeC USB socket is connected with charging communication interfaces preset by the OTG cable (namely DP2 and DM2 of the TypeC USB plug), the second power interface Vbus2 of the TypeC USB socket is connected with a second OTG power supply interface preset by the OTG cable (namely Vbus1 of the TypeC USB plug), and the second data interface of the TypeC USB socket is connected with OTG communication interfaces preset by the OTG cable (namely DP1 and DM1 of the TypeC USB plug).
In this embodiment, the SBUs 1 and SUB2 are sideband Use (Side Band Use) interfaces, are suitable for transmitting non-USB signals, and are used in an analog audio Mode, an alternative Mode (Alternate Mode, abbreviated as "Alt Mode"), and an peripheral Mode (access Mode).
Based on the previous embodiment, in this embodiment, the method may further include steps 105 to 107:
105. the power management module detects whether the OTG cable is connected with a device for charging.
In this embodiment, step 105 may include the following steps 1051 and 1052:
1051. the power management module detects the voltage of the first charging interface (i.e., Vbus2) preset by itself.
1052. The power management module judges whether the voltage is in a preset second voltage range, and if so, the OTG cable is connected with a charging device. In this embodiment, the preset second voltage range is, for example, 4.2V to 10V.
106. If the OTG cable is connected with the charging equipment, the power management module determines the charging type.
107. If the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, and if the current data communication type of the OTG cable is USB communication, the power management module controls the connection disconnection between the data interface of the CPU and the OTG communication interface preset by the OTG cable according to the connection direction and controls the connection between the data interface of the CPU and the charging communication interface preset by the OTG cable.
In this embodiment, step 107 includes: if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is positive, the power management module controls a Switch module control interface preset by the power management module to output low level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a third connection mode.
In this embodiment, referring to fig. 7, the third connection mode is: the first power interface Vbus1a of Switch is connected to the fourth power interface Vbus2 of Switch, the first data interface of Switch is connected to the fourth data interface of Switch, the second power interface Vbus2a of Switch is connected to the third power interface Vbus1 of Switch, and the second data interface of Switch is connected to the fourth data interface of Switch.
Based on the previous embodiment, in this embodiment, step 107 further includes: if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is reverse, the power management module controls a Switch module control interface preset by the power management module to output high level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a fourth connection mode.
In this embodiment, referring to fig. 9, the fourth connection mode is: the first power interface Vbus1a of Switch is connected to the third power interface Vbus1 of Switch, the first data interface of Switch is connected to the third data interface of Switch, the second power interface Vbus2a of Switch is connected to the fourth power interface Vbus2 of Switch, and the second data interface of Switch is connected to the third data interface of Switch.
It can be seen that, in the method for concurrently executing the OTG function and the charging function disclosed in this embodiment, the connection direction of the OTG cable is detected by the power management module, and then the power management module controls the preset OTG power supply interface of the power management module and the data interface of the CPU to be respectively connected to the preset OTG power supply interface and the preset OTG communication interface of the OTG cable according to the connection direction, thereby implementing the OTG communication of the terminal and the device with the OTG function connected to the OTG cable, that is, implementing the OTG function.
In a second aspect, an embodiment of the present invention further discloses a terminal 2, and referring to fig. 4, the terminal may include: a power management module 21, a CPU22, and an interface module 23.
In this embodiment, the OTG cable 3 includes: interface module plug 31, OTG equipment socket 32 and charging equipment socket 33, wherein, interface module plug 31 can insert the interface module 23 at terminal to make the OTG cable connect the terminal, OTG equipment socket can connect the equipment that has the OTG function, and charging equipment socket can connect the equipment that has the function of charging.
In this embodiment, the power management module 21, the CPU22 and the interface module 23 are connected in pairs.
In this embodiment, the power management module 21 includes: the first OTG power supply interface and the first interface that charges.
In this embodiment, the power management module 21 is configured to: detecting whether the interface module 23 is connected with an OTG cable; if the interface module 23 is detected to be connected with the OTG cable, judging the connection direction of the OTG cable; according to the connection direction, the first OTG power supply interface is controlled to be connected with a preset second OTG power supply interface of the OTG cable, the data interface of the CPU22 is controlled to be connected with a preset OTG communication interface of the OTG cable, and the first charging interface is controlled to be connected with the preset second charging interface of the OTG cable.
In this embodiment, the power management module 21 and the CPU22 may perform data interaction.
It is thus clear that this embodiment discloses the terminal, detect the direction of connection of OTG cable through power management module 21, and then power management module 21 connects predetermined OTG power supply interface and OTG communication interface of OTG cable respectively according to direction of connection control self predetermined OTG power supply interface and CPU 22's data interface, thereby the equipment that has the OTG function that realizes that the terminal is connected with the OTG cable carries out the OTG communication, also realized the OTG function, in addition, power management module 21 still connects the predetermined interface that charges of OTG cable according to direction of connection control self predetermined interface that charges, realize the function of charging, make the OTG function and the function of charging of terminal can carry out simultaneously, solve the problem that the terminal can't support the OTG function and the function of charging and carry out simultaneously.
In a specific example, the power management module 21 is further configured to: and controlling a preset data interface of the OTG cable to be connected with a preset charging communication interface of the OTG cable according to the connection direction.
Based on the previous embodiment, in this embodiment, the power management module 21 is further configured to: detecting whether the OTG cable is connected with a device for charging; if the OTG cable is detected to be connected with equipment for charging, determining the charging type; if the charging type is determined to be USB charging, whether the current data communication type of the OTG cable is USB communication is judged, if the current data communication type is USB communication, the connection disconnection between the data interface of the CPU22 and the OTG communication interface preset by the OTG cable is controlled according to the connection direction, and the connection between the data interface of the CPU22 and the charging communication interface preset by the OTG cable is controlled.
Based on the previous embodiment, in this embodiment, the power management module 21 is further configured to: if the charging type is determined to be USB charging, acquiring a data communication request queue of the OTG cable;
correspondingly, the power management module 21 determines whether the current data communication type of the OTG cable is USB communication, including: the power management module 21 determines whether the data communication request arranged at the first position in the data communication request queue of the OTG cable is a USB communication request, and if so, determines that the current data communication type is USB communication.
In one specific example, the interface module 23 is a TypeC USB socket;
accordingly, the power management module 21 detects whether the interface module 23 is connected to the OTG cable, including: the power management module 21 detects whether a TypeC USB plug of an OTG cable is inserted into a TypeC USB socket of the terminal;
accordingly, the power management module 21 is further configured to: if the interface module 23 is detected to be connected with the OTG cable, detecting a first channel configuration CC1 interface voltage and a second channel configuration CC2 interface voltage of the TypeC USB socket;
correspondingly, the power management module 21 determines the connection direction of the OTG cable, including: the power management module 21 determines the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage.
Based on the previous embodiment, in this embodiment, the determining, by the power management module 21, the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage includes:
if the voltage of the CC1 interface is in a preset first voltage range, judging that the connection direction of the TypeC USB plug is the positive direction;
if the voltage of the CC2 interface is in the first voltage range, the connection direction of the TypeC USB plug is determined to be reverse.
In a specific example, referring to fig. 5, the terminal 2 may further include: a Switch module (Switch) 24;
correspondingly, power management module 21 controls the preset second OTG power supply interface connection of first OTG power supply interface and OTG cable according to the connection direction, and controls the preset OTG communication interface connection of CPU 22's data interface and OTG cable, and controls the preset second charging interface connection of first charging interface and OTG cable, including:
the power management module 21 adjusts the connection mode inside the Switch according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU22 is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch.
In a specific example, the power management module 21 includes: a switch module control interface;
the Switch includes: a first switch interface SW0, a second switch interface SW3, a first power interface Vbus1a, a first data interface, a second power interface Vbus2a, a second data interface, a third power interface Vbus1, a third data interface, a fourth power interface Vbus2, and a fourth data interface;
the switch module control interface is connected with the first switch interface SW0, and the general input/output interface of the CPU22 is connected with the second switch interface SW 3; the first power interface Vbus1a is connected with a first charging interface of the power management module 21, the first data interface is connected with a preset data interface of the power management module 21, the second power interface Vbus2a is connected with a first OTG power supply interface of the power management module 21, the second data interface is connected with a data interface of a CPU22, the third power interface Vbus1 is connected with a first power interface Vbus1 of a TypeC USB socket, the third data interface is connected with a first data interface of the TypeC USB socket, the fourth power interface Vbus2 is connected with a second power interface Vbus2 of the TypeC USB socket, and the fourth data interface is connected with a second data interface of the TypeC USB socket;
if the connection direction is the forward direction, a first power interface Vbus1 of the TypeC USB socket is connected with a second OTG power supply interface preset by an OTG cable, a first data interface of the TypeC USB socket is connected with an OTG communication interface preset by the OTG cable, a second power interface Vbus2 of the TypeC USB socket is connected with a second charging interface preset by the OTG cable, and a second data interface of the TypeC USB socket is connected with a charging communication interface preset by the OTG cable;
correspondingly, the power management module 21 adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, including: if the connection direction is positive, the power management module 21 controls the Switch module control interface to output low level and controls the general-purpose input/output interface of the CPU22 to output low level, so that the connection mode inside the Switch is the first connection mode;
wherein, the first connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the third data interface.
Based on the previous embodiment, in this embodiment, if the connection direction is reverse, the first power interface Vbus1 of the TypeC USB socket is connected to the second charging interface preset by the OTG cable, the first data interface of the TypeC USB socket is connected to the charging communication interface preset by the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected to the second OTG power supply interface preset by the OTG cable, and the second data interface of the TypeC USB socket is connected to the OTG communication interface preset by the OTG cable;
correspondingly, the power management module 21 adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, and further includes:
if the connection direction is reverse, the power management module 21 controls the Switch module control interface preset by itself to output a high level and controls the general input/output interface of the CPU22 to output a low level, so that the connection mode inside the Switch is the second connection mode;
wherein, the second connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the fourth data interface.
Based on the previous embodiment, in this embodiment, the power management module 21 is further configured to: detecting whether the OTG cable is connected with a device for charging; if the OTG cable is detected to be connected with equipment for charging, determining the charging type; if the charging type is determined to be USB charging, whether the current data communication type of the OTG cable is USB communication is judged, if the current data communication type is USB communication and the connection direction is positive, a Switch module preset by the OTG cable is controlled to output a low level and a general input/output interface of the CPU22 is controlled to output a high level, so that the connection mode inside the Switch is a third connection mode;
wherein, the third connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the fourth data interface.
Based on the previous embodiment, in this embodiment, the detecting, by the power management module 21, whether the OTG cable is connected to the device for charging includes:
the power management module 21 detects the voltage of a first charging interface preset by the power management module;
the power management module 21 determines whether the voltage is within a preset second voltage range, and if so, determines that the OTG cable is connected to the charging device.
In a specific example, the power management module 21 is further configured to: if the charging type is determined to be USB charging, judging whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is reverse, controlling a self-preset Switch module control interface to output a high level and controlling a general input/output interface of the CPU22 to output a high level so as to enable the connection mode inside the Switch to be a fourth connection mode;
wherein, the fourth connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the third data interface.
It should be noted that, the terminal disclosed in the second aspect is capable of implementing the steps of the method embodiments disclosed in the first aspect, and is not described herein again to avoid repetition.
The terminal disclosed in the second aspect, detect the direction of connection of OTG cable through power management module, and then power management module connects preset OTG power supply interface of OTG cable and OTG communication interface respectively according to direction of connection control self preset OTG power supply interface and CPU's data interface, thereby the equipment that has OTG function that realizes that the terminal is connected with the OTG cable carries out OTG communication, also realized the OTG function, in addition, power management module still connects the preset interface that charges of OTG cable according to direction of connection control self preset interface that charges, realize the function of charging, make the OTG function and the function of charging of terminal can carry out simultaneously, solve the problem that the terminal can't support the OTG function and the function of charging and carry out simultaneously.
Those of ordinary skill in the art will appreciate that the various illustrative steps and modules described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It is noted that, in this document, the term "comprising" is intended to cover a non-exclusive inclusion.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
Through the above description of the embodiments, those skilled in the art will clearly understand that the methods described in the embodiments of the present invention can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (12)
1. A method for parallel execution of an OTG function and a charging function is applied to a terminal, and the terminal comprises: a power management module and an interface module, the method comprising:
the power management module detects whether an interface module of the terminal is connected with the OTG cable;
if the power management module detects that an interface module of the terminal is connected with an OTG cable, judging the connection direction of the OTG cable;
the power management module according to the direction of connection, control first OTG power supply interface that self predetermines with the second OTG power supply interface connection that the OTG cable predetermines to control CPU's data interface with the OTG communication interface connection that the OTG cable predetermines, and control the first interface that charges that self predetermines with the second interface connection that charges that the OTG cable predetermines includes: the power management module adjusts the connection mode inside a Switch module of the terminal according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch;
the power management module adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, and the method comprises the following steps:
if the connection direction is the forward direction, the power management module controls a self-preset Switch module control interface to output a low level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a first connection mode;
wherein the Switch comprises: a first power interface Vbus1a, a first data interface, a second power interface Vbus2a, a second data interface, a third power interface Vbus1, a third data interface, a fourth power interface Vbus2, and a fourth data interface;
wherein, the first connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the third data interface;
if the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output a high level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a second connection mode;
wherein, the second connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the fourth data interface.
2. The method of claim 1, further comprising:
and the power supply management module controls a self-preset data interface to be connected with a preset charging communication interface of the OTG cable according to the connection direction.
3. The method of claim 2, further comprising:
the power management module detects whether the OTG cable is connected with a device for charging;
if the OTG cable is connected with a device for charging, the power supply management module determines the charging type;
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type of the OTG cable is USB communication, the power management module controls the connection disconnection between the data interface of the CPU and the OTG communication interface preset by the OTG cable according to the connection direction, and controls the data interface of the CPU to be connected with the charging communication interface preset by the OTG cable.
4. The method of claim 3, further comprising:
if the charging type is determined to be USB charging, acquiring a data communication request queue of the OTG cable;
correspondingly, the power management module judges whether the current data communication type of the OTG cable is USB communication, including: the power supply management module judges whether the data communication request arranged at the first position in the data communication request queue of the OTG cable is a USB communication request, and if so, judges that the current data communication type is USB communication.
5. The method of claim 1, wherein the interface module is a TypeC USB socket;
correspondingly, the power management module detects whether the interface module of the terminal is connected with the OTG cable, including: the power management module detects whether a TypeC USB plug of an OTG cable is inserted into a TypeC USB socket of the terminal;
accordingly, the method further comprises: if the terminal is connected with the OTG cable, the power management module detects the first channel configuration CC1 interface voltage and the second channel configuration CC2 interface voltage of the TypeC USB socket;
correspondingly, the power management module determines the connection direction of the OTG cable, including: the power management module judges the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage.
6. The method of claim 5, wherein the power management module determining the connection direction of the TypeC USB plug based on the CC1 interface voltage and the CC2 interface voltage comprises:
if the voltage of the CC1 interface is within a preset first voltage range, determining that the connection direction of the TypeC USB plug is a forward direction;
if the CC2 interface voltage is in the first voltage range, the connection direction of the TypeC USB plug is determined to be reverse.
7. The method according to claim 6, wherein if the connection direction is a forward direction, the power management module controls a Switch module control interface preset by itself to output a low level and controls a general input/output interface of the CPU to output a low level, so that a connection manner inside the Switch is a first connection manner, including:
the Switch module control interface is connected with a first Switch interface SW0 preset by the Switch, and a general input/output interface of the CPU is connected with a second Switch interface SW3 preset by the Switch;
the first power interface Vbus1a is connected to a first charging interface of the power management module, the first data interface is connected to a data interface preset by the power management module, the second power interface Vbus2a is connected to a first OTG power supply interface of the power management module, the second data interface is connected to a data interface of the CPU, the third power interface Vbus1 is connected to a first power interface Vbus1 of the TypeC USB socket, the third data interface is connected to a first data interface of the TypeC USB socket, the fourth power interface Vbus2 is connected to a second power interface Vbus2 of the TypeC USB socket, and the fourth data interface is connected to a second data interface of the TypeC USB socket;
the first power interface Vbus1 of the TypeC USB socket is connected with the preset second OTG power supply interface of the OTG cable, the first data interface of the TypeC USB socket is connected with the preset OTG communication interface of the OTG cable, the second power interface Vbus2 of the TypeC USB socket is connected with the preset second charging interface of the OTG cable, and the second data interface of the TypeC USB socket is connected with the preset charging communication interface of the OTG cable.
8. The method according to claim 6, wherein if the connection direction is reverse, the power management module controls a Switch module control interface preset by itself to output a high level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a second connection mode, including:
the first power source interface Vbus1 of TypeC USB socket with the second interface connection that charges that the OTG cable was predetermine, the first data interface of TypeC USB socket with the communication interface connection that charges that the OTG cable was predetermine, the second power source interface Vbus2 of TypeC USB socket with the second OTG power supply interface connection that the OTG cable was predetermine, the second data interface of TypeC USB socket with the OTG communication interface connection that the OTG cable was predetermine.
9. The method according to claim 7 or 8, characterized in that the method further comprises:
the power management module detects whether the OTG cable is connected with a device for charging;
if the OTG cable is connected with a device for charging, the power supply management module determines the charging type;
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is positive, the power management module controls a Switch module control interface preset by the power management module to output low level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a third connection mode;
wherein, the third connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the fourth data interface.
10. The method of claim 9, wherein the power management module detects whether the OTG cable is connected to a device for charging, comprising:
the power supply management module detects the voltage of a first charging interface preset by the power supply management module;
the power management module judges whether the voltage is in a preset second voltage range, and if so, the OTG cable is connected with a charging device.
11. The method of claim 9, further comprising:
if the charging type is determined to be USB charging, the power management module judges whether the current data communication type of the OTG cable is USB communication, if the current data communication type is USB communication and the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output high level and controls a general input/output interface of the CPU to output high level, so that the connection mode inside the Switch is a fourth connection mode;
wherein, the fourth connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the third data interface.
12. A terminal, comprising: the system comprises a power supply management module, a CPU and an interface module;
the power management module includes: the system comprises a first OTG power supply interface and a first charging interface;
the power management module is used for: detecting whether the interface module is connected with an OTG cable or not; if the interface module is detected to be connected with the OTG cable, judging the connection direction of the OTG cable; according to the direction of connection, control first OTG power supply interface with the second OTG power supply interface connection that the OTG cable was predetermine, and control CPU's data interface with the OTG communication interface connection that the OTG cable was predetermine, and control first interface that charges with the second interface connection that charges that the OTG cable was predetermine, include: the power management module adjusts the connection mode inside a Switch module of the terminal according to the connection direction, so that the first OTG power supply interface is connected with the second OTG power supply interface through the Switch, the data interface of the CPU is connected with the OTG communication interface through the Switch, and the first charging interface is connected with the second charging interface through the Switch;
the power management module adjusts the connection mode inside the Switch module Switch of the terminal according to the connection direction, and the method comprises the following steps:
if the connection direction is the forward direction, the power management module controls a self-preset Switch module control interface to output a low level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a first connection mode;
wherein the Switch comprises: a first power interface Vbus1a, a first data interface, a second power interface Vbus2a, a second data interface, a third power interface Vbus1, a third data interface, a fourth power interface Vbus2, and a fourth data interface;
wherein, the first connection mode is as follows: the first power interface Vbus1a is connected to the fourth power interface Vbus2, the first data interface is connected to the fourth data interface, the second power interface Vbus2a is connected to the third power interface Vbus1, and the second data interface is connected to the third data interface;
if the connection direction is reverse, the power management module controls a self-preset Switch module control interface to output a high level and controls a general input/output interface of the CPU to output a low level, so that the connection mode inside the Switch is a second connection mode;
wherein, the second connection mode is as follows: the first power interface Vbus1a is connected to the third power interface Vbus1, the first data interface is connected to the third data interface, the second power interface Vbus2a is connected to the fourth power interface Vbus2, and the second data interface is connected to the fourth data interface.
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 CN109101447A (en) | 2018-12-28 |
CN109101447B true 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) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109769174B (en) * | 2019-03-27 | 2024-04-12 | 上海爻火微电子有限公司 | Judging circuit and method for positive and negative terminals of MIC (microphone) of earphone and electronic equipment |
CN110062186B (en) * | 2019-05-29 | 2022-03-01 | 北京硬壳科技有限公司 | Data transmission method and system and touch display |
CN110597375B (en) * | 2019-11-13 | 2020-02-14 | 亮风台(上海)信息科技有限公司 | External equipment power supply device |
CN111651387B (en) * | 2020-05-25 | 2022-02-15 | 维沃移动通信有限公司 | Interface circuit and electronic equipment |
CN112148104B (en) * | 2020-09-30 | 2023-01-17 | 维沃移动通信有限公司 | Control method of electronic equipment |
EP4105786B1 (en) * | 2021-06-14 | 2024-05-15 | 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 |
---|
Research of data bidirectional USB transfer technology based on MicroBlaze;Qinghua Yao等;《 2010 International Conference on Computer, Mechatronics, Control and Electronic Engineering》;20100826;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN109101447A (en) | 2018-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109101447B (en) | Method and terminal for parallel execution of OTG function and charging function | |
CN105718027B (en) | The management method and mobile terminal of background application | |
CN104955023B (en) | A kind of mobile terminal and the method for updating network parameter | |
CN104980588B (en) | A kind of method and apparatus for detecting mobile terminal state | |
CN106654424A (en) | Charging method and terminal | |
CN104811865B (en) | Audio-frequency inputting method, device and system | |
CN105100308B (en) | Mobile terminal and its test method | |
CN105430258B (en) | A kind of method and apparatus of self-timer group photo | |
CN105117241A (en) | Firmware upgrade method and apparatus | |
CN105490928A (en) | Mobile terminal and multitask processing method thereof | |
CN105426036A (en) | Interface display upgrade method, apparatus and system for application | |
CN105138255A (en) | Terminal and image information acquisition method | |
CN107018334A (en) | A kind of applied program processing method and device based on dual camera | |
CN104866352A (en) | Method for starting application and mobile terminal | |
CN106412316A (en) | Media resource playing control device and method | |
CN106412878B (en) | Activation device and method for subscriber identity module card | |
CN105227771B (en) | Picture transmission method and device | |
CN105126339B (en) | A kind of game control device and method | |
CN106791149A (en) | A kind of method of mobile terminal and control screen | |
CN107025158B (en) | Sliding operation testing method and device and terminal | |
CN106897044B (en) | Screen color temperature consistency fault-tolerant method and terminal | |
CN108964188B (en) | Mobile terminal charging control circuit, charging circuit and electronic equipment | |
CN105245707A (en) | Mobile terminal and method for processing information | |
CN106900037B (en) | Display method and terminal | |
CN106649753B (en) | Data processing method and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |