CN104459376B - A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit - Google Patents
A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit Download PDFInfo
- Publication number
- CN104459376B CN104459376B CN201410660734.2A CN201410660734A CN104459376B CN 104459376 B CN104459376 B CN 104459376B CN 201410660734 A CN201410660734 A CN 201410660734A CN 104459376 B CN104459376 B CN 104459376B
- Authority
- CN
- China
- Prior art keywords
- earphone
- control circuit
- control
- pin
- switch
- 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
Landscapes
- Headphones And Earphones (AREA)
- Telephone Function (AREA)
Abstract
The invention discloses a kind of interface circuit and the peripherals detecting method based on the circuit, outer sensor, the interface circuit include:Control circuit, combinational, earphone socket, the control circuit according to reception detection pin discrepancy magnitude of voltage or level value, determine the external equipment type of the earphone socket, when the external equipment for determining to access is earphone, the control circuit controls the combinational to be connected the earphone control wire pin of the control circuit with the control line port of the earphone socket, when the external equipment for determining to access is sensor, the control circuit controls the combinational to be connected the sensor control lines pin of the control circuit with the control line port of the earphone socket, outer sensor is accessed by the headset output interface to realize, reach the purpose of extension sensor.
Description
Technical field
The present invention relates to electronic device field, is specifically related to a kind of interface circuit and the peripheral hardware detection side based on the circuit
Method, outer sensor.
Background technology
With the continuous development of MEMS (Microelectro Mechanical Systems, MEMS) technology, work
The various kinds of sensors used in industry gradually minimizes, and begins to use on substantial amounts of mobile phone, such as, exist at present
Gravity sensor is integrated with mobile terminal successively, apart from the micro- electricity of more moneys such as photosensitive sensors, temperature sensor, geomagnetic sensor
The structure sensor of sub- technology.
As sensor plan is more and more, and mobile terminal is limited by motherboard space, it is impossible to integrated all biographies
Sensor can not meet consumer demand on mainboard.Therefore, it is badly in need of a kind of external sensor access technology, to meet
Use demand of the user to different sensors.
The content of the invention
The embodiment of the present invention provides a kind of interface circuit and peripherals detecting method, outer sensor based on the circuit, uses
To realize that outer sensor is connected by the interface circuit with mobile terminal, reach the purpose of extension mobile terminal sensor.
To achieve these goals, the embodiments of the invention provide a kind of interface circuit, including:Control circuit, combination are opened
Powered-down road, earphone socket;
The earphone of the control circuit is optionally controlled wire pin and the earphone socket by the combinational
The connection of signal wire port, and the signal line end by the sensor control lines pin of the control circuit and the earphone socket
Mouth connection;
The control circuit is used for the magnitude of voltage or level value of the input of the detection pin according to the control circuit, it is determined that
The external equipment type of the earphone socket access, and when the external equipment for determining access is earphone, control the combination
The earphone of control circuit control wire pin is connected by on-off circuit with the signal wire port of the earphone socket, when determining
When the external equipment of access is sensor, the combinational is controlled by the sensor control lines pin of the control circuit
It is connected with the signal wire port of the earphone socket.
It is preferred that the control circuit is additionally operable to:
In the case where the input voltage that detection pin is inserted according to earphone determines to access currently without external equipment, control
The earphone control wire pin of the control circuit is connected by the combinational with the signal wire port of the earphone socket.
It is preferred that also include:
The signal wire port of the earphone socket includes MIC signal wires port, ground connection GND signal wires port, L channel letter
Number line end mouth and right-channel signals line end mouth;Left channel signals line end mouth and the inspection of the control circuit in the earphone socket
Pin connection is surveyed, and the L channel control wire pin of the control circuit is connected with grounding resistance R1;Or the earphone socket
In right-channel signals line end mouth be connected with the detection pin of the control circuit, and the R channel control line of the control circuit
Pin is connected with grounding resistance R1;
The earphone insertion switch port of the earphone socket is connected with the earphone insertion detection pin of the control circuit, and
Pass through resistance R2 connecting detection voltages between the two.
It is preferred that the control circuit is specifically used for:
When the detection pin is ADC pins, judge whether the input voltage value of the ADC pins is less than A* detection electricity
Pressure, if it is, the external equipment for determining the earphone socket access is earphone, if it is not, then determining that the earphone socket connects
The external equipment entered is sensor, and wherein A is the coefficient of the detection voltage;
When the detection pin is GPIO pin, whether the input level value for judging the GPIO pin is high level,
If it is, the external equipment for determining the earphone socket access is sensor, if it is not, then determining the earphone socket access
External equipment be earphone.
It is preferred that the combinational includes:First switch, second switch, third switch and the 4th switch, it is described
The first end of first switch is fixedly connected with the MIC signal wires port of the earphone socket, the second end and selectively connects the control
The IIC device power supply (DPS)s output pin and earphone MIC pins of circuit, the first end of the second switch are fixedly connected with the earphone and inserted
SPK (L) signal wires port, the second end of seat selectively connect the IIC equipment SCL pins and earphone SPK (L) of the control circuit
Pin, the described 3rd first end switched is fixedly connected with the ground signal line port of the earphone socket, the second end selectively connects
The IIC equipment grounds pin and earphone grounding pin of the control circuit are connect, the first end of the 4th switch is fixedly connected with institute
State SPK (R) signal wires port, the IIC equipment SDA pins and ear of the second end selectively connection control circuit of earphone socket
Machine SPK (R) pin;
The control circuit is specifically used for:
When the external equipment for determining access is earphone, the second end of the first switch is controlled to be connected to the control
The earphone MIC pins of circuit, the second end of the second switch is controlled to be connected to earphone SPK (L) pin of the control circuit,
The second end of the 3rd switch is controlled to be connected to the earphone grounding pin of the control circuit, the of control the 4th switch
Two ends are connected to earphone SPK (R) pin of the control circuit;
When the external equipment for determining access is sensor, the second end of the first switch is controlled to be connected to the control
The IIC device power supply (DPS) output pins of circuit processed, control the second end of the second switch to be connected to the IIC of the control circuit and set
Standby SCL pins, the second end of control the 3rd switch are connected to the IIC equipment ground pins of the control circuit, control institute
The second end for stating the 4th switch is connected to the IIC equipment SDA pins of the control circuit.
The embodiments of the invention provide a kind of peripherals detecting method based on above-mentioned interface circuit, this method includes:
Receive the magnitude of voltage or level value of detection pin input;
The magnitude of voltage or level value inputted according to the detection pin of the reception, determine the external equipment of earphone socket access
Type, and when the external equipment for determining access is earphone, control switchgroup circuit is by the earphone control line of control circuit
Pin is connected with the signal wire port of the earphone socket, when the external equipment for determining access is sensor, described in control
The sensor control lines pin of the control circuit is connected by combinational with the signal wire port of the earphone socket.
It is preferred that magnitude of voltage or level value that the detection pin according to the reception inputs, determine that earphone socket connects
The external equipment type entered, including:
When the detection pin is ADC pins, judge whether the input voltage value of the ADC pins is less than A* detection electricity
Pressure, if it is, the external equipment for determining the earphone socket access is earphone, if it is not, then determining that the earphone socket connects
The external equipment entered is sensor, wherein the A is the coefficient of the detection voltage;
When the detection pin is GPIO pin, whether the input level value for judging the GPIO pin is high level,
If it is, the external equipment for determining the earphone socket access is sensor, if it is not, then determining the earphone socket access
External equipment be earphone.
It is preferred that also include:
When the external equipment for determining access is earphone, the second end of first switch is controlled to be connected to the control circuit
Earphone MIC pins, control the second end of second switch to be connected to earphone SPK (L) pin of the control circuit, control the 3rd
Second end of switch is connected to the earphone grounding pin of the control circuit, and the second end of the switch of control the 4th is connected to the control
Earphone SPK (R) pin of circuit processed;
When the external equipment for determining access is sensor, the second end of the first switch is controlled to be connected to the control
The IIC device power supply (DPS) output pins of circuit processed, control the second end of the second switch to be connected to the IIC of the control circuit and set
Standby SCL pins, the second end of control the 3rd switch are connected to the IIC equipment ground pins of the control circuit, control institute
The second end for stating the 4th switch is connected to the IIC equipment SDA pins of the control circuit.
It is preferred that also include:
In the case where the input voltage that detection pin is inserted according to earphone determines to access currently without external equipment, control
The earphone control wire pin of the control circuit is connected by the combinational with the signal wire port of the earphone socket.
The embodiment of the present invention additionally provides a kind of outer sensor being adapted to above-mentioned interface circuit, including:Headset plug
And sensor assembly, the headset plug are used for the earphone socket for inserting the interface circuit;
The signal wire port of the headset plug includes microphone MIC signal wires port, ground connection GND signal wires port, a left side
Sound channel signal line end mouth and right-channel signals line end mouth, the MIC signal wires port of the headset plug are used to insert with the earphone
MIC signal wires port connection in seat, the ground connection GND signal wires port of the headset plug for in the earphone socket
The connection of GND signal wires port is grounded, the left channel signals line end mouth of the headset plug is used for and the left side in the earphone socket
Sound channel signal line end mouth connects, and the right-channel signals line end mouth of the headset plug is used for and the R channel in the earphone socket
Signal wire port connects;
The POWER ports of the sensor assembly are connected with the MIC signal wires port of the headset plug, the sensor
The GND ports of module are connected with the GND signal wires port of the headset plug, the clock signal SCL ends of the sensor assembly
Mouthful be connected with the left channel signals line end mouth of the headset plug, the data-signal SDA ports of the sensor assembly with it is described
The right-channel signals line end mouth connection of headset plug.
It is preferred that pull-up resistor R is provided between the SCL ports and POWER ports of the sensor assemblySCL, and it is described
Pull-up resistor R is provided between the SDA ports and POWER ports of sensor assemblySDA。
It is preferred that the sensor assembly have it is multiple.
In interface circuit in above-described embodiment, including control circuit, combinational, earphone socket, wherein, it is described
Left channel signals line end mouth in earphone socket is connected with the detection pin of the control circuit, and the left sound of the control circuit
Road control wire pin is connected with grounding resistance R1;Or the right-channel signals line end mouth in the earphone socket and the control
The detection pin connection of circuit, and the R channel control wire pin of the control circuit is connected with grounding resistance R1;The earphone
The earphone insertion switch port of socket is connected with the earphone insertion detection pin of the control circuit, and passes through resistance between the two
R2 connecting detection voltages.The magnitude of voltage or level value that the control circuit detects according to its detection pin, you can determine institute
State the external equipment type of earphone socket, and according to the Type Control combinational of external equipment with realize interface circuit with
The adaptation of external equipment.Specifically, when the external equipment for determining to access is earphone, the control circuit controls the combination
The earphone control wire pin of the control circuit is connected by on-off circuit with the signal wire port of the earphone socket, is being determined
When the external equipment of access is sensor, the control circuit controls the combinational by the sensing of the control circuit
Device control wire pin is connected with the signal wire port of the earphone socket, external by headset output interface access to realize
Sensor, reach the purpose of extension sensor.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment
Accompanying drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this
For the those of ordinary skill in field, without having to pay creative labor, it can also be obtained according to these accompanying drawings
His accompanying drawing.
Fig. 1 is a kind of electrical block diagram of earphone in the prior art;
Fig. 2 is a kind of electrical block diagram of sensor in the prior art;
Fig. 3 is a kind of structural representation of interface circuit in the embodiment of the present invention;
Fig. 4 is a kind of peripherals detecting method in the embodiment of the present invention;
Fig. 5 is a kind of outer sensor in the embodiment of the present invention;
Fig. 6 is another outer sensor in the embodiment of the present invention;
Fig. 7 is the electrical block diagram that a kind of outer sensor is connected with interface circuit in the embodiment of the present invention.
Embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, the present invention is made below in conjunction with accompanying drawing into
One step it is described in detail, it is clear that the described embodiment only a part of embodiment of the present invention, rather than whole implementation
Example.Based on the embodiment in the present invention, what those of ordinary skill in the art were obtained under the premise of creative work is not made
All other embodiment, belongs to the scope of protection of the invention.
Fig. 1 shows a kind of electrical block diagram of earphone.Headphone circuit interface (is shown as including microphone interface in figure
MIC), ground interface (GND is shown as in figure), left channel interface (SPK (L) is shown as in figure) and right channel interface (are shown as SPK in figure
(R)).In addition, left acoustical device (SL, such as loudspeaker are shown as in figure) is connected between left channel interface and ground interface, on the right side
Right acoustical device (SR, such as loudspeaker are shown as in figure) is connected between channel interface and ground interface.
Fig. 2 shows a kind of electrical block diagram of sensor.The circuit interface of the sensor includes input power
Interface (POWER is shown as in figure), clock signal line interface (SCL is shown as in figure), grounding pin (GND is shown as in figure), data letter
Number line interface (SDA is shown as in figure).In addition, pull-up resistor R is connected between SCL interfaces and POWER interfacesSCL, in SDA interfaces
Pull-up resistor R is connected between POWER interfacesSDA。
The embodiment of the present invention is multiplexed head circuit and sensor circuit by the earphone socket of electronic equipment, to realize to passing
The extension of sensor.IIC (Inter-Integrated Circuit, IC bus) equipment in the embodiment of the present invention is i.e.
Sensor device in the embodiment of the present invention, it is the equipment connected by iic bus.Because the left and right acoustic channels of general earphone exist
Two acoustical devices inside earphone, its power born is usually a few milliwatts, and the clock cable sum of sensor it is believed that
The signal voltage of number line is generally in 1.8V or 2.8V, if can be produced on two acoustical devices of the voltage-drop loading to earphone
More than 100MW power, the power can burn the acoustical device inside earphone, therefore, it is necessary to a kind of new interface circuit, meets electricity
Sub- equipment can both access earphone, can also access sensor.
To achieve these goals, a kind of structural representation of interface circuit as shown in Figure 3.
The interface circuit includes:Control circuit 301, combinational 302, earphone socket 303.
As illustrated, control circuit 301 includes the microphone pin (MIC is shown as in figure) in earphone control wire pin, a left side
Sound channel pin (SPK (L) is shown as in figure), grounding pin (GND), right channel pin (SPK (R)), and sensor control lines pin
In IIC device power supply (DPS)s output pin (POWER is shown as in figure), IIC equipment clock signal wire pins (SCL is shown as in figure), IIC
Equipment ground pin (GND is shown as in figure), IIC device data signal wire pins (SDA is shown as in figure), in addition to detection pin
3011 and earphone insertion detection pin 3012.
Combinational 302 optionally controls the earphone of control circuit 301 in the letter of wire pin and earphone socket 303
The connection of number line end mouth, and the signal wire port of the sensor control lines pin of control circuit 301 and earphone socket 303 is connected
Connect.
The signal wire port of earphone socket 303 includes MIC signal wires port, ground connection GND signal wires port, left channel signals
Line end mouth and right-channel signals line end mouth;Left channel signals line end mouth and the detection of control circuit 301 in earphone socket 303 draw
Pin 3011 connects, and the L channel control wire pin of control circuit 301 is connected with grounding resistance R1;Or in earphone socket 303
Right-channel signals line end mouth be connected with the detection pin 3011 of control circuit 301, and the R channel control line of control circuit 301
Pin is connected with grounding resistance R1.
The earphone insertion switch port of earphone socket 303 is connected with the earphone insertion detection pin 3012 of control circuit 301,
And pass through resistance R2 connecting detection voltages V between the twodet。
Control circuit 301 is used for the magnitude of voltage or level value of the input according to detection pin 3011, determines earphone socket 303
The external equipment type of access, and when the external equipment for determining access is earphone, control switchgroup circuit 302 will control
The earphone control wire pin of circuit 301 is connected with the signal wire port of earphone socket 303, when the external equipment for determining access is
During sensor, control switchgroup circuit 302 is by the letter of the sensor control lines pin of control circuit 301 and earphone socket 303
The connection of number line end mouth.
Preferably, the initial position of the switch in combinational 302 is:By the earphone control line of control circuit 301
Pin is connected with the signal wire port of earphone socket 303.In the case of it is determined that being accessed currently without external equipment, control circuit
301 control switchgroup circuits 302 are in initial position.The initial position of switch in combinational 302 is set
Put and ensure that, when earphone accesses, the acoustical device inside earphone will not be burned out.
Further, outside control circuit 301 currently has according to the input voltage determination of earphone insertion detection pin 3012
In the case of portion's equipment access, when the detection pin 3011 of control circuit 301 is ADC (Analog-to-Digital
Converter, analog/digital conversion) pin, judge whether the input voltage value of ADC pins is less than A* detection voltages Vdet, if it is,
Then determine that the external equipment that earphone socket 303 accesses is earphone, if it is not, then determining the external equipment that earphone socket 303 accesses
For sensor, wherein A is the coefficient of the detection voltage, can be any number between 0~1, such as 0.5,0.6,0.7,0.8
Number, can set according to actual conditions;When the detection pin 3011 of control circuit 301 is GPIO (General Purpose Input
Output, universal input output) pin when, whether the input level value for judging the GPIO pin is high level, if it is,
Determine that the external equipment that earphone socket 303 accesses is sensor, if it is not, then determining the external equipment that earphone socket 303 accesses
For earphone.In embodiments of the present invention, if the external equipment of access is earphone, detection voltage VdetBy resistance R2, ground connection
Resistance R1, earphone load resistance partial pressure.If the external equipment of access is sensor, detection voltage VdetBy resistance R2,
Grounding resistance R1 and sensor load resistance partial pressure.By detecting magnitude of voltage or level value after partial pressure, you can distinguish
The type of the external equipment of access.
Preferably, combinational 302 includes:First switch, second switch, third switch and the 4th switch, it is described
The first end of first switch is fixedly connected with the MIC signal wires port of earphone socket 303, the second end selectively connection control circuit
301 IIC device power supply (DPS)s output pin and earphone MIC pins, the first end of the second switch are fixedly connected with earphone socket 303
SPK (L) signal wires port, the second end selectively connection control circuit 301 IIC equipment SCL pins and earphone SPK (L) draw
Pin, the first end of the 3rd switch are fixedly connected with the selectively connection control of the ground signal line port of earphone socket 303, the second end
The IIC equipment grounds pin and earphone grounding pin of circuit 301 processed, the first end of the 4th switch are fixedly connected with earphone socket
The IIC equipment SDA pins and earphone SPK (R) of 303 SPK (R) signal wires port, the second end selectively connection control circuit 301
Pin.
Control circuit 301 is specifically used for:When the external equipment for determining access is earphone, the first switch is controlled
Second end is connected to the earphone MIC pins of control circuit 301, controls the second end of the second switch to be connected to control circuit
301 earphone SPK (L) pin, the second end of control the 3rd switch are connected to the earphone grounding pin of control circuit 301,
The second end of the 4th switch is controlled to be connected to earphone SPK (R) pin of control circuit 301;When the outside for determining access
When equipment is sensor, control the first switch the second end be connected to control circuit 301 IIC device power supply (DPS)s output draw
Pin, the second end of the second switch is controlled to be connected to the IIC equipment SCL pins of control circuit 301, control the 3rd switch
The second end be connected to the IIC equipment ground pins of control circuit 301, the second end of control the 4th switch is connected to control
The IIC equipment SDA pins of circuit 301.Control circuit 301 is realized by the switching of the switch in control switchgroup circuit 302
The access of external equipment earphone or sensor, with reach can accessing user's needs access at any time each sensor, realize
The expanded function of sensor.What if earphone socket 303 accessed is sensor, the control switchgroup circuit 302 of control circuit 301
The sensor control lines pin of control circuit 301 is connected with the signal wire port of earphone socket 303, in the sensor no longer
After accessing earphone socket 303, the switch in the control switchgroup circuit 302 of control circuit 301 recovers initial position, will control
The earphone control wire pin of circuit 301 is connected with the signal wire port of earphone socket 303, is easy to connecing for external equipment next time
Enter.
Correspondingly, when confirm the access of earphone socket 303 is sensor, control circuit 301 can be by following
One of mode judges whether the sensor is extracted:
Mode one, when control circuit 301 communicates error with the sensor, the control circuit 301 is judged as can not
The equipment of identification or being identified as equipment occurs abnormal, then be considered as the sensor and extracted, the control circuit 301 controls institute
Combinational 302 is stated to be connected the earphone control wire pin of control circuit 301 with the signal wire port of earphone socket 303.
Mode two, when the control switchgroup circuit 302 of control circuit 301 draws the sensor control lines of control circuit 301
After pin is connected with the signal wire port of earphone socket 303, the IIC equipment SDA pins of control circuit 301 need sending for cycle low
Level pulse, now the earphone insertion of control circuit 301 detect pin 3012 and need that periodic low voltage pulse can be detected,
If earphone insertion detection pin 3012 can't detect, control circuit 301 judges that the sensor has been extracted, the control electricity
Road 301 controls the combinational 302 by the signal of the earphone control wire pin and earphone socket 303 of control circuit 301
Line end mouth connects.
Mode three, detection pin 3011 and earphone the insertion detection pin 3012 of control circuit 301 interconnect, control circuit
301 signals received are that real-time synchronization is equivalent, when sensor is extracted, detect pin 3011 and earphone insertion detection pin
Circuit between 3012 is to disconnect, now, if control circuit 301 judges detection pin 3011 and earphone insertion detection pin
3012 signals received differ, then judge that the sensor has been extracted, and the control circuit 301 controls the stacked switch
The earphone control wire pin of control circuit 301 is connected by circuit 302 with the signal wire port of earphone socket 303.
Above-described embodiment shows, due to earphone load resistance and sensor load resistance resistance difference it is very big, because
This detection voltage VdetVoltage or level value after partial pressure are also different, and control circuit 301 is defeated according to detection pin 3011
The type for the external equipment that earphone socket 303 accesses can be distinguished by entering magnitude of voltage or level value, then further according to the outer of determination
The type of portion's equipment, the switching of the switch in control switchgroup circuit 302, set to connect the outside of the access of earphone socket 303
It is standby.
Based on above-mentioned interface circuit, a kind of schematic flow sheet of peripherals detecting method as shown in Figure 4, the flow is by scheming
Interface circuit shown in 3 performs.The specific steps of the flow include:
Step S401, receive magnitude of voltage or level value that detection pin 3011 inputs.
Specifically, magnitude of voltage or level value that control circuit 301 is inputted by detecting pin 3011, if the detection is drawn
Pin 3011 is ADC pins, then what is inputted is magnitude of voltage, if GPIO pin during the detection pin 3011, what is inputted is electricity
Level values.
Step S402, the magnitude of voltage or level value inputted according to the detection pin 3011 of the reception, determines earphone socket
The external equipment type of 303 accesses, and when the external equipment for determining access is earphone, control switchgroup circuit 302 will
Control circuit 301 earphone control wire pin be connected with the signal wire port of the earphone socket 303, when determine access outside
When portion's equipment is sensor, control the combinational 302 by the sensor control lines pin of the control circuit 301 with
The signal wire port connection of the earphone socket 303.
In the step S402, when the detection pin 3011 is ADC pins, i.e., described detection pin 3011 inputs
Be magnitude of voltage, the control circuit 301 judges whether the input voltage value of the ADC pins is less than A* detections voltage Vdet, such as
Fruit is, it is determined that the external equipment that the earphone socket 303 accesses is earphone, if it is not, then determining that the earphone socket 303 connects
The external equipment entered is sensor, and wherein A is the coefficient of the detection voltage, can be any number between 0~1, such as 0.5,
0.6th, the number such as 0.7,0.8, can set according to actual conditions.When the detection pin 3011 is GPIO pin, i.e., described detection
What pin 3011 inputted is level value, and the control circuit 301 judges whether the input level value of the GPIO pin is high electricity
It is flat, if it is, determining that the external equipment that the earphone socket 303 accesses is sensor, if it is not, then determining that the earphone is inserted
The external equipment of the access of seat 303 is earphone.In embodiments of the present invention, if the external equipment of access is earphone, detection electricity
Press VdetBy resistance R2, grounding resistance R1, earphone load resistance partial pressure.If the external equipment of access is sensor, examine
Survey voltage VdetBy resistance R2, grounding resistance R1 and sensor load resistance partial pressure.By detecting the voltage after partial pressure
Value or level value, you can distinguish the type of the external equipment of access.
Further, when the external equipment for determining access is earphone, the second end of first switch is controlled to be connected to institute
The earphone MIC pins of control circuit 301 are stated, control the second end of second switch to be connected to the earphone SPK of the control circuit 301
(L) pin, the second end of the switch of control the 3rd are connected to the earphone grounding pin of the control circuit 301, the switch of control the 4th
The second end be connected to earphone SPK (R) pin of the control circuit 301.When the external equipment for determining access is sensor
When, control the second end of the first switch to be connected to the IIC device power supply (DPS) output pins of the control circuit 301, control institute
The second end for stating second switch is connected to the IIC equipment SCL pins of the control circuit 301, and the of control the 3rd switch
Two ends are connected to the IIC equipment ground pins of the control circuit 301, and the second end that control the described 4th switchs is connected to described
The IIC equipment SDA pins of control circuit 301.The control circuit 301 is by controlling opening in the combinational 302
The switching of pass, realize the access of external equipment earphone or sensor, with reach can at any time accessing user's needs access it is each
Kind sensor, realize the expanded function of sensor.If what earphone socket 303 accessed is sensor, the control circuit 301 is controlled
The combinational 302 is made by the sensor control lines pin of the control circuit 301 and the letter of the earphone socket 303
The connection of number line end mouth, after the sensor no longer accesses the earphone socket 303, the control circuit 301 controls described group
Switch in combination switch circuit 302 recovers initial position, will the control circuit 301 earphone control wire pin and the ear
The signal wire port connection of machine transplanting of rice seat 303, is easy to the access of external equipment next time.
Correspondingly, when confirm the access of earphone socket 303 is sensor, control circuit 301 can be by following
One of mode judges whether the sensor is extracted:
Mode one, when control circuit 301 communicates error with the sensor, the control circuit 301 is judged as can not
The equipment of identification or being identified as equipment occurs abnormal, then be considered as the sensor and extracted, the control circuit 301 controls institute
Combinational 302 is stated to be connected the earphone control wire pin of control circuit 301 with the signal wire port of earphone socket 303.
Mode two, when the control switchgroup circuit 302 of control circuit 301 draws the sensor control lines of control circuit 301
After pin is connected with the signal wire port of earphone socket 303, the IIC equipment SDA pins of control circuit 301 need sending for cycle low
Level pulse, now the earphone insertion of control circuit 301 detect pin 3012 and need that periodic low voltage pulse can be detected,
If earphone insertion detection pin 3012 can't detect, control circuit 301 judges that the sensor has been extracted, the control electricity
Road 301 controls the combinational 302 by the signal of the earphone control wire pin and earphone socket 303 of control circuit 301
Line end mouth connects.
Mode three, detection pin 3011 and earphone the insertion detection pin 3012 of control circuit 301 interconnect, control circuit
301 signals received are that real-time synchronization is equivalent, when sensor is extracted, detect pin 3011 and earphone insertion detection pin
Circuit between 3012 is to disconnect, now, if control circuit 301 judges detection pin 3011 and earphone insertion detection pin
3012 signals received differ, then judge that the sensor has been extracted, and the control circuit 301 controls the stacked switch
The earphone control wire pin of control circuit 301 is connected by circuit 302 with the signal wire port of earphone socket 303.
Further, determine to access currently without external equipment in the input voltage for inserting detection pin 3012 according to earphone
In the case of, control the combinational 302 to insert the earphone control wire pin of the control circuit 301 with the earphone
The signal wire port connection of seat 303.The setting of the initial position of switch in the combinational 302 ensure that in earphone
During access, the acoustical device inside earphone will not be burned out.
Based on above-mentioned interface circuit, a kind of outer sensor as shown in Figure 5, the outer sensor and above-mentioned interface circuit
Adaptation, the outer sensor include:Headset plug and sensor assembly, the headset plug are used to insert the interface circuit
Earphone socket 303.The headset plug is adapted with the profile of earphone socket 303, may be inserted into earphone socket 303.
The signal wire port of the headset plug includes MIC signal wires port, GND signal wires port, left channel signals line
Port and right-channel signals line end mouth, the MIC signal wires port of the headset plug be used for in the earphone socket 303
MIC signal wires port connects, and the GND signal wires port of the headset plug is used for and the GND signals in the earphone socket 303
Line end mouth connects, and the left channel signals line end mouth of the headset plug is used for and the left channel signals in the earphone socket 303
Line end mouth connects, and the right-channel signals line end mouth of the headset plug is used for and the right-channel signals in the earphone socket 303
Line end mouth connects.
The POWER ports of the sensor assembly are connected with the MIC signal wires port of the headset plug, the sensor
The GND ports of module are connected with the GND signal wires port of the headset plug, the SCL ports of the sensor assembly with it is described
The left channel signals line end mouth connection of headset plug, the SDA ports of the sensor assembly and the R channel of the headset plug
Signal wire port connects.
Preferably, pull-up resistor R is provided between the SCL ports of the sensor assembly and POWER portsSCL, Yi Ji
Pull-up resistor R is provided between the SDA ports and POWER ports of the sensor assemblySDA.The pull-up resistor can be on strong
If pull-up resistor can also be pull-up resistor, the resistance of the strong pull-up resistance is less than 10k ohm, the resistance of the weak pull-up resistor
More than 50k ohm.
A kind of structural representation of outer sensor as shown in Figure 6, the sensor assembly have it is multiple, such as:Gravity passes
Sensor, the sensor for going for apart from photosensitive sensors, temperature sensor, geomagnetic sensor etc. terminal, the multiple biography
Sensor module same the POWER ports for being connected to module-external, GND ports, SCL ports and SDA ports.The outer sensor can
To reach the purpose of extension sensor.
Fig. 7 shows that the circuit structure after a kind of earphone socket 303 of the headset plug access terminal of outer sensor shows
It is intended to, the POWER ports of the outer sensor are connected after earphone socket 303 with the POWER pins of control circuit 301,
GND pin of the GND ports of the outer sensor with control circuit 301 after earphone socket 303 is connected, the external biography
The SCL ports of sensor are connected after earphone socket 303 with the SCL pins of control circuit 301, the SDA of the outer sensor
Port is connected after earphone socket 303 with the SDA pins of control circuit 301.The SCL ports of the sensor assembly with
Pull-up resistor R is provided between POWER portsSCL, and be provided between the SDA ports of the sensor assembly and POWER ports
Pull-up resistor RSDA.The control circuit 301 is powered by POWER pins for the sensor assembly, the control circuit 301
The sensor assembly is controlled to work.The earphone of control circuit 301 insertion detection pin 3012 accesses the SDA ends of outer sensor
Mouthful, the low voltage pulse that can be periodically sent with real-time measure and control circuit 301.The detection pin 3011 of control circuit 301
Also the SDA ports of the outer sensor are accessed, inserting detection pin 3012 with the earphone of control circuit 301 forms loop, control
Circuit 301 may determine that whether identical the signal judgement that detection pin 3011 and earphone insertion detection pin 3012 receive be described outer
Put whether sensor has been extracted.
In summary, the embodiment of the present invention includes control circuit 301, combinational 302, earphone socket 303, control
Circuit 301 determines the external equipment of earphone socket 303 according to the magnitude of voltage or level value of the discrepancy of the detection pin 3011 of reception
Type, when the external equipment for determining to access is earphone, the control switchgroup circuit 302 of control circuit 301 will control
The earphone control wire pin of circuit 301 is connected with the signal wire port of earphone socket 303, is in the external equipment for determining to access
During sensor, the control switchgroup circuit 302 of control circuit 301 is by the sensor control lines pin and earphone of control circuit 301
The signal wire port connection of socket 303, outer sensor is accessed to realize by the headset output interface, reaches extension sensing
The purpose of device.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.
Claims (11)
- A kind of 1. interface circuit, it is characterised in that including:Control circuit, combinational, earphone socket;The combinational includes:First switch, second switch, third switch and the 4th switch, the first switch First end is fixedly connected with the MIC signal wires port of the earphone socket, and the first end of the second switch is fixedly connected with the ear The SPK_L signal wires port of machine transplanting of rice seat, the first end of the 3rd switch are fixedly connected with the ground signal line of the earphone socket Port, the first end of the 4th switch are fixedly connected with the SPK_R signal wires port of the earphone socket;The control circuit is used for the magnitude of voltage or level value of the input of the detection pin according to the control circuit, it is determined that described The external equipment type of earphone socket access, and when the external equipment for determining access is earphone, control the first switch The second end be connected to the earphone MIC pins of the control circuit, control the second end of the second switch to be connected to the control The earphone SPK_L pins of circuit processed, the second end of the 3rd switch in the combinational is controlled to be connected to the control electricity The earphone grounding pin on road, the second end of the 4th switch in the combinational is controlled to be connected to the ear of the control circuit Machine SPK_R pins;When the external equipment for determining access is sensor, the second end of the first switch is controlled to be connected to institute The IIC device power supply (DPS) output pins of control circuit are stated, control the second end of the second switch to be connected to the control circuit IIC equipment SCL pins, the second end of control the 3rd switch are connected to the IIC equipment ground pins of the control circuit, control The second end for making the 4th switch is connected to the IIC equipment SDA pins of the control circuit.
- 2. circuit as claimed in claim 1, it is characterised in that the control circuit is additionally operable to:In the case where the input voltage that detection pin is inserted according to earphone determines to access currently without external equipment, described in control The earphone control wire pin of the control circuit is connected by combinational with the signal wire port of the earphone socket.
- 3. circuit as claimed in claim 1, it is characterised in that also include:The signal wire port of the earphone socket includes MIC signal wires port, ground connection GND signal wires port, left channel signals line Port and right-channel signals line end mouth;Left channel signals line end mouth and the detection of the control circuit in the earphone socket draw Pin connects, and the L channel control wire pin of the control circuit is connected with grounding resistance R1;Or in the earphone socket Right-channel signals line end mouth is connected with the detection pin of the control circuit, and the R channel control wire pin of the control circuit It is connected with grounding resistance R1;The earphone insertion switch port of the earphone socket is connected with the earphone insertion detection pin of the control circuit, and both Between pass through resistance R2 connecting detection voltages.
- 4. circuit as claimed in claim 1, it is characterised in that the control circuit is specifically used for:When the detection pin is ADC pins, judge whether the input voltage value of the ADC pins is less than A* detection voltages, If it is, the external equipment for determining the earphone socket access is earphone, if it is not, then determining the earphone socket access External equipment is sensor, and wherein A is the coefficient of the detection voltage;When the detection pin is GPIO pin, whether the input level value for judging the GPIO pin is high level, if It is, it is determined that the external equipment of the earphone socket access is sensor, if it is not, then determining the outer of the earphone socket access Portion's equipment is earphone.
- 5. a kind of peripherals detecting method based on any described circuit of Claims 1-4, it is characterised in that this method includes:Receive the magnitude of voltage or level value of detection pin input;The magnitude of voltage or level value inputted according to the detection pin of the reception, determine the external equipment class of earphone socket access Type, and when the external equipment for determining access is earphone, control switchgroup circuit draws the earphone control line of control circuit Pin is connected with the signal wire port of the earphone socket, when the external equipment for determining access is sensor, controls described group The sensor control lines pin of the control circuit is connected by combination switch circuit with the signal wire port of the earphone socket.
- 6. method as claimed in claim 5, it is characterised in that the magnitude of voltage that the detection pin according to the reception inputs Or level value, the external equipment type that earphone socket accesses is determined, including:When the detection pin is ADC pins, judge whether the input voltage value of the ADC pins is less than A* detection voltages, If it is, the external equipment for determining the earphone socket access is earphone, if it is not, then determining the earphone socket access External equipment is sensor, and wherein A is the coefficient of the detection voltage;When the detection pin is GPIO pin, whether the input level value for judging the GPIO pin is high level, if It is, it is determined that the external equipment of the earphone socket access is sensor, if it is not, then determining the outer of the earphone socket access Portion's equipment is earphone.
- 7. method as claimed in claim 6, it is characterised in that also include:When the external equipment for determining access is earphone, the second end of first switch is controlled to be connected to the ear of the control circuit Machine MIC pins, the second end of second switch is controlled to be connected to the earphone SPK_L pins of the control circuit, the switch of control the 3rd The second end be connected to the earphone grounding pin of the control circuit, the second end of the switch of control the 4th is connected to the control electricity The earphone SPK_R pins on road;When the external equipment for determining access is sensor, the second end of the first switch is controlled to be connected to the control electricity The IIC device power supply (DPS) output pins on road, control the second end of the second switch to be connected to the IIC equipment of the control circuit SCL pins, the second end of control the 3rd switch are connected to the IIC equipment ground pins of the control circuit, described in control Second end of the 4th switch is connected to the IIC equipment SDA pins of the control circuit.
- 8. method as claimed in claim 5, it is characterised in that also include:In the case where the input voltage that detection pin is inserted according to earphone determines to access currently without external equipment, described in control The earphone control wire pin of the control circuit is connected by combinational with the signal wire port of the earphone socket.
- A kind of 9. outer sensor that interface circuit with as any one of Claims 1-4 is adapted to, it is characterised in that Including:Headset plug and sensor assembly, the headset plug are used for the earphone socket for inserting the interface circuit;The signal wire port of the headset plug includes microphone MIC signal wires port, ground connection GND signal wires port, L channel Signal wire port and right-channel signals line end mouth, the MIC signal wires port of the headset plug be used for in the earphone socket The connection of MIC signal wires port, the GND signal wires port of the headset plug is used for and the GND signals in the earphone socket Line end mouth connects, and the left channel signals line end mouth of the headset plug is used for and the left channel signals line end in the earphone socket Mouth connection, the right-channel signals line end mouth of the headset plug is used for and the right-channel signals line end mouth in the earphone socket connects Connect;The POWER ports of the sensor assembly are connected with the MIC signal wires port of the headset plug, the sensor assembly GND ports be connected with the GND signal wires port of the headset plug, the clock signal SCL ports of the sensor assembly with The left channel signals line end mouth connection of the headset plug, data-signal SDA ports and the earphone of the sensor assembly The right-channel signals line end mouth connection of plug.
- 10. outer sensor as claimed in claim 9, it is characterised in that the SCL ports of the sensor assembly and POWER Pull-up resistor R is provided between portSCL, and pull-up electricity is provided between the SDA ports and POWER ports of the sensor assembly Hinder RSDA。
- 11. the outer sensor as described in claim 9 or 10, it is characterised in that the sensor assembly has multiple.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410660734.2A CN104459376B (en) | 2014-11-18 | 2014-11-18 | A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410660734.2A CN104459376B (en) | 2014-11-18 | 2014-11-18 | A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104459376A CN104459376A (en) | 2015-03-25 |
CN104459376B true CN104459376B (en) | 2018-03-23 |
Family
ID=52905746
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410660734.2A Active CN104459376B (en) | 2014-11-18 | 2014-11-18 | A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104459376B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105554604A (en) * | 2015-12-08 | 2016-05-04 | 潍坊歌尔电子有限公司 | Headset interface conversion device and electronic equipment |
CN108226618B (en) * | 2016-12-14 | 2020-06-30 | 中国航空工业集团公司西安航空计算技术研究所 | Method for realizing power supply, acquisition and detection of sensor through interface configuration circuit |
CN108664365A (en) * | 2017-03-27 | 2018-10-16 | 翌朵网络科技(上海)有限公司 | The detection method of the external accessory of a kind of electronic equipment |
CN114518724B (en) * | 2022-01-28 | 2023-04-28 | 弥费科技(上海)股份有限公司 | Communication device and communication mode suitable for AMHS |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101841586A (en) * | 2010-04-27 | 2010-09-22 | 深圳桑菲消费通信有限公司 | Method for expanding earphone interface of mobile phone into serial communication interface |
CN102082846A (en) * | 2010-12-02 | 2011-06-01 | 惠州Tcl移动通信有限公司 | Terminal equipment with plurality of externally arranged shared interfaces |
CN102281482A (en) * | 2011-07-11 | 2011-12-14 | 浙江大学 | Function extension method and device thereof for earphone jack of smart phone |
CN202111352U (en) * | 2011-06-10 | 2012-01-11 | 深圳市博亚时代科技有限公司 | Multiplexing circuit of Micro USB connector |
CN202197393U (en) * | 2011-08-03 | 2012-04-18 | 深圳市金康特通讯技术有限公司 | Earphone interface and mobile terminal shared by sensor and earphone |
CN102724367A (en) * | 2012-06-27 | 2012-10-10 | 喻应东 | Mobile phone extension system, signal transfer equipment and mobile phone |
-
2014
- 2014-11-18 CN CN201410660734.2A patent/CN104459376B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101841586A (en) * | 2010-04-27 | 2010-09-22 | 深圳桑菲消费通信有限公司 | Method for expanding earphone interface of mobile phone into serial communication interface |
CN102082846A (en) * | 2010-12-02 | 2011-06-01 | 惠州Tcl移动通信有限公司 | Terminal equipment with plurality of externally arranged shared interfaces |
CN202111352U (en) * | 2011-06-10 | 2012-01-11 | 深圳市博亚时代科技有限公司 | Multiplexing circuit of Micro USB connector |
CN102281482A (en) * | 2011-07-11 | 2011-12-14 | 浙江大学 | Function extension method and device thereof for earphone jack of smart phone |
CN202197393U (en) * | 2011-08-03 | 2012-04-18 | 深圳市金康特通讯技术有限公司 | Earphone interface and mobile terminal shared by sensor and earphone |
CN102724367A (en) * | 2012-06-27 | 2012-10-10 | 喻应东 | Mobile phone extension system, signal transfer equipment and mobile phone |
Also Published As
Publication number | Publication date |
---|---|
CN104459376A (en) | 2015-03-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7863906B2 (en) | Systems and methods for determining the configuration of electronic connections | |
CN100495377C (en) | Method for inspecting type of connected peripheral apparatus and terminal interface | |
EP3117329B1 (en) | Method, apparatus, and computer program product for entering accessory docking mode in usb type c | |
JP5683696B2 (en) | Detecting cable connections for electronic devices | |
CN104459376B (en) | A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit | |
CN101426038B (en) | Portable electronic device and accessory identification method | |
EP2597844A1 (en) | Method and device for sharing micro-usb interface between earphone and usb | |
US20130154547A1 (en) | Determination circuit | |
CN101841753A (en) | Drive-by-wire earphone for portable electronic equipment and method for realizing drive-by-wire | |
CN110275855A (en) | Signal transmission direction method of adjustment and device and two-way signaling repeater integrated circuit | |
CN103888873B (en) | Electronic installation, UART output systems and method | |
CN101951421A (en) | Expansion use method for cell phone earphone interface | |
EP3202127B1 (en) | Electronics interface for device headset jack | |
JP2007193796A (en) | Usb device, and data processing system including usb device | |
CN104054064B (en) | Flexible port configuration based on interface coupling | |
CN104581527B (en) | A kind of interface circuit and peripherals detecting method, outer sensor based on the circuit | |
CN103096210A (en) | Signal connection module, electronic device and connector identification method | |
CN207995366U (en) | A kind of earphone compatible circuit and electric terminal | |
EP2687993B1 (en) | USB apparatus and embedded system incorporating same | |
CN101827157B (en) | Automatic detection and recognition method of electronic device, electronic system and peripheral device | |
CN106603755A (en) | Mobile terminal and data processing method based on mobile terminal | |
CN106776400A (en) | Electronic equipment and its circuit, interconnecting device and its circuit and whistle control system | |
TWI394045B (en) | Portable electronic device and method of identifying its accessories | |
CN203708324U (en) | Shooting device with audio and video inputs and outputs | |
WO2016074457A1 (en) | Methods and circuits for earphone recognition and connection and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |