Headphone type recognition device, headphone type recognition method, device and storage medium

By configuring registers and detection circuits, the headphone type recognition process is simplified, and the problems of complex and costly headphone type recognition in the prior art are solved, thereby achieving low-cost and efficient headphone type recognition.

CN114979925BActive Publication Date: 2025-06-27BEIJING SPREADTRUM HI TECH COMM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210509408.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2025-06-27
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

The existing headphone type recognition method has complex processes, high costs, and high professional and technical requirements for engineers.

Method used

By configuring power registers, headphone plug-in detection registers and type detection registers, the detection circuit is used to detect the type of headphones, including power supply, headphone plug-in status detection and microphone terminal detection.

Benefits of technology

It realizes simplification of headphone type recognition, reduces detection cost and time, and reduces the requirements for engineers' professional technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979925B_ABST
    Figure CN114979925B_ABST
Patent Text Reader

Abstract

The present invention discloses a headphone type identification device, a headphone type identification method, a device and a storage medium. The headphone type identification device includes: a power supply register for triggering the power supply to supply power to the headphone; a headphone plugging and unplugging detection register for detecting a first level between the power supply and a first pull-up resistor; a type detection register for detecting a second level between the second pull-up resistor and the terminal to be detected. In the present invention, only a small number of registers need to be configured. That is, by configuring the power supply register to trigger the power supply to supply power to the headphone, by configuring the headphone plugging and unplugging detection register to detect the plugging and unplugging state of the headphone, and by configuring the type detection register, when the headphone plugging and unplugging detection register detects that the headphone is in the inserted state, then continue to detect whether the headphone has a microphone terminal, so that the specific type of the headphone can be judged through the detection signal of the register. The present invention saves the detection time and reduces the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communications, and particularly to a headphone type identification device, a headphone type identification method, a device, and a storage medium. Background Art

[0002] On a terminal device with a headphone function, after a headphone is inserted, headphone type identification needs to be performed first. Currently, the common headphone type identification method requires a series of complex operations to identify whether the inserted headphone is a 3P (three-section headphone, i.e., a headphone without a microphone) headphone or a 4P (three-section headphone, i.e., a headphone with a microphone) headphone. The software implementation has a large amount of code, complex calculations, requires a lot of configured hardware, and also needs to consider conflict management with the battery module. The process CPU (Central Processing Unit) occupancy is high, and the professional technical requirements for engineers are high. It takes a lot of time and high cost from being familiar with the principle to implementing the code and debugging it well. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to overcome the defects of complex process and high cost in the prior art when identifying the headphone type, and to provide a headphone type identification device, a headphone type identification method, a device, and a storage medium.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] The present invention provides a headphone type identification device, which is used to detect the type of the headphone based on a detection circuit. The detection circuit includes:

[0006] A power supply for supplying power to the headphone;

[0007] A first pull-up resistor for connecting the power supply and the channel end of the headphone;

[0008] A second pull-up resistor for connecting the power supply and the terminal to be detected of the headphone, where the terminal to be detected includes a microphone end or a ground end;

[0009] The headphone type identification device includes:

[0010] A power supply register for triggering the power supply to supply power to the headphone;

[0011] A headphone plugging and unplugging detection register for detecting a first level between the power supply and the first pull-up resistor;

[0012] A type detection register for detecting a second level between the second pull-up resistor and the terminal to be detected.

[0013] Preferably, the power supply includes a main power supply and a sub - power supply. The main power supply is used to supply power to the earphone, and the sub - power supply is used to supply power to the microphone terminal.

[0014] The power supply register includes a main power supply register and a sub - power supply register. The main power supply register is used to trigger the main power supply to supply power to the earphone, and the sub - power supply register is used to trigger the sub - power supply to supply power to the microphone terminal.

[0015] Preferably, the earphone type identification device further includes a detection trigger register for triggering the activation of the type detection register.

[0016] Preferably, the detection circuit further includes a buffer resistor and / or a capacitor;

[0017] The buffer resistor is connected to the first pull - up resistor;

[0018] One end of the capacitor is connected to the first pull - up resistor, and the other end is grounded.

[0019] The present invention also provides an earphone type identification method. The earphone type identification method is based on the earphone type identification device as described above. The earphone type identification method includes:

[0020] In response to the connection of the channel terminal of the earphone to the detection circuit, trigger the power supply to supply power to the earphone through the power supply register;

