CN104750226A - USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method - Google Patents

USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method Download PDF

Info

Publication number
CN104750226A
CN104750226A CN201310753789.3A CN201310753789A CN104750226A CN 104750226 A CN104750226 A CN 104750226A CN 201310753789 A CN201310753789 A CN 201310753789A CN 104750226 A CN104750226 A CN 104750226A
Authority
CN
China
Prior art keywords
usb
module
hardware interface
gpio
configuration
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
CN201310753789.3A
Other languages
Chinese (zh)
Other versions
CN104750226B (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.)
Leadcore Technology Co Ltd
Original Assignee
Leadcore Technology Co 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 Leadcore Technology Co Ltd filed Critical Leadcore Technology Co Ltd
Priority to CN201310753789.3A priority Critical patent/CN104750226B/en
Publication of CN104750226A publication Critical patent/CN104750226A/en
Application granted granted Critical
Publication of CN104750226B publication Critical patent/CN104750226B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Power Sources (AREA)

Abstract

The invention provides a USB (universal serial bus) OTG (on-the-go) pattern recognition system and a USB OTG pattern recognition method. According to the USB OTG pattern recognition system and the USB OTG pattern recognition method, an ID pin of a USB hardware interface is configured to a GPIO (general purpose input/output) pattern and enables GPIO interruption, and the interruption is configured to that a falling edge is effective; when a plug is plugged into the USB hardware interface, the ID pin of the USB hardware interface is configured to an ID pattern of a USB module, in other words, the status of the ID pin of the USB hardware interface is monitored through a GPIO module, the USB module acquires signals of the ID pin of the USB hardware interface, and therefore, the USB module can acquire work pattern information thereof directly, in other words, low consumption can be kept under the condition that the USB module can acquire the work pattern information thereof.

Description

