[go: up one dir, main page]

CN107632949A - Data line identification circuit, method and terminal - Google Patents

Data line identification circuit, method and terminal Download PDF

Info

Publication number
CN107632949A
CN107632949A CN201710944527.3A CN201710944527A CN107632949A CN 107632949 A CN107632949 A CN 107632949A CN 201710944527 A CN201710944527 A CN 201710944527A CN 107632949 A CN107632949 A CN 107632949A
Authority
CN
China
Prior art keywords
output end
data line
output
otg
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710944527.3A
Other languages
Chinese (zh)
Other versions
CN107632949B (en
Inventor
曾元清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710944527.3A priority Critical patent/CN107632949B/en
Publication of CN107632949A publication Critical patent/CN107632949A/en
Application granted granted Critical
Publication of CN107632949B publication Critical patent/CN107632949B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The application relates to a data line identification circuit, a method and a terminal, wherein the data line identification circuit is used for identifying the type of an accessed data line, and the type of the data line comprises an OTG data line, a charging data line and an OTG charging data line. An interface identification circuit, comprising: the interface module is used for accessing an OTG data line, a charging data line and an OTG charging data line; the debugging module is connected with the interface module, comprises a first output end and a second output end and is used for correspondingly outputting corresponding level signals to the first output end and the second output end respectively according to different types of data lines accessed by the interface module; and the processor is respectively connected with the first output end and the second output end and is used for acquiring the level signals output by the first output end and the second output end and identifying the type of the data line accessed by the interface module according to the output level signals. Through above-mentioned data line identification circuit, can realize data transmission function and charging function simultaneously, improve user's experience degree.

Description

数据线识别电路、方法和终端Data line identification circuit, method and terminal

技术领域technical field

本申请涉及数据接口技术领域,特别是涉及数据线识别电路、方法和终端。The present application relates to the field of data interface technology, in particular to a data line identification circuit, method and terminal.

背景技术Background technique

目前移动终端(手机或平板电脑等电子设备)绝大多数都采用Micro-USB接口,用户通过Micro-USB接口可以使用OTG功能以实现数据传输,或对其进行充电。Micro-USB接口的USD_ID脚是用来识别是接入的数据线时是用于充电,还是用于数据传输。At present, the vast majority of mobile terminals (electronic devices such as mobile phones or tablet computers) use Micro-USB interfaces, and users can use the OTG function through the Micro-USB interface to realize data transmission or charge them. The USD_ID pin of the Micro-USB interface is used to identify whether the connected data line is used for charging or data transmission.

而传统的Micro-USB接口只采用一个USB_ID脚,当在使用OTG功能时,则不能实现对充电,给用户带来不便。However, the traditional Micro-USB interface only uses one USB_ID pin. When the OTG function is used, the charging cannot be realized, which brings inconvenience to the user.

发明内容Contents of the invention

本申请实施例提供一种数据线识别电路、方法和终端,可以同时实现充电和传输数据的功能。Embodiments of the present application provide a data line identification circuit, method, and terminal, which can realize the functions of charging and data transmission at the same time.

一种数据线识别电路,用于识别接入的数据线的类型,所述数据线的类型包括OTG数据线、充电数据线和OTG充电数据线;A data line identification circuit, used to identify the type of data line connected, the type of data line includes OTG data line, charging data line and OTG charging data line;

所述接口识别电路,包括:The interface identification circuit includes:

接口模块,用于接入所述OTG数据线、充电数据线和OTG充电数据线;An interface module, used to access the OTG data line, the charging data line and the OTG charging data line;

调试模块,与所述接口模块连接,所述调试模块包括第一输出端和第二输出端,用于根据所述接口模块接入不同的数据线类型,分别对应输出相应的电平信号至所述第一输出端、第二输出端;The debugging module is connected with the interface module, and the debugging module includes a first output terminal and a second output terminal, which are used to connect different data line types according to the interface module, and respectively output corresponding level signals to the Describe the first output end and the second output end;

处理器,分别与所述第一输出端、第二输出端连接,用于获取所述第一输出端、第二输出端输出的电平信号,并根据所述输出的电平信号识别所述接口模块接入的所述数据线的类型。a processor, connected to the first output terminal and the second output terminal respectively, and used to obtain the level signals output by the first output terminal and the second output terminal, and identify the The type of the data line connected to the interface module.

一种数据线识别方法,用于识别接入的数据线的类型,所述数据线的类型包括OTG数据线、充电数据线和OTG充电数据线;所述识别方法基于数据线识别电路,所述数据线识别电路,包括依次连接的接口模块、调试模块和处理器;所述调试模块包括第一输出端和第二输出端;A data line identification method, used to identify the type of data line connected, the type of the data line includes OTG data line, charging data line and OTG charging data line; the identification method is based on the data line identification circuit, the The data line identification circuit includes an interface module, a debugging module and a processor connected in sequence; the debugging module includes a first output terminal and a second output terminal;

当所述接口模块分别接入OTG数据线、充电数据线和OTG充电数据线时,所述调试模块分别对应输出相应的电平信号至所述第一输出端、第二输出端;When the interface module is respectively connected to the OTG data line, the charging data line and the OTG charging data line, the debugging module outputs corresponding level signals to the first output terminal and the second output terminal respectively;

所述处理器获取所述第一输出端、第二输出端输出的电平信号;The processor obtains the level signals output by the first output terminal and the second output terminal;

所述处理器根据预设的数据线类型与所述第一输出端、第二输出端输出的电平信号的真值表,识别所述接口模块接入的所述数据线的类型。The processor identifies the type of the data line connected to the interface module according to the preset data line type and the truth table of the level signals output by the first output terminal and the second output terminal.

一种终端,包括上述的数据线识别电路。A terminal includes the above-mentioned data line identification circuit.

通过上述数据线识别电路、方法和终端,能够在不影响接口模块的正常识别充电数据线和OTG数据线的前提下,还可以识别能够同时实现充电功能和数据传输功能的OTG充电数据线。也即,通过上述数据线识别电路,可以同时实现数据传输功能和充电功能,提高了用户的体验度。Through the above data line identification circuit, method and terminal, the OTG charging data line that can simultaneously realize the charging function and data transmission function can be identified without affecting the normal identification of the charging data line and the OTG data line of the interface module. That is, through the above-mentioned data line identification circuit, the data transmission function and the charging function can be realized at the same time, which improves user experience.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为一个实施例中数据线识别电路的结构框架图;Fig. 1 is a structural frame diagram of a data line identification circuit in an embodiment;

图2为一个实施例中数据线识别电路的电路原理图;Fig. 2 is a circuit schematic diagram of a data line identification circuit in an embodiment;

图3为一个实施例个数据线识别方法的流程图;Fig. 3 is a flowchart of an embodiment of a data line identification method;

图4为与终端相关的手机的部分结构的框图。FIG. 4 is a block diagram of a partial structure of a mobile phone related to a terminal.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

如图1所示,本申请提供一种数据线识别电路,数据线识别电路用于识别接入的数据线的类型,其中,数据线的类型包括:OTG数据线、充电数据线和OTG充电数据线。数据线识别电路应用于具有OTG功能的终端,其中,终端可以为手机、平板电脑或其他具有OTG功能的电子设备。数据线识别电路能够实现OTG功能和充电功能的并行执行。As shown in Figure 1, the present application provides a data line identification circuit, which is used to identify the type of data line connected, wherein the type of data line includes: OTG data line, charging data line and OTG charging data Wire. The data line identification circuit is applied to a terminal with an OTG function, wherein the terminal can be a mobile phone, a tablet computer or other electronic devices with an OTG function. The data line identification circuit can realize the parallel execution of the OTG function and the charging function.

其中,OTG数据线中,OTG是On-The-Go的缩写,OTG数据线主用于连接OTG设备,以实现OTG功能进行传输数据。充电数据线,可以用于连接电源适配器以实现充电功能;OTG充电数据线用于连接既能实现充电又可以实现数据传输的功能的特殊设备。Among them, in the OTG data cable, OTG is the abbreviation of On-The-Go, and the OTG data cable is mainly used to connect the OTG device to realize the OTG function to transmit data. The charging data cable can be used to connect the power adapter to realize the charging function; the OTG charging data cable is used to connect special devices that can realize both charging and data transmission functions.

在一个实施例中,接口识别电路包括接口模块110、调试模块120和处理器130。其中,接口模块110,用于接入OTG数据线、充电数据线和OTG充电数据线;调试模块120,与接口模块110连接,调试模块120包括第一输出端TP1和第二输出端TP2,用于根据接口模块110接入不同的数据线类型,分别对应输出相应的电平信号至第一输出端TP1、第二输出端TP2;处理器130,分别与第一输出端TP1、第二输出端TP2连接,用于识别第一输出端TP1、第二输出端TP2输出的电平信号,并根据输出的电平信号识别接口模块110接入的数据线的类型。In one embodiment, the interface identification circuit includes an interface module 110 , a debugging module 120 and a processor 130 . Wherein, the interface module 110 is used to access the OTG data line, the charging data line and the OTG charging data line; the debugging module 120 is connected to the interface module 110, and the debugging module 120 includes a first output terminal TP1 and a second output terminal TP2 for use in According to the different data line types connected to the interface module 110, the corresponding level signals are respectively output to the first output terminal TP1 and the second output terminal TP2; the processor 130 is respectively connected to the first output terminal TP1 and the second output terminal The TP2 connection is used to identify the level signals output by the first output terminal TP1 and the second output terminal TP2, and identify the type of the data line connected to the interface module 110 according to the output level signals.

通过上述数据线识别电路,能够在不影响接口模块110的正常识别充电数据线和OTG数据线的前提下,还可以识别能够同时实现充电功能和数据传输功能的OTG充电数据线。也即,通过上述数据线识别电路,可以同时实现数据传输功能和充电功能。Through the above-mentioned data line identification circuit, the OTG charging data line that can simultaneously realize the charging function and the data transmission function can be identified without affecting the normal identification of the charging data line and the OTG data line of the interface module 110 . That is, the data transmission function and the charging function can be realized simultaneously through the above-mentioned data line identification circuit.

在一个实施例中,接口模块110至少包括OTG数据线、充电数据线的识别接口,该识别接口与所述调试模块120连接。In one embodiment, the interface module 110 at least includes an identification interface for an OTG data line and a charging data line, and the identification interface is connected to the debugging module 120 .

需要说明的是,接口模块110为Micro-USB接口,其中,Micro-USB接口共有5个信号引脚,分别为:电源引脚(VBUS)、识别数据线引脚(USB_ID)、用来正传送数据引脚(D+)、负传送数据引脚(D-)和接地引脚(GND)。也即,接口模块110中的识别接口为Micro-USB接口中的识别数据线引脚(USB_ID)。It should be noted that the interface module 110 is a Micro-USB interface, wherein the Micro-USB interface has 5 signal pins in total, which are: a power supply pin (VBUS), an identification data line pin (USB_ID), and a pin for forward transmission Data pin (D+), negative transfer data pin (D-), and ground pin (GND). That is, the identification interface in the interface module 110 is the identification data line pin (USB_ID) in the Micro-USB interface.

当连接OTG设备的OTG数据线接入接口模块110时,等效于在OTG设备中,USB_ID引脚接地;当连接电源适配器的充电数据线接入接口模块110时,等效于在电源适配器中USB_ID引脚浮空;当连特殊设备的OTG充电数据线接入接口模块110时,等效于在特殊设备中USB_ID引脚经过电阻R6接地。When the OTG data line connected to the OTG device is connected to the interface module 110, it is equivalent to the USB_ID pin being grounded in the OTG device; when the charging data line connected to the power adapter is connected to the interface module 110, it is equivalent to being in the power adapter The USB_ID pin is floating; when the OTG charging data line connected to the special device is connected to the interface module 110, it is equivalent to the USB_ID pin being grounded through the resistor R6 in the special device.

如图2所示,在一个实施例中,调试模块120还包括第一开关管Q1、第二开关管Q2和调试单元121。第一开关管Q1包括第一控制端、第一连接端和第二连接端,第一控制端经调试单元121与接口模块110连接;第一连接端分别与第一电源模块140、第一输出端TP1连接;第二连接端接地。第二开关管Q2包括第二控制端、第三连接端和第四连接端,第二控制端分别与接口模块110、调试单元121连接,第三连接端分别与第一电源模块140、第二输出端TP2连接;第四连接端接地。As shown in FIG. 2 , in one embodiment, the debugging module 120 further includes a first switching transistor Q1 , a second switching transistor Q2 and a debugging unit 121 . The first switching tube Q1 includes a first control terminal, a first connection terminal and a second connection terminal, the first control terminal is connected to the interface module 110 via the debugging unit 121; the first connection terminal is connected to the first power supply module 140, the first output The terminal TP1 is connected; the second connection terminal is grounded. The second switching tube Q2 includes a second control terminal, a third connection terminal and a fourth connection terminal, the second control terminal is respectively connected to the interface module 110 and the debugging unit 121, and the third connection terminal is respectively connected to the first power supply module 140, the second The output terminal TP2 is connected; the fourth connection terminal is grounded.

调试单元121分别根据接口模块110接入的数据线的类型控制第一开关管Q1、第二开关管Q2的工作状态以输出相应的电平信号至第一输出端TP1、第二输出端TP2。The debugging unit 121 controls the working states of the first switch Q1 and the second switch Q2 according to the type of the data line connected to the interface module 110 to output corresponding level signals to the first output terminal TP1 and the second output terminal TP2 .

进一步地,第一开关管Q1、第二开关管Q2均为MOS管。其中,第一开关管Q1的栅极为第一控制端,第一开关管Q1的漏极为第一连接端、第一开关管Q1的源极为第二连接端;第二开关管Q2的栅极为第二控制端,第二开关管Q2的漏极为第三连接端、第二开关管Q2的源极为第四连接端。也即,第一开关管Q1的栅极与接口模块110的USB_ID引脚连接,第一开关管Q1的漏极分别与第一电源模块140、第一输出端TP1连接,第一开关管Q1的源极接地。第二开关管Q2的栅极与接口模块110的USB_ID引脚连接,第二开关管Q2的漏极分别与第一电源模块140、第二输出端TP2连接,第二开关管Q2的源极接地。其中,第一电源模块140用于给处理器130供电,以满足处理器130的供电需求。Further, both the first switch tube Q1 and the second switch tube Q2 are MOS tubes. Wherein, the gate of the first switching transistor Q1 is the first control terminal, the drain of the first switching transistor Q1 is the first connecting terminal, the source of the first switching transistor Q1 is the second connecting terminal; the gate of the second switching transistor Q2 is the second connecting terminal. Two control terminals, the drain of the second switch transistor Q2 is the third connection terminal, and the source of the second switch transistor Q2 is the fourth connection terminal. That is, the gate of the first switching transistor Q1 is connected to the USB_ID pin of the interface module 110, the drain of the first switching transistor Q1 is respectively connected to the first power module 140 and the first output terminal TP1, and the first switching transistor Q1 Source ground. The gate of the second switching tube Q2 is connected to the USB_ID pin of the interface module 110, the drain of the second switching tube Q2 is respectively connected to the first power module 140 and the second output terminal TP2, and the source of the second switching tube Q2 is grounded . Wherein, the first power supply module 140 is used to supply power to the processor 130 to meet the power supply requirements of the processor 130 .

进一步可以理解,第一开关管Q1和第二开关管Q2均为MOS管,其MOS管的导通压降为V0。当MOS管栅极、源极的压降VGS小于V0时,MOS管不导通,处于截止状态,此时,MOS管漏极和源极的电阻相当于无穷大。当MOS管栅极、源极的压降VGS大于V0时,MOS管导通,此时,MOS管漏极和源极的阻抗相当于0ohm。It can be further understood that both the first switch tube Q1 and the second switch tube Q2 are MOS tubes, and the conduction voltage drop of the MOS tubes is V 0 . When the voltage drop V GS of the gate and source of the MOS transistor is less than V 0 , the MOS transistor is not turned on and is in an off state. At this time, the resistance of the drain and source of the MOS transistor is equivalent to infinite. When the voltage drop V GS of the gate and source of the MOS transistor is greater than V 0 , the MOS transistor is turned on. At this time, the impedance of the drain and source of the MOS transistor is equivalent to 0ohm.

其中,当第一开关管Q1导通时,其第一输出端TP1输出的电平信号为低电平信号;当第一开关管Q1截止时,其第一输出端TP1输出的电平信号为高电平信号。相应的,当第二开关管Q2导通时,其第二输出端TP2输出的电平信号为低电平信号;当第二开关管Q2截止时,其第二输出端TP2输出的电平信号为高电平信号。Wherein, when the first switch tube Q1 is turned on, the level signal output by its first output terminal TP1 is a low level signal; when the first switch tube Q1 is turned off, the level signal output by its first output terminal TP1 is high level signal. Correspondingly, when the second switch tube Q2 is turned on, the level signal output by its second output terminal TP2 is a low level signal; when the second switch tube Q2 is turned off, the level signal output by its second output terminal TP2 is a high level signal.

调试单元121根据接口模块110接入的数据线的类型控制第一开关管Q1、第二开关管Q2的工作状态(导通或截止)以输出相应的电平信号至第一输出端TP1、第二输出端TP2。The debugging unit 121 controls the working state (on or off) of the first switch tube Q1 and the second switch tube Q2 according to the type of the data line connected to the interface module 110 to output corresponding level signals to the first output terminal TP1, the second output terminal TP1, and the second switch tube Q2. Two output terminals TP2.

可选的,第一开关管Q1、第二开关管Q2还可以为三极管或其他具有导通电压的电子开关管。Optionally, the first switching tube Q1 and the second switching tube Q2 may also be triodes or other electronic switching tubes with conduction voltage.

在一个实施例中,处理器130设有多个GPIO接口,其第一输出端TP1、第二输出端TP2分别对应与处理器130上的两个GPIO接口连接。In one embodiment, the processor 130 is provided with multiple GPIO interfaces, and the first output terminal TP1 and the second output terminal TP2 of the processor 130 are respectively connected to the two GPIO interfaces on the processor 130 .

处理器130接收第一输出端TP1、第二输出端TP2输出的电平信号,处理器130可以根据存储的数据线类型与第一输出端TP1、第二输出端TP2输出的电平信号的真值表(如表1所示),识别出插入接口模块110的数据线的类型。The processor 130 receives the level signals output by the first output terminal TP1 and the second output terminal TP2, and the processor 130 can be based on the type of the stored data line and the true level signal output by the first output terminal TP1 and the second output terminal TP2. A table of values (shown in Table 1 ), identifying the type of data line plugged into the interface module 110 .

表1为数据线类型与第一输出端TP1、第二输出端TP2输出的电平信号的真值表Table 1 is the truth table of the data line type and the level signals output by the first output terminal TP1 and the second output terminal TP2

数据线的类型Type of data cable 第一输出端TP1First output terminal TP1 第二输出TP2Second output TP2 OTG数据线OTG data cable 11 11 充电数据线charging data cable 00 00 OTG充电数据线OTG charging data cable 00 11

具体地,当第一输出端TP1、第二输出端TP2输出的电平信号均为高电平时,数据线为OTG数据线;当第一输出端TP1、第二输出端TP2输出的电平信号均为低电平时,数据线为充电数据线;当第一输出端TP1输出的电平信号为低电平、且第二输出端TP2输出的电平信号为高电平时,数据线为OTG充电数据线。Specifically, when the level signals output by the first output terminal TP1 and the second output terminal TP2 are both high level, the data line is an OTG data line; when the level signals output by the first output terminal TP1 and the second output terminal TP2 When both are low level, the data line is the charging data line; when the level signal output by the first output terminal TP1 is low level, and the level signal output by the second output terminal TP2 is high level, the data line is OTG charging data line.

通过上述数据线识别电路,处理器130能够根据第一输出端TP1、第二输出端TP2输出的电平信号,可以识别出插入接口模块110的数据线的类型,也即,可以识别出具有数据传输功能的OTG数据线、具有充电功能的充电数据线以及同时具备数据传输功能和充电功能的OTG充电数据线。也即,通过上述数据线识别电路,可以同时实现数据传输功能和充电功能的并行执行。Through the above-mentioned data line identification circuit, the processor 130 can identify the type of the data line inserted into the interface module 110 according to the level signals output by the first output terminal TP1 and the second output terminal TP2, that is, it can identify the OTG data cable with transmission function, charging data cable with charging function, and OTG charging data cable with both data transmission function and charging function. That is, through the above-mentioned data line identification circuit, the parallel execution of the data transmission function and the charging function can be realized at the same time.

在一个实施例中,调试模块包括依次连接的第一电阻R1、第二电阻R2和第三电阻R3,第一电阻R1、第二电阻R2、第三电阻R3用于分压。第一电阻R1的一端与第二电源模块140连接,第一电阻R1、第二电阻R2的公共端与第一控制端连接;第二电阻R2、第三电阻R3的公共端分别与接口模块110、第二控制端连接,第三电阻R3的另一端接地。其中,第二电源模块140为直流电源模块,其输出的直流电压用V2表示,V2可以为3.3伏。In one embodiment, the debugging module includes a first resistor R1 , a second resistor R2 and a third resistor R3 connected in sequence, and the first resistor R1 , the second resistor R2 and the third resistor R3 are used for voltage division. One end of the first resistor R1 is connected to the second power module 140, the common end of the first resistor R1 and the second resistor R2 are connected to the first control end; the common ends of the second resistor R2 and the third resistor R3 are respectively connected to the interface module 110 , the second control end, and the other end of the third resistor R3 is grounded. Wherein, the second power supply module 140 is a direct current power supply module, and its output direct current voltage is denoted by V2, and V2 may be 3.3 volts.

当接口模块110的USB_ID引脚接口OTG数据线时,第一开关管Q1栅极的电压VG1=V2*R2/(R1+R2),第二开关管Q2的栅极电压为0V,第二开关管Q2不导通。When the USB_ID pin of the interface module 110 interfaces with the OTG data line, the voltage V G1 of the gate of the first switching transistor Q1 = V2*R2/(R1+R2), the gate voltage of the second switching transistor Q2 is 0V, and the second The switch tube Q2 is not turned on.

当接口模块110的USB_ID引脚接口充电数据线时,第一开关管Q1栅极的电压VG1'=V2*R3/(R1+R2+R3);第二开关管Q2的栅极电压为VG2'=V2*(R2+R3)/(R1+R2+R3)。When the USB_ID pin interface charging data line of the interface module 110, the voltage V G1 ' =V2*R3/(R1+R2+R3) of the gate voltage of the first switch tube Q1; the gate voltage of the second switch tube Q2 is V G2' =V2*(R2+R3)/(R1+R2+R3).

由于,当连特殊设备的OTG充电数据线接入接口模块110时,等效于在特殊设备中USB_ID引脚经电阻R6接地。当接口模块110的USB_ID引脚接口OTG充电数据线时,第二开关管Q2的栅极对地的阻抗RX=R6*R3/(R6+R3),此时,第一开关管Q1栅极的电压VG1”=V2*(R2+Rx)/(R1+R2+Rx),第二开关管Q2栅极的电压VG2”=V2*Rx/(R1+R2+Rx)。Because, when the OTG charging data line connected to the special device is connected to the interface module 110, it is equivalent to grounding the USB_ID pin of the special device through the resistor R6. When the USB_ID pin of the interface module 110 interfaces with the OTG charging data line, the impedance R X of the gate of the second switching transistor Q2 to ground = R6*R3/(R6+R3), at this time, the gate of the first switching transistor Q1 The voltage V G1 ″=V2*(R2+Rx)/(R1+R2+Rx), the voltage V G2 ″=V2*Rx/(R1+R2+Rx) on the gate of the second switching transistor Q2.

当第一输出端TP1、第二输出端TP2输出的电平信号均为高电平时,可以判断出接入接口模块110的数据线为OTG数据线;也即,需要使第一开关管Q1、第二开关管Q2均处于截止状态(不导通),满足条件VG1=V2*R2/(R1+R2)<V0即可。When the level signals output by the first output terminal TP1 and the second output terminal TP2 are both high level, it can be determined that the data line connected to the interface module 110 is an OTG data line; Both the second switch tubes Q2 are in a cut-off state (non-conductive), and the condition V G1 =V2*R2/(R1+R2)<V 0 can be satisfied.

当第一输出端TP1、第二输出端TP2输出的电平信号均为低电平时,数据线为充电数据线;也即,需要使第一开关管Q1、第二开关管Q2均处于导通状态,满足条件VG1'=V2*R3/(R1+R2+R3)>V0;V2*(R2+R3)/(R1+R2+R3)>V0When the level signals output by the first output terminal TP1 and the second output terminal TP2 are both low level, the data line is a charging data line; that is, it is necessary to make the first switching tube Q1 and the second switching tube Q2 both in conduction The state satisfies the condition V G1' =V2*R3/(R1+R2+R3)>V 0 ; V2*(R2+R3)/(R1+R2+R3)>V 0 .

当第一输出端TP1输出的电平信号为低电平、且第二输出端TP2输出的电平信号为高电平时,数据线为OTG充电数据线。也即,需要使第一开关管Q1处于导通状态、第二开关管Q2均处于截止状态(不导通),满足条件:VG1”=V2*(R2+Rx)/(R1+R2+Rx)>V0;VG2”=V1*Rx/(R1+R2+Rx)<V0When the level signal output by the first output terminal TP1 is low level and the level signal output by the second output terminal TP2 is high level, the data line is an OTG charging data line. That is, it is necessary to make the first switching tube Q1 in the conduction state and the second switching tube Q2 in the off state (non-conducting), satisfying the condition: V G1 "=V2*(R2+Rx)/(R1+R2+ Rx)>V 0 ; V G2 ″=V1*Rx/(R1+R2+Rx)<V 0 .

通过设置合理的分压单元的中的第一电阻R1、第二电阻R2、第三电阻R3以及电阻R6的阻值,当接口模块110插入不同类型的数据线时,处理器130可以根据第一输出端TP1、第二输出端TP2输出的电平信号,即可判断出接口模块110插入的数据线的类型。By setting reasonable resistance values of the first resistor R1, the second resistor R2, the third resistor R3, and the resistor R6 in the voltage dividing unit, when the interface module 110 is plugged into different types of data lines, the processor 130 can use the first The level signal output by the output terminal TP1 and the second output terminal TP2 can determine the type of the data line inserted into the interface module 110 .

在一个实施例中,调试模块120还包括第一上拉电阻R4和第二上拉电阻R5。第一上拉电阻R4的一端与第一电源模块140连接,第一上拉电阻R4的另一端分别与第一输出端TP1、第一连接端连接;第二上拉电阻R5的一端与第一电源模块140连接,第二上拉电阻R5的另一端分别与第二输出端TP2、第三连接端连接。其中,第一上拉电阻R4、第二上拉电阻R5的阻值均为10k欧姆。In one embodiment, the debugging module 120 further includes a first pull-up resistor R4 and a second pull-up resistor R5. One end of the first pull-up resistor R4 is connected to the first power module 140, and the other end of the first pull-up resistor R4 is respectively connected to the first output terminal TP1 and the first connection end; one end of the second pull-up resistor R5 is connected to the first The power module 140 is connected, and the other end of the second pull-up resistor R5 is respectively connected to the second output terminal TP2 and the third connection end. Wherein, the resistance values of the first pull-up resistor R4 and the second pull-up resistor R5 are both 10k ohms.

本申请还提供一种数据线识别方法,用于识别接入的数据线的类型,数据线的类型为OTG数据线、充电数据线和OTG充电数据线。The present application also provides a data line identification method, which is used to identify the type of the connected data line, and the types of the data line are OTG data line, charging data line and OTG charging data line.

需要说明的是,OTG数据线中,OTG是On-The-Go的缩写,OTG数据线主用于连接OTG设备,以实现OTG功能进行传输数据。充电数据线,可以用于连接电源适配器以实现充电功能;OTG充电数据线用于连接既能实现充电又可以实现数据传输的功能的特殊设备。It should be noted that in the OTG data cable, OTG is the abbreviation of On-The-Go, and the OTG data cable is mainly used to connect OTG devices to realize the OTG function for data transmission. The charging data cable can be used to connect the power adapter to realize the charging function; the OTG charging data cable is used to connect special devices that can realize both charging and data transmission functions.

数据线识别方法基于数据线识别电路,数据线识别电路包括依次连接的接口模块、调试模块和处理器;调试模块包括第一输出端和第二输出端。The data line identification method is based on a data line identification circuit. The data line identification circuit includes an interface module, a debugging module and a processor connected in sequence; the debugging module includes a first output terminal and a second output terminal.

数据线识别方法包括:Data line identification methods include:

步骤302:当接口模块分别接入OTG数据线、充电数据线和OTG充电数据线时,调试模块分别对应输出相应的电平信号至第一输出端、第二输出端。Step 302: When the interface module is respectively connected to the OTG data line, the charging data line and the OTG charging data line, the debugging module outputs corresponding level signals to the first output end and the second output end respectively.

具体地,接口模块为Micro-USB接口,其中,Micro-USB接口共有5个信号引脚,分别为:电源引脚(VBUS)、识别数据线引脚(USB_ID)、用来正传送数据引脚(D+)、负传送数据引脚(D-)和接地引脚(GND)。也即,接口模块中的识别接口为Micro-USB接口中的识别数据线引脚(USB_ID),与调试模块连接。Specifically, the interface module is a Micro-USB interface, wherein the Micro-USB interface has a total of 5 signal pins, which are: a power supply pin (VBUS), an identification data line pin (USB_ID), and a pin for transmitting data. (D+), negative transfer data pin (D-), and ground pin (GND). That is, the identification interface in the interface module is the identification data line pin (USB_ID) in the Micro-USB interface, which is connected to the debugging module.

当连接OTG设备的OTG数据线接入接口模块时,等效于在OTG设备中,USB_ID引脚接地;当连接电源适配器的充电数据线接入接口模块时,等效于在电源适配器中USB_ID引脚浮空;当连特殊设备的OTG充电数据线接入接口模块时,等效于在特殊设备中USB_ID引脚经过电阻接地。When the OTG data line connected to the OTG device is connected to the interface module, it is equivalent to the USB_ID pin being grounded in the OTG device; when the charging data line connected to the power adapter is connected to the interface module, it is equivalent to the USB_ID pin in the power adapter. The pin is floating; when the OTG charging data line connected to the special device is connected to the interface module, it is equivalent to the USB_ID pin in the special device being grounded through a resistor.

当接口模块分别接入OTG数据线、充电数据线和OTG充电数据线中的任一数据线时,调试模块根据接入的数据线类型,对应输出相应的电平信号至第一输出端、第二输出端。When the interface module is respectively connected to any one of the OTG data line, the charging data line and the OTG charging data line, the debugging module will output corresponding level signals to the first output terminal, the second Two output terminals.

步骤304:处理器获取第一输出端、第二输出端输出的电平信号。Step 304: The processor acquires level signals output from the first output terminal and the second output terminal.

在一个实施例中,处理器设有多个GPIO接口,其第一输出端、第二输出端分别对应与处理器上的两个GPIO接口连接。In one embodiment, the processor is provided with a plurality of GPIO interfaces, and the first output end and the second output end thereof are correspondingly connected to two GPIO interfaces on the processor.

处理器通过两个GPIO接口对应接收第一输出端、第二输出端输出的电平信号。The processor correspondingly receives the level signals output from the first output terminal and the second output terminal through the two GPIO interfaces.

步骤306:处理器根据预设的数据线类型与第一输出端、第二输出端输出的电平信号的真值表,识别接口模块接入的数据线的类型。Step 306: The processor identifies the type of the data line connected to the interface module according to the preset data line type and the truth table of the level signals output by the first output terminal and the second output terminal.

处理器接收第一输出端、第二输出端输出的电平信号,处理器可以根据存储的数据线类型与第一输出端、第二输出端输出的电平信号的真值表(如表1所示),识别出插入接口模块的数据线的类型。The processor receives the level signals output by the first output terminal and the second output terminal, and the processor can use the stored data line type and the truth table of the level signals output by the first output terminal and the second output terminal (as shown in Table 1) shown), to identify the type of data cable plugged into the interface module.