[0021] Detect the first level between the power supply and the first pull - up resistor through the earphone plug - in detection register;

[0022] If the first level is less than or equal to a first preset level, detect the second level between the second pull - up resistor and the terminal to be detected through the type detection register: if the second level is less than or equal to a second preset level, confirm that the type of the earphone is a three - segment earphone; and / or, if the second level is greater than the second preset level, confirm that the type of the earphone is a four - segment earphone.

[0023] Preferably, the step of detecting the second level between the second pull - up resistor and the terminal to be detected through the type detection register includes:

[0024] Obtain the first detection signal of the type detection register every first preset time;

[0025] When the number of the obtained first detection signals reaches a first preset number: if the number of the first target signals in the obtained first detection signals is greater than or equal to a second preset number, confirm that the type of the earphone is a three - segment earphone; and / or, if the number of the first target signals in the obtained first detection signals is less than the second preset number, confirm that the type of the earphone is a four - segment earphone;

[0026] The first target signal represents a signal in which the second level is less than or equal to a second preset level.

[0027] Preferably, the step of detecting the first level between the power supply and the first pull-up resistor through the headphone plug detection register includes:

[0028] Obtaining a second detection signal of the headphone plug detection register;

[0029] If the second detection signal is a second target signal, return to the step of obtaining the second detection signal of the headphone plug detection register at an interval of a second preset time until the second detection signal is a third target signal, where the second target signal represents a signal in which the first level is less than the first preset level, and the third target signal represents a signal in which the first level is greater than or equal to the first preset level.

[0030] Preferably, before the step in which the first level is greater than or equal to a first preset level, further included are:

[0031] Determining the first preset level according to the first pull-up resistor and the internal resistance of the headphone; and / or,

[0032] Before the step in which the second level is greater than or equal to a second preset level, further included are:

[0033] Determining the second preset level according to the second pull-up resistor and the internal resistance of the headphone; and / or,

[0034] Before the step of detecting the second level between the second pull-up resistor and the terminal to be detected through the type detection register, the detection trigger register is turned on.

[0035] The present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the headphone type recognition method as described above is implemented.

[0036] The present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the headphone type recognition method as described above is implemented.

[0037] The positive and progressive effects of the present invention are as follows: In the present invention, only a small number of registers need to be configured. That is, by configuring the power register, the power supply to the headset is triggered. By configuring the headset plug and unplug detection register, the plug and unplug state of the headset is detected. By configuring the type detection register, when the headset plug and unplug detection register detects that the headset is in the inserted state, it continues to detect whether the headset has a microphone terminal, so that the specific type of the headset can be judged through the detection signal of the register. The present invention does not require complex operations, and the specific type of the headset can be detected by simply reading a small number of registers, saving the detection time and reducing the detection cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic block diagram of a headset type recognition device in Embodiment 1 of the present invention.

[0039] Figure 2 It is a flowchart of a headset type recognition method in Embodiment 1 of the present invention.

[0040] Figure 3 It is a schematic block diagram of an electronic device in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0041] For ease of understanding, the terms that often appear in the embodiments are explained below:

[0042]

Definition of "including"

[0043]

Definition of "and / or"

[0044]

Definitions of First and Second

[0045]

Definition of Connection

[0046] The present invention will be further described below by way of embodiments, but the present invention is not limited to the scope of the described embodiments.

[0047] Embodiment 1

[0048] This embodiment provides a headphone type recognition device, which is used to detect the type of a headphone based on a detection circuit. Among them, the detection circuit can be either a part of the headphone type recognition device or a part of a terminal device (i.e., a chip and a chip module product with headphone functions).

[0049] Figure 1 A schematic diagram showing the connection relationship between the headphone type recognition device and the headphone is schematically shown. Among them, the detection circuit includes: a power supply, a first pull-up resistor R2, and a second pull-up resistor R1. It should be understood that Figure 1 the headphone circuit is only schematically shown as an example, and the specific implementation form of the headphone circuit can be confirmed according to the actual situation.

[0050] The power supply is used to supply power to the headphone. The first pull-up resistor R2 is used to connect the power supply and the channel terminal of the headphone. The second pull-up resistor R1 is used to connect the power supply and the terminal to be detected of the headphone. In this embodiment, the first pull-up resistor R2 is connected to the left channel terminal. In other embodiments, the first pull-up resistor can also be connected to the right channel terminal.