USB OTG pattern recognition system and method
Technical field
The present invention relates to data communication technology field, particularly a kind of USB OTG pattern recognition system and method.
Background technology
USB (universal serial bus) (USB, Universal Serial Bus) OTG(On The Go) technology applied more and more widely, in USB OTG technology, a very important job is that in judgment device, USB module is host mode or equipment mode, could carry out subsequent communications according to this thus.Concrete, USB hardware interface has individual ID pin, when state ID pin being detected is low level, the USB module of indication equipment needs to take host mode; When state ID pin being detected is high level, the USB module of indication equipment needs to take equipment mode.
In prior art, realize the judgement of host mode and equipment mode mainly through the following two kinds mode:
1, in use equipment, the ID pin of USB module judges;
2, in use equipment, GPIO module judges.
Concrete, please refer to Fig. 1, it is the module diagram being realized host mode and equipment mode judgement in prior art by USB module.As shown in Figure 1, the ID pin on USB hardware interface 13 is directly connected with the ID pin in USB module 10, realizes the status monitoring to the ID pin on described USB hardware interface 13 by described USB module 10.Concrete, ID pin on described USB hardware interface 13 is connected with the ID pin in the USB OTG Physical layer 12 in described USB module 10, the state of the ID pin that just can be detected on USB hardware interface 13 by USB otg controller 11 is low level or high level, thus directly can obtain USB module and should take host mode or equipment mode.
But the ID pin of USB module carries out the judgement of host mode and equipment mode in use equipment, need USB otg controller 11 and USB OTG Physical layer 12 in running order, will larger power consumption be produced thus.
For the second way, please refer to Fig. 2, it is the module diagram being realized host mode and equipment mode judgement in prior art by GPIO module.As shown in Figure 2, the ID pin on USB hardware interface 22 is connected directly to GPIO module 21, realizes the status monitoring to the ID pin on described USB hardware interface 13 by described GPIO module 21.When the state of the ID pin that described GPIO module 21 detects on USB hardware interface 22 be low level or high level time, just can obtain USB module and should take host mode or equipment mode, and and then inform described USB module.
Under a second technique, owing to being carried out the judgement of host mode and equipment mode by GPIO module 21, now, USB module 20 just can not work, due to GPIO module 21 relatively power saving, therefore for first kind of way, the second way reduces power consumption.But under a second technique, USB module 20 directly cannot be known and work in host mode or equipment mode, will be not easy to the work of USB module 20 thus.And when USB module 20 needs to obtain operating mode information, need to depend on GPIO module 21 and do extra judgement, too increasing complicacy thus.
Therefore, how when USB module can obtain its operating mode information, lower power consumption can be kept again to have become a great problem of this area.
Summary of the invention
The object of the present invention is to provide a kind of USB OTG pattern recognition system and method, be in host mode or the mode of equipment mode to solve existing judgement USB module, the problem of lower power consumption can not be kept when USB module directly obtains its operating mode information.
For solving the problems of the technologies described above, the invention provides a kind of USB OTG pattern recognition system, described USB OTG pattern recognition system comprises: chip and USB hardware interface, described chip comprises USB module, GPIO module and pin multiplexing device, wherein, the ID pin of described USB hardware interface is connected with described pin multiplexing device, described pin multiplexing device and described USB module and GPIO model calling;
The ID pin configuration of described USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface, the ID pin configuration of described USB hardware interface becomes the ID pattern of USB module.
Optionally, in described USB OTG pattern recognition system, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts.
Optionally, in described USB OTG pattern recognition system, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Remove the pull-up configuration of GPIO, configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
Optionally, in described USB OTG pattern recognition system, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
Optionally, in described USB OTG pattern recognition system, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts, and removes the pull-up configuration of GPIO, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG pattern recognition system, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
The present invention also provides a kind of USB OTG pattern recognition system, described USB OTG pattern recognition system comprises: chip, USB hardware interface and matching module, described chip comprises USB module and GPIO module, wherein, the ID pin of described USB hardware interface is connected with described matching module, described matching module and described USB module and GPIO model calling;
GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface, forbidding GPIO interrupts, and configuration USB module, makes it can know the ID pin status of described USB hardware interface.
Optionally, in described USB OTG pattern recognition system, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
Forbidding GPIO interrupts.
Optionally, in described USB OTG pattern recognition system, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
Optionally, in described USB OTG pattern recognition system, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
Optionally, in described USB OTG pattern recognition system, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
Forbidding GPIO interrupts, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG pattern recognition system, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
The present invention also provides a kind of USB OTG mode identification method of above-mentioned USB OTG pattern recognition system, and described USB OTG mode identification method comprises:
Pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, described pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to USB module.
Optionally, in described USB OTG mode identification method, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts.
Optionally, in described USB OTG mode identification method, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Remove the pull-up configuration of GPIO, configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
Optionally, in described USB OTG mode identification method, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
Optionally, in described USB OTG mode identification method, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts, and removes the pull-up configuration of GPIO, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG mode identification method, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
The present invention also provides a kind of USB OTG mode identification method of above-mentioned USB OTG pattern recognition system, and described USB OTG mode identification method comprises:
Matching module by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, forbidding GPIO interrupts, and configuration USB module, makes it can know the ID pin status of described USB hardware interface.
Optionally, in described USB OTG mode identification method, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
Forbidding GPIO interrupts.
Optionally, in described USB OTG mode identification method, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
Optionally, in described USB OTG mode identification method, when the MINI-A plug in described USB hardware interface is extracted, following process is carried out in the ID state change interruption producing USB module:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
Optionally, in described USB OTG mode identification method, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
Forbidding GPIO interrupts, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG mode identification method, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
In USB OTG pattern recognition system provided by the invention and method, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective; When having plug to insert in USB hardware interface, the ID pin configuration of described USB hardware interface becomes the ID pattern of USB module, namely by the ID pin status of GPIO module monitors USB hardware interface, simultaneously when having plug to insert in described USB hardware interface, USB module obtains the signal of the ID pin of USB hardware interface, also just achieve the object that USB module directly can obtain its operating mode information thus, namely achieve and keep lower power consumption when USB module can obtain its operating mode information.
Accompanying drawing explanation
Fig. 1 is the module diagram being realized host mode and equipment mode judgement in prior art by USB module;
Fig. 2 is the module diagram being realized host mode and equipment mode judgement in prior art by GPIO module;
Fig. 3 is the module diagram of the USB OTG pattern recognition system of the embodiment of the present invention one;
Fig. 4 is the schematic flow sheet of the USB OTG mode identification method of the embodiment of the present invention one;
Fig. 5 is the module diagram of the USB OTG pattern recognition system of the embodiment of the present invention two;
Fig. 6 is the schematic flow sheet of the USB OTG mode identification method of the embodiment of the present invention two.
Embodiment
The USB OTG pattern recognition system proposed the present invention below in conjunction with the drawings and specific embodiments and method are described in further detail.According to the following describes and claims, advantages and features of the invention will be clearer.It should be noted that, accompanying drawing all adopts the form that simplifies very much and all uses non-ratio accurately, only in order to object that is convenient, the aid illustration embodiment of the present invention lucidly.
[embodiment one]
Please refer to Fig. 3 and Fig. 4, wherein, Fig. 3 is the module diagram of the USB OTG pattern recognition system of the embodiment of the present invention one; Fig. 4 is the schematic flow sheet of the USB OTG mode identification method of the embodiment of the present invention one.
As shown in Figure 3, described USB OTG pattern recognition system comprises: chip 3 and USB hardware interface 32, described chip 3 comprises USB module 30, GPIO module 31 and pin multiplexing device 33, wherein, the ID pin of described USB hardware interface 32 is connected with described pin multiplexing device 33, described pin multiplexing device 33 and described USB module 30 and GPIO model calling 31;
The ID pin configuration of described USB hardware interface 32 becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface 32, the ID pin configuration of described USB hardware interface 32 becomes the ID pattern of USB module.
Accordingly, the present embodiment also provides a kind of USB OTG mode identification method of above-mentioned USB OTG pattern recognition system, and described USB OTG mode identification method comprises:
Pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, described pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to USB module.
In the USB OTG pattern recognition system provided in the embodiment of the present invention and method, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective; When having plug to insert in USB hardware interface, the ID pin configuration of described USB hardware interface becomes the ID pattern of USB module, namely by the ID pin status of GPIO module monitors USB hardware interface, simultaneously when having plug to insert in described USB hardware interface, USB module obtains the signal of the ID pin of USB hardware interface, also just achieve the object that USB module directly can obtain its operating mode information thus, namely achieve and keep lower power consumption when USB module can obtain its operating mode information.
Please continue to refer to Fig. 3 and Fig. 4, described USB OTG mode identification method realizes especially by following method:
At execution step S40: after starting, first carry out initial configuration to USB OTG pattern recognition system, concrete, perform step S41: the ID pin configuration of USB hardware interface is become GPIO pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective.Then whether, just by the ID pin status of USB hardware interface described in described GPIO module monitors, namely perform step S42: judged whether insertion event, namely monitoring in USB hardware interface has plug to insert.When there being plug to insert, the ID pin configuration performing step S43:USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts and removes the pull-up configuration of GPIO.When not having plug to insert, then continue to perform step S42, also namely keep the monitoring for USB hardware interface.
Concrete, the plug of insertion can be divided into MINI-A plug and MINI-B plug, and wherein, when insertion plug is MINI-A plug, USB module is in host mode; When insertion plug is MINI-B plug, USB module is in equipment mode.According to the difference inserting plug, when performing step S42, the embodiment of the present application takes different specific implementations.Concrete, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt; When described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted.Namely be achieved by the interruption of disparate modules.Take above-mentioned different modes reason as follows:
When insertion plug is MINI-A plug, has negative edge thus GPIO can be produced and interrupt;
When insertion plug is MINI-B plug, is equivalent to ID pin unsettled, namely there is no negative edge, therefore, in application embodiment, power by giving VBUS pin and produce the respective interrupt of PMU module 34.
Further, in the embodiment of the present application, when there being MINI-A plug during described USB hardware interface inserts, also following process is carried out: the ID state change of enable USB module is interrupted.Thus, in follow-up, when the MINI-A plug in described USB hardware interface is extracted, the ID state change that can produce USB module is interrupted, and then be configured accordingly and make USB module enter battery saving mode, carry out following process: the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective simultaneously.And when insertion plug is MINI-B plug, because corresponding the extracting of PMU is interrupted being enable, therefore, follow-uply namely can detect extracting of MINI-B plug, and then be configured accordingly and make USB module enter battery saving mode, carry out following process: the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective simultaneously.
Base this, namely complete the monitoring of GPIO module for ID pin, and USB module is for the acquisition of mode of operation.Follow-uply can perform conventional processing, concrete comprises:
Perform step S44:USB module to configure accordingly according to the mode of operation obtained;
Perform step S45: normal use USB OTG.
In the embodiment of the present application, because interruption is extracted in the ID state change interruption or PMU being configured with enable USB module, therefore, then step S46 can be performed accordingly: detect whether extract event.When extracting event, step S47 can be performed: configuration USB module enters battery saving mode, closes clock and power supply, and then the ID pin configuration recovering USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.When not extracting event, then continue to perform step S46, carry out corresponding monitoring.
As fully visible, become GPIO pattern by the ID pin configuration of USB hardware interface, and enable GPIO interrupts, interrupt configuration becomes negative edge effective; When having plug to insert in USB hardware interface, the ID pin configuration of described USB hardware interface becomes the ID pattern of USB module, namely by the ID pin status of GPIO module monitors USB hardware interface, simultaneously when having plug to insert in described USB hardware interface, USB module obtains the signal of the ID pin of USB hardware interface, also just achieve the object that USB module directly can obtain its operating mode information thus, namely achieve and keep lower power consumption when USB module can obtain its operating mode information.
[embodiment two]
Please refer to Fig. 5 and Fig. 6, wherein, Fig. 5 is the module diagram of the USB OTG pattern recognition system of the embodiment of the present invention two; Fig. 6 is the schematic flow sheet of the USB OTG mode identification method of the embodiment of the present invention two.
As shown in Figure 5, described USB OTG pattern recognition system comprises: chip 5, USB hardware interface 52 and matching module 53, described chip 5 comprises USB module 50 and GPIO module 51, wherein, the ID pin of described USB hardware interface 52 is connected with described matching module 53, and described matching module 53 is connected with described USB module 50 and GPIO module 51;
Described GPIO module 51 is configured to input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface 52, forbidding GPIO interrupts, and configuration USB module 50, makes it can know the ID pin status of described USB hardware interface 52.
Accordingly, the present embodiment also provides a kind of USB OTG mode identification method of above-mentioned USB OTG pattern recognition system, and described USB OTG mode identification method comprises:
Matching module by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, forbidding GPIO interrupts, and configuration USB module, makes it can know the ID pin status of described USB hardware interface.
The present embodiment two is with the difference of embodiment one, and embodiment one has made change at chip internal, adds pin multiplexing device; And the present embodiment two is changed in chip exterior, add matching module, by described matching module, the ID signal of USB module and the signal level of GPIO module are mated.
In the USB OTG pattern recognition system provided in the embodiment of the present invention and method, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective; When having plug to insert in USB hardware interface, forbidding GPIO interrupts, configuration USB module, namely by the ID pin status of GPIO module monitors USB hardware interface, simultaneously when having plug to insert in described USB hardware interface, USB module obtains the signal of the ID pin of USB hardware interface, also just achieves the object that USB module directly can obtain its operating mode information thus, namely achieves and keep lower power consumption when USB module can obtain its operating mode information.
Please continue to refer to Fig. 5 and Fig. 6, described USB OTG mode identification method realizes especially by following method:
At execution step S60: after starting, first carry out initial configuration to USB OTG pattern recognition system, concrete, perform step S61:GPIO and be configured as input pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective.Then whether, just by the ID pin status of USB hardware interface described in described GPIO module monitors, namely perform step S62: judged whether insertion event, namely monitoring in USB hardware interface has plug to insert.When there being plug to insert, perform step S63: forbidding GPIO interrupts.When not having plug to insert, then continue to perform step S62, also namely keep the monitoring for USB hardware interface.
Concrete, the plug of insertion can be divided into MINI-A plug and MINI-B plug, and wherein, when insertion plug is MINI-A plug, USB module is in host mode; When insertion plug is MINI-B plug, USB module is in equipment mode.According to the difference inserting plug, when performing step S62, the embodiment of the present application takes different specific implementations.Concrete, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt; When described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted.Namely be achieved by the interruption of disparate modules.Take above-mentioned different modes reason as follows:
When insertion plug is MINI-A plug, has negative edge thus GPIO can be produced and interrupt;
When insertion plug is MINI-B plug, is equivalent to ID pin unsettled, namely there is no negative edge, therefore, in application embodiment, power by giving VBUS pin and produce the respective interrupt of PMU module 54.
Further, in the embodiment of the present application, when there being MINI-A plug during described USB hardware interface inserts, also following process is carried out: the ID state change of enable USB module is interrupted.Thus, in follow-up, when the MINI-A plug in described USB hardware interface is extracted, the ID state change that can produce USB module is interrupted, and then be configured accordingly and make USB module enter battery saving mode, carry out following process: GP configuring IO is input pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective simultaneously.And when insertion plug is MINI-B plug, because corresponding the extracting of PMU is interrupted being enable, therefore, follow-uply namely can detect extracting of MINI-B plug, and then be configured accordingly and make USB module enter battery saving mode, carry out following process: GP configuring IO is input pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective simultaneously.
Base this, namely complete the monitoring of GPIO module for ID pin, and USB module is for the acquisition of mode of operation.Follow-uply can perform conventional processing, concrete comprises:
Perform step S64:USB module to configure accordingly according to the mode of operation obtained;
Perform step S65: normal use USB OTG.
In the embodiment of the present application, because interruption is extracted in the ID state change interruption or PMU being configured with enable USB module, therefore, then step S66 can be performed accordingly: detect whether extract event.When extracting event, step S67 can be performed: configuration USB module enters battery saving mode, and close clock and power supply, and then recovery configuring GPIO is input pattern, and enable GPIO interrupts, interrupt configuration becomes negative edge effective.When not extracting event, then continue to perform step S66, carry out corresponding monitoring.
As fully visible, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective; When having plug to insert in USB hardware interface, forbidding GPIO interrupts, configuration USB module, namely by the ID pin status of GPIO module monitors USB hardware interface, simultaneously when having plug to insert in described USB hardware interface, USB module obtains the signal of the ID pin of USB hardware interface, also just achieves the object that USB module directly can obtain its operating mode information thus, namely achieves and keep lower power consumption when USB module can obtain its operating mode information.
Foregoing description is only the description to present pre-ferred embodiments, any restriction not to the scope of the invention, and any change that the those of ordinary skill in field of the present invention does according to above-mentioned disclosure, modification, all belong to the protection domain of claims.