具体地,当处理器接收到的第一输出端、第二输出端输出的电平信号均为高电平时,数据线为OTG数据线;当处理器接收到的第一输出端、第二输出端输出的电平信号均为低电平时,数据线为充电数据线;当处理器接收到的第一输出端输出的电平信号为低电平、且第二输出端输出的电平信号为高电平时,数据线为OTG充电数据线。Specifically, when the level signals output by the first output terminal and the second output terminal received by the processor are both high level, the data line is an OTG data line; when the first output terminal and the second output terminal received by the processor When the level signals output by the terminal are all low level, the data line is the charging data line; when the level signal output by the first output terminal received by the processor is low level, and the level signal output by the second output terminal is When the level is high, the data line is an OTG charging data line.

通过上述数据线识别方法,处理器能够根据第一输出端、第二输出端输出的电平信号,可以识别出插入接口模块的数据线的类型,也即,可以识别出具有数据传输功能的OTG数据线、具有充电功能的充电数据线以及同时具备数据传输功能和充电功能的OTG充电数据线。也即,通过上述数据线识别方法,可以同时实现数据传输功能和充电功能的并行执行。Through the above data line identification method, the processor can identify the type of data line inserted into the interface module according to the level signals output by the first output terminal and the second output terminal, that is, it can identify the OTG with data transmission function. Data cable, charging data cable with charging function, and OTG charging data cable with both data transmission function and charging function. That is, through the above-mentioned data line identification method, the parallel execution of the data transmission function and the charging function can be realized at the same time.

