CN104750226B - USB OTG mode identification system and method - Google Patents
USB OTG mode identification system and method Download PDFInfo
- Publication number
- CN104750226B CN104750226B CN201310753789.3A CN201310753789A CN104750226B CN 104750226 B CN104750226 B CN 104750226B CN 201310753789 A CN201310753789 A CN 201310753789A CN 104750226 B CN104750226 B CN 104750226B
- Authority
- CN
- China
- Prior art keywords
- usb
- gpio
- hardware interface
- module
- otg
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000003780 insertion Methods 0.000 claims description 57
- 230000037431 insertion Effects 0.000 claims description 57
- 238000012545 processing Methods 0.000 claims description 46
- 238000000605 extraction Methods 0.000 claims description 24
- 238000003909 pattern recognition Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 6
- 238000012544 monitoring process Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000007423 decrease Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000005611 electricity Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Landscapes
- Power Sources (AREA)
Abstract
The invention provides a USB OTG mode identification system and a method, wherein an ID pin of a USB hardware interface is configured into a GPIO mode, GPIO interruption is enabled, and the interruption is configured to be effective at a falling edge; when a plug is inserted into the USB hardware interface, the ID pin of the USB hardware interface is configured into the ID mode of the USB module, namely the state of the ID pin of the USB hardware interface is monitored through the GPIO module, and meanwhile, when the plug is inserted into the USB hardware interface, the USB module acquires the signal of the ID pin of the USB hardware interface, so that the aim that the USB module can directly acquire the working mode information of the USB module is fulfilled, namely, the USB module can keep low power consumption under the condition that the USB module can acquire the working mode information of the USB module is fulfilled.
Description
Technical field
The present invention relates to data communication technology field, more particularly to a kind of USB OTG PRSs and method.
Background technology
USB(USB, Universal Serial Bus)OTG(On The Go)Technology is by increasingly
It is widely applied, a very important job is to judge that USB module is host mode or set in equipment in USB OTG technologies
Standby pattern, subsequent communications thus could be carried out according to this.Specifically, there is individual ID pins on USB hardware interface, when detecting ID pins
State be low level when, represent equipment USB module need to take host mode;It is high electricity when detecting the state of ID pins
Usually, represent that the USB module of equipment needs to take equipment mode.
In the prior art, the judgement of host mode and equipment mode is mainly realized by the following two kinds mode:
1st, judged using the ID pins of USB module in equipment;
2nd, judged using GPIO modules in equipment.
Specifically, refer to Fig. 1, it is to realize that host mode and equipment mode judge by USB module in the prior art
Module diagram.As shown in figure 1, the ID pins on USB hardware interface 13 are directly connected with the ID pins in USB module 10,
Status monitoring to the ID pins on the USB hardware interface 13 is realized by the USB module 10.Specifically, the USB is hard
ID pins on part interface 13 are connected with the ID pins in the USB OTG physical layers 12 in the USB module 10, pass through USB
The state that otg controller 11 just can detect the ID pins on USB hardware interface 13 is low level or high level, so as to
Host mode or equipment mode should be taken by directly obtaining USB module.
But, the judgement of host mode and equipment mode is carried out, it is necessary to USB using the ID pins of USB module in equipment
Otg controller 11 and USB OTG physical layers 12 are in running order, thus will produce larger power consumption.
For the second way, Fig. 2 is refer to, it is to realize host mode by GPIO modules in the prior art and set
The module diagram of standby mode decision.As shown in Fig. 2 the ID pins on USB hardware interface 22 are connected directly to GPIO modules 21,
Status monitoring to the ID pins on the USB hardware interface 13 is realized by the GPIO modules 21.When the GPIO modules
When 21 states for detecting the ID pins on USB hardware interface 22 are low level or high level, USB module just can be obtained
It should take host mode or equipment mode, and and then inform the USB module.
Under a second technique, due to the judgement by the progress host mode of GPIO modules 21 and equipment mode, now,
USB module 20 just can not work, due to the relatively power saving of GPIO modules 21, therefore for first way, and second
The mode of kind reduces power consumption.But, under a second technique, USB module 20, which will be unable to directly know, is operate on host mode
Or equipment mode, thus will be not easy to the work of USB module 20.And when USB module 20 needs to obtain operating mode information,
It need to rely on GPIO modules 21 and do extra judgement, thus also increase complexity.
Therefore, how in the case where USB module can obtain its operating mode information, relatively low power consumption can be kept again
Into a great problem of this area.
The content of the invention
It is an object of the invention to provide a kind of USB OTG PRSs and method, to solve existing judgement USB
During module is the mode of host mode or equipment mode, it is impossible to directly obtain the situation of its operating mode information in USB module
The problem of lower holding lower power consumption.
In order to solve the above technical problems, the present invention provides a kind of USB OTG PRSs, the USB OTG patterns
Identifying system includes:Chip and USB hardware interface, the chip include USB module, GPIO modules and pin multiplexing device, wherein,
The ID pins of the USB hardware interface are connected with the pin multiplexing device, the pin multiplexing device and the USB module and GPIO
Module is connected;
The ID pin configurations of the USB hardware interface enable GPIO interruptions into GPIO patterns, and interruption is configured to trailing edge
Effectively;
When having plug insertion in the USB hardware interface, the ID pin configurations of the USB hardware interface are into USB module
ID patterns.
Optionally, in described USB OTG PRSs, when the USB hardware interface inserts MINI-A plugs
When, produce GPIO and interrupt and carry out following processing:
The ID pin configurations of USB hardware interface into USB module ID patterns, and disabling GPIO interrupt.
Optionally, in described USB OTG PRSs, there is MINI-A in the USB hardware interface is inserted
During plug, following processing are also carried out:
GPIO pull-up configuration is removed, configuration USB module is operated in host mode, and enable the ID states of USB module and become
Change and interrupt.
Optionally, in described USB OTG PRSs, the MINI-A plugs in the USB hardware interface
During extraction, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface are enabled into GPIO patterns
GPIO is interrupted, and it is effective that interruption is configured to trailing edge.
Optionally, in described USB OTG PRSs, when the USB hardware interface inserts MINI-B plugs
When, following processing are interrupted and carried out in the insertion for producing a PMU modules:
The ID pin configurations of USB hardware interface are into the ID patterns of USB module, and disabling GPIO is interrupted, and removes the upper of GPIO
Configuration is drawn, configuration USB module is operated in equipment mode.
Optionally, in described USB OTG PRSs, the MINI-B plugs in the USB hardware interface
During extraction, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface are enabled into GPIO patterns
GPIO is interrupted, and it is effective that interruption is configured to trailing edge.
The present invention also provides a kind of USB OTG PRSs, and the USB OTG PRSs include:Chip,
USB hardware interface and matching module, the chip include USB module and GPIO modules, wherein, the ID of the USB hardware interface
Pin is connected with the matching module, and the matching module is connected with the USB module and GPIO modules;
GPIO modules are configured as input pattern, and enable GPIO interruptions, and it is effective that interruption is configured to trailing edge;
When having plug insertion in the USB hardware interface, disabling GPIO is interrupted, and is configured USB module, is known it
The ID pin status of the USB hardware interface.
Optionally, in described USB OTG PRSs, when the USB hardware interface inserts MINI-A plugs
When, produce GPIO and interrupt and carry out following processing:
GPIO is disabled to interrupt.
Optionally, in described USB OTG PRSs, there is MINI-A in the USB hardware interface is inserted
During plug, following processing are also carried out:
Configuration USB module is operated in host mode, and enables the ID state changes interruption of USB module.
Optionally, in described USB OTG PRSs, the MINI-A plugs in the USB hardware interface
During extraction, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enables GPIO and is interrupted,
It is effective that interruption is configured to trailing edge.
Optionally, in described USB OTG PRSs, when the USB hardware interface inserts MINI-B plugs
When, following processing are interrupted and carried out in the insertion for producing a PMU modules:
GPIO is disabled to interrupt, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG PRSs, the MINI-B plugs in the USB hardware interface
During extraction, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enables GPIO and is interrupted,
It is effective that interruption is configured to trailing edge.
The present invention also provides a kind of USB OTG mode identification methods of above-mentioned USB OTG PRSs, the USB
OTG mode identification methods include:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules, the GPIO module monitors by pin multiplexing device
The ID pin status of the USB hardware interface;
When having plug insertion in the USB hardware interface, the pin multiplexing device is by the ID pins of USB hardware interface
Signal is transferred to USB module.
Optionally, in described USB OTG mode identification methods, when the USB hardware interface inserts MINI-A plugs
When, produce GPIO and interrupt and carry out following processing:
The ID pin configurations of USB hardware interface into USB module ID patterns, and disabling GPIO interrupt.
Optionally, in described USB OTG mode identification methods, there is MINI-A in the USB hardware interface is inserted
During plug, following processing are also carried out:
GPIO pull-up configuration is removed, configuration USB module is operated in host mode, and enable the ID states of USB module and become
Change and interrupt.
Optionally, in described USB OTG mode identification methods, the MINI-A plugs in the USB hardware interface
During extraction, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface are enabled into GPIO patterns
GPIO is interrupted, and it is effective that interruption is configured to trailing edge.
Optionally, in described USB OTG mode identification methods, when the USB hardware interface inserts MINI-B plugs
When, following processing are interrupted and carried out in the insertion for producing a PMU modules:
The ID pin configurations of USB hardware interface are into the ID patterns of USB module, and disabling GPIO is interrupted, and removes the upper of GPIO
Configuration is drawn, configuration USB module is operated in equipment mode.
Optionally, in described USB OTG mode identification methods, the MINI-B plugs in the USB hardware interface
During extraction, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface are enabled into GPIO patterns
GPIO is interrupted, and it is effective that interruption is configured to trailing edge.
The present invention also provides a kind of USB OTG mode identification methods of above-mentioned USB OTG PRSs, the USB
OTG mode identification methods include:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules, the GPIO module monitors institute by matching module
State the ID pin status of USB hardware interface;
When having plug insertion in the USB hardware interface, disabling GPIO is interrupted, and is configured USB module, is known it
The ID pin status of the USB hardware interface.
Optionally, in described USB OTG mode identification methods, when the USB hardware interface inserts MINI-A plugs
When, produce GPIO and interrupt and carry out following processing:
GPIO is disabled to interrupt.
Optionally, in described USB OTG mode identification methods, there is MINI-A in the USB hardware interface is inserted
During plug, following processing are also carried out:
Configuration USB module is operated in host mode, and enables the ID state changes interruption of USB module.
Optionally, in described USB OTG mode identification methods, the MINI-A plugs in the USB hardware interface
During extraction, the ID state changes for producing USB module interrupt the following processing of progress:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enables GPIO and is interrupted,
It is effective that interruption is configured to trailing edge.
Optionally, in described USB OTG mode identification methods, when the USB hardware interface inserts MINI-B plugs
When, following processing are interrupted and carried out in the insertion for producing a PMU modules:
GPIO is disabled to interrupt, and configuration USB module is operated in equipment mode.
Optionally, in described USB OTG mode identification methods, the MINI-B plugs in the USB hardware interface
During extraction, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enable in GPIO
Disconnected, it is effective that interruption is configured to trailing edge.
In the USB OTG PRSs that provide of the present invention and method, the ID pin configurations of USB hardware interface into
GPIO patterns, and GPIO interruptions are enabled, it is effective that interruption is configured to trailing edge;It is described when there is plug insertion in USB hardware interface
The ID pin configurations of USB hardware interface are managed into the ID patterns of USB module by the ID of GPIO module monitors USB hardware interfaces
Feet state, while when having plug insertion in the USB hardware interface, USB module obtains the letter of the ID pins of USB hardware interface
Number, thus also it is achieved that USB module can directly obtain the purpose of its operating mode information, that is, realizes in USB module energy
Relatively low power consumption is kept in the case of enough obtaining its operating mode information.
Brief description of the drawings
Fig. 1 is to realize the module diagram that host mode and equipment mode judge by USB module in the prior art;
Fig. 2 is to realize the module diagram that host mode and equipment mode judge by GPIO modules in the prior art;
Fig. 3 is the module diagram of the USB OTG PRSs of the embodiment of the present invention one;
Fig. 4 is the schematic flow sheet of the USB OTG mode identification methods of the embodiment of the present invention one;
Fig. 5 is the module diagram of the USB OTG PRSs of the embodiment of the present invention two;
Fig. 6 is the schematic flow sheet of the USB OTG mode identification methods of the embodiment of the present invention two.
Embodiment
USB OTG PRSs proposed by the present invention and method are made into one below in conjunction with the drawings and specific embodiments
Step is described in detail.According to following explanation and claims, advantages and features of the invention will become apparent from.It should be noted that, it is attached
Figure is using very simplified form and uses non-accurately ratio, only real conveniently, lucidly to aid in illustrating the present invention
Apply the purpose of example.
【Embodiment one】
Fig. 3 and Fig. 4 are refer to, wherein, Fig. 3 is that the module of the USB OTG PRSs of the embodiment of the present invention one is shown
It is intended to;Fig. 4 is the schematic flow sheet of the USB OTG mode identification methods of the embodiment of the present invention one.
As shown in figure 3, the USB OTG PRSs include:Chip 3 and USB hardware interface 32, the chip 3
Including USB module 30, GPIO modules 31 and pin multiplexing device 33, wherein, ID pins and the pipe of the USB hardware interface 32
Pin multiplexer 33 is connected, and the pin multiplexing device 33 is connected 31 with the USB module 30 and GPIO modules;
The ID pin configurations of the USB hardware interface 32 enable GPIO interruptions into GPIO patterns, and interruption is configured to decline
Along effectively;
When having plug insertion in the USB hardware interface 32, the ID pin configurations of the USB hardware interface 32 are into USB
The ID patterns of module.
Accordingly, the present embodiment also provides a kind of USB OTG pattern-recognition sides of above-mentioned USB OTG PRSs
Method, the USB OTG mode identification methods include:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules, the GPIO module monitors by pin multiplexing device
The ID pin status of the USB hardware interface;
When having plug insertion in the USB hardware interface, the pin multiplexing device is by the ID pins of USB hardware interface
Signal is transferred to USB module.
In USB OTG PRSs provided in an embodiment of the present invention and method, the ID pins of USB hardware interface are matched somebody with somebody
GPIO patterns are set to, and enable GPIO interruptions, it is effective that interruption is configured to trailing edge;When there is plug insertion in USB hardware interface,
The ID pin configurations of the USB hardware interface pass through GPIO module monitors USB hardware interfaces into the ID patterns of USB module
ID pin status, while when having plug insertion in the USB hardware interface, USB module obtains the ID pins of USB hardware interface
Signal, be thus also achieved that USB module can directly obtain the purpose of its operating mode information, that is, realize in USB moulds
Block keeps relatively low power consumption in the case of can obtaining its operating mode information.
Please continue to refer to Fig. 3 and Fig. 4, the USB OTG mode identification methods are realized especially by following method:
Performing step S40:After beginning, initial configuration is carried out to USB OTG PRSs first, specifically,
Perform step S41:By the ID pin configurations of USB hardware interface into GPIO patterns, and GPIO interruptions are enabled, interruption is configured to decline
Along effectively.Then, just step can be performed by the ID pin status of USB hardware interface described in the GPIO module monitors
S42:Insertion event is determined whether, that is, monitors in USB hardware interface whether have plug insertion.When there is plug insertion, perform
Step S43:The ID pin configurations of USB hardware interface disable the pull-up that GPIO is interrupted and removed GPIO into the ID patterns of USB module
Configuration.When no plug is inserted, then step S42 is continued executing with, namely keep the monitoring for USB hardware interface.
Specifically, the plug of insertion can be divided into MINI-A plugs and MINI-B plugs, wherein, when insertion plug is MINI-A
During plug, USB module is in host mode;When it is MINI-B plugs to insert plug, USB module is in equipment mode.According to
The difference of plug is inserted, when performing step S42, the embodiment of the present application takes different specific implementations.Specifically, working as institute
When stating USB hardware interface insertion MINI-A plugs, produce GPIO and interrupt;When the USB hardware interface inserts MINI-B plugs,
The insertion for producing a PMU modules is interrupted.It is achieved by the interruption of disparate modules.Take above-mentioned different modes reason such as
Under:
When it is MINI-A plugs to insert plug, has trailing edge and interrupted so as to produce GPIO;
When it is MINI-B plugs to insert plug, ID pins are equivalent to vacantly, i.e., no trailing edge is therefore, real in application
Apply in example, the respective interrupt of PMU modules 34 is produced by being powered to VBUS pins.
Further, in the embodiment of the present application, when there are MINI-A plugs in USB hardware interface insertion, also enter
The following processing of row:The ID state changes for enabling USB module are interrupted.Thus, in follow-up, when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes that can produce USB module are interrupted, and then carry out configuration accordingly so that USB module is entered
Enter battery saving mode, while carrying out following processing:The ID pin configurations of USB hardware interface into GPIO patterns, and enable GPIO interruption,
It is effective that interruption is configured to trailing edge.And when it is MINI-B plugs to insert plug, it is to enable that interruption is extracted because PMU is corresponding
, it is therefore, follow-up to detect the extraction of MINI-B plugs, and then configuration is carried out accordingly so that USB module enters power saving
Pattern, while carrying out following processing:The ID pin configurations of USB hardware interface enable GPIO interruptions into GPIO patterns, and interruption is matched somebody with somebody
It is set to trailing edge effective.
Base this, that is, complete monitoring of the GPIO modules for ID pins, and USB module for the acquisition of mode of operation.
Follow-up i.e. executable conventional treatment, specifically includes:
Perform step S44:USB module is configured accordingly according to obtained mode of operation;
Perform step S45:It is normal to use USB OTG.
In the embodiment of the present application, during the interruption of ID state changes or PMU that USB module is enabled due to being configured with are extracted
It is disconnected, therefore, step S46 can be then performed accordingly:Extraction event is detected whether.When there is extraction event, you can perform step
S47:Configuration USB module enters battery saving mode, closes clock and power supply, so recover the ID pin configurations of USB hardware interface into
GPIO patterns, and GPIO interruptions are enabled, it is effective that interruption is configured to trailing edge.When no extraction event, then step is continued executing with
S46, is accordingly monitored.
As fully visible, by the ID pin configurations of USB hardware interface into GPIO patterns, and GPIO interruptions are enabled, interruption is matched somebody with somebody
It is set to trailing edge effective;When there is plug insertion in USB hardware interface, the ID pin configurations of the USB hardware interface are into USB moulds
The ID patterns of block, i.e., by the ID pin status of GPIO module monitors USB hardware interfaces, while when in the USB hardware interface
When having plug insertion, USB module obtains the signal of the ID pins of USB hardware interface, is thus also achieved that USB module can be straight
The purpose for taking its operating mode information is obtained, that is, realizes and is protected in the case where USB module can obtain its operating mode information
Hold relatively low power consumption.
【Embodiment two】
Fig. 5 and Fig. 6 are refer to, wherein, Fig. 5 is that the module of the USB OTG PRSs of the embodiment of the present invention two is shown
It is intended to;Fig. 6 is the schematic flow sheet of the USB OTG mode identification methods of the embodiment of the present invention two.
As shown in figure 5, the USB OTG PRSs include:Chip 5, USB hardware interface 52 and matching module
53, the chip 5 include USB module 50 and GPIO modules 51, wherein, the ID pins of the USB hardware interface 52 with described
Connected with module 53, the matching module 53 is connected with the USB module 50 and GPIO modules 51;
The GPIO modules 51 are configured to input pattern, and enable GPIO interruptions, and it is effective that interruption is configured to trailing edge;
When having plug insertion in the USB hardware interface 52, disabling GPIO is interrupted, and configures USB module 50, makes it can be with
Know the ID pin status of the USB hardware interface 52.
Accordingly, the present embodiment also provides a kind of USB OTG pattern-recognition sides of above-mentioned USB OTG PRSs
Method, the USB OTG mode identification methods include:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules, the GPIO module monitors institute by matching module
State the ID pin status of USB hardware interface;
When having plug insertion in the USB hardware interface, disabling GPIO is interrupted, and is configured USB module, is known it
The ID pin status of the USB hardware interface.
The present embodiment two and the difference of embodiment one are that embodiment one is made that change in chip internal, adds pipe
Pin multiplexer;And the present embodiment two is modified in chip exterior, add matching module, by the matching module for
The ID signals of USB module and the signal level of GPIO modules are matched.
In USB OTG PRSs provided in an embodiment of the present invention and method, GPIO modules are configured to input mould
Formula, and GPIO interruptions are enabled, it is effective that interruption is configured to trailing edge;When there is plug insertion in USB hardware interface, in disabling GPIO
It is disconnected, USB module is configured, i.e., by the ID pin status of GPIO module monitors USB hardware interfaces, while when the USB hardware connects
When having plug insertion in mouthful, USB module obtains the signal of the ID pins of USB hardware interface, is thus also achieved that USB module energy
Enough purposes for directly obtaining its operating mode information, that is, the situation of its operating mode information can be obtained in USB module by realizing
It is lower to keep relatively low power consumption.
Please continue to refer to Fig. 5 and Fig. 6, the USB OTG mode identification methods are realized especially by following method:
Performing step S60:After beginning, initial configuration is carried out to USB OTG PRSs first, specifically,
Perform step S61:GPIO is configured as input pattern, and enables GPIO interruptions, and it is effective that interruption is configured to trailing edge.Then, just
Step S62 can be performed by the ID pin status of USB hardware interface described in the GPIO module monitors:Determine whether to insert
Incoming event, that is, monitor in USB hardware interface whether have plug insertion.When there is plug insertion, step S63 is performed:Disable GPIO
Interrupt.When no plug is inserted, then step S62 is continued executing with, namely keep the monitoring for USB hardware interface.
Specifically, the plug of insertion can be divided into MINI-A plugs and MINI-B plugs, wherein, when insertion plug is MINI-A
During plug, USB module is in host mode;When it is MINI-B plugs to insert plug, USB module is in equipment mode.According to
The difference of plug is inserted, when performing step S62, the embodiment of the present application takes different specific implementations.Specifically, working as institute
When stating USB hardware interface insertion MINI-A plugs, produce GPIO and interrupt;When the USB hardware interface inserts MINI-B plugs,
The insertion for producing a PMU modules is interrupted.It is achieved by the interruption of disparate modules.Take above-mentioned different modes reason such as
Under:
When it is MINI-A plugs to insert plug, has trailing edge and interrupted so as to produce GPIO;
When it is MINI-B plugs to insert plug, ID pins are equivalent to vacantly, i.e., no trailing edge is therefore, real in application
Apply in example, the respective interrupt of PMU modules 54 is produced by being powered to VBUS pins.
Further, in the embodiment of the present application, when there are MINI-A plugs in USB hardware interface insertion, also enter
The following processing of row:The ID state changes for enabling USB module are interrupted.Thus, in follow-up, when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes that can produce USB module are interrupted, and then carry out configuration accordingly so that USB module is entered
Enter battery saving mode, while carrying out following processing:GP configuring IO is input pattern, and enables GPIO interruptions, and interruption is configured to decline
Along effectively.It is therefore, follow-up to be and when inserting plug for MINI-B plugs, it is to enable that interruption is extracted because PMU is corresponding
The extraction of MINI-B plugs can be detected, and then carries out configuration accordingly so that USB module enters battery saving mode, while under carrying out
State processing:GP configuring IO is input pattern, and enables GPIO interruptions, and it is effective that interruption is configured to trailing edge.
Base this, that is, complete monitoring of the GPIO modules for ID pins, and USB module for the acquisition of mode of operation.
Follow-up i.e. executable conventional treatment, specifically includes:
Perform step S64:USB module is configured accordingly according to obtained mode of operation;
Perform step S65:It is normal to use USB OTG.
In the embodiment of the present application, during the interruption of ID state changes or PMU that USB module is enabled due to being configured with are extracted
It is disconnected, therefore, step S66 can be then performed accordingly:Extraction event is detected whether.When there is extraction event, you can perform step
S67:Configuration USB module enters battery saving mode, closes clock and power supply, and then recovery configuring GPIO is input pattern, and enables
GPIO is interrupted, and it is effective that interruption is configured to trailing edge.When no extraction event, then step S66 is continued executing with, is accordingly supervised
Survey.
As fully visible, GPIO modules are configured to input pattern, and enable GPIO interruptions, and it is effective that interruption is configured to trailing edge;
When there is plug insertion in USB hardware interface, disabling GPIO is interrupted, and configures USB module, i.e., hard by GPIO module monitors USB
The ID pin status of part interface, while when having plug insertion in the USB hardware interface, USB module obtains USB hardware interface
ID pins signal, be thus also achieved that USB module can directly obtain the purpose of its operating mode information, that is, realize
Relatively low power consumption is kept in the case where USB module can obtain its operating mode information.
Foregoing description is only the description to present pre-ferred embodiments, not to any restriction of the scope of the invention, this hair
Any change, modification that the those of ordinary skill in bright field does according to the disclosure above content, belong to the protection of claims
Scope.
Claims (24)
1. a kind of USB OTG PRSs, it is characterised in that including:Chip and USB hardware interface, the chip include
USB module, GPIO modules and pin multiplexing device, wherein, the ID pins of the USB hardware interface connect with the pin multiplexing device
Connect, the pin multiplexing device is connected with the USB module and GPIO modules;
The ID pin configurations of the USB hardware interface enable GPIO interruptions into GPIO patterns, and interruption, which is configured to trailing edge, to be had
Effect;
When having plug insertion in the USB hardware interface, the ID of the ID pin configurations of the USB hardware interface into USB module
Pattern.
2. USB OTG PRSs as claimed in claim 1, it is characterised in that when USB hardware interface insertion
During MINI-A plugs, produce GPIO and interrupt and carry out following processing:
The ID pin configurations of USB hardware interface into USB module ID patterns, and disabling GPIO interrupt.
3. USB OTG PRSs as claimed in claim 2, it is characterised in that when in USB hardware interface insertion
When there are MINI-A plugs, following processing are also carried out:
GPIO pull-up configuration is removed, configuration USB module is operated in host mode, and enables in the ID state changes of USB module
It is disconnected.
4. USB OTG PRSs as claimed in claim 3, it is characterised in that when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface enable GPIO into GPIO patterns
Interrupt, it is effective that interruption is configured to trailing edge.
5. USB OTG PRSs as claimed in claim 1, it is characterised in that when USB hardware interface insertion
During MINI-B plugs, following processing are interrupted and carried out in the insertion for producing a PMU modules:
The ID pin configurations of USB hardware interface are into the ID patterns of USB module, and disabling GPIO is interrupted, and removal GPIO pull-up is matched somebody with somebody
Put, configuration USB module is operated in equipment mode.
6. USB OTG PRSs as claimed in claim 5, it is characterised in that when in the USB hardware interface
When MINI-B plugs are extracted, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface enable GPIO into GPIO patterns
Interrupt, it is effective that interruption is configured to trailing edge.
7. a kind of USB OTG PRSs, it is characterised in that including:Chip, USB hardware interface and matching module, it is described
Chip includes USB module and GPIO modules, wherein, the ID pins of the USB hardware interface are connected with the matching module, described
Matching module is connected with the USB module and GPIO modules;
GPIO modules are configured as input pattern, and enable GPIO interruptions, and it is effective that interruption is configured to trailing edge;
When having plug insertion in the USB hardware interface, disabling GPIO is interrupted, and configures USB module, knows it described
The ID pin status of USB hardware interface.
8. USB OTG PRSs as claimed in claim 7, it is characterised in that when USB hardware interface insertion
During MINI-A plugs, produce GPIO and interrupt and carry out following processing:
GPIO is disabled to interrupt.
9. USB OTG PRSs as claimed in claim 8, it is characterised in that when in USB hardware interface insertion
When there are MINI-A plugs, following processing are also carried out:
Configuration USB module is operated in host mode, and enables the ID state changes interruption of USB module.
10. USB OTG PRSs as claimed in claim 9, it is characterised in that when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enable GPIO interruptions, interrupt
It is configured to trailing edge effective.
11. USB OTG PRSs as claimed in claim 7, it is characterised in that when USB hardware interface insertion
During MINI-B plugs, following processing are interrupted and carried out in the insertion for producing a PMU modules:
GPIO is disabled to interrupt, and configuration USB module is operated in equipment mode.
12. USB OTG PRSs as claimed in claim 11, it is characterised in that when in the USB hardware interface
When MINI-B plugs are extracted, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enable GPIO interruptions, interrupt
It is configured to trailing edge effective.
13. it is a kind of such as the USB OTG pattern-recognition sides of USB OTG PRSs according to any one of claims 1 to 6
Method, it is characterised in that including:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules by pin multiplexing device, described in the GPIO module monitors
The ID pin status of USB hardware interface;
When having plug insertion in the USB hardware interface, the pin multiplexing device is by the signal of the ID pins of USB hardware interface
It is transferred to USB module.
14. USB OTG mode identification methods as claimed in claim 13, it is characterised in that when USB hardware interface insertion
During MINI-A plugs, produce GPIO and interrupt and carry out following processing:
The ID pin configurations of USB hardware interface into USB module ID patterns, and disabling GPIO interrupt.
15. USB OTG mode identification methods as claimed in claim 14, it is characterised in that when USB hardware interface insertion
In when having MINI-A plugs, also carry out following processing:
GPIO pull-up configuration is removed, configuration USB module is operated in host mode, and enables in the ID state changes of USB module
It is disconnected.
16. USB OTG mode identification methods as claimed in claim 15, it is characterised in that when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface enable GPIO into GPIO patterns
Interrupt, it is effective that interruption is configured to trailing edge.
17. USB OTG mode identification methods as claimed in claim 13, it is characterised in that when USB hardware interface insertion
During MINI-B plugs, following processing are interrupted and carried out in the insertion for producing a PMU modules:
The ID pin configurations of USB hardware interface are into the ID patterns of USB module, and disabling GPIO is interrupted, and removal GPIO pull-up is matched somebody with somebody
Put, configuration USB module is operated in equipment mode.
18. USB OTG mode identification methods as claimed in claim 17, it is characterised in that when in the USB hardware interface
When MINI-B plugs are extracted, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, the ID pin configurations of USB hardware interface enable GPIO into GPIO patterns
Interrupt, it is effective that interruption is configured to trailing edge.
19. a kind of USB OTG pattern-recognitions of USB OTG PRSs as any one of claim 7~12
Method, it is characterised in that including:
The signal of the ID pins of USB hardware interface is transferred to GPIO modules, USB described in the GPIO module monitors by matching module
The ID pin status of hardware interface;
When having plug insertion in the USB hardware interface, disabling GPIO is interrupted, and configures USB module, knows it described
The ID pin status of USB hardware interface.
20. USB OTG mode identification methods as claimed in claim 19, it is characterised in that when USB hardware interface insertion
During MINI-A plugs, produce GPIO and interrupt and carry out following processing:
GPIO is disabled to interrupt.
21. USB OTG mode identification methods as claimed in claim 20, it is characterised in that when USB hardware interface insertion
In when having MINI-A plugs, also carry out following processing:
Configuration USB module is operated in host mode, and enables the ID state changes interruption of USB module.
22. USB OTG mode identification methods as claimed in claim 21, it is characterised in that when in the USB hardware interface
When MINI-A plugs are extracted, the ID state changes for producing USB module are interrupted and carry out following processing:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enable GPIO interruptions, interrupt
It is configured to trailing edge effective.
23. USB OTG mode identification methods as claimed in claim 19, it is characterised in that when USB hardware interface insertion
During MINI-B plugs, following processing are interrupted and carried out in the insertion for producing a PMU modules:
GPIO is disabled to interrupt, and configuration USB module is operated in equipment mode.
24. USB OTG mode identification methods as claimed in claim 23, it is characterised in that when in the USB hardware interface
When MINI-B plugs are extracted, following processing are interrupted and carried out in the extraction for producing a PMU modules:
USB module is disabled, allows it to enter battery saving mode, GPIO modules are configured as input pattern, and enable GPIO interruptions, interrupt
It is configured to trailing edge effective.
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 CN104750226A (en) | 2015-07-01 |
CN104750226B true 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) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105183678A (en) * | 2015-08-25 | 2015-12-23 | 广东欧珀移动通信有限公司 | Communication method and apparatus of terminal interface |
CN105404600B (en) * | 2015-10-23 | 2018-05-25 | 广东欧珀移动通信有限公司 | Take into account the method and device of USB eye patterns performance and OTG functions |
CN106852188B (en) * | 2016-10-31 | 2021-08-03 | 深圳市大疆创新科技有限公司 | Data interaction method based on universal serial bus and universal serial bus equipment |
CN107678996A (en) * | 2017-09-26 | 2018-02-09 | 深圳市汉普电子技术开发有限公司 | Determination method, USB device and the storage medium of USB mode |
CN111581144B (en) * | 2020-03-24 | 2022-02-08 | 惠州市德赛西威智能交通技术研究院有限公司 | Vehicle-mounted camera hot-plug self-recovery method and device and storage medium |
CN111757051B (en) * | 2020-05-20 | 2022-07-26 | 惠州市德赛西威智能交通技术研究院有限公司 | Data transmission method, intelligent terminal and radar system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101359316A (en) * | 2007-08-03 | 2009-02-04 | 大唐移动通信设备有限公司 | Method and apparatus for implementing general-purpose serial bus USB OTG |
CN101645051A (en) * | 2009-06-10 | 2010-02-10 | 北京中星微电子有限公司 | GPIO interrupt control device, chip and GPIO interrupt control method |
CN101901201A (en) * | 2010-08-06 | 2010-12-01 | 中兴通讯股份有限公司 | 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 |
-
2013
- 2013-12-31 CN CN201310753789.3A patent/CN104750226B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101359316A (en) * | 2007-08-03 | 2009-02-04 | 大唐移动通信设备有限公司 | Method and apparatus for implementing general-purpose serial bus USB OTG |
CN101645051A (en) * | 2009-06-10 | 2010-02-10 | 北京中星微电子有限公司 | GPIO interrupt control device, chip and GPIO interrupt control method |
CN101901201A (en) * | 2010-08-06 | 2010-12-01 | 中兴通讯股份有限公司 | 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 |
Also Published As
Publication number | Publication date |
---|---|
CN104750226A (en) | 2015-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104750226B (en) | USB OTG mode identification system and method | |
CN103078393B (en) | USB hub and electric power supply method for the same | |
CN109857243B (en) | System-on-chip, universal serial bus master device, system and awakening method | |
CN105225316B (en) | A kind of dormancy of electron key low-power consumption power supply plan and awakening method | |
CN104272217A (en) | Master-slave interface | |
CN102799550B (en) | Based on the waking up of chip chamber high-speed interface HSIC, hot-plug method and equipment | |
CN101276319B (en) | Equipment and method for making USB interface to time-sharing apply as standard I /O interface | |
CN106681231A (en) | Type-C detection method | |
CN107357410A (en) | The power consumption control method of split type VR equipment and split type VR equipment | |
CN102780207B (en) | voltage protection system and method | |
CN106464824B (en) | Pin control method and device | |
CN106774769A (en) | The changing method and device of a kind of terminal work mode, handheld terminal | |
CN107908585A (en) | A kind of PCIE BOX plates for surpassing calculation function with PCIe card and GPU | |
CN205263730U (en) | Novel IO riser integrated circuit board based on POWER platform | |
CN203759602U (en) | Nest plate-based CPCI (Compact Peripheral Component Interconnect) industrial control computer mainboard | |
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 | |
CN103123463B (en) | A kind of method and device of control system state | |
CN110311436A (en) | A kind of charging circuit and electronic equipment of USB interface | |
CN100452005C (en) | System and method for controlling interrput | |
CN102810840B (en) | Voltage protection system | |
CN101968843A (en) | Computer operation locking device | |
CN206282173U (en) | Mainboard based on FT 1500A chips of soaring | |
CN107423242A (en) | SD interface and the electronic installation and method of USB interface multiplexing |
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 | ||
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 |