[0051] Among them, the headphone type recognition device includes: a power register, a headphone plug detection register, and a type detection register.

[0052] The power register is used to trigger the power supply to supply power to the headphone.

[0053] In a specific embodiment, as Figure 1 shown, the power supply includes a main power supply VDDIO and a sub - power supply HEADMICBIAS. The main power supply is used to supply power to the earphone, and the sub - power supply is used to supply power to the terminal to be detected.

[0054] The power register includes a main - power register and a sub - power register. The main - power register is used to trigger the main power supply to supply power to the earphone, and the sub - power register is used to trigger the sub - power supply to supply power to the terminal to be detected.

[0055] In this embodiment, the power register is the main switch of the entire earphone, controlling the voltage of the entire earphone. The sub - power register is the sub - switch of the terminal to be detected, controlling the voltage of the microphone terminal. Only when the main - power register is turned on can the sub - switch of the microphone terminal take effect.

[0056] In this embodiment, the main - power register controls the power supply to the entire earphone. Based on this, the sub - power register controls the power supply to the microphone terminal. By this way of segmented control, the stability of the earphone type recognition device is improved, and it is also convenient to repair the device when a fault occurs.

[0057] In this embodiment, the earphone plug - in detection register is used to detect the first level between the power supply and the first pull - up resistor. Through the detection of the earphone plug - in detection register, it can be reflected whether the earphone is normally inserted into the terminal device. For example, when the signal detected by the earphone plug - in detection register is 1, it is confirmed that the earphone is normally inserted; when the signal detected by the register is 0, it is confirmed that the earphone is abnormally inserted.

[0058] The type detection register is used to detect the second level between the second pull - up resistor and the terminal to be detected. Among them, when the earphone is a three - segment earphone, the terminal to be detected is the ground terminal; when the earphone is a four - segment earphone, the terminal to be detected is the microphone terminal, that is, the MIC terminal. Through the detection of the type detection register, it can be reflected whether the earphone has a microphone terminal. For example, when the signal detected by the type detection register is 1, it is confirmed that the earphone has a microphone terminal, that is, the earphone is a four - segment earphone; when the signal detected by the type detection register is 0, it is confirmed that the earphone does not have a microphone terminal, that is, the earphone is a three - segment earphone.

[0059] In this embodiment, only a small number of registers need to be configured. That is, by configuring the power register to trigger the power supply to the earphone, by configuring the earphone plug - in detection register to detect the plug - in state of the earphone, and by configuring the type detection register, when the earphone plug - in detection register detects that the earphone is in the inserted state, it continues to detect whether the earphone has a microphone terminal. Thus, the specific type of the earphone can be judged through the detection signals of the registers. This embodiment does not require complex operations, and the specific type of the earphone can be detected by simply reading the values of a small number of registers, saving the detection time and reducing the detection cost.

[0060] In a specific implementation, the headset type identification device further includes a detection trigger register, which is used to trigger the opening of the type detection register.

[0061] In this embodiment, the activation of the detection trigger register is used as a prerequisite for the activation of the type detection register, so that the registers can be controlled step by step, which is convenient for the management of each register and for later debugging.

[0062] In a specific embodiment, Figure 1 As shown, the detection circuit further includes a buffer resistor R3 and / or a capacitor C1, wherein the buffer resistor is connected to the first pull-up resistor, one end of the capacitor is connected to the first pull-up resistor, and the other end is grounded.

[0063] In this embodiment, by setting a buffer resistor, it is possible to avoid the earphone being burned out due to excessive voltage at the earphone end when the earphone is connected. By setting a capacitor, the stability of the first level between the detected power supply and the first pull-up resistor can be improved, so that the first level changes more slowly when the earphone is inserted or unplugged.

[0064] This embodiment also provides a method for identifying the type of earphones. The method for identifying the type of earphones is implemented based on the aforementioned device for identifying the type of earphones. Figure 2 As shown, the headphone type identification method includes:

[0065] Step 101, in response to the channel end of the earphone being connected to the detection circuit, triggering a power supply to supply power to the earphone through a power register;

[0066] Step 102, detecting a first level between a power source and a first pull-up resistor through a headphone plug-in detection register: if the first level is less than or equal to a first preset level, executing step 103;