在一个实施例中,调试模块还包括第一开关管、第二开关管和调试单元;其中,第一开关管包括第一控制端、第一连接端和第二连接端,第一控制端经调试单元与接口模块连接;第一连接端分别与第一电源模块、第一输出端连接;第二连接端接地;第二开关管包括第二控制端、第三连接端和第四连接端,第二控制端分别与接口模块、调试单元连接,第三连接端分别与第一电源模块、第二输出端连接;第四连接端接地。In one embodiment, the debugging module further includes a first switch tube, a second switch tube, and a debugging unit; wherein, the first switch tube includes a first control terminal, a first connection terminal, and a second connection terminal, and the first control terminal is connected via The debugging unit is connected to the interface module; the first connection terminal is respectively connected to the first power module and the first output terminal; the second connection terminal is grounded; the second switch tube includes a second control terminal, a third connection terminal and a fourth connection terminal, The second control terminal is respectively connected with the interface module and the debugging unit; the third connection terminal is respectively connected with the first power supply module and the second output terminal; the fourth connection terminal is grounded.

进一步地,第一开关管、第二开关管均为MOS管。其中,第一开关管的栅极为第一控制端,第一开关管的漏极为第一连接端、第一开关管的源极为第二连接端;第二开关管的栅极为第二控制端,第二开关管的漏极为第三连接端、第二开关管的源极为第四连接端。也即,第一开关管的栅极与接口模块的USB_ID引脚连接,第一开关管的漏极分别与第一电源模块、第一输出端连接,第一开关管的源极接地。第二开关管的栅极与接口模块的USB_ID引脚连接,第二开关管的漏极分别与第一电源模块、第二输出端连接,第二开关管的源极接地。其中,第一电源模块用于给处理器供电,以满足处理器的供电需求。Further, both the first switch tube and the second switch tube are MOS tubes. Wherein, the gate of the first switch tube is the first control terminal, the drain of the first switch tube is the first connection terminal, and the source of the first switch tube is the second connection terminal; the gate of the second switch tube is the second control terminal, The drain of the second switch transistor is the third connection end, and the source of the second switch transistor is the fourth connection end. That is, the gate of the first switch tube is connected to the USB_ID pin of the interface module, the drain of the first switch tube is connected to the first power module and the first output terminal respectively, and the source of the first switch tube is grounded. The gate of the second switch tube is connected to the USB_ID pin of the interface module, the drain of the second switch tube is respectively connected to the first power module and the second output terminal, and the source of the second switch tube is grounded. Wherein, the first power supply module is used to supply power to the processor, so as to meet the power supply requirement of the processor.

