Earphone interface multiplexing circuit and electronic device
Patent Information
- Application Number
- CN202510522067.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2026-10-27
Smart Images

Figure CN122985680A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of headphone jack multiplexing technology, and in particular to a headphone jack multiplexing circuit and electronic device. Background Technology
[0002] Mobile terminals and other electronic devices are increasingly used in people's daily lives. In order to meet various functions and applications, various interfaces are set on electronic devices. As the functions and applications increase, the number of interfaces on electronic devices also increases. Too many interfaces will hinder the miniaturization design of electronic devices, and setting too many interfaces will lead to higher circuit costs for electronic devices. Summary of the Invention
[0003] One objective of this application is to provide a headphone jack multiplexing circuit and electronic device to improve the technical problem of electronic devices having a large number of interfaces in related technologies.
[0004] In a first aspect, embodiments of this application provide a headphone jack multiplexing circuit, comprising: a headphone jack, a switching circuit, a first data path, a second data path, and a controller. The headphone jack includes a first detection pin and a second detection pin. A first terminal of the switching circuit is electrically connected to the first detection pin, a second terminal of the switching circuit is electrically connected to the second detection pin, and a control terminal of the switching circuit is electrically connected to a first terminal of the controller. The first data path is electrically connected between the input / output terminals of the switching circuit and the controller, and the second data path is electrically connected between the switching circuit and the linear output terminal of the controller. The switching circuit defaults to selecting the first data path, so that the first detection pin and the second detection pin pass through the first data path. A data path is electrically connected to the controller. The headphone jack is configured to respond to the insertion of a first type device or a second type device. The first detection pin and the second detection pin generate a first device type signal or a second device type signal. The first device type signal or the second device type signal is transmitted through the first data path. The controller is configured to control the switching circuit to select the first data path when responding to the input of the first device type signal, thereby enabling the first type device to communicate and interact with the controller through the first data path. When responding to the input of the second device type signal, the controller controls the switching circuit to switch to select the second data path, thereby enabling the second type device to communicate and interact with the controller through the second data path.
[0005] When different types of devices are plugged into the headphone jack, the first detection pin and the second detection pin send different device type signals to the controller through the first gating circuit. The controller identifies the type of the plugged device based on the device type signal, and then controls the switching circuit to select the corresponding data path. This allows different types of devices plugged into the headphone jack to transmit data with the controller, realizing the reuse of the headphone jack. This reduces the number of interfaces in electronic devices, which is beneficial for the miniaturization and thinning of electronic devices, and also reduces circuit costs.
[0006] Optionally, the first data path includes a left channel path and a right channel path, and the input / output terminals of the controller include a first input / output terminal and a second input / output terminal. The left channel path is electrically connected between the third terminal of the switching circuit and the first input / output terminal of the controller, and the right channel path is electrically connected between the fourth terminal of the switching circuit and the second input / output terminal of the controller. The left channel path is configured to transmit the first device type signal or the second device type signal sent by the first detection pin, or to transmit data of communication interaction between the first type device and the controller. The right channel path is configured to transmit the first device type signal or the second device type signal sent by the second detection pin, or to transmit data of communication interaction between the first type device and the controller.
[0007] In this embodiment, the signals sent by the first detection pin and the second detection pin are transmitted through the left channel path and the right channel path respectively, so as to realize the type detection of the inserted device and the communication interaction between the controller and the first type of device.
[0008] Optionally, the first data path further includes a switching circuit, a first terminal of which is electrically connected to a first power supply, a second terminal of which is electrically connected to a second terminal of the controller, and a control terminal of which is electrically connected to a third terminal of the switching circuit and the left channel path, respectively. The switching circuit is configured such that when the switching circuit selects the first data path, and when the first type of device is an infrared device, it responds to the infrared data signal sent by the infrared device by being in an on or off state to transmit the infrared data signal to the controller.
[0009] In this embodiment, the switching circuit sends the infrared data signal to the second terminal of the controller to ensure the correct transmission of the infrared data signal and realize the correct communication between the infrared device and the controller.
[0010] Optionally, the switching circuit includes a MOSFET, a first resistor, and a second resistor. The first end of the first resistor is electrically connected to the third end of the switching circuit, the second end of the first resistor is connected to the gate of the MOSFET, the source of the MOSFET is grounded, the drain of the MOSFET is electrically connected to the first end of the second resistor and the second end of the controller, and the second end of the second resistor is electrically connected to the first power supply.
[0011] Optionally, the second data path includes an amplifier circuit, the input terminal of which is electrically connected to the linear output terminal of the controller, the first output terminal of which is electrically connected to the fifth terminal of the switching circuit, and the second output terminal of which is electrically connected to the sixth terminal of the switching circuit. The amplifier circuit is configured to amplify the audio signal output by the controller when the switching circuit selects the second data path.
[0012] When the controller transmits audio signals to the audio device, the amplifier circuit amplifies the audio signals and then transmits them to the audio device through the switching circuit and headphone jack to enhance the anti-interference capability of the audio signals and improve audio quality and sound effects.
[0013] Optionally, the headphone jack further includes an insertion detection pin, which is electrically connected to a third terminal of the controller and configured to send an insertion detection signal to the controller so that the controller determines whether a device is inserted into the headphone jack based on the insertion detection signal.
[0014] In this embodiment of the application, the presence of a device inserted into the headphone jack is accurately detected by inserting a detection pin.
[0015] Optionally, determining whether a device is inserted into the headphone jack based on the insertion detection signal specifically includes: if the insertion detection signal is a low-level signal, determining that no device is inserted into the headphone jack; if the insertion detection signal is a high-level signal, determining that a device is inserted into the headphone jack; or, if the insertion detection signal is a high-level signal, determining that no device is inserted into the headphone jack; if the insertion detection signal is a low-level signal, determining that a device is inserted into the headphone jack.
[0016] Optionally, the controller is further configured to control the switching circuit to resume selecting the first data path in response to the insertion detection signal changing from a high level signal to a low level signal; or, the controller is further configured to control the switching circuit to resume selecting the first data path in response to the insertion detection signal changing from a low level signal to a high level signal.
[0017] In this embodiment, after the controller determines that the device has been unplugged by inserting a detection signal, it controls the switching circuit to resume selecting the first data path. When a new external device is plugged into the headphone jack the next time, the controller can accurately obtain the device type signal, thereby accurately identifying the device type and precisely controlling the working state of the switching circuit. Through this method, a smooth data transmission link can be established between the controller and the newly inserted device, enabling successful data transmission and achieving multi-functional reuse of the headphone jack.
[0018] In a second aspect, embodiments of this application provide an electronic device including the headphone jack multiplexing circuit described above. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the structure of one of the headphone jack multiplexing circuits provided in an embodiment of this application;
[0021] Figure 2 This is a schematic diagram of the structure of one of the headphone jack multiplexing circuits provided in an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of the structure of one of the headphone jack multiplexing circuits provided in an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of the structure of one of the headphone jack multiplexing circuits provided in an embodiment of this application;
[0024] Figure 5 This is a schematic diagram of the circuit structure of one of the headphone jack multiplexing circuits provided in an embodiment of this application. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0026] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0027] With the continuous development of technology, electronic devices are being used more and more, and their functions are becoming more and more complex. In order to support these applications, electronic devices are also having more and more interfaces. If a corresponding interface is set for each function, the overall thickness of the electronic device will be high, which is not conducive to the miniaturization and thinner design of the electronic device. Moreover, the interface standards of different electronic devices are often different, resulting in low interface universality and compatibility. This makes it inconvenient for electronic devices to connect to external devices, and setting too many interfaces will increase the circuit cost of electronic devices.
[0028] To address the aforementioned issues, this application provides a headphone multiplexing circuit applied to electronic devices. When a first type of device is inserted into the headphone jack, the headphone jack sends a first device type signal through a first detection pin and a second detection pin. The controller controls a switching circuit to select a first data path, enabling the first type of device to communicate with the controller through the first data path. When a second type of device is inserted into the headphone jack, the headphone jack sends a second device type signal through the first detection pin and the second detection pin. The controller controls the switching circuit to switch to select a second data path, enabling the second type of device to communicate with the controller through the second data path. Therefore, in this application's headphone multiplexing circuit, when different types of devices are inserted into the headphone jack, the first and second detection pins send different device type signals to the controller through a first selection circuit. The controller identifies the type of inserted device based on the device type signal, thereby controlling the switching circuit to select the corresponding data path. This allows different types of devices inserted into the headphone jack to transmit data with the controller, achieving headphone jack multiplexing, reducing the number of jacks, facilitating miniaturization and thinner design of electronic devices, reducing circuit costs, and enhancing headphone jack compatibility by using the same headphone jack for different devices, thus facilitating connection between electronic devices and external devices.
[0029] It should be noted that the electronic device provided in this application embodiment is any electronic device with a headphone jack, such as a mobile terminal, tablet computer, music player, game console, smartwatch, and car audio system, etc., and this application embodiment does not impose any restrictions on it.
[0030] Please see Figure 1 , Figure 1 This is a schematic diagram of a headphone jack multiplexing circuit provided in an embodiment of this application, as shown below. Figure 1 As shown, the headphone jack multiplexing circuit 100 includes a headphone jack 10, a switching circuit 20, a controller 30, a first data path 40, and a second data path 50. The headphone jack 10 includes a first detection pin and a second detection pin.
[0031] The headphone jack 10, also known as a headphone socket or audio interface, is an interface device used to connect audio plugs (such as speaker plugs or headphone plugs) to achieve linear audio signal output. The headphone jack 10 is generally mounted on the circuit board of electronic devices. It provides an audio signal transmission channel and mechanical connection interface for audio devices (such as speaker devices or headphone devices). Through the headphone jack 10, the electronic device can transmit audio signals to the audio device, enabling the audio device to convert electrical signals into sound, thus allowing the user to hear the sound. For example, when a computer is connected to powered speakers, the computer and speakers can be connected via the headphone jack 10 on the computer's sound card using an audio cable, transmitting the audio signals from the computer to the speakers for playback.
[0032] According to their size, headphone jacks can be divided into 3.5mm, 2.5mm and 6.35mm jacks. Among them, the 3.5mm jack is the most common type of headphone jack. Its size is moderate and can better balance audio transmission performance and device space layout. It is widely used in a variety of electronic devices such as smartphones, tablets, laptops, and music players.
[0033] When a device is plugged into the headphone jack 10, the type of device used by the controller 30 for data transmission differs. For example, the controller 30 includes general purpose input / output (GPIO) pins for data transmission with a universal asynchronous transceiver, and a line out pin for data transmission with an audio device to transmit audio signals.
[0034] Therefore, different types of devices use different pins on the controller 30 when transmitting data. The switching circuit 20 needs to be in different operating states depending on the type of inserted device to select different data paths, enabling data transmission between the controller 30 and the inserted device.
[0035] Specifically, the first end of the switching circuit 20 is electrically connected to the first detection pin, the second end of the switching circuit 20 is electrically connected to the second detection pin, the control end of the switching circuit 20 is electrically connected to the first end of the controller 30, the first data path 40 is electrically connected between the input and output ends of the switching circuit 20 and the controller 30, and the second data path 50 is electrically connected between the linear output end of the switching circuit 20 and the controller 30.
[0036] The switching circuit 20 is a multi-channel switch, such as a double-pole double-throw switch, a double-pole single-throw switch, and a multi-pole multi-throw switch. The control signal output from the first terminal of the controller 30 controls the switching circuit 20 to switch its working state, thereby selecting different data paths and switching different controller pins to establish connections with the headphone jack 10, so as to realize communication and interaction between different types of devices and the controller 30.
[0037] The switching circuit 20 defaults to selecting the first data path 40, so that the input and output terminals of the controller 30 are connected to the first detection pin and the second detection pin through the first data path 40. When a device is inserted into the headphone jack 10, the first detection pin and the second detection pin send a first device type signal or a second device type signal to the controller 30 through the first data path 40. The first device type signal and the second device type signal are signals with different level states, which represent the type of inserted device. For example, the first device type signal is a high level signal and the second device type signal is a low level signal.
[0038] Different types of devices send different device type signals from the first detection pin and the second detection pin. When a device of the first type is inserted into the headphone jack 10, the first detection pin and the second detection pin transmit the first device type signal through the first data path 40. After receiving the first device type signal, the controller 30 recognizes that the inserted device is a device of the first type, and thus controls the switching circuit 20 to select the first data path 40, so that the device of the first type can communicate and interact with the controller 30 through the first data path 40.
[0039] When a second type of device is inserted into the headphone jack 10, the first detection pin and the second detection pin transmit a second device type signal through the first data path 40. After receiving the second device type signal, the controller 30 recognizes that the inserted device is a second type of device and controls the switching circuit 20 to switch and change the current connection state to select the second data path 50. This allows the second type of device to communicate and interact with the controller 30 through the second data path 50, thus realizing the multiplexing of the headphone jack 10.
[0040] Therefore, when a device is inserted into the headphone jack 10, the headphone jack multiplexing circuit 100 sends a device type signal corresponding to the device type to the controller 30 via the first data path 40. The controller 30 identifies the type of the inserted device based on the received device type signal, and then controls the switching circuit 20 to select the corresponding data path, so that the inserted device can establish a connection with the controller 30 through the headphone jack 10 and the corresponding data path, thereby enabling communication and interaction between the inserted device and the controller 30.
[0041] Different types of devices can be plugged into the headphone jack 10, and the controller 30 can communicate and interact with the plugged devices through the corresponding data path, switching circuit 20, and headphone jack 10, realizing the reuse of the headphone jack 10. This reduces the number of interfaces in electronic devices, which is beneficial for miniaturization and thinner design of electronic devices, and also reduces circuit costs. At the same time, different devices using the same headphone jack 10 ensures a unified interface standard, enhances the compatibility of the headphone jack 10, and makes it easier to connect electronic devices to other devices.
[0042] Controller 30 can be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), microcontroller, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Furthermore, controller 30 can also be any conventional processor, controller, microcontroller, or state machine. Controller 30 can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP, and / or any other such configuration. Controller 30 can also be a system-on-a-chip (SOC) for electronic devices.
[0043] In some embodiments, please continue reading Figure 1 The headphone jack 10 also includes an insertion detection pin, which is electrically connected to the third terminal of the controller 30. The insertion detection pin sends an insertion detection signal to the controller 30. The controller 30 determines whether a device has been inserted into or removed from the headphone jack 10 based on the level of the insertion detection signal, so that the controller 30 can automatically detect whether a device has been inserted into or removed from the headphone jack 10.
[0044] In some embodiments, if the insertion detection signal is a low-level signal, the controller 30 determines that no device is inserted into the headphone jack 10. When a device is inserted into the headphone jack 10, the level state of the insertion detection pin changes, and the insertion detection signal becomes a high-level signal. Then the controller 30 determines that a device is inserted into the headphone jack 10, accurately identifying the insertion action of the device.
[0045] In some embodiments, if the insertion detection signal is a high-level signal, the controller 30 determines that no device is inserted into the headphone jack 10. When a device is inserted into the headphone jack 10, the level state of the insertion detection pin changes, and the insertion detection signal becomes a low-level signal. Then the controller 30 determines that a device is inserted into the headphone jack 10, accurately identifying the insertion action of the device.
[0046] After the controller 30 determines that a device has been inserted into the headphone jack 10, it reads the signals at its input and output terminals. If a first device type signal is received, the control switching circuit 20 selects the first data path 40. If a second device type signal is received, the control switching circuit 20 selects the second data path 50.
[0047] In some embodiments, if the inserted device is removed, the controller 30 controls the switching circuit 20 to resume selecting the first data path 40 and performs the next insertion detection. In some embodiments, the controller 30 analyzes the insertion detection signal; if the insertion detection signal changes from a high level signal to a low level signal, the controller 30 controls the switching circuit 20 to resume selecting the first data path 40, so that the first detection pin and the second detection pin are electrically connected to the input / output terminals of the controller 30 through the first data path 40. In other embodiments, the controller 30 analyzes the insertion detection signal; if the insertion detection signal changes from a low level signal to a high level signal, the controller 30 controls the switching circuit 20 to resume selecting the first data path 40, so that the first detection pin and the second detection pin are electrically connected to the input / output terminals of the controller 30 through the first data path 40.
[0048] If the switching circuit 20 does not restore the first data path 40 to be selected after the device is unplugged, the first detection pin and the second detection pin cannot establish a connection with the input and output terminals of the controller 30. Therefore, when the device is plugged in again, the controller 30 will not be able to receive the first device type signal or the second device type signal, and thus will not be able to identify the device.
[0049] Therefore, in this embodiment, after the controller 30 determines that the device has been unplugged by inserting a detection signal, it controls the switching circuit 20 to resume selecting the first data path 40. When a new external device is inserted into the headphone jack 10 next time, the controller 30 can accurately obtain the device type signal, thereby accurately identifying the device type and precisely controlling the working state of the switching circuit 20. Through this method, it is ensured that a smooth data transmission link can be established between the controller 30 and the newly inserted device, enabling successful data transmission and realizing the multi-functional multiplexing of the headphone jack 10.
[0050] In some embodiments, please refer to Figure 2 , Figure 2This is a schematic diagram of a headphone jack multiplexing circuit provided in an embodiment of this application, as shown below. Figure 2 As shown, the first data path 40 includes a left channel path 41 and a right channel path 42. The controller 30 includes a first input / output terminal and a second input / output terminal. The left channel path 41 is electrically connected between the third terminal of the switching circuit 20 and the first input / output terminal of the controller 30, and the right channel path 42 is electrically connected between the fourth terminal of the switching circuit 20 and the second input / output terminal of the controller 30.
[0051] When a device of type 1 is inserted into the headphone jack 10, the first detection pin transmits the first device type signal to the first input / output terminal of the controller 30 through the left channel path 41, and the second detection pin transmits the first device type signal to the second input / output terminal of the controller 30 through the right channel path 42. The controller 30 analyzes the first device type signal to determine that the inserted device is a device of type 1, so as to control the switching circuit 20 to select the first data path 40, that is, to select the left channel path 41 and the right channel path 42.
[0052] The first type of device communicates with the controller 30 through the first detection pin and the left channel path 41, and also communicates with the controller 30 through the second detection pin and the right channel path 42. The left channel path 41 and the right channel path 42 transmit communication data.
[0053] When the second type device is inserted into the headphone jack 10, the first detection pin transmits the second device type signal to the first input / output terminal of the controller 30 through the left channel path 41, and the second detection pin transmits the second device type signal to the second input / output terminal of the controller 30 through the right channel path 42. The controller 30 analyzes the second device type signal to determine that the inserted device is a second type device, so as to control the switching circuit 20 to select the second data path 50.
[0054] Therefore, in this embodiment of the application, the signals sent by the first detection pin and the second detection pin are transmitted through the left channel path 41 and the right channel path 42 respectively, so as to realize the type detection of the inserted device and the communication interaction between the controller 30 and the first type of device.
[0055] In some embodiments, the first type of device is a non-audio device. When it is plugged into the headphone jack 10, the first detection pin and the second detection pin output a first device type signal, which is a high-level signal. The second type of device is an audio device, such as headphones, speakers, or other audio equipment. When it is plugged into the headphone jack 10, the first detection pin and the second detection pin output a second device type signal, which is a low-level signal.
[0056] The non-audio device can be any device that enables the first detection pin and the second detection pin to output high-level signals when the headphone jack 10 is plugged in. In this embodiment, the second type of device is a Universal Asynchronous Receiver / Transmitter (UART) or an Infrared Equipment (IR device). A UART is an integrated circuit or module used for asynchronous serial communication, and an IR device can be an infrared camera, an infrared thermal imager, an infrared remote control, or other similar devices.
[0057] In some embodiments, if the first type of device is a UART, the UART establishes a connection with the input / output terminal of the controller 30 via the headphone jack 10, the switching circuit 20, the first data path 40, and the UART transmits data with the controller 30 through the general-purpose input / output pin.
[0058] For details, please continue reading Figure 2 If the first type of device is a UART, the UART is electrically connected to the first input / output terminal of the controller 30 via the first detection pin, the switching circuit 20, and the left channel path 41. The UART is also electrically connected to the second input / output terminal of the controller 30 via the second detection pin, the switching circuit 20, and the right channel path 42. The UART communicates with the controller 30 through the left channel path 41 and the right channel path 42, respectively, such as transmitting serial port data.
[0059] If the second type of device is an infrared device, its data format is generally encoded, and data transmission usually needs to be performed through a dedicated input pin of the controller 30; otherwise, data transmission errors are likely to occur.
[0060] Based on the above issues, such as Figure 3 As shown, the first data path 40 also includes a switch circuit 43. The first end of the switch circuit 43 is electrically connected to the first power supply, the second end of the switch circuit 43 is electrically connected to the second end of the controller 30, and the control end of the switch circuit 43 is electrically connected to the third end of the switching circuit 20 and the left channel path 41, respectively.
[0061] The switching circuit 20 selects the first data path 40, that is, selects the left channel path 41 and the right channel path 42. Then, the third terminal of the switching circuit 20 is connected to the first detection pin through the first terminal of the switching circuit 20, and the fourth terminal of the switching circuit 20 is connected to the second detection pin through the second terminal of the switching circuit 20. When the infrared device sends an infrared data signal, the infrared data signal acts on the control terminal of the switching circuit 43 through the first detection pin and the third terminal of the switching circuit 20, so that the switching circuit 43 is in the on state or the off state. When the switching circuit 43 is in the on state, the second terminal of the controller 30 receives a low level signal. When the switching circuit 43 is in the off state, the second terminal of the controller 30 receives a high level signal. Thus, the switching circuit 43 converts the infrared data signal into the corresponding high and low level signals and transmits them to the controller 30.
[0062] When an infrared device sends an infrared data signal, since the first data path 40 is selected, the infrared data signal may also be transmitted to the first input / output terminal of the controller 30 via the left channel path 41 and to the second input / output terminal of the controller 30 via the right channel path 42. The controller 30 analyzes the received data and determines that it is an infrared data signal. Then, it does not respond to the infrared data signal received at its first input / output terminal and the second input / output terminal, or ignores it.
[0063] Therefore, when the first type of device is an infrared device, the switching circuit 43 responds to the infrared data signal sent by the infrared device, and is in an on or off state to transmit the infrared data signal to the controller 30. In this embodiment, the switching circuit 43 sends the infrared data signal to the second terminal of the controller 30, ensuring the correct transmission of the infrared data signal and realizing correct communication between the infrared device and the controller 30.
[0064] In some embodiments, if the second type of device is an audio device, the voltage or current amplitude may be relatively small when the controller 30 transmits an audio signal to the audio device, which may prevent the audio device from playing clear audio. Furthermore, the small audio signal is easily interfered with, which may cause the audio played by the audio device to be distorted and the audio quality to decrease.
[0065] Based on the above issues, such as Figure 4 As shown, the second data path 50 in this embodiment includes an amplifier circuit 51. The input terminal of the amplifier circuit 51 is electrically connected to the linear output terminal of the controller 30, the first output terminal of the amplifier circuit is electrically connected to the fifth terminal of the switching circuit 20, and the second output terminal of the amplifier circuit is electrically connected to the sixth terminal of the switching circuit 20.
[0066] When the inserted device is an audio device, the switching circuit 20 selects the second data path. When the controller 30 transmits the audio signal to the audio device through the second data path, the amplifier circuit 51 amplifies the audio signal and then transmits it to the audio device through the switching circuit 20 and the headphone interface 10, so as to enhance the anti-interference capability of the audio signal and improve the audio quality and sound effect.
[0067] In some embodiments, the first detection pin is the left channel pin of the headphone jack 10, and the second detection pin is the right channel pin of the headphone jack 10. When the device is plugged into the headphone jack 10, both the left channel pin and the right channel pin send a first device type signal or a second device type signal. After the controller 30 identifies the type of the device, the device transmits data through the left channel pin and the right channel pin.
[0068] For example, if the inserted device is an audio device, the controller 30 receives the second device type signal, the controller 30 controls the switching circuit 20 to select the second data path, the controller 30 outputs the audio signal to the amplifier circuit 51, the amplifier circuit 51 amplifies it to obtain the left channel signal and the right channel signal, the left channel signal and the right channel signal are transmitted to the left channel pin and the right channel pin respectively through the switching circuit 20, and then transmitted to the audio device through the headphone interface 10 for the audio device to play.
[0069] In this embodiment, the left and right channel pins of the headphone jack 10 itself are used as detection pins, and no external detection circuit is required. The detection is convenient and flexible, reducing interference from the external detection circuit. Furthermore, the left and right channel pins are also used as data transmission pins, realizing pin multiplexing of the headphone jack 10.
[0070] Please see Figure 5 , Figure 5 This is a schematic diagram of the circuit structure of a headphone jack multiplexing circuit provided in an embodiment of this application, as shown below. Figure 5 As shown, the switching circuit 43 includes a MOSFET Q1, a first resistor R1, and a second resistor R2. The first end of the first resistor R1 is electrically connected to the third end of the switching circuit 20, and the second end of the first resistor R1 is connected to the gate of the MOSFET Q1. The source of the MOSFET Q1 is grounded, and the drain of the MOSFET Q1 is electrically connected to the first end of the second resistor R2 and the second end of the controller 30. The second end of the second resistor R2 is electrically connected to the first power supply Vdd. The first end of the first resistor R1 is the control terminal of the switching circuit 43, the drain of the MOSFET Q1 is the second terminal of the switching circuit 43, and the second end of the second resistor R2 is the first terminal of the switching circuit 43. In this embodiment, the MOSFET Q1 is an NMOS transistor.
[0071] In some embodiments, please continue reading Figure 5The switching circuit 20 is an analog switch chip U1, which has various models. In this embodiment, the connection relationship of the switching circuit 20 is described using the analog switch chip U1 model aip4052ta16 as an example.
[0072] The nZ1 pin of analog switch chip U1 is the first terminal of switching circuit 20, the nZ2 pin of analog switch chip U1 is the second terminal of switching circuit 20, the nY0 pin of analog switch chip U1 is the third terminal of switching circuit 20, the nY1 pin of analog switch chip U1 is the fourth terminal of switching circuit 20, the nY0 pin of analog switch chip U1 is connected to the first terminal of the first resistor R1, the nY0 pin of analog switch chip U1 is also connected to the GPIO1 pin of controller 30 through the left channel path 41, and the nY1 pin of analog switch chip U1 is connected to the right channel path 42 of controller 30. The GPIO2 pin is connected, the GPIO1 pin of the controller 30 is the first input / output terminal of the controller 30, the GPIO2 pin of the controller 30 is the second input / output terminal of the controller 30, and the nY2 pin of the analog switch chip U1 is the fifth terminal of the switching circuit 20, the nY3 pin of the analog switch chip U1 is the sixth terminal of the switching circuit 20, the nY2 pin of the analog switch chip U1 is connected to the first output terminal of the amplifier circuit 51, the nY2 pin of the analog switch chip U1 is connected to the second output terminal of the amplifier circuit 51, and the input terminal of the amplifier circuit 51 is connected to the Line Out pin of the controller 30. In this embodiment, the amplifier circuit is an amplifier, and its input terminal can be a differential input terminal. The Line Out pin of the controller 30 is the linear output terminal of the controller 30.
[0073] In this embodiment, the left channel path 41 includes a third resistor, and the right channel path 42 includes a fourth resistor. The third resistor is connected between the nY0 pin of the analog switch chip U1 and the GPIO1 pin of the controller 30, and the fourth resistor is connected between the nY1 pin of the analog switch chip U1 and the GPIO2 pin of the controller 30.
[0074] In this embodiment, the first detection pin is the left channel pin (EP_L pin) of the headphone jack 10, the second detection pin is the right channel pin (EP_R pin) of the headphone jack 10, and the insertion detection pin is the DET pin of the headphone jack 10.
[0075] In the default state, the analog switch chip U1 selects the first data path 40, that is, the nZ1 pin of the analog switch chip U1 is connected to the nY0 pin, then the EP_L pin of the headphone interface 10 is connected to the GPIO1 pin of the controller 30, and the nZ2 pin of the analog switch chip U1 is connected to the nY1 pin, then the EP_R pin of the headphone interface 10 is connected to the GPIO2 pin of the controller 30.
[0076] When a device is plugged into the headphone jack 10, the headphone jack 10 sends a high-level insertion detection signal to the controller 30 via the DET pin, and the controller 30 determines that a device has been plugged into the headphone jack 10. The plugged device then sends a device type signal to the controller 30 via the analog switch chip U1 through the EP_L and EP_R pins of the headphone jack 10. The controller 30 obtains the device type signal through its GPIO1 and GPIO2 pins and identifies the type of plugged device based on the level of the device type signal.
[0077] When the device type signal is a high-level first device type signal, the controller 30 determines that the inserted device is a first type device. If the first type device is a UART, the UART transmits data to the controller 30 through the analog switch chip U1 via the EP_L and EP_R pins of the headphone interface 10. The controller 30 receives serial data sent by the UART or sends serial data to the UART through its GPIO1 and GPIO2 pins.
[0078] When the first type of device is an infrared device, the infrared data signal sent by the infrared device is transmitted through the EP_L and EP_R pins of the headphone jack 10 and then through the nY0 pin of the analog switch chip U1 to the gate of the MOSFET Q1, controlling its conduction or cutoff. When the infrared data signal is a high-level signal, the MOSFET Q1 is turned on, connecting the second terminal of the controller 30 to ground, and the second terminal of the controller 30 is in a low-level state. When the infrared data signal is a low-level signal, the MOSFET Q1 is turned on, and the first power supply Vdd pulls up the voltage of the second terminal of the controller 30, putting the second terminal of the controller 30 in a high-level state. Therefore, the MOSFET Q1 converts the infrared data signal into a signal that the controller 30 can receive, realizing correct communication between the infrared device and the controller 30.
[0079] The infrared data signal sent by the infrared device is also transmitted to the GPIO1 pin of the controller 30 via the nY0 pin of the analog switch chip U1, and to the GPIO2 pin of the controller 30 via the nY1 pin of the analog switch chip U1. The controller 30 recognizes that the signal received by the pin is an infrared data signal, and therefore does not respond to the infrared data signal of the pin.
[0080] When the device type signal is a low-level second device type signal, the controller 30 determines that the inserted device is a second type device, such as an audio device. The controller 30 then sends a control signal to the analog switch chip U1 through its third terminal to control the analog switch chip U1 to switch and select the second data path 50. This establishes a connection between the nZ1 pin and the nY2 pin of the analog switch chip U1, and between the nZ2 pin and the nY3 pin of the analog switch chip U1. The second type device then transmits data to the controller 30 through the EP_L pin and EP_R pin of the headphone jack 10 via the analog switch chip U1, the amplifier circuit 51, and the controller 30. The controller 30 sends an audio signal to the amplifier circuit 51 through its Line out pin. The amplifier circuit 51 amplifies the audio signal and outputs a left channel signal and a right channel signal. The left channel signal is transmitted to the audio device through the analog switch chip U1 and the EP_L pin of the headphone jack 10, and the right channel signal is transmitted to the audio device through the analog switch chip U1 and the EP_R pin of the headphone jack 10, so that the audio device plays the left channel signal and the right channel signal.
[0081] When the device unplugs the headphone jack 10, the controller 30 detects that the insertion detection signal changes from a high level signal to a low level signal, confirming that the device has unplugged the headphone jack 10. Then, it sends a control signal to the analog switch chip U1 to restore the analog switch chip U1 to the preset default state, that is, to restore it to the selected first data path 40. The nZ1 pin of the analog switch chip U1 remains connected to its nY1 pin, and the nZ2 pin of the analog switch chip U1 remains connected to its nY2 pin. When a new external device is plugged into the headphone jack 10 again, the controller 30 can accurately identify the type of the device to ensure that a smooth data transmission link can be established between the controller 30 and the newly plugged device, and data transmission can be carried out smoothly.
[0082] In summary, when different types of devices are plugged into the headphone jack, the controller can communicate and interact with the plugged device through the corresponding data path, realizing headphone jack reuse. This reduces the number of interfaces on electronic devices, which is beneficial for miniaturization and thinner / lighter designs, and also reduces circuit costs. Furthermore, using the same headphone jack across different devices ensures a unified interface standard, enhances headphone jack compatibility, and makes connecting electronic devices to other devices more convenient.
[0083] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A headphone jack multiplexing circuit, characterized in that, The headphone interface multiplexing circuit includes: a headphone interface, a switching circuit, a first data path, a second data path, and a controller, wherein the headphone interface includes a first detection pin and a second detection pin; The first terminal of the switching circuit is electrically connected to the first detection pin, the second terminal of the switching circuit is electrically connected to the second detection pin, the control terminal of the switching circuit is electrically connected to the first terminal of the controller, the first data path is electrically connected between the input and output terminals of the switching circuit and the controller, the second data path is electrically connected between the linear output terminal of the switching circuit and the controller, and the switching circuit defaults to selecting the first data path so that the first detection pin and the second detection pin are electrically connected to the controller through the first data path; The headphone jack is configured to respond to the insertion of a first type of device or a second type of device, and a first device type signal or a second device type signal is generated by the first detection pin and the second detection pin, and the first device type signal or the second device type signal is transmitted through the first data path; The controller is configured to accept a first device type signal or a second device type signal. When the first device type signal is input, the controller controls the switching circuit to select the first data path, thereby enabling the first type device to communicate and interact with the controller through the first data path. When the second device type signal is input, the controller controls the switching circuit to switch to select the second data path, thereby enabling the second type device to communicate and interact with the controller through the second data path.
2. The headphone jack multiplexing circuit according to claim 1, characterized in that, The first data path includes a left channel path and a right channel path, and the input / output terminals of the controller include a first input / output terminal and a second input / output terminal; The left channel path is electrically connected between the third terminal of the switching circuit and the first input / output terminal of the controller, and the right channel path is electrically connected between the fourth terminal of the switching circuit and the second input / output terminal of the controller. The left channel path is configured to transmit the first device type signal or the second device type signal sent by the first detection pin, or to transmit data of communication interaction between the first type device and the controller; The right channel path is configured to transmit the first device type signal or the second device type signal sent by the second detection pin, or to transmit data of communication interaction between the first type device and the controller.
3. The headphone jack multiplexing circuit according to claim 2, characterized in that, The first type of device is a universal asynchronous transceiver or an infrared device, and the second type of device is an audio device.
4. The headphone jack multiplexing circuit according to claim 3, characterized in that, The first data path also includes a switching circuit; The first terminal of the switching circuit is electrically connected to the first power supply, the second terminal of the switching circuit is electrically connected to the second terminal of the controller, and the control terminal of the switching circuit is electrically connected to the third terminal of the switching circuit and the left channel path, respectively. The switching circuit is configured such that when the switching circuit selects the first data path and the first type of device is an infrared device, it responds to the infrared data signal sent by the infrared device by being in an on or off state to transmit the infrared data signal to the controller.
5. The headphone jack multiplexing circuit according to claim 4, characterized in that, The switching circuit includes a MOSFET, a first resistor, and a second resistor; The first end of the first resistor is electrically connected to the third end of the switching circuit, the second end of the first resistor is connected to the gate of the MOS transistor, the source of the MOS transistor is grounded, the drain of the MOS transistor is electrically connected to the first end of the second resistor and the second end of the controller, and the second end of the second resistor is electrically connected to the first power supply.
6. The headphone jack multiplexing circuit according to claim 3, characterized in that, The second data path includes an amplifier circuit; The input terminal of the amplifier circuit is electrically connected to the linear output terminal of the controller, the first output terminal of the amplifier circuit is electrically connected to the fifth terminal of the switching circuit, and the second output terminal of the amplifier circuit is electrically connected to the sixth terminal of the switching circuit. The amplifier circuit is configured to amplify the audio signal output by the controller when the switching circuit selects the second data path.
7. The headphone jack multiplexing circuit according to any one of claims 1-6, characterized in that, The headphone jack also includes an insertion detection pin, which is electrically connected to a third terminal of the controller and configured to send an insertion detection signal to the controller so that the controller determines whether a device is inserted into the headphone jack based on the insertion detection signal.
8. The headphone jack multiplexing circuit according to claim 7, characterized in that, The step of determining whether a device is inserted into the headphone jack based on the insertion detection signal specifically includes: If the insertion detection signal is a low-level signal, it is determined that no device is inserted into the headphone jack; If the insertion detection signal is a high-level signal, it is determined that a device has been inserted into the headphone jack; or, If the insertion detection signal is a high-level signal, it is determined that no device is inserted into the headphone jack; If the insertion detection signal is a low-level signal, it is determined that a device has been inserted into the headphone jack.
9. The headphone jack multiplexing circuit according to claim 8, characterized in that, The controller is also configured to control the switching circuit to resume selecting the first data path in response to the insertion detection signal changing from a high level signal to a low level signal; or, The controller is also configured to control the switching circuit to resume selecting the first data path in response to the insertion detection signal changing from a low level signal to a high level signal.
10. An electronic device, characterized in that, Includes the headphone jack multiplexing circuit as described in any one of claims 1-9.