[0067] Step 103, detecting a second level between the second pull-up resistor and the end to be detected through the type detection register: if the second level is less than or equal to the second preset level, executing step 105; if the second level is greater than the second preset level, executing step 106;

[0068] Step 105, confirming that the type of the earphone is a three-stage earphone;

[0069] Step 106: Confirm that the type of the earphone is a four-band earphone.

[0070] In a specific implementation manner, step 102 may obtain a second detection signal of a headphone plug and unplug detection register. When the second detection signal is a third target signal, it is confirmed that the headphone has been plugged in, and step 103 is continued. When the second detection signal is a second target signal, it indicates that the headphone is not plugged in. Among them, the third target signal represents a signal whose first level is less than or equal to a first preset level, and the second target signal represents a signal whose first level is greater than the first preset level.

[0071] In a specific embodiment, step 103 has multiple ways to detect the type of the headphone. The following takes two specific ways as examples for illustration:

[0072] Way 1: Obtain a first detection signal of a type detection register. When the first detection signal is a first target signal, it indicates that the headphone is a three-section headphone. Among them, the first target signal represents a signal whose second level is less than or equal to a second preset level; if the detected first detection signal represents a signal whose second level is greater than the second preset level, it indicates that the headphone is a four-section headphone.

[0073] Way 2:

[0074] Obtain the first detection signal of the type detection register every first preset time;

[0075] When the number of the obtained first detection signals reaches a first preset number:

[0076] If the number of the first target signals in the obtained first detection signals is greater than or equal to a second preset number, confirm that the type of the headphone is a three-section headphone; if the number of the first target signals in the obtained first detection signals is less than the second preset number, confirm that the type of the headphone is a four-section headphone.

[0077] In this embodiment, the first detection signal of the type detection register is obtained multiple times. When the number of the first target signals in the first detection signals is greater than or equal to the second preset number, confirm that the type of the headphone is a three-section headphone. If the aforementioned number is less than the second preset number, confirm that the type of the headphone is a four-section headphone. By this way, the situation that the accuracy of headphone type judgment is affected due to the unstable detection signal of the type detection register can be avoided, and thus the accuracy of headphone type judgment can be improved.

[0078] In a preferred embodiment, the first preset level can be determined according to the first pull-up resistor and the internal resistance of the headphone. Specifically, before the step where the first level is greater than or equal to the first preset level, the following steps are further included:

[0079] Determine the first preset level according to the first pull-up resistor and the internal resistance of the headphone.

[0080] In this embodiment, through the first pull-up resistor and the internal resistance of the earphone, the node for determining whether the earphone is inserted can be determined according to the actual situation, making the applicability of the earphone insertion judgment wider.

[0081] In a preferred embodiment, the second preset level can be determined according to the second pull-up resistor and the internal resistance of the earphone. Specifically, before the step that the second level is greater than or equal to the second preset level, it further includes:

[0082] Determine the second preset level according to the second pull-up resistor and the internal resistance of the earphone.

[0083] In this embodiment, through the second pull-up resistor and the internal resistance of the earphone, the node for determining that the earphone includes a microphone end can be determined according to the actual situation, making the applicability of the earphone type judgment wider.

[0084] To better understand this embodiment, the following is combined with Figure 1 , and is explained through a specific example:

[0085] In this example, a left-channel detection mechanism is specifically adopted (a right-channel detection mechanism can also be adopted in other examples). That is, when the earphone is inserted, the left channel L is connected to the first pull-up resistor, and HP_DET is the pin on the chip that triggers a hardware interrupt when the earphone is inserted. First, connect the first pull-up resistor R2 to the elastic piece in contact with the left channel of the earphone, pull up the voltage to 2.8v, and at the same time connect it to the HP_DET pin of the chip. At this time, since the earphone is not inserted, the GPIO (general-purpose input / output) pin corresponding to HP_DET is at a high level.

[0086] When the earphone is inserted, since the internal of the left channel of the earphone is equivalent to a 32-ohm resistor (the mainstream internal resistance of the earphone is 32 ohms, and there are also 8 ohms and 1000 k ohms. In this embodiment, an earphone with an internal resistance of 32 ohms is specifically used as an example for convenience of explanation) connected to GND (ground). Since the left-channel contact is connected to the GPIO pin corresponding to HP_DET and the impedance of the coil on the earphone is 32 ohms, the HP_DET pin will be pulled to a low level, causing a software interrupt. The internal comparator of the chip will generate an interrupt and update the status of the earphone plug-in detection register (update the value of the first detection signal RG_AUD_HEAD_INSERT to the first target signal 1). Since the left channel is at the innermost of the earphone socket, the insertion and removal of the earphone can be accurately judged.