具体地,当第一开关管导通时,第一输出端输出的电平信号为低电平;当第一开关管截止时,第一输出端输出的电平信号为高电平;当第二开关管导通时,第二输出端输出的电平信号为低电平;当第二开关管截止时,第二输出端输出的电平信号为高电平。Specifically, when the first switch tube is turned on, the level signal output by the first output terminal is low level; when the first switch tube is turned off, the level signal output by the first output terminal is high level; When the two switch tubes are turned on, the level signal output by the second output terminal is low level; when the second switch tube is turned off, the level signal output by the second output terminal is high level.

调试单元根据接口模块接入的数据线的类型控制第一开关管、第二开关管的工作状态(导通或截止)以输出相应的电平信号至第一输出端、第二输出端。The debugging unit controls the working state (on or off) of the first switch tube and the second switch tube according to the type of the data line connected to the interface module to output corresponding level signals to the first output terminal and the second output terminal.

在一个实施例中,调试模块包括依次连接的第一电阻R1、第二电阻R2和第三电阻R3,第一电阻R1、第二电阻R2、第三电阻R3用于分压。第一电阻R1的一端与第二电源模块连接,第一电阻R1、第二电阻R2的公共端与第一控制端连接;第二电阻R2、第三电阻R3的公共端分别与接口模块、第二控制端连接,第三电阻R3的另一端接地。其中,第二电源模块为直流电源模块,其输出的直流电压用V2表示,V2可以为3.3伏。In one embodiment, the debugging module includes a first resistor R1 , a second resistor R2 and a third resistor R3 connected in sequence, and the first resistor R1 , the second resistor R2 and the third resistor R3 are used for voltage division. One end of the first resistor R1 is connected to the second power module, the common end of the first resistor R1 and the second resistor R2 are connected to the first control end; the common ends of the second resistor R2 and the third resistor R3 are respectively connected to the interface module, the second The two control terminals are connected, and the other end of the third resistor R3 is grounded. Wherein, the second power supply module is a DC power supply module, and its output DC voltage is denoted by V2, and V2 may be 3.3 volts.