Claims (24)

1. a USB OTG pattern recognition system, it is characterized in that, comprise: chip and USB hardware interface, described chip comprises USB module, GPIO module and pin multiplexing device, wherein, the ID pin of described USB hardware interface is connected with described pin multiplexing device, described pin multiplexing device and described USB module and GPIO model calling;
The ID pin configuration of described USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface, the ID pin configuration of described USB hardware interface becomes the ID pattern of USB module.
2. USB OTG pattern recognition system as claimed in claim 1, is characterized in that, when described USB hardware interface inserts MINI-A plug, produces GPIO and interrupts and carry out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts.
3. USB OTG pattern recognition system as claimed in claim 2, is characterized in that, when there being MINI-A plug during described USB hardware interface inserts, also carries out following process:
Remove the pull-up configuration of GPIO, configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
4. USB OTG pattern recognition system as claimed in claim 3, is characterized in that, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
5. USB OTG pattern recognition system as claimed in claim 1, is characterized in that, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts, and removes the pull-up configuration of GPIO, and configuration USB module is operated in equipment mode.
6. USB OTG pattern recognition system as claimed in claim 5, is characterized in that, when the MINI-B plug in described USB hardware interface is extracted, produces extracting of a PMU module and interrupts and carry out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
7. a USB OTG pattern recognition system, it is characterized in that, comprise: chip, USB hardware interface and matching module, described chip comprises USB module and GPIO module, wherein, the ID pin of described USB hardware interface is connected with described matching module, described matching module and described USB module and GPIO model calling;
GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective;
When having plug to insert in described USB hardware interface, forbidding GPIO interrupts, and configuration USB module, makes it can know the ID pin status of described USB hardware interface.
8. USB OTG pattern recognition system as claimed in claim 7, is characterized in that, when described USB hardware interface inserts MINI-A plug, produces GPIO and interrupts and carry out following process:
Forbidding GPIO interrupts.
9. USB OTG pattern recognition system as claimed in claim 8, is characterized in that, when there being MINI-A plug during described USB hardware interface inserts, also carries out following process:
Configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
10. USB OTG pattern recognition system as claimed in claim 9, is characterized in that, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
11. USB OTG pattern recognition system as claimed in claim 7, is characterized in that, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
Forbidding GPIO interrupts, and configuration USB module is operated in equipment mode.
12. USB OTG pattern recognition system as claimed in claim 11, is characterized in that, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
The USBOTG mode identification method of 13. 1 kinds of USB OTG pattern recognition system according to any one of claim 1 ~ 6, is characterized in that, comprising:
Pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, described pin multiplexing device by the Signal transmissions of the ID pin of USB hardware interface to USB module.
14. USB OTG mode identification methods as claimed in claim 13, is characterized in that, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts.
15. USB OTG mode identification methods as claimed in claim 14, is characterized in that, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Remove the pull-up configuration of GPIO, configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
16. USB OTG mode identification methods as claimed in claim 15, is characterized in that, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
17. USB OTG mode identification methods as claimed in claim 13, is characterized in that, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
The ID pin configuration of USB hardware interface becomes the ID pattern of USB module, and forbidding GPIO interrupts, and removes the pull-up configuration of GPIO, and configuration USB module is operated in equipment mode.
18. USB OTG mode identification methods as claimed in claim 17, is characterized in that, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, the ID pin configuration of USB hardware interface becomes GPIO pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
The USBOTG mode identification method of 19. 1 kinds of USB OTG pattern recognition system according to any one of claim 7 ~ 12, is characterized in that, comprising:
Matching module by the Signal transmissions of the ID pin of USB hardware interface to GPIO module, the ID pin status of USB hardware interface described in described GPIO module monitors;
When having plug to insert in described USB hardware interface, forbidding GPIO interrupts, and configuration USB module, makes it can know the ID pin status of described USB hardware interface.
20. USB OTG mode identification methods as claimed in claim 19, is characterized in that, when described USB hardware interface inserts MINI-A plug, produce GPIO and interrupt and carry out following process:
Forbidding GPIO interrupts.
21. USB OTG mode identification methods as claimed in claim 20, is characterized in that, when there being MINI-A plug during described USB hardware interface inserts, also carry out following process:
Configuration USB module is operated in host mode, and the change of the ID state of enable USB module is interrupted.
22. USB OTG mode identification methods as claimed in claim 21, is characterized in that, when the MINI-A plug in described USB hardware interface is extracted, the ID state change producing USB module is interrupted and carries out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
23. USB OTG mode identification methods as claimed in claim 19, is characterized in that, when described USB hardware interface inserts MINI-B plug, the insertion producing a PMU module is interrupted and carries out following process:
Forbidding GPIO interrupts, and configuration USB module is operated in equipment mode.
24. USB OTG mode identification methods as claimed in claim 23, is characterized in that, when the MINI-B plug in described USB hardware interface is extracted, produce extracting of a PMU module and interrupt and carry out following process:
Forbidding USB module, allow it enter battery saving mode, GPIO block configuration becomes input pattern, and enable GPIO interrupts, and interrupt configuration becomes negative edge effective.
CN201310753789.3A 2013-12-31 2013-12-31 USB OTG mode identification system and method Active CN104750226B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310753789.3A CN104750226B (en) 2013-12-31 2013-12-31 USB OTG mode identification system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310753789.3A CN104750226B (en) 2013-12-31 2013-12-31 USB OTG mode identification system and method