[0087] Similarly, when the earphone is a three-section earphone, since the terminal to be detected is the ground terminal, when the three-section earphone is plugged in, the second level between the second pull-up resistor and the ground terminal is pulled down, thereby triggering the generation of the first target signal, from which it can be determined that the earphone is a three-section earphone without a microphone terminal; while when the earphone is a four-section earphone, since the terminal to be detected is the microphone terminal and it has a corresponding internal resistance, the second level between the second pull-up resistor and the ground terminal is relatively high, greater than or equal to the second preset level, so that it can be determined that the earphone is a four-section earphone with a microphone terminal.

[0088] In a specific implementation manner, step 102 may specifically include the following steps:

[0089] Obtain the second detection signal of the earphone plug detection register;

[0090] If the second detection signal is the second target signal, return to the step of obtaining the second detection signal of the earphone plug detection register at an interval of the second preset time until the second detection signal is the third target signal.

[0091] In this embodiment, if the second detection signal is the second target signal, it means that the earphone is not inserted into the terminal. In this case, the second detection signal of the earphone plug detection register will be obtained again every second preset time until the second detection signal is the third target signal, so that it can be determined that the earphone is inserted into the terminal, and thus the accuracy of subsequent earphone type detection can be ensured.

[0092] In a specific implementation manner, before step 103, the step of enabling the detection trigger register may also be included.

[0093] In this embodiment, enabling the detection trigger register is used as a prerequisite for the type detection register to start detection, so that the registers can be controlled step by step, which is convenient for managing each register and also convenient for debugging it later.

[0094] To better understand this embodiment, the following is illustrated by a specific example:

[0095] After the earphone is inserted, initialize the registers, that is, enable the power register, sub-power register, earphone plug detection register, detection trigger register, and type detection register.

[0096] If the earphone plug detection register detects that the second detection signal is the third target signal, it is confirmed that the earphone has been inserted. If it detects that the second detection signal is the second target signal, it means that the earphone insertion state is unstable. Then, after waiting for 1 second, the second detection signal is detected again until the second detection signal is the third target signal before performing the subsequent steps.

[0097] Read the first detection signal of the type detection register every 1 millisecond. If the first detection signal is the first target signal, increment the value of the counter by 1. When the first detection signal is read 50 times, if the value of the counter is greater than or equal to 10, confirm that the earphone is a three-section earphone; if the value of the counter is less than 10, confirm that the earphone is a four-section earphone, and the earphone type detection is completed.

[0098] To save energy consumption, further, if it is confirmed that the earphone is a three-section earphone, then close the registers related to the detection microphone end, namely the power distribution register, the detection trigger register, and the type detection register.

[0099] Embodiment 2

[0100] This embodiment provides an electronic device, which can be presented in the form of a computing device (for example, it can be a server device), including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the earphone type recognition method in Embodiment 1 can be implemented.

[0101] Figure 3 The hardware structure diagram of this embodiment is shown, as Figure 3 shown, the electronic device 9 specifically includes:

[0102] At least one processor 91, at least one memory 92, and a bus 93 for connecting different system components (including the processor 91 and the memory 92), where:

[0103] The bus 93 includes a data bus, an address bus, and a control bus.

[0104] The memory 92 includes volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922, and may further include a read-only memory (ROM) 923.

[0105] The memory 92 further includes a program / utility 925 having a set (at least one) of program modules 924. Such program modules 924 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.

[0106] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the earphone type recognition method in Embodiment 1 of the present invention.

[0107] The electronic device 9 can further communicate with one or more external devices 94 (such as a keyboard, a pointing device, etc.). Such communication can be carried out through the input / output (I / O) interface 95. Moreover, the electronic device 9 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 96. The network adapter 96 communicates with other modules of the electronic device 9 through the bus 93. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (redundant array of independent disks) systems, tape drives, and data backup storage systems, etc.

[0108] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more of the above-described units / modules can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.

[0109] Embodiment 3

[0110] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the headphone type recognition method in Embodiment 1.

[0111] Among them, the more specific computer-readable storage medium that can be adopted can include but not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0112] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the headphone type recognition method in Embodiment 1.