当接口模块的USB_ID引脚接口OTG数据线时,第一开关管栅极的电压VG1=V2*R2/(R1+R2),第二开关管的栅极电压为0V,第二开关管不导通。When the USB_ID pin of the interface module interfaces with the OTG data line, the voltage V G1 of the gate of the first switch tube = V2*R2/(R1+R2), the gate voltage of the second switch tube is 0V, and the second switch tube does not conduction.

当接口模块110的USB_ID引脚接口充电数据线时,第一开关管栅极的电压VG1'=V2*R3/(R1+R2+R3);第二开关管的栅极电压为VG2'=V2*(R2+R3)/(R1+R2+R3)。When the USB_ID pin of the interface module 110 interfaces with the charging data line, the voltage V G1' of the gate of the first switch tube = V2*R3/(R1+R2+R3); the gate voltage of the second switch tube is V G2' =V2*(R2+R3)/(R1+R2+R3).

由于,当连特殊设备的OTG充电数据线接入接口模块时,等效于在特殊设备中USB_ID引脚经电阻R6接地。当接口模块的USB_ID引脚接口OTG充电数据线时,第二开关管的栅极对地的阻抗RX=R6*R3/(R6+R3),此时,第一开关管栅极的电压VG1”=V2*(R2+Rx)/(R1+R2+Rx),第二开关管栅极的电压VG2”=V2*Rx/(R1+R2+Rx)。Because, when the OTG charging data line connected to the special device is connected to the interface module, it is equivalent to grounding the USB_ID pin in the special device through the resistor R6. When the USB_ID pin of the interface module is connected to the OTG charging data line, the impedance R X of the grid of the second switching tube to ground = R6*R3/(R6+R3), at this time, the voltage V of the grid of the first switching tube G1 ″=V2*(R2+Rx)/(R1+R2+Rx), the voltage V G2 ″=V2*Rx/(R1+R2+Rx) on the gate of the second switching tube.