Publications (2)

Publication Number Publication Date
CN104750226A true CN104750226A (en) 2015-07-01
CN104750226B CN104750226B (en) 2017-09-29

Family

ID=53590058

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310753789.3A Active CN104750226B (en) 2013-12-31 2013-12-31 USB OTG mode identification system and method

Country Status (1)

Country Link
CN (1) CN104750226B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183678A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Communication method and apparatus of terminal interface
CN105404600A (en) * 2015-10-23 2016-03-16 广东欧珀移动通信有限公司 Method and apparatus giving consideration to USB eye pattern performance and OTG function
CN107678996A (en) * 2017-09-26 2018-02-09 深圳市汉普电子技术开发有限公司 Determination method, USB device and the storage medium of USB mode
WO2018076382A1 (en) * 2016-10-31 2018-05-03 深圳市大疆创新科技有限公司 Universal serial bus-based method for data exchange and universal serial bus device
CN111581144A (en) * 2020-03-24 2020-08-25 惠州市德赛西威智能交通技术研究院有限公司 Vehicle-mounted camera hot-plug self-recovery method and device and storage medium
CN111757051A (en) * 2020-05-20 2020-10-09 惠州市德赛西威智能交通技术研究院有限公司 Data transmission method, intelligent terminal and radar system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101359316B (en) * 2007-08-03 2010-06-30 联芯科技有限公司 Method and apparatus for implementing general-purpose serial bus USB OTG
CN101645051B (en) * 2009-06-10 2013-04-24 无锡中星微电子有限公司 GPIO interrupt control device, chip and GPIO interrupt control method
CN101901201B (en) * 2010-08-06 2014-07-16 中兴通讯股份有限公司 Method and device for realizing USB OTG function on electronic equipment
CN202872406U (en) * 2012-09-19 2013-04-10 青岛海信移动通信技术股份有限公司 Interface multiplexing circuit and mobile terminal

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183678A (en) * 2015-08-25 2015-12-23 广东欧珀移动通信有限公司 Communication method and apparatus of terminal interface
CN105404600A (en) * 2015-10-23 2016-03-16 广东欧珀移动通信有限公司 Method and apparatus giving consideration to USB eye pattern performance and OTG function
CN105404600B (en) * 2015-10-23 2018-05-25 广东欧珀移动通信有限公司 Take into account the method and device of USB eye patterns performance and OTG functions
WO2018076382A1 (en) * 2016-10-31 2018-05-03 深圳市大疆创新科技有限公司 Universal serial bus-based method for data exchange and universal serial bus device
CN107678996A (en) * 2017-09-26 2018-02-09 深圳市汉普电子技术开发有限公司 Determination method, USB device and the storage medium of USB mode
CN111581144A (en) * 2020-03-24 2020-08-25 惠州市德赛西威智能交通技术研究院有限公司 Vehicle-mounted camera hot-plug self-recovery method and device and storage medium
CN111757051A (en) * 2020-05-20 2020-10-09 惠州市德赛西威智能交通技术研究院有限公司 Data transmission method, intelligent terminal and radar system