[0113] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be completely executed on the user device, partially executed on the user device, executed as an independent software package, partially executed on the user device and partially executed on a remote device, or completely executed on a remote device.

[0114] Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present invention is defined by the appended claims. Without departing from the principle and essence of the present invention, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A headphone type recognition device, characterized in that, The headphone type recognition device is used to detect the type of the headphone based on a detection circuit, and the detection circuit includes: A power supply for supplying power to the headphone; A first pull-up resistor for connecting the power supply and the channel terminal of the headphone; A second pull-up resistor for connecting the power supply and the terminal to be detected of the headphone, and the terminal to be detected includes a microphone terminal or a ground terminal; The headphone type recognition device includes: A power supply register for triggering the power supply to supply power to the headphone; A headphone plug-in detection register for detecting a first level between the power supply and the first pull-up resistor; A type detection register for detecting a second level between the second pull-up resistor and the terminal to be detected.

2. The headphone type recognition device according to claim 1, wherein The power supply includes a main power supply and a sub-power supply. The main power supply is used to supply power to the headphone, and the sub-power supply is used to supply power to the microphone terminal; The power supply register includes a main power supply register and a sub-power supply register. The main power supply register is used to trigger the main power supply to supply power to the headphone, and the sub-power supply register is used to trigger the sub-power supply to supply power to the microphone terminal.

3. The earphone type recognition device according to claim 1, characterized in that The headphone type recognition device further includes a detection trigger register for triggering the type detection register to start.

4. The earphone type recognition device according to any one of claims 1-3, characterized in that, The detection circuit further includes a buffer resistor and / or a capacitor; The buffer resistor is connected to the first pull-up resistor; One end of the capacitor is connected to the first pull-up resistor, and the other end is grounded.

5. A method for identifying headphone types, characterized in that, The headphone type recognition method is based on the headphone type recognition device according to any one of claims 1-4, and the headphone type recognition method includes: In response to the connection between the channel terminal of the headphone and the detection circuit, triggering the power supply to supply power to the headphone through the power supply register; Detecting a first level between the power supply and the first pull-up resistor through the headphone plug-in detection register; If the first level is less than or equal to a first preset level, detecting a second level between the second pull-up resistor and the terminal to be detected through the type detection register: if the second level is less than or equal to a second preset level, confirming that the type of the headphone is a three-section headphone; and / or, if the second level is greater than the second preset level, confirming that the type of the headphone is a four-section headphone.

6. The headphone type recognition method according to claim 5, characterized in that The step of detecting a second level between the second pull-up resistor and the terminal to be detected through the type detection register includes: Obtaining a first detection signal of the type detection register every first preset time; When the number of the obtained first detection signals reaches a first preset number: if the number of first target signals in the obtained first detection signals is greater than or equal to a second preset number, confirming that the type of the headphone is a three-section headphone; and / or, if the number of first target signals in the obtained first detection signals is less than the second preset number, confirming that the type of the headphone is a four-section headphone; The first target signal represents a signal indicating that the second level is less than or equal to the second preset level.

7. The earphone type recognition method according to claim 5, wherein, The step of detecting a first level between the power supply and the first pull-up resistor through the headphone plug-in detection register includes: Obtaining a second detection signal of the headphone plug-in detection register; If the second detection signal is a second target signal, return to the step of obtaining the second detection signal of the headphone plug and unplug detection register at an interval of a second preset time until the second detection signal is a third target signal. The second target signal represents a signal where the first level is less than the first preset level, and the third target signal represents a signal where the first level is greater than or equal to the first preset level.

8. The method for identifying the type of earphone according to any one of claims 5-7, characterized in that, Before the step where the first level is greater than or equal to the first preset level, it further includes: Determine the first preset level according to the first pull-up resistor and the internal resistance of the headphone; and / or, Before the step where the second level is greater than or equal to the second preset level, it further includes: Determine the second preset level according to the second pull-up resistor and the internal resistance of the headphone; and / or, Before the step of detecting the second level between the second pull-up resistor and the terminal to be detected through the type detection register, it includes: turning on the detection trigger register.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the headphone type recognition method according to any one of claims 5 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the headphone type recognition method according to any one of claims 5 to 8.

Citation Information

Patent Citations

  • 3.5 mm earphone type detection circuit

    CN111698634A

  • Headset microphone type detect

    US20090296952A1