当第一输出端、第二输出端输出的电平信号均为高电平时,可以判断出接入接口模块的数据线为OTG数据线;也即,需要使第一开关管、第二开关管均处于截止状态(不导通),获取满足条件1:VG1=V2*R2/(R1+R2)<V0When the level signals output by the first output terminal and the second output terminal are both high level, it can be judged that the data line connected to the interface module is an OTG data line; that is, it is necessary to make the first switch tube and the second switch tube All are in the cut-off state (non-conductive), and condition 1 is satisfied: V G1 =V2*R2/(R1+R2)<V 0 .

当第一输出端、第二输出端输出的电平信号均为低电平时,数据线为充电数据线;也即,需要使第一开关管、第二开关管均处于导通状态,获取满足条件2:VG1'=V2*R3/(R1+R2+R3)>V0;V2*(R2+R3)/(R1+R2+R3)>V0When the level signals output by the first output terminal and the second output terminal are both low level, the data line is a charging data line; that is, it is necessary to make the first switch tube and the second switch tube both in the conducting state, so as to obtain the satisfaction Condition 2: V G1' = V2*R3/(R1+R2+R3)>V 0 ; V2*(R2+R3)/(R1+R2+R3)>V 0 .

当第一输出端输出的电平信号为低电平、且第二输出端输出的电平信号为高电平时,数据线为OTG充电数据线。也即,需要使第一开关管处于导通状态、第二开关管均处于截止状态(不导通),获取满足条件3:VG1”=V2*(R2+Rx)/(R1+R2+Rx)>V0;VG2”=V1*Rx/(R1+R2+Rx)<V0When the level signal output by the first output terminal is low level and the level signal output by the second output terminal is high level, the data line is an OTG charging data line. That is, it is necessary to make the first switch tube in the conduction state and the second switch tube in the off state (non-conduction), so as to obtain and satisfy the condition 3: V G1 "=V2*(R2+Rx)/(R1+R2+ Rx)>V 0 ; V G2 ″=V1*Rx/(R1+R2+Rx)<V 0 .

当满足条件1、2、3同时成立时,计算出分压单元的中的第一电阻R1、第二电阻R2、第三电阻R3以及电阻R6的阻值,并对对应的电阻进行赋值。当接口模块插入不同类型的数据线时,处理器可以根据第一输出端、第二输出端输出的电平信号,可以识别具有数据传输功能的OTG数据线、具有充电功能的充电数据线以及同时具备数据传输功能和充电功能的OTG充电数据线。也即,通过上述数据线识别方法,可以同时实现数据传输功能和充电功能的并行执行。When the conditions 1, 2, and 3 are met simultaneously, calculate the resistance values of the first resistor R1, the second resistor R2, the third resistor R3, and the resistor R6 in the voltage dividing unit, and assign the corresponding resistors. When the interface module is plugged into different types of data lines, the processor can identify the OTG data line with data transmission function, the charging data line with charging function and simultaneously according to the level signals output by the first output terminal and the second output terminal OTG charging data cable with data transmission function and charging function. That is, through the above-mentioned data line identification method, the parallel execution of the data transmission function and the charging function can be realized at the same time.

本申请还提供一种终端,该终端具备具有OTG功能,终端包括上述任一实施例中的数据线识别电路。通过在终端内设置数据线识别电路,可以识别出具有数据传输功能的OTG数据线、具有充电功能的充电数据线以及同时具备数据传输功能和充电功能的OTG充电数据线。也即,终端通过OTG充电数据线同时实现数据传输功能和充电功能的并行传输。The present application also provides a terminal, which has an OTG function, and the terminal includes the data line identification circuit in any one of the above embodiments. By setting the data line identification circuit in the terminal, the OTG data line with data transmission function, the charging data line with charging function and the OTG charging data line with both data transmission function and charging function can be identified. That is to say, the terminal simultaneously implements the parallel transmission of the data transmission function and the charging function through the OTG charging data line.

如图4所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、穿戴式设备等任意终端设备,以终端为手机为例:As shown in FIG. 4 , for the convenience of description, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The terminal can be any terminal device including mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant), POS (Point of Sales, sales terminal), vehicle-mounted computer, wearable device, etc. Taking the terminal as a mobile phone as an example:

图4为与本申请实施例提供的终端相关的手机的部分结构的框图。参考图4,手机包括:射频(Radio Frequency,RF)电路410、存储器420、输入单元430、显示单元440、传感器450、音频电路460、无线保真(wireless fidelity,WiFi)模块470、处理器480、以及电源490等部件。本领域技术人员可以理解,图4所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Fig. 4 is a block diagram of a partial structure of a mobile phone related to a terminal provided by an embodiment of the present application. Referring to FIG. 4 , the mobile phone includes: a radio frequency (Radio Frequency, RF) circuit 410, a memory 420, an input unit 430, a display unit 440, a sensor 450, an audio circuit 460, a wireless fidelity (wireless fidelity, WiFi) module 470, and a processor 480 , and power supply 490 and other components. Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 4 does not constitute a limitation to the mobile phone, and may include more or less components than shown in the figure, or combine some components, or arrange different components.

其中,RF电路410可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器480处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路410还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System ofMobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband CodeDivision Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。Among them, the RF circuit 410 can be used for sending and receiving information or receiving and sending signals during a call. After receiving the downlink information from the base station, it can be processed by the processor 480; it can also send uplink data to the base station. Generally, an RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, and the like. In addition, RF circuitry 410 may also communicate with networks and other devices via wireless communications. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile Communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

存储器420可用于存储软件程序以及模块,处理器480通过运行存储在存储器420的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器420可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器420可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 420 can be used to store software programs and modules, and the processor 480 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 420 . The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as an application program for a sound playback function, an application program for an image playback function, etc.), etc.; The data storage area can store data created according to the use of the mobile phone (such as audio data, address book, etc.) and the like. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

输入单元430可用于接收输入的数字或字符信息,以及产生与手机400的用户设置以及功能控制有关的键信号输入。具体地,输入单元430可包括触控面板431以及其他输入设备432。触控面板431,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板431上或在触控面板431附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板431可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器480,并能接收处理器480发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板431。除了触控面板431,输入单元430还可以包括数据线识别电路432。显示单元440可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元440可包括显示面板441。在一个实施例中,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板441。在一个实施例中,触控面板431可覆盖显示面板441,当触控面板431检测到在其上或附近的触摸操作后,传送给处理器480以确定触摸事件的类型,随后处理器480根据触摸事件的类型在显示面板441上提供相应的视觉输出。虽然在图4中,触控面板431与显示面板441是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板431与显示面板441集成而实现手机的输入和输出功能。The input unit 430 can be used to receive input numbers or character information, and generate key signal input related to user settings and function control of the mobile phone 400 . Specifically, the input unit 430 may include a touch panel 431 and other input devices 432 . The touch panel 431, which can also be referred to as a touch screen, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch panel 431 or near the touch panel 431 operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 431 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 480, and can receive and execute commands sent by the processor 480. In addition, the touch panel 431 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 431 , the input unit 430 may further include a data line identification circuit 432 . The display unit 440 may be used to display information input by or provided to the user and various menus of the mobile phone. The display unit 440 may include a display panel 441 . In one embodiment, the display panel 441 may be configured in the form of a Liquid Crystal Display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (Organic Light-Emitting Diode, OLED), or the like. In one embodiment, the touch panel 431 can cover the display panel 441, and when the touch panel 431 detects a touch operation on or near it, it transmits to the processor 480 to determine the type of the touch event, and then the processor 480 according to The type of touch event provides a corresponding visual output on the display panel 441 . Although in FIG. 4 , the touch panel 431 and the display panel 441 are used as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 431 and the display panel 441 can be integrated to form a mobile phone. Realize the input and output functions of the mobile phone.