Also Published As

Publication number Publication date
CN104750226B (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN104750226A (en) USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method
CN101901201B (en) Method and device for realizing USB OTG function on electronic equipment
CN101840387B (en) USB (Universal Serial Bus) Key device and method for realizing smart card communications using USB interface
US20150236522A1 (en) Usb charging system with variable charging voltage, charger and smart terminal
CN101276319B (en) Equipment and method for making USB interface to time-sharing apply as standard I /O interface
CN103024195B (en) Smart mobile terminal and implementation method of charging of smart mobile terminal
CN101526930A (en) USB interface master-slave machine detection device and detection method
WO2011088672A1 (en) Intelligent charging method and device for terminal
CN107678532A (en) A kind of low-power dissipation SOC wake module and low-power dissipation SOC
CN102799550A (en) Awakening and hot-plugging methods and equipment based on high speed inter-chip (HSIC)
CN105225316A (en) A kind of dormancy of electron key low-power consumption power supply plan and awakening method
CN104281465A (en) Computer and awakening method thereof
CN102981916A (en) Mobile terminal and control method of mobile terminal and device of mobile terminal
CN203084723U (en) PCIE interface
CN104270740A (en) Slot-sharing T card and SIM card detection method
CN206363301U (en) The TYPE_C interface protocol chips of super low-power consumption
CN106774769A (en) The changing method and device of a kind of terminal work mode, handheld terminal
CN104361277A (en) Identity authentication module and method for USB interface equipment
CN106856289A (en) Electronic equipment and its circuit, interconnecting device and its circuit and signal processing system
CN203759601U (en) Industrial computer mainboard
CN102981588B (en) System and method capable of starting up through universal sequence bus device
CN206441175U (en) A kind of isolator of movable storage device
CN211149356U (en) Shenwei 1621CPU ICH-free 2 suite server mainboard
CN204315876U (en) The mutual charging data line of a kind of smart machine
CN104345850A (en) Intelligent type automatic power-on device

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
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20150701

Assignee: Shanghai Li Ke Semiconductor Technology Co., Ltd.

Assignor: Leadcore Technology Co., Ltd.

Contract record no.: 2018990000159

Denomination of invention: USB (universal serial bus) OTG (on-the-go) pattern recognition system and USB OTG pattern recognition method

Granted publication date: 20170929

License type: Common License

Record date: 20180615

EE01 Entry into force of recordation of patent licensing contract