The content of the invention
In order to solve the insufficient space of mobile terminal to set more physical interface, the use process of each physical interface
Relatively complicated and not convenient enough the problem of, set the embodiments of the invention provide a kind of interface circuit, interface switching method and electronics
It is standby.The technical scheme is as follows:
First aspect according to embodiments of the present invention includes there is provided a kind of interface circuit, the interface circuit:
Earphone interface;The earphone interface includes L channel terminal, R channel terminal, microphone terminal and ground terminal;
The audio frequency processing circuit being electrical connected with the earphone interface;
The USB process circuits being electrical connected with the earphone interface;
It is electrical connected by one in selecting switch and both the audio frequency processing circuit and the USB process circuits
Power supply circuit, the selecting switch is to include two moved ends, the SPDT switch of not moved end and control end;
The processor being electrical connected with the earphone interface;
The power supply terminal of the microphone terminal of the earphone interface and the USB process circuits is electrical connected, the earphone
The ground terminal of the ground terminal of interface and the USB process circuits is electrical connected;
A moved end and the audio frequency processing circuit of the selecting switch are electrical connected;
Another moved end of the selecting switch is electrical connected with the USB process circuits;
The not moved end of the selecting switch is electrical connected with the power supply circuit;
The control end of the selecting switch is electrical connected with the processor;
If the microphone terminal that the processor is used for the earphone interface is high level, whether the processor is detected
The charging indication signal of charging chip transmission is received, the charging chip is located in the USB process circuits;
If the processor receives the charging indication signal, it is determined that the Interface status is the USB connections shape
State.
Second aspect according to embodiments of the present invention includes there is provided a kind of interface switching method, methods described:
The Interface status of the earphone interface is detected, the Interface status includes audio connection status and USB connection status
In one kind;
If the Interface status is audio connection status, the first control signal, described the are sent to the selecting switch
One control signal is used to control the selecting switch to connect the power supply circuit and the audio frequency processing circuit;
If the Interface status is USB connection status, the second control signal, described second are sent to the selecting switch
Control signal is used to control the selecting switch to connect the power supply circuit and the USB process circuits;
Wherein, the Interface status of the detection earphone interface, including:
If the microphone terminal of the earphone interface is high level, detect whether the processor receives charging chip
The charging indication signal of transmission, the charging chip is located in the USB process circuits;
If the processor receives the charging indication signal, it is determined that the Interface status is the USB connections shape
State;
Wherein, the selecting switch is to include two moved ends, the SPDT of not moved end and a control end
Switch.
The third aspect according to embodiments of the present invention is there is provided a kind of electronic equipment, and the electronic equipment includes such as first
Interface circuit described in aspect.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By using earphone interface simultaneously as COBBAIF and USB interface, while according to the Interface status of earphone interface
Control power supply circuit is selectively connected with audio frequency processing circuit or USB process circuits;Solve the insufficient space of mobile terminal
To set more physical interface, the problem of use process of each physical interface is relatively complicated and not convenient enough;Sound is reached
The effect of frequency interface and USB interface sharing earphone interface, realizes the switching of audio connection status and USB connection status.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1 is refer to, the circuit diagram of the interface circuit provided it illustrates one embodiment of the invention.Interface electricity
Road includes:Earphone interface 110, audio frequency processing circuit 120, USB process circuits 130, selecting switch 140 and power supply circuit 150.
Earphone interface 110 generally includes four terminals, respectively L channel terminal 111, R channel terminal 112, ground terminal
Son 113 and microphone terminal 114.The difference of professional standard according to referenced by earphone socket 110, the arrangement of this four terminals is suitable
Sequence may be slightly different.
Audio frequency processing circuit 120 is electrical connected with earphone interface 110.
Audio frequency processing circuit 120 includes four terminals, respectively L channel terminal 121, R channel terminal 122, ground wire
Terminal 123 and microphone terminal 124.Wherein, in the L channel terminal 121 in audio frequency processing circuit 120 and earphone interface 110
L channel terminal 111 is electrical connected;R channel terminal 122 in audio frequency processing circuit 120 and the R channel in earphone interface 110
Terminal 112 is electrical connected;Ground wire terminal 123 in audio frequency processing circuit 120 and the electricity of ground wire terminal 113 in earphone interface 110
Property be connected;Microphone terminal 124 in audio frequency processing circuit 120 and the electrical phase of microphone terminal 114 in earphone interface 110
Even.
USB process circuits 130 are electrical connected with earphone interface 110.
USB process circuits 130 include four terminals, respectively data plus end DATA+, data negative terminal DATA-,
Line terminals GND and power supply terminal VCC.Wherein, in the data plus end DATA+ in USB process circuits 130 and earphone interface 110
L channel terminal 111 be electrical connected;Data negative terminal DATA- in USB process circuits 130 and the right side in earphone interface 110
Sound channel terminal 112 is electrical connected;Ground wire terminal GND in USB process circuits 130 and the ground wire terminal 113 in earphone interface 110
It is electrical connected;Power supply terminal VCC in USB process circuits 130 is electrical connected with the microphone terminal 114 in earphone interface 110.
Power supply circuit 150 by selecting switch 140 respectively with audio frequency processing circuit 130 and the electrical phase of USB process circuits 150
Even.
Selecting switch 140 be include two moved ends, one not moved end 143 and control end 144 SPDT switch;
The not moved end 143 that power supply circuit 150 is switched with SPDT is electrical connected;
One moved end 141 of SPDT switch is electrical connected with audio frequency processing circuit 120;
Another moved end 142 and USB process circuit 130 of SPDT switch is electrical connected.
In summary, the interface circuit that the present embodiment is provided, COBBAIF and USB are used as by using earphone interface simultaneously
Interface, while controlling power supply circuit and audio frequency processing circuit or USB process circuits selectivity according to the Interface status of earphone interface
Ground is connected;The insufficient space of mobile terminal is solved to set more physical interface, the use process of each physical interface compared with
For it is cumbersome and not convenient enough the problem of;The effect of COBBAIF and USB interface sharing earphone interface has been reached, audio company is realized
Connect the switching of state and USB connection status.
It should be noted that in each embodiment of the invention, so that the standard of earphone interface is international standard as an example, the ear
Four terminals of machine interface are set gradually as L channel terminal, R channel terminal, ground wire terminal and microphone terminal.
It should be added that, data plus end DATA+ in USB process circuits 130 can with earphone interface 110
L channel terminal 111 be electrical connected, now in the data negative terminal DATA- in USB process circuits 130 and earphone interface 110
R channel terminal 112 be electrical connected;Data plus end DATA+ in USB process circuits 130 can with earphone interface 110
R channel terminal 112 be electrical connected, now in the data negative terminal DATA- in USB process circuits 130 and earphone interface 110
L channel terminal 111 be electrical connected.In each embodiment of the invention, with the data plus end in USB process circuits 130
DATA+ is electrical connected with the L channel terminal 111 in earphone interface 110;Data negative terminal DATA- in USB process circuits 130
It is illustrated exemplified by being electrical connected with the R channel terminal 112 in earphone interface 110.
Fig. 2 is refer to, the circuit diagram of the interface circuit provided it illustrates another embodiment of the present invention.The interface
Circuit includes:Earphone interface 210, audio frequency processing circuit 220, USB process circuits 230, selecting switch 240, the and of power supply circuit 250
Processor 260.
Earphone interface 210 generally includes four terminals, respectively ground wire terminal 211, microphone terminal 212, R channel end
Son 213 and L channel terminal 214.
Audio frequency processing circuit 220 is electrical connected with earphone interface 210.
Audio frequency processing circuit 220 includes four terminals, respectively L channel terminal 221, R channel terminal 222, ground wire
Terminal 223 and microphone terminal 224.Wherein, in the L channel terminal 221 in audio frequency processing circuit 220 and earphone interface 210
L channel terminal 211 is electrical connected;R channel terminal 222 in audio frequency processing circuit 220 and the R channel in earphone interface 210
Terminal 212 is electrical connected;Ground wire terminal 223 in audio frequency processing circuit 220 and the electricity of ground wire terminal 213 in earphone interface 210
Property be connected;Microphone terminal 224 in audio frequency processing circuit 220 and the electrical phase of microphone terminal 214 in earphone interface 210
Even.
USB process circuits 230 are electrical connected with earphone interface 210.
USB process circuits 230 include four terminals, respectively data minus (DATA-) terminal 231, data just (DATA+)
Terminal 232, ground wire (GND) terminal 233 and power supply (VCC) terminal 234.Wherein, the DATA- terminals in USB process circuits 230
231 are electrical connected with the L channel terminal 211 in earphone interface 210;DATA+ terminals 232 and ear in USB process circuits 230
R channel terminal 212 in machine interface 210 is electrical connected;GND terminal 233 and earphone interface 210 in USB process circuits 230
In ground wire terminal 213 be electrical connected;VCC terminal 234 in USB process circuits 230 and the microphone end in earphone interface 210
Son 214 is electrical connected.
Power supply circuit 250 by selecting switch 240 respectively with audio frequency processing circuit 230 and the electrical phase of USB process circuits 250
Even.
Selecting switch 240 be include two moved ends, one not moved end 243 and control end 244 SPDT switch;
The not moved end 243 that power supply circuit 250 is switched with SPDT is electrical connected;
One moved end 241 of SPDT switch is electrical connected with audio frequency processing circuit 220;
Another moved end 242 and USB process circuit 230 of SPDT switch is electrical connected;
The control end 244 of SPDT switch is electrical connected with processor 260.
Earphone interface 210 is electrical connected with processor 260.
The microphone terminal 212 and ground terminal 211 of processor 260 and earphone interface 210 are electrical connected respectively.
In summary, the interface circuit that the present embodiment is provided, COBBAIF and USB are used as by using earphone interface simultaneously
Interface, while controlling power supply circuit and audio frequency processing circuit or USB process circuits selectivity according to the Interface status of earphone interface
Ground is connected;The insufficient space of mobile terminal is solved to set more physical interface, the use process of each physical interface compared with
For it is cumbersome and not convenient enough the problem of;The effect of COBBAIF and USB interface sharing earphone interface has been reached, audio company is realized
Connect the switching of state and USB connection status.
Fig. 3 is refer to, the method flow diagram of the interface switching method provided it illustrates one embodiment of the invention.With this
Interface switching method is used to be illustrated in the processor in the circuit diagram shown in Fig. 1.The interface switching method, bag
Include:
Step 302, the Interface status of test earphone interface, the Interface status includes audio connection status and USB connection shapes
One kind in state;
Step 304, if the Interface status is audio connection status, the first control signal is sent to selecting switch, this
One control signal is used for control selections and switched power supply circuit and audio frequency processing circuit connection;
Step 306, if the Interface status is USB connection status, the second control signal is sent to selecting switch, this second
Control signal is used for control selections and switched power supply circuit and the connection of USB process circuits.
In summary, the interface switching method that the present embodiment is provided, COBBAIF is used as by using earphone interface simultaneously
And USB interface, while controlling power supply circuit to be selected with audio frequency processing circuit or USB process circuits according to the Interface status of earphone interface
Connect to selecting property;The insufficient space of mobile terminal is solved to set more physical interface, the use of each physical interface
The problem of journey is relatively complicated and not convenient enough;The effect of COBBAIF and USB interface sharing earphone interface has been reached, sound is realized
The switching of frequency connection status and USB connection status.
Fig. 4 is refer to, the method flow diagram of the interface switching method provided it illustrates one embodiment of the invention.With this
Interface switching method is used to be illustrated in the processor in the circuit diagram shown in Fig. 1.The interface switching method, bag
Include:
Step 402, the Interface status of test earphone interface, the Interface status includes audio connection status and USB connection shapes
One kind in state;
The Interface status of processor test earphone interface, the Interface status includes audio connection status and USB connection status
In one kind.
The step 402 can include following sub-step:
First, whether the microphone terminal of test earphone interface is low level;
Whether the microphone terminal of processor test earphone interface is low level.
If the 2, the microphone terminal of earphone interface is low level, it is determined that Interface status is audio connection status.
Due under audio connection status, being provided with pull-up resistor, therefore, if detecting the microphone terminal of earphone interface
For low level, then processor determines that the Interface status is audio connection status.
The step 402 can also include following sub-step:
If the 3, the microphone terminal of earphone interface is high level, whether measurement processor receives charging chip transmission
Charging indication signal, charging chip be located at USB process circuits in;
Due to only under audio connection status, being provided with pull-up resistor, therefore, under non-audio connection status, processor
The microphone terminal of test earphone interface is high level.It is respectively only to fill due under USB connection status, there is both of which
Power mode and charging and data-transmission mode.In embodiments of the present invention, both patterns are not differentiated, because both of which is produced
Raw charging effect, therefore, whether measurement processor receives the charging indication signal of charging chip transmission, and the charging chip is located at
In USB process circuits.
If the 4, processor receives charging indication signal, it is determined that Interface status is USB connection status.
If processor receives charging indication signal, illustrate between the VCC terminal and GND terminal in USB process circuits
5V voltage difference is generated, therefore, processor determines that the Interface status is USB connection status.
If the microphone terminal in processor test earphone interface is high level, and does not receive charging indication signal, then
Processor determines that the Interface status is connectionless state.
Step 404, if the Interface status is audio connection status, the first control signal is sent to selecting switch, this
One control signal is used for control selections and switched power supply circuit and audio frequency processing circuit connection;
If the Interface status is audio connection status, processor sends the first control signal to selecting switch, and this first
Control signal is used for control selections and switched power supply circuit and audio frequency processing circuit connection.
Step 406, if the Interface status is USB connection status, the second control signal is sent to selecting switch, this second
Control signal is used for control selections and switched power supply circuit and the connection of USB process circuits.
If the Interface status is USB connection status, processor sends the second control signal to selecting switch, second control
Signal processed is used for control selections and switched power supply circuit and the connection of USB process circuits.
In summary, the interface switching method that the present embodiment is provided, COBBAIF is used as by using earphone interface simultaneously
And USB interface, while controlling power supply circuit to be selected with audio frequency processing circuit or USB process circuits according to the Interface status of earphone interface
Connect to selecting property;The insufficient space of mobile terminal is solved to set more physical interface, the use of each physical interface
The problem of journey is relatively complicated and not convenient enough;The effect of COBBAIF and USB interface sharing earphone interface has been reached, sound is realized
The switching of frequency connection status and USB connection status.
Fig. 5 is refer to, the block diagram of the interface change-over device provided it illustrates one embodiment of the invention.With this
Interface change-over device is used to be illustrated in the processor in the circuit diagram shown in Fig. 1.The interface change-over device, bag
Include:
Interface detection module 520, for the Interface status of test earphone interface, the Interface status includes audio connection status
With one kind in USB connection status;
First control module 540, if being audio connection status for the Interface status, sending first to selecting switch controls
Signal processed, first control signal is used for control selections and switched power supply circuit and audio frequency processing circuit connection;
Second control module 560, if being USB connection status for the Interface status, sending second to selecting switch controls
Signal processed, second control signal is used for control selections and switched power supply circuit and the connection of USB process circuits.
In summary, the interface change-over device that the present embodiment is provided, COBBAIF is used as by using earphone interface simultaneously
And USB interface, while controlling power supply circuit to be selected with audio frequency processing circuit or USB process circuits according to the Interface status of earphone interface
Connect to selecting property;The insufficient space of mobile terminal is solved to set more physical interface, the use of each physical interface
The problem of journey is relatively complicated and not convenient enough;The effect of COBBAIF and USB interface sharing earphone interface has been reached, sound is realized
The switching of frequency connection status and USB connection status.
Fig. 6 is refer to, the block diagram of the interface change-over device provided it illustrates one embodiment of the invention.With this
Interface change-over device is used to be illustrated in the processor in the circuit diagram shown in Fig. 1.The interface change-over device, bag
Include:
Interface detection module 620, for the Interface status of test earphone interface, the Interface status includes audio connection status
With one kind in USB connection status;
First control module 640, if being audio connection status for the Interface status, sending first to selecting switch controls
Signal processed, first control signal is used for control selections and switched power supply circuit and audio frequency processing circuit connection;
Second control module 660, if being USB connection status for the Interface status, sending second to selecting switch controls
Signal processed, second control signal is used for control selections and switched power supply circuit and the connection of USB process circuits.
Alternatively, the interface detection module 620, including:
First detection unit 621, whether the microphone terminal for test earphone interface is low level;
First determining unit 622, for when the microphone terminal of earphone interface is low level, it to be sound to determine Interface status
Frequency connection status.
Alternatively, the interface detection module 620, in addition to:
Second detection unit 623, for when the microphone terminal of earphone interface is high level, whether measurement processor to connect
The charging indication signal of charging chip transmission is received, charging chip is located in USB process circuits;
Second determining unit 624, for when processor receives charging indication signal, determining that Interface status connects for USB
Connect state.
In summary, the interface change-over device that the present embodiment is provided, COBBAIF is used as by using earphone interface simultaneously
And USB interface, while controlling power supply circuit to be selected with audio frequency processing circuit or USB process circuits according to the Interface status of earphone interface
Connect to selecting property;The insufficient space of mobile terminal is solved to set more physical interface, the use of each physical interface
The problem of journey is relatively complicated and not convenient enough;The effect of COBBAIF and USB interface sharing earphone interface has been reached, sound is realized
The switching of frequency connection status and USB connection status.
It should be noted that:The device for the interface switching that above-described embodiment is provided is in switching interface, only with above-mentioned each work(
The division progress of energy module is for example, in practical application, as needed can distribute above-mentioned functions by different functions
Module is completed, i.e., the internal structure of equipment is divided into different functional modules, described above all or part of to complete
Function.In addition, the interface change-over device that above-described embodiment is provided belongs to same design with interface switching method embodiment, its is specific
Implementation process refers to embodiment of the method, repeats no more here.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.