手机400还可包括至少一种传感器450,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板441的亮度,接近传感器可在手机移动到耳边时,关闭显示面板441和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。Cell phone 400 may also include at least one sensor 450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 441 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 441 and/or when the mobile phone is moved to the ear. or backlight. The motion sensor can include an acceleration sensor, through which the magnitude of acceleration in various directions can be detected, and the magnitude and direction of gravity can be detected when stationary, and can be used for applications that recognize the attitude of a mobile phone (such as switching between horizontal and vertical screens), vibration recognition related functions (such as pedometer, tap), etc.; in addition, the mobile phone can also be equipped with gyroscope, barometer, hygrometer, thermometer, infrared sensor and other sensors.

音频电路460、扬声器461和传声器462可提供用户与手机之间的音频接口。音频电路460可将接收到的音频数据转换后的电信号,传输到扬声器461,由扬声器461转换为声音信号输出;另一方面,传声器462将收集的声音信号转换为电信号,由音频电路460接收后转换为音频数据,再将音频数据输出处理器480处理后,经RF电路410可以发送给另一手机,或者将音频数据输出至存储器420以便后续处理。Audio circuitry 460, speaker 461 and microphone 462 may provide an audio interface between the user and the handset. The audio circuit 460 can transmit the electrical signal converted from the received audio data to the loudspeaker 461, and the loudspeaker 461 converts it into an audio signal output; After being received, it is converted into audio data, and after being processed by the output processor 480, the audio data can be sent to another mobile phone through the RF circuit 410, or the audio data can be output to the memory 420 for subsequent processing.

WiFi属于短距离无线传输技术,手机通过WiFi模块470可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图4示出了WiFi模块470,但是可以理解的是,其并不属于手机400的必须构成,可以根据需要而省略。WiFi is a short-distance wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 470, which provides users with wireless broadband Internet access. Although FIG. 4 shows the WiFi module 470, it can be understood that it is not an essential component of the mobile phone 400 and can be omitted as required.

处理器480是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器420内的软件程序和/或模块,以及调用存储在存储器420内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器480可包括一个或多个处理单元。在一个实施例中,处理器480可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器480中。The processor 480 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and/or modules stored in the memory 420, and calling data stored in the memory 420, execution Various functions and processing data of the mobile phone, so as to monitor the mobile phone as a whole. In one embodiment, processor 480 may include one or more processing units. In one embodiment, the processor 480 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc.; the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 480 .

手机400还包括给各个部件供电的电源490(比如电池),优选的,电源可以通过电源管理系统与处理器480逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 400 also includes a power supply 490 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 480 through the power management system, so that functions such as charging, discharging, and power consumption management can be realized through the power management system.

在一个实施例中,手机400还可以包括摄像头、蓝牙模块等。In one embodiment, the mobile phone 400 may also include a camera, a Bluetooth module, and the like.

本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

1. a kind of data wire identification circuit, it is characterised in that for the type for the data wire for identifying access, the class of the data wire Type includes OTG data wires, charging data line and OTG charging data lines;
The interface identification circuit, including:
Interface module, for accessing the OTG data wires, charging data line and OTG charging data lines;
Debugging module, it is connected with the interface module, the debugging module includes the first output end and the second output end, for root Different data wire types is accessed according to the interface module, corresponds to the corresponding level signal of output respectively to the described first output End, the second output end;
Processor, it is connected respectively with first output end, the second output end, for obtaining first output end, second defeated Go out to hold the level signal of output, and the data wire accessed according to the level signal of the output identification interface module Type.
2. data wire identification circuit according to claim 1, it is characterised in that the debugging module, in addition to first open Guan Guan, second switch pipe and debugging unit;
The first switch pipe includes the first control terminal, the first connection end and second connection end, described in the first control terminal warp Debugging unit is connected with the interface module;First connection end is connected with the first power module, the first output end respectively;Institute State second connection end ground connection;
The second switch pipe includes the second control terminal, the 3rd connection end and the 4th connection end, second control terminal respectively with The interface module, debugging unit connection, the 3rd connection end connect with first power module, the second output end respectively Connect;The 4th connection end ground connection;
The debugging unit, the type of the data wire for being accessed according to the interface module control the first switch respectively Pipe, the working condition of second switch pipe are to export corresponding level signal to first output end, the second output end.
3. data wire identification circuit according to claim 2, it is characterised in that the debugging module debugging unit include according to First resistor, second resistance and the 3rd resistor of secondary connection;
One end of the first resistor is connected with second source module, the first resistor, second resistance common port with it is described First control terminal connects;The second resistance, the common port of 3rd resistor connect with the interface module, the second control terminal respectively Connect, the other end ground connection of the 3rd resistor.
4. data wire identification circuit according to claim 2, it is characterised in that the first switch pipe, second switch pipe It is metal-oxide-semiconductor;
The grid of the first switch pipe is first control terminal, and the drain electrode of the first switch pipe is the described first connection End, the source electrode of the first switch pipe are the second connection end;
The grid of the second switch pipe is second control terminal, and the drain electrode of the second switch pipe is the described 3rd connection End, the source electrode of the second switch pipe are the 4th connection end.
5. data wire identification circuit according to claim 2, it is characterised in that the debugging module also includes the first pull-up Resistance and the second pull-up resistor;
One end of first pull-up resistor is connected with first power module, the other end difference of first pull-up resistor It is connected with first output end, first connection end;
One end of second pull-up resistor is connected with first power module, the other end difference of second pull-up resistor It is connected with second output end, the 3rd connection end.
6. data wire identification circuit according to claim 1, it is characterised in that the interface module, which comprises at least, to be used to know Not described OTG data wires, the identification interface of charging data line, the identification interface are connected with the debugging module.
7. a kind of data wire recognition methods, it is characterised in that for the type for the data wire for identifying access, the class of the data wire Type includes OTG data wires, charging data line and OTG charging data lines;The recognition methods is based on data wire identification circuit, described Data wire identification circuit, including interface module, debugging module and the processor being sequentially connected;It is defeated that the debugging module includes first Go out end and the second output end;
When the interface module is respectively connected to OTG data wires, charging data line and OTG charging data lines, the debugging module The corresponding level signal of output is corresponded to respectively to first output end, the second output end;
The processor obtains first output end, the level signal of the second output end output;
The level signal that the processor exports according to default data wire type and first output end, the second output end Truth table, identify the type of the data wire of the interface module access.
8. data wire recognition methods according to claim 7, it is characterised in that the identification interface module access The type of the data wire, including:
When the level signal that first output end, the second output end export is high level, the data wire is OTG data Line;
When the level signal that first output end, the second output end export is low level, the data wire is charging number According to line;
When the level signal of first output end output is that the level signal that low level and the second output end export is high level When, the data wire is OTG charging data lines.
9. data wire recognition methods according to claim 8, it is characterised in that the debugging module also includes first switch Pipe, second switch pipe and debugging unit;Wherein, the first switch pipe includes the first control terminal, the first connection end and second connects End is connect, first control terminal is connected through the debugging unit with the interface module;First connection end is respectively with first Power module, the connection of the first output end;The second connection end ground connection;The second switch pipe includes the second control terminal, the 3rd Connection end and the 4th connection end, second control terminal are connected with the interface module, debugging unit respectively, the 3rd connection End is connected with first power module, the second output end respectively;The 4th connection end ground connection;
When the first switch pipe turns on, the level signal of the first output end output is low level;
When the first switch pipe ends, the level signal of the first output end output is high level;
When the second switch pipe turns on, the level signal of the second output end output is low level;
When the second switch pipe ends, the level signal of the second output end output is high level.
10. a kind of terminal, it is characterised in that including the data wire identification circuit as described in any in claim 1~6.
CN201710944527.3A 2017-09-30 2017-09-30 Data line identification circuit, method and terminal Active CN107632949B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710944527.3A CN107632949B (en) 2017-09-30 2017-09-30 Data line identification circuit, method and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710944527.3A CN107632949B (en) 2017-09-30 2017-09-30 Data line identification circuit, method and terminal

