[go: up one dir, main page]

CN105404600A - Method and apparatus giving consideration to USB eye pattern performance and OTG function - Google Patents

Method and apparatus giving consideration to USB eye pattern performance and OTG function Download PDF

Info

Publication number
CN105404600A
CN105404600A CN201510703554.2A CN201510703554A CN105404600A CN 105404600 A CN105404600 A CN 105404600A CN 201510703554 A CN201510703554 A CN 201510703554A CN 105404600 A CN105404600 A CN 105404600A
Authority
CN
China
Prior art keywords
usb
mobile terminal
drive current
usb drive
external unit
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
CN201510703554.2A
Other languages
Chinese (zh)
Other versions
CN105404600B (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 CN201510703554.2A priority Critical patent/CN105404600B/en
Publication of CN105404600A publication Critical patent/CN105404600A/en
Application granted granted Critical
Publication of CN105404600B publication Critical patent/CN105404600B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method and an apparatus giving consideration to USB eye pattern performance and an OTG function. The method comprises: detecting whether an external device is connected to a mobile terminal through a USB interface or not; when the external device is connected to the mobile terminal, judging whether the mobile terminal serves as a slave device or a master device when communicating with the external device; when the mobile terminal serves as the slave device, setting a USB driving current according to a first USB driving current parameter; and when the mobile terminal serves as the master device, setting the USB driving current according to a second USB driving current parameter, wherein the first USB driving current parameter is determined according to the USB eye pattern performance, and the second USB driving current parameter is determined according to the OTG compatibility. According to the method and the apparatus, the USB transmission performance when the mobile terminal serves as the slave device is ensured and the OTG compatibility when the mobile terminal serves as the master device is ensured.

Description

兼顾USB眼图性能和OTG功能的方法及装置Method and device for both USB eye diagram performance and OTG function

技术领域 technical field

本发明实施例涉及通信技术领域,尤其涉及一种兼顾USB眼图性能和OTG功能的方法及装置。 The embodiments of the present invention relate to the field of communication technologies, and in particular, to a method and a device for taking USB eye diagram performance and OTG function into consideration.

背景技术 Background technique

随着智能移动终端的发展,USB-OTG功能已经成为标配,众所周知USB-OTG和普通的USB(UniversalSerialBus,通用串行总线)功能都是通过USB接口实现的。普通的USB功能,手机作为从设备,计算机作为主设备;而USB-OTG恰好是让手机作为主设备而插入手机的另一设备作为从设备,从而使得移动终端之间的文件传输更加的便捷。其中,USB-OTG是USBOnTheGo的缩写,是近年发展起来的技术,2001年12月18日由USBImplementersForum(USB实施者论坛)公布,主要应用于各种不同的设备或移动设备间的联接,进行数据交换。 With the development of smart mobile terminals, the USB-OTG function has become a standard configuration. It is well known that the USB-OTG and common USB (Universal Serial Bus, universal serial bus) functions are all implemented through the USB interface. Ordinary USB functions, mobile phone as a slave device, computer as a master device; and USB-OTG just makes the mobile phone as the master device and another device inserted into the mobile phone as the slave device, which makes file transfer between mobile terminals more convenient. Among them, USB-OTG is the abbreviation of USBOnTheGo, which is a technology developed in recent years. It was announced by USBImplementersForum (USB Implementers Forum) on December 18, 2001. It is mainly used in the connection between various devices or mobile devices to carry out data exchange.

由于移动终端屏幕尺寸越来越大,一般的设计都是将USB接口放在手机下端,主芯片在手机上端,从而导致USB走线很长,同时USB作为对位接口会在信号线上并联ESD(Electro-Staticdischarge,静电释放)器件以防止静电损坏端口,同时信号线上还有USB开关器件,这些因素最终导致USB眼图质量很难满足要求。USB作为手机最常用的接口,其接口速度很快,如果USB眼图质量不好可能会导致数据传输过程中出错。 As the screen size of mobile terminals is getting larger and larger, the general design is to place the USB interface at the bottom of the mobile phone and the main chip at the top of the mobile phone, resulting in a very long USB line. (Electro-Staticdischarge, electrostatic discharge) device to prevent static electricity from damaging the port, and there are USB switching devices on the signal line. These factors ultimately make it difficult for the quality of the USB eye diagram to meet the requirements. USB is the most commonly used interface for mobile phones, and its interface speed is very fast. If the quality of the USB eye pattern is not good, it may cause errors during data transmission.

为了提升USB眼图质量,常用的方法是提高USB驱动电流,改善效果很明显,如图1a、图1b、图2a和图2b所示。但是,对于支持OTG功能的设计而言,通过提高USB驱动电流的改善方案会对OTG兼容性带来影响,可能降低OTG的识别成功率。因此提高USB驱动电流对USB传输和OTG传输而言是相互矛盾的,如何在保证USB传输性能的同时保证OTG的兼容性是一个需要解决的问题。 In order to improve the quality of the USB eye diagram, a common method is to increase the USB drive current, and the improvement effect is obvious, as shown in Figure 1a, Figure 1b, Figure 2a and Figure 2b. However, for the design supporting OTG function, the improvement solution by increasing the USB drive current will affect the OTG compatibility, which may reduce the success rate of OTG identification. Therefore, increasing the USB driving current is contradictory to USB transmission and OTG transmission. How to ensure OTG compatibility while ensuring USB transmission performance is a problem that needs to be solved.

发明内容 Contents of the invention

有鉴于此,本发明实施例提供一种兼顾USB眼图性能和OTG功能的方法及装置,以在保证USB传输性能的同时保证OTG的兼容性。 In view of this, the embodiments of the present invention provide a method and device that take into account USB eye diagram performance and OTG function, so as to guarantee OTG compatibility while ensuring USB transmission performance.

第一方面,本发明实施例提供了一种兼顾USB眼图性能和OTG功能的方法,所述方法包括: In the first aspect, the embodiment of the present invention provides a method for both USB eye diagram performance and OTG function, the method comprising:

检测是否有外部设备通过USB接口接入移动终端; Detect whether there is an external device connected to the mobile terminal through the USB interface;

当有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备; When an external device is connected to the mobile terminal, judging whether the mobile terminal acts as a slave device or as a master device when communicating with the external device;

当所述移动终端与所述外部设备进行通信时是作为从设备时,按照第一USB驱动电流参数设置USB驱动电流; When the mobile terminal is used as a slave device when communicating with the external device, the USB drive current is set according to the first USB drive current parameter;

当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流; When the mobile terminal is used as the master device when communicating with the external device, the USB drive current is set according to the second USB drive current parameter;

其中,所述第一USB驱动电流参数是根据USB眼图性能确定的USB驱动电流参数,所述第二USB驱动电流参数是根据OTG兼容性确定的USB驱动电流参数。 Wherein, the first USB driving current parameter is a USB driving current parameter determined according to USB eye diagram performance, and the second USB driving current parameter is a USB driving current parameter determined according to OTG compatibility.

第二方面,本发明实施例还提供了一种兼顾USB眼图性能和OTG功能的装置,所述装置包括: In the second aspect, the embodiment of the present invention also provides a device that takes into account USB eye diagram performance and OTG function, and the device includes:

检测模块,用于检测是否有外部设备通过USB接口接入移动终端; A detection module is used to detect whether an external device is connected to the mobile terminal through the USB interface;

判断模块,用于当有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备; A judging module, configured to judge whether the mobile terminal is used as a slave device or as a master device when communicating with the external device when an external device is connected to the mobile terminal;

第一设置模块,用于当所述移动终端与所述外部设备进行通信时是作为从设备时,按照第一USB驱动电流参数设置USB驱动电流; The first setting module is used to set the USB driving current according to the first USB driving current parameter when the mobile terminal is used as a slave device when communicating with the external device;

第二设置模块,用于当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流; The second setting module is used to set the USB drive current according to the second USB drive current parameter when the mobile terminal is used as the master device when communicating with the external device;

其中,所述第一USB驱动电流参数是根据USB眼图性能确定的USB驱动电流参数,所述第二USB驱动电流参数是根据OTG兼容性确定的USB驱动电流参数。 Wherein, the first USB driving current parameter is a USB driving current parameter determined according to USB eye diagram performance, and the second USB driving current parameter is a USB driving current parameter determined according to OTG compatibility.

本发明实施例通过在检测到有外部设备通过USB接口接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备,根据移动终端是作为主设备还是从设备设置相应的USB驱动电流,即当移动终端作为从设备时按照根据USB眼图性能确定的第一USB驱动电流参数设置USB驱动电流,当移动终端作为主设备时按照根据OTG兼容性确定的第二USB驱动电流参数设置USB驱动电流,保证了移动终端作为从设备时的USB传输性能,同时保证了移动终端作为主设备时的OTG兼容性。 In the embodiment of the present invention, when it is detected that an external device is connected to the mobile terminal through the USB interface, it is judged whether the mobile terminal is used as a slave device or a master device when communicating with the external device. The slave device sets the corresponding USB drive current, that is, when the mobile terminal is used as a slave device, the USB drive current is set according to the first USB drive current parameter determined according to the performance of the USB eye diagram, and when the mobile terminal is used as a master device, it is determined according to the OTG compatibility. The second USB drive current parameter sets the USB drive current, which ensures the USB transmission performance when the mobile terminal acts as a slave device, and at the same time ensures the OTG compatibility when the mobile terminal acts as a master device.

附图说明 Description of drawings

图1a是现有技术中未提高USB驱动电流时的近端USB眼图的仿真图; FIG. 1a is a simulation diagram of a near-end USB eye diagram when the USB driving current is not increased in the prior art;

图1b是现有技术中未提高USB驱动电流时的远端USB眼图的仿真图; Fig. 1b is a simulation diagram of the remote USB eye diagram when the USB driving current is not increased in the prior art;

图2a是现有技术中通过提高USB驱动电流时的近端USB眼图的仿真图; FIG. 2a is a simulation diagram of a near-end USB eye diagram when the USB drive current is increased in the prior art;

图2b是现有技术中通过提高USB驱动电流时的远端USB眼图的仿真图; Fig. 2b is a simulation diagram of the remote USB eye diagram when the USB drive current is increased in the prior art;

图3是本发明实施例一提供的一种兼顾USB眼图性能和OTG功能的方法的流程图; FIG. 3 is a flow chart of a method for taking USB eye diagram performance and OTG function into consideration according to Embodiment 1 of the present invention;

图4是本发明实施例二提供的一种兼顾USB眼图性能和OTG功能的方法的流程图; FIG. 4 is a flow chart of a method for taking into account USB eye diagram performance and OTG function provided by Embodiment 2 of the present invention;

图5是本发明实施例三提供的一种兼顾USB眼图性能和OTG功能的装置的结构示意图。 FIG. 5 is a schematic structural diagram of a device that takes both USB eye diagram performance and OTG function into consideration according to Embodiment 3 of the present invention.

具体实施方式 detailed description

下面结合附图和实施例对本发明作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部内容。 The present invention 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 invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, only parts related to the present invention are shown in the drawings but not all content.

实施例一 Embodiment one

图3是本发明实施例一提供的一种兼顾USB眼图性能和OTG功能的方法的流程图,本实施例可适用于具有USB-OTG功能的移动终端在保证USB眼图性能的同时保证OTG的兼容性,该方法可以由具有USB-OTG功能的移动终端来执行,具体包括如下步骤: Fig. 3 is a flow chart of a method for taking into account USB eye diagram performance and OTG function provided by Embodiment 1 of the present invention. This embodiment can be applied to mobile terminals with USB-OTG function to ensure OTG while ensuring USB eye diagram performance. compatibility, the method can be performed by a mobile terminal with a USB-OTG function, and specifically includes the following steps:

步骤310,检测是否有外部设备通过USB接口接入移动终端。 Step 310, detecting whether there is an external device connected to the mobile terminal through the USB interface.

移动终端通过检测USB硬件电路的信号变化,检测是否有外部设备通过USB接口接入该移动终端。 The mobile terminal detects whether there is an external device connected to the mobile terminal through the USB interface by detecting the signal change of the USB hardware circuit.

其中,检测是否有外部设备通过USB接口接入移动终端,优选包括: Wherein, detecting whether an external device is connected to the mobile terminal through a USB interface preferably includes:

通过检测USB接口的电平变化,检测是否有外部设备通过USB接口接入移动终端。 By detecting the level change of the USB interface, it is detected whether an external device is connected to the mobile terminal through the USB interface.

当有外部设备通过USB接口接入移动终端时,会引起USB接口的电平变化,根据该USB接口的电平变化,就可以检测到有外部设备通过USB接口接入了移动终端,当USB接口的电平没有变化时,表示没有外部设备通过USB接口接入该移动终端。 When an external device is connected to the mobile terminal through the USB interface, the level of the USB interface will change. According to the level change of the USB interface, it can be detected that there is an external device connected to the mobile terminal through the USB interface. When the USB interface When the level of does not change, it means that no external device is connected to the mobile terminal through the USB interface.

步骤320,当有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备。 Step 320, when an external device is connected to the mobile terminal, it is judged whether the mobile terminal acts as a slave device or as a master device when communicating with the external device.

当检测到有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时,所述移动终端是作为从设备还是作为主设备。具体可以通过判断具有OTG功能的USB接口芯片的电平变化情况,来判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备。 When it is detected that an external device is connected to the mobile terminal, it is judged whether the mobile terminal acts as a slave device or as a master device when the mobile terminal communicates with the external device. Specifically, it can be judged whether the mobile terminal is used as a slave device or a master device when communicating with the external device by judging the level change of the USB interface chip with OTG function.

判断所述移动终端与所述外部设备进行通信时,是作为从设备还是作为主设备,具体包括: Judging whether the mobile terminal is used as a slave device or as a master device when communicating with the external device, specifically includes:

通过判断USBID引脚电平,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备。 By judging the level of the USBID pin, it is judged whether the mobile terminal acts as a slave device or as a master device when communicating with the external device.

具有USB-OTG功能的移动终端增加了第五个引脚-ID,用于识别通过USB接口接入的外部设备是作为主设备还是从设备,从而配置自身为相应的从设备或者主设备,具体为,当移动终端检测ID引脚接地时,表示接入移动终端的外部设备是作为USB设备,即从设备,此时移动终端将自身配置为USB主设备;而当移动终端检测到ID引脚悬空时,表示接入移动终端的外部设备是作为USB主设备,此时移动终端将自身配置为USB设备,即从设备。 The mobile terminal with USB-OTG function adds a fifth pin-ID, which is used to identify whether the external device connected through the USB interface is used as a master device or a slave device, so as to configure itself as the corresponding slave device or master device, specifically For, when the mobile terminal detects that the ID pin is grounded, it means that the external device connected to the mobile terminal is a USB device, that is, a slave device. At this time, the mobile terminal configures itself as a USB master device; and when the mobile terminal detects that the ID pin When it is suspended, it means that the external device connected to the mobile terminal is used as a USB master device. At this time, the mobile terminal configures itself as a USB device, that is, a slave device.

步骤330,当所述移动终端与所述外部设备进行通信时是作为从设备时,按照第一USB驱动电流参数设置USB驱动电流。 Step 330, when the mobile terminal is used as a slave device when communicating with the external device, set the USB driving current according to the first USB driving current parameter.

其中,所述第一USB驱动电流参数是根据USB眼图性能确定的USB驱动电流参数,即当移动终端与所述外部设备进行通信时是作为从设备时,则保证USB的眼图性能良好,使得USB眼图的信号质量达到最佳,确保USB数据传输质量,使得数据之间的码间串扰最小。 Wherein, the first USB drive current parameter is a USB drive current parameter determined according to the performance of the USB eye diagram, that is, when the mobile terminal is used as a slave device when communicating with the external device, it is ensured that the USB eye diagram performance is good, The signal quality of the USB eye diagram is optimized, the USB data transmission quality is ensured, and the intersymbol crosstalk between data is minimized.

步骤340,当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流。 Step 340, when the mobile terminal is acting as the master device when communicating with the external device, set the USB driving current according to the second USB driving current parameter.

其中,所述第二USB驱动电流参数是根据OTG兼容性确定的USB驱动电流参数,即当移动终端与所述外部设备进行通信时是作为主设备时,则保证OTG兼容性,即保证OTG的识别成功率,能够成功识别相应的设备。 Wherein, the second USB drive current parameter is a USB drive current parameter determined according to OTG compatibility, that is, when the mobile terminal communicates with the external device as a master device, OTG compatibility is guaranteed, that is, the OTG Recognition success rate, the corresponding device can be successfully recognized.

其中,所述第一USB驱动电流参数大于所述第二USB驱动电流参数,从而保证USB的眼图性能及OTG的识别兼容性,所述第一USB驱动电流参数和第二USB驱动电流参数的设定与移动终端的处理器相关,不同的处理器,相应的驱动电流参数可能不同,但一般满足第一USB驱动电流参数大于第二USB驱动电流参数。 Wherein, the first USB drive current parameter is greater than the second USB drive current parameter, so as to ensure USB eye diagram performance and OTG identification compatibility, the first USB drive current parameter and the second USB drive current parameter The setting is related to the processor of the mobile terminal. Different processors may have different corresponding driving current parameters, but generally, the first USB driving current parameter is greater than the second USB driving current parameter.

本实施例通过在检测到有外部设备通过USB接口接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备,当作为从设备时,按照根据USB眼图性能确定的第一USB驱动电流参数设置USB驱动电流,当作为主设备时按照根据OTG兼容性确定的第二USB驱动电流参数设置USB驱动电流,根据移动终端是作为主设备还是从设备设置相应的USB驱动电流,保证了移动终端作为从设备时的USB传输性能,同时保证移动终端作为主设备时的OTG兼容性。 In this embodiment, when it is detected that an external device is connected to the mobile terminal through the USB interface, it is judged whether the mobile terminal is used as a slave device or as a master device when communicating with the external device. When it is used as a slave device, according to the USB The first USB drive current parameter determined by the eye diagram performance is used to set the USB drive current, and when it is used as a master device, the USB drive current is set according to the second USB drive current parameter determined according to OTG compatibility, and the USB drive current is set according to whether the mobile terminal is used as a master device or a slave device The corresponding USB driving current ensures the USB transmission performance when the mobile terminal acts as a slave device, and at the same time ensures the OTG compatibility when the mobile terminal acts as a master device.

实施例二 Embodiment two

图4是本发明实施例二提供的一种兼顾USB眼图性能和OTG功能的方法的流程图,本实施例对实施例一进行了优化,具体包括如下步骤: Fig. 4 is a flow chart of a method for taking into account USB eye diagram performance and OTG function provided by Embodiment 2 of the present invention. This embodiment optimizes Embodiment 1, and specifically includes the following steps:

步骤410,检测是否有外部设备通过USB接口接入移动终端。 Step 410, detecting whether there is an external device connected to the mobile terminal through the USB interface.

步骤420,当有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备。 Step 420, when an external device is connected to the mobile terminal, it is judged whether the mobile terminal acts as a slave device or as a master device when communicating with the external device.

步骤430,当所述移动终端与所述外部设备进行通信时是作为从设备时,按照第一USB驱动电流参数设置USB驱动电流。 Step 430, when the mobile terminal acts as a slave device when communicating with the external device, set the USB driving current according to the first USB driving current parameter.

步骤440,当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流。 Step 440, when the mobile terminal acts as a master device when communicating with the external device, set the USB driving current according to the second USB driving current parameter.

步骤450,当检测到所述外部设备拔出移动终端的USB接口时,按照第一USB驱动电流参数设置USB驱动电流。 Step 450, when it is detected that the external device is pulled out of the USB interface of the mobile terminal, set the USB driving current according to the first USB driving current parameter.

在当所述移动终端与所述外部设备进校通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流之后,实时检测所述外部设备是否拔出该移动终端的USB接口,当检测到所述外部设备拔出该移动终端的USB接口时,将USB驱动电流参数设置为第一USB驱动电流参数,因为当外部设备插入移动终端时,该移动终端大部分是作为从设备,所以默认USB驱动电流参数为第一USB驱动电流参数,保证USB的眼图性能。 When the mobile terminal is used as the master device when communicating with the external device, after the USB drive current is set according to the second USB drive current parameter, it is detected in real time whether the external device is pulled out of the USB interface of the mobile terminal, When detecting that the external device pulls out the USB interface of the mobile terminal, the USB drive current parameter is set to the first USB drive current parameter, because when the external device is inserted into the mobile terminal, the mobile terminal is mostly used as a slave device, Therefore, the default USB drive current parameter is the first USB drive current parameter to ensure the eye diagram performance of the USB.

本实施例通过在检测到有外部设备通过USB接口接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备,当作为从设备时,按照根据USB眼图性能确定的第一USB驱动电流参数设置USB驱动电流,当作为主设备时按照根据OTG兼容性确定的第二USB驱动电流参数设置USB驱动电流,当检测到所述外部设备拔出移动终端的USB接口时,按照第一USB驱动电流参数设置USB驱动电流,根据移动终端是作为主设备还是从设备设置相应的USB驱动电流,保证了移动终端作为从设备时的USB传输性能,同时保证移动终端作为主设备时的OTG兼容性,与实施例一相比,当移动终端作为主设备,根据第二USB驱动电流参数设置USB驱动电流后,检测到外部设备拔出移动终端时,将USB驱动电流参数设置为第一驱动电流参数,即默认移动终端与外部设备进行通信时作为USB从设备,因为大多数移动终端与外部设备通信时是作为从设备的,从而可以省略配置USB驱动电流参数的这一步,从而节省时间。 In this embodiment, when it is detected that an external device is connected to the mobile terminal through the USB interface, it is judged whether the mobile terminal is used as a slave device or as a master device when communicating with the external device. When it is used as a slave device, according to the USB The first USB drive current parameter determined by the eye diagram performance is used to set the USB drive current. When the master device is used, the USB drive current is set according to the second USB drive current parameter determined according to OTG compatibility. When the external device is detected to be pulled out of the mobile terminal When the USB interface is used, the USB drive current is set according to the first USB drive current parameter, and the corresponding USB drive current is set according to whether the mobile terminal is a master device or a slave device, so as to ensure the USB transmission performance of the mobile terminal as a slave device, and at the same time ensure that the mobile terminal OTG compatibility when the terminal is used as the main device, compared with Embodiment 1, when the mobile terminal is used as the main device, after the USB drive current is set according to the second USB drive current parameter, when it is detected that the external device is pulled out of the mobile terminal, the USB will be driven The current parameter is set as the first driving current parameter, that is, the default mobile terminal is used as a USB slave device when communicating with an external device, because most mobile terminals are used as a slave device when communicating with an external device, so the configuration of the USB driving current parameter can be omitted. This step saves time.

实施例三 Embodiment three

图5是本发明实施例三提供的一种兼顾USB眼图性能和OTG功能的装置的结构示意图,如图5所示,本实施例所述的兼顾USB眼图性能和OTG功能的装置包括检测模块510、判断模块520、第一设置模块530和第二设置模块540。 Figure 5 is a schematic structural diagram of a device that takes into account USB eye diagram performance and OTG function provided by Embodiment 3 of the present invention. As shown in Figure 5, the device that takes into account USB eye diagram performance and OTG function described in this embodiment includes a detection Module 510 , judging module 520 , first setting module 530 and second setting module 540 .

其中,检测模块510用于检测是否有外部设备通过USB接口接入移动终端; Wherein, the detection module 510 is used to detect whether an external device is connected to the mobile terminal through the USB interface;

判断模块520用于当有外部设备接入移动终端时,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备; The judging module 520 is used to judge whether the mobile terminal is used as a slave device or as a master device when communicating with the external device when an external device is connected to the mobile terminal;

第一设置模块530用于当所述移动终端与所述外部设备进行通信时是作为从设备时,按照第一USB驱动电流参数设置USB驱动电流; The first setting module 530 is used to set the USB drive current according to the first USB drive current parameter when the mobile terminal is used as a slave device when communicating with the external device;

第二设置模块540用于当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流; The second setting module 540 is used to set the USB drive current according to the second USB drive current parameter when the mobile terminal is used as the master device when communicating with the external device;

其中,所述第一USB驱动电流参数是根据USB眼图性能确定的USB驱动电流参数,所述第二USB驱动电流参数是根据OTG兼容性确定的USB驱动电流参数。 Wherein, the first USB driving current parameter is a USB driving current parameter determined according to USB eye diagram performance, and the second USB driving current parameter is a USB driving current parameter determined according to OTG compatibility.

其中,所述第一USB驱动电流参数优选大于所述第二USB驱动电流参数。 Wherein, the first USB driving current parameter is preferably greater than the second USB driving current parameter.

优选的,所述判断模块具体用于: Preferably, the judging module is specifically used for:

通过判断USBID引脚电平,判断所述移动终端与所述外部设备进行通信时是作为从设备还是作为主设备。 By judging the level of the USBID pin, it is judged whether the mobile terminal acts as a slave device or as a master device when communicating with the external device.

优选的,所述检测模块具体用于: Preferably, the detection module is specifically used for:

通过检测USB接口的电平变化,检测是否有外部设备通过USB接口接入移动终端。 By detecting the level change of the USB interface, it is detected whether an external device is connected to the mobile terminal through the USB interface.

优选的,该兼顾USB眼图性能和OTG功能的装置还包括: Preferably, the device that takes into account USB eye diagram performance and OTG function also includes:

第三设置模块,用于在当所述移动终端与所述外部设备进行通信时是作为主设备时,按照第二USB驱动电流参数设置USB驱动电流之后,当检测到所述外部设备拔出移动终端的USB接口时,按照第一USB驱动电流参数设置USB驱动电流。 The third setting module is used for when the mobile terminal is used as the master device when communicating with the external device, after the USB drive current is set according to the second USB drive current parameter, when it is detected that the external device is pulled out and moves For the USB interface of the terminal, the USB driving current is set according to the first USB driving current parameter.

上述产品可执行本发明任意实施例所提供的方法,具备执行方法相应的功能模块和有益效果。 The above-mentioned product can execute the method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method.

注意,上述仅为本发明的较佳实施例及所运用技术原理。本领域技术人员会理解,本发明不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本发明的保护范围。因此,虽然通过以上实施例对本发明进行了较为详细的说明,但是本发明不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本发明的范围由所附的权利要求范围决定。 Note that the above are only preferred embodiments of the present invention and applied technical principles. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present invention, and the present invention The scope is determined by the scope of the appended claims.

Claims (10)

1. take into account a method for USB eye pattern performance and OTG function, it is characterized in that, described method comprises:
Whether detect has external unit to access mobile terminal by USB interface;
When there being external unit to access mobile terminal, judge that described mobile terminal is as from equipment or as main equipment when communicating with described external unit;
As during from equipment when described mobile terminal communicates with described external unit, according to a USB drive current optimum configurations USB drive current;
When being as main equipment when described mobile terminal communicates with described external unit, according to the 2nd USB drive current optimum configurations USB drive current;
Wherein, a described USB drive current parameter is the USB drive current parameter determined according to USB eye pattern performance, and described 2nd USB drive current parameter is the USB drive current parameter determined according to OTG compatibility.
2. method according to claim 1, is characterized in that, a described USB drive current parameter is greater than described 2nd USB drive current parameter.
3. method according to claim 1, is characterized in that, when judging that described mobile terminal communicates with described external unit, is as from equipment or as main equipment, comprises:
By judging USBID pin level, judge that described mobile terminal is as from equipment or as main equipment when communicating with described external unit.
4. whether method according to claim 1, is characterized in that, detect and have external unit to access mobile terminal by USB interface, comprising:
By detecting the level change of USB interface, detecting and whether having external unit to access mobile terminal by USB interface.
5., according to the arbitrary described method of claim 1-4, it is characterized in that, when being as main equipment when described mobile terminal communicates with described external unit, after the 2nd USB drive current optimum configurations USB drive current, also comprising:
When detecting that described external unit extracts the USB interface of mobile terminal, according to a USB drive current optimum configurations USB drive current.
6. take into account a device for USB eye pattern performance and OTG function, it is characterized in that, described device comprises:
Whether detection module, have external unit to access mobile terminal by USB interface for detecting;
Judge module, for when there being external unit to access mobile terminal, judges that described mobile terminal is as from equipment or as main equipment when communicating with described external unit;
First arranges module, for being as during from equipment when described mobile terminal communicates with described external unit, according to a USB drive current optimum configurations USB drive current;
Second arranges module, during for being as main equipment when described mobile terminal communicates with described external unit, according to the 2nd USB drive current optimum configurations USB drive current;
Wherein, a described USB drive current parameter is the USB drive current parameter determined according to USB eye pattern performance, and described 2nd USB drive current parameter is the USB drive current parameter determined according to OTG compatibility.
7. device according to claim 6, is characterized in that, a described USB drive current parameter is greater than described 2nd USB drive current parameter.
8. device according to claim 6, is characterized in that, described judge module specifically for:
By judging USBID pin level, judge that described mobile terminal is as from equipment or as main equipment when communicating with described external unit.
9. device according to claim 6, is characterized in that, described detection module specifically for:
By detecting the level change of USB interface, detecting and whether having external unit to access mobile terminal by USB interface.
10., according to the arbitrary described device of claim 6-9, it is characterized in that, also comprise:
3rd arranges module, for when being as main equipment when described mobile terminal communicates with described external unit, after the 2nd USB drive current optimum configurations USB drive current, when detecting that described external unit extracts the USB interface of mobile terminal, according to a USB drive current optimum configurations USB drive current.
CN201510703554.2A 2015-10-23 2015-10-23 Take into account the method and device of USB eye patterns performance and OTG functions Expired - Fee Related CN105404600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510703554.2A CN105404600B (en) 2015-10-23 2015-10-23 Take into account the method and device of USB eye patterns performance and OTG functions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510703554.2A CN105404600B (en) 2015-10-23 2015-10-23 Take into account the method and device of USB eye patterns performance and OTG functions

Publications (2)

Publication Number Publication Date
CN105404600A true CN105404600A (en) 2016-03-16
CN105404600B CN105404600B (en) 2018-05-25

Family

ID=55470096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510703554.2A Expired - Fee Related CN105404600B (en) 2015-10-23 2015-10-23 Take into account the method and device of USB eye patterns performance and OTG functions

Country Status (1)

Country Link
CN (1) CN105404600B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106527639A (en) * 2016-09-21 2017-03-22 奇酷互联网络科技(深圳)有限公司 OTG (On-The-Go) connection control method, master equipment and terminal equipment
CN109921959A (en) * 2019-03-22 2019-06-21 维沃移动通信有限公司 A kind of parameter regulation means and communication equipment
CN111858430A (en) * 2020-07-07 2020-10-30 上海龙旗科技股份有限公司 OTG optimization method and system of mobile terminal
CN112256610A (en) * 2020-10-19 2021-01-22 Tcl通讯(宁波)有限公司 Connection control method, system, storage medium and mobile terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010034807A1 (en) * 2000-04-25 2001-10-25 Kabushiki Kaisha Mobile communication terminal device
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN104750226A (en) * 2013-12-31 2015-07-01 联芯科技有限公司 USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010034807A1 (en) * 2000-04-25 2001-10-25 Kabushiki Kaisha Mobile communication terminal device
CN104750226A (en) * 2013-12-31 2015-07-01 联芯科技有限公司 USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method
CN103744821A (en) * 2014-01-10 2014-04-23 广东欧珀移动通信有限公司 Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106527639A (en) * 2016-09-21 2017-03-22 奇酷互联网络科技(深圳)有限公司 OTG (On-The-Go) connection control method, master equipment and terminal equipment
CN106527639B (en) * 2016-09-21 2019-10-25 奇酷互联网络科技(深圳)有限公司 OTG connection control method, main equipment and terminal device
CN109921959A (en) * 2019-03-22 2019-06-21 维沃移动通信有限公司 A kind of parameter regulation means and communication equipment
CN111858430A (en) * 2020-07-07 2020-10-30 上海龙旗科技股份有限公司 OTG optimization method and system of mobile terminal
CN112256610A (en) * 2020-10-19 2021-01-22 Tcl通讯(宁波)有限公司 Connection control method, system, storage medium and mobile terminal

Also Published As

Publication number Publication date
CN105404600B (en) 2018-05-25

Similar Documents

Publication Publication Date Title
CN106797127B (en) Electronic device, method for controlling charging through electronic device and method for supplying power through power supply device
US9128691B2 (en) Method and terminal for selecting internal circuit according to USB interface status
CN100495377C (en) Method for inspecting type of connected peripheral apparatus and terminal interface
CN102572352B (en) HDMI multiplexing method, HDMI, and equipped provided with HDMI
EP2860638B1 (en) Serial communication over communication control pin
CN103618356B (en) A charging system and charging method for a mobile terminal
CN104063348B (en) Realize the device and method of compatible USB communications and voice communication
CN108920397B (en) Device identification method and device, storage medium and electronic device
CN105404600B (en) Take into account the method and device of USB eye patterns performance and OTG functions
CN105068959A (en) A charging method and device for a terminal and a terminal with a data exchange function
CN204576500U (en) A kind of usb communication circuit of compatible I2C communication and system
CN105048018B (en) The charging method and device of a kind of terminal with data exchanging function
WO2017161750A1 (en) Mobile apparatus
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
CN103888873A (en) Electronic device and UART output system and method
CN202696710U (en) A system that uses impedance to identify peripherals
CN112799985B (en) USB interface control method, USB control circuit and main board of intelligent network connected equipment
CN105183678A (en) Communication method and device for terminal interface
US9547615B2 (en) Peripheral protocol negotiation
CN104850512B (en) No ID pin does the method and device of USB OTG function
US10515025B2 (en) Communication protocol adapter
CN105824732A (en) USB detection method and detection system
CN105071488B (en) A kind of charging method and device of the terminal with data exchanging function
CN104077255A (en) Method for terminal to communicate with computer through USB
CN102761624A (en) Method and device for debugging Internet access out of panel and cable

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

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

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

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

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CP01 Change in the name or title of a patent holder
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180525

CF01 Termination of patent right due to non-payment of annual fee