Publications (2)

Publication Number Publication Date
CN107632949A true CN107632949A (en) 2018-01-26
CN107632949B CN107632949B (en) 2019-10-25

Family

ID=61103181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710944527.3A Active CN107632949B (en) 2017-09-30 2017-09-30 Data line identification circuit, method and terminal

Country Status (1)

Country Link
CN (1) CN107632949B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399142A (en) * 2018-03-20 2018-08-14 青岛海信移动通信技术股份有限公司 A kind of usb circuit and mobile terminal
CN108647160A (en) * 2018-06-28 2018-10-12 努比亚技术有限公司 USB force downloads circuit, mobile terminal, method for down loading and data line
CN108877185A (en) * 2018-08-24 2018-11-23 深圳和而泰小家电智能科技有限公司 A bluetooth remote control method and circuit
CN109918327A (en) * 2019-03-27 2019-06-21 深圳传音通讯有限公司 OTG reverse charging current improvement method and OTG mobile phone
CN110601302A (en) * 2019-09-25 2019-12-20 陈涛 Charging and power conversion circuit and connector thereof
CN110659237A (en) * 2019-09-27 2020-01-07 闻泰通讯股份有限公司 Function adaptation method, device, equipment and storage medium
CN111169412A (en) * 2018-11-09 2020-05-19 联发科技(新加坡)私人有限公司 Vehicle-mounted terminal and startup and shutdown method
CN111514589A (en) * 2019-05-27 2020-08-11 四川越洋电子科技有限责任公司 System and method for identifying data line of game machine
CN112345975A (en) * 2019-07-22 2021-02-09 深圳市创能亿科科技开发有限公司 Wire identification system and method
CN115391258A (en) * 2022-08-16 2022-11-25 云码智能(海南)科技有限公司 Interface management circuit, method, apparatus, device, storage medium, and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186483A (en) * 2011-12-27 2013-07-03 比亚迪股份有限公司 Terminal, and OTG (On-The-Go) function-charging function paralleled execution method used for same
KR20150069659A (en) * 2013-12-16 2015-06-24 (주)아이티헬스 Usb gender
CN204515763U (en) * 2015-03-16 2015-07-29 联想(北京)有限公司 Data line and terminal system
CN105048018A (en) * 2015-08-25 2015-11-11 广东欧珀移动通信有限公司 Charging method and device for terminal having on-the-go (OTG) function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186483A (en) * 2011-12-27 2013-07-03 比亚迪股份有限公司 Terminal, and OTG (On-The-Go) function-charging function paralleled execution method used for same
KR20150069659A (en) * 2013-12-16 2015-06-24 (주)아이티헬스 Usb gender
CN204515763U (en) * 2015-03-16 2015-07-29 联想(北京)有限公司 Data line and terminal system
CN105048018A (en) * 2015-08-25 2015-11-11 广东欧珀移动通信有限公司 Charging method and device for terminal having on-the-go (OTG) function

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399142A (en) * 2018-03-20 2018-08-14 青岛海信移动通信技术股份有限公司 A kind of usb circuit and mobile terminal
CN108399142B (en) * 2018-03-20 2021-06-01 青岛海信移动通信技术股份有限公司 USB interface circuit and mobile terminal
CN108647160A (en) * 2018-06-28 2018-10-12 努比亚技术有限公司 USB force downloads circuit, mobile terminal, method for down loading and data line
CN108877185A (en) * 2018-08-24 2018-11-23 深圳和而泰小家电智能科技有限公司 A bluetooth remote control method and circuit
TWI703061B (en) * 2018-11-09 2020-09-01 新加坡商聯發科技(新加坡)私人有限公司 In-vehicle terminal
CN111169412B (en) * 2018-11-09 2023-01-10 联发科技(新加坡)私人有限公司 Vehicle-mounted terminal and startup and shutdown method
US11112850B2 (en) 2018-11-09 2021-09-07 Mediatek Singapore Pte. Ltd. In-vehicle terminal with enhanced compatibility and method for turning on/off it
CN111169412A (en) * 2018-11-09 2020-05-19 联发科技(新加坡)私人有限公司 Vehicle-mounted terminal and startup and shutdown method
CN109918327A (en) * 2019-03-27 2019-06-21 深圳传音通讯有限公司 OTG reverse charging current improvement method and OTG mobile phone
CN111514589A (en) * 2019-05-27 2020-08-11 四川越洋电子科技有限责任公司 System and method for identifying data line of game machine
CN112345975A (en) * 2019-07-22 2021-02-09 深圳市创能亿科科技开发有限公司 Wire identification system and method
CN110601302A (en) * 2019-09-25 2019-12-20 陈涛 Charging and power conversion circuit and connector thereof
CN110659237A (en) * 2019-09-27 2020-01-07 闻泰通讯股份有限公司 Function adaptation method, device, equipment and storage medium
CN115391258A (en) * 2022-08-16 2022-11-25 云码智能(海南)科技有限公司 Interface management circuit, method, apparatus, device, storage medium, and program product
CN115391258B (en) * 2022-08-16 2023-05-02 云码智能(海南)科技有限公司 Interface management circuit, method, apparatus, device, storage medium, and program product

Also Published As

Publication number Publication date
CN107632949B (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN107632949B (en) Data line identification circuit, method and terminal
CN113258652B (en) Battery control system and method, electronic equipment
CN107708168A (en) SIM card switching method, mobile terminal and computer-readable storage medium
CN108063646A (en) Anti-interference method for electronic equipment and related products
CN108829553B (en) Universal serial bus C-type interface detection circuit, detection method and electronic equipment
CN108415865A (en) Interface circuit and electronic device
CN106532876B (en) Power supply control method and device and computer equipment
CN108966085B (en) Self-adaptive audio circuit and mobile terminal
CN108415863A (en) Hardware compatible implementation method of electronic device and related product
CN106714103A (en) Network location method and terminal equipment
CN107678989A (en) UART and USB multiplexing circuit and mobile terminal
CN111245057B (en) Electronic equipment
CN107884619A (en) Load power consumption test system and method, mobile terminal
CN106877103B (en) A kind of method that realizing circuit switching and adapter
CN108681514A (en) Equipment detection method, device, storage medium and electronic equipment
CN107807820A (en) Information processing method, device, mobile terminal and readable storage medium
CN111478378B (en) Protection circuit, charging control device and method, and electronic device
CN107145386A (en) Data migration method, terminal device and computer-readable recording medium
CN107577322B (en) A crash restart method, terminal and computer-readable storage medium
CN108491733A (en) Privacy application recommendation method and device, storage medium, electronic device
CN104869550A (en) Communication event processing method and device
CN106714279A (en) A hotspot network switching method and terminal equipment
CN108415856A (en) Device compatibility method and related device
CN112130928A (en) Automatic searching method, device, equipment and storage medium for Linux system sound card
CN107577567B (en) Mainboard test circuit and related products

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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant