CN114979925A - Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium - Google Patents

Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium Download PDF

Info

Publication number
CN114979925A
CN114979925A CN202210509408.6A CN202210509408A CN114979925A CN 114979925 A CN114979925 A CN 114979925A CN 202210509408 A CN202210509408 A CN 202210509408A CN 114979925 A CN114979925 A CN 114979925A
Authority
CN
China
Prior art keywords
earphone
register
type
detection
level
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210509408.6A
Other languages
Chinese (zh)
Inventor
龙玉珍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ziguang Zhanrui Communication Technology Co Ltd
Original Assignee
Beijing Ziguang Zhanrui Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ziguang Zhanrui Communication Technology Co Ltd filed Critical Beijing Ziguang Zhanrui Communication Technology Co Ltd
Priority to CN202210509408.6A priority Critical patent/CN114979925A/en
Publication of CN114979925A publication Critical patent/CN114979925A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • H04R29/001Monitoring arrangements; Testing arrangements for loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • H04R29/004Monitoring arrangements; Testing arrangements for microphones
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Headphones And Earphones (AREA)

Abstract

The invention discloses a headset type identification device, a headset type identification method, equipment and a storage medium, wherein the headset type identification device comprises: the power supply register is used for triggering a power supply to supply power to the earphone; the earphone plugging detection register is used for detecting a first level between a power supply and a first pull-up resistor; and the type detection register is used for detecting a second level between the second pull-up resistor and the end to be detected. According to the invention, only a small number of registers need to be configured, namely, the power supply register is configured to trigger the power supply earphone to supply power, the earphone plugging and unplugging detection register is configured to detect the plugging and unplugging state of the earphone, and the type detection register is configured to continuously detect whether the earphone has a microphone end or not when the earphone plugging and unplugging detection register detects that the earphone is in the plugging state, so that the specific type of the earphone can be judged through the detection signal of the register.

Description

Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium
Technical Field
The present invention relates to the field of communications, and in particular, to an earphone type identification apparatus, an earphone type identification method, an apparatus, and a storage medium.
Background
On a terminal device with an earphone function, after an earphone is inserted, the earphone type identification needs to be performed first, and currently, a general earphone type identification method needs to identify whether the inserted earphone is a 3P (three-segment earphone, i.e. an earphone without a microphone) earphone or a 4P (three-segment earphone, i.e. an earphone with a microphone) earphone through a series of complex operations. The software implementation code amount is large, the calculation is complex, the configuration hardware is large, and the conflict management with the battery module needs to be considered. The process CPU (central processing unit) occupies a large area, has high technical requirements on engineers and professions, needs a large amount of time from the familiar principle to the realization of codes and good debugging, and has high cost.
Disclosure of Invention
The invention provides an earphone type identification device, an earphone type identification method, equipment and a storage medium, aiming at overcoming the defects of complex flow and high cost in earphone type identification in the prior art.
The invention solves the technical problems through the following technical scheme:
the invention provides an earphone type recognition device, which is used for detecting the type of an earphone based on a detection circuit, wherein the detection circuit comprises:
a power supply for supplying power to the headset;
the first pull-up resistor is used for connecting the power supply and the sound channel end of the earphone;
the second pull-up resistor is used for connecting the power supply and a to-be-detected end of the earphone, and the to-be-detected end comprises a microphone end or a ground end;
the earphone type recognition apparatus includes:
the power supply register is used for triggering the power supply to supply power to the earphone;
the earphone plugging detection register is used for detecting a first level between the power supply and the first pull-up resistor;
and the type detection register is used for detecting a second level between the second pull-up resistor and the end to be detected.
Preferably, the power supply comprises a main power supply and a sub power supply, the main power supply is used for supplying power to the earphone, and the sub power supply is used for supplying power to the microphone end;
the power register comprises a main power register and a sub power register, the main power register is used for triggering the main power to supply power to the earphone, and the sub power register is used for triggering the sub power to supply power to the microphone end.
Preferably, the earphone type recognition device further comprises a detection trigger register for triggering the turning on of the type detection register.
Preferably, the detection circuit further comprises a buffer resistor and/or a capacitor;
the buffer resistor is connected with the first pull-up resistor;
one end of the capacitor is connected with the first pull-up resistor, and the other end of the capacitor is grounded.
The invention also provides an earphone type identification method, which is based on the earphone type identification device and comprises the following steps:
responding to the connection of the sound channel end of the earphone and the detection circuit, and triggering a power supply to supply power to the earphone through the power supply register;
detecting a first level between the power supply and a first pull-up resistor through an earphone plugging detection register;
if the first level is less than or equal to a first preset level, detecting a second level between a second pull-up resistor and the end to be detected through a type detection register: if the second level is less than or equal to a second preset level, determining that the type of the earphone is a three-section type earphone; and/or if the second level is greater than the second preset level, determining that the type of the earphone is a four-section type earphone.
Preferably, the step of detecting the second level between the second pull-up resistor and the terminal to be detected by the type detection register includes:
acquiring a first detection signal of the type detection register at intervals of first preset time;
when the number of the acquired first detection signals reaches a first preset number: if the number of the first target signals in the acquired first detection signals is larger than or equal to a second preset number, determining that the type of the earphone is a three-section type earphone; and/or if the number of the first target signals in the acquired first detection signals is smaller than the second preset number, determining that the type of the earphone is a four-section type earphone;
the first target signal represents a signal of which the second level is less than or equal to a second preset level.
Preferably, the step of detecting a first level between the power supply and the first pull-up resistor through the headphone plug detection register includes:
acquiring a second detection signal of the earphone plugging detection register;
and if the second detection signal is a second target signal, returning to the step of acquiring the second detection signal of the earphone plugging detection register at an interval of second preset time until the second detection signal is a third target signal, wherein the second target signal represents a signal of which the first level is less than the first preset level, and the third target signal represents a signal of which the first level is greater than or equal to the first preset level.
Preferably, before the step of making the first level greater than or equal to the first preset level, the method further comprises:
determining the first preset level according to the first pull-up resistor and the internal resistance of the earphone; and/or the presence of a gas in the gas,
the step that the second level is greater than or equal to the second preset level further comprises the following steps:
determining the second preset level according to the second pull-up resistor and the internal resistance of the earphone; and/or the presence of a gas in the atmosphere,
before the step of detecting the second level between the second pull-up resistor and the end to be detected through the type detection register, the method further comprises the following steps: the detection trigger register is turned on.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the earphone type identification method as described above when executing the computer program.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a headset type identification method as described above.
The positive progress effects of the invention are as follows: according to the invention, only a small number of registers need to be configured, namely, the power supply register is configured to trigger the power supply of the earphone, the earphone plugging and unplugging detection register is configured to detect the plugging and unplugging state of the earphone, and the type detection register is configured to continuously detect whether the earphone has a microphone end or not when the earphone plugging and unplugging detection register detects that the earphone is in the plugging state, so that the specific type of the earphone can be judged through the detection signal of the register.
Drawings
Fig. 1 is a block diagram of an apparatus for identifying a type of a headset according to embodiment 1 of the present invention.
Fig. 2 is a flowchart of a method for identifying a type of an earphone according to embodiment 1 of the present invention.
Fig. 3 is a schematic block diagram of an electronic device in embodiment 2 of the present invention.
Detailed Description
For the sake of understanding, terms frequently appearing in the examples are explained below:
the terms "having," "may have," "include," or "may include," as used herein, indicate the presence of the corresponding function, operation, element, etc. of the disclosure, and do not limit the presence of the other function or functions, operations, elements, etc. It will be further understood that the terms "comprises" and "comprising," when used herein, specify the presence of stated features, integers, steps, operations, elements, components, or groups thereof, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof.
The term "a or B", "at least one of a and/or B", or "one or more of a and/or B", as used herein, includes any and all combinations of the words listed therewith. For example, "a or B," "at least one of a and B," or "at least one of a or B" means (1) including at least one a, (2) including at least one B, or (3) including both at least one a and at least one B.
The descriptions of the first, second, etc. appearing in the embodiments of the present application are for illustrative purposes and for distinguishing the objects of description, and do not indicate any particular limitation on the number of devices in the embodiments of the present application, and do not constitute any limitation on the embodiments of the present application. For example, a first element could be termed a second element, without departing from the scope of the present disclosure, and, similarly, a second element could be termed a first element.
It will be understood that when an element (e.g., a first element) is "connected to" or "coupled (operatively or communicatively) to" another element (e.g., a second element), the element may be directly connected or coupled to the other element and there may be intermediate elements (e.g., a third element) between the element and the other element. In contrast, it will be understood that when an element (e.g., a first element) is "directly connected to" or "directly coupled to" another element (e.g., a second element), there are no intervening elements (e.g., third elements) between the element and the other element.
The invention is further illustrated by the following examples, which are not intended to limit the invention thereto.
Example 1
The present embodiment provides a headphone type identifying apparatus for detecting the type of a headphone based on a detection circuit. The detection circuit can be used as a part of the earphone type identification device, and can also be used as a part of the terminal equipment (i.e. a chip and a chip module product with an earphone function).
Fig. 1 schematically shows a connection relationship between a headset type identification device and a headset. Wherein, detection circuitry includes: a power supply, a first pull-up resistor R2 and a second pull-up resistor R1. It should be understood that the headset circuit in fig. 1 is only schematically taken as an example, and the implementation form of the specific headset circuit can be confirmed according to the actual situation.
The power supply is used for supplying power to the earphone, the first pull-up resistor R2 is used for being connected with the power supply and the sound channel end of the earphone, and the second pull-up resistor R2 is used for being connected with the power supply and the end to be detected of the earphone. In this embodiment, the first pull-up resistor R2 is connected to the left channel end, but in other embodiments, the first pull-up resistor R may be connected to the right channel end.
Wherein, this earphone type recognition device includes: a power supply register, an earphone plugging detection register and a type detection register.
The power supply register is used for triggering the power supply to supply power to the earphone.
In a specific embodiment, as shown in fig. 1, the power supply includes a main power supply VDDIO and a sub power supply HEADMICBIAS, the main power supply is used for supplying power to the earphone, and the sub power supply is used for supplying power to the terminal to be detected.
The power register comprises a main power register and a branch power register, the main power register is used for triggering the main power to supply power to the earphone, and the branch power register is used for triggering the branch power to supply power to the end to be detected.
In this embodiment, the power register is a master switch of the whole earphone and controls the voltage of the whole earphone, the sub-power register is a sub-switch of the end to be detected and controls the voltage of the microphone end, and the sub-switch of the microphone end can only function when the master power register is turned on.
In this embodiment, the total power register controls power supply to the whole earphone, and based on this, the power register controls power supply to the microphone end, and through the mode of this kind of sectional control, improved earphone type recognition device's stability, when earphone type recognition device breaks down, also be convenient for overhaul it.
In this embodiment, the earphone plugging detection register is configured to detect a first level between the power supply and the first pull-up resistor, and detect the earphone plugging detection register to reflect whether the earphone is normally plugged into the terminal device, where if a signal detected by the earphone plugging detection register is 1, it is determined that the earphone is normally plugged, and if the signal detected by the earphone plugging detection register is 0, it is determined that the earphone is abnormally plugged.
The type detection register is used for detecting a second level between the second pull-up resistor and the end to be detected. When the earphone is a three-section earphone, the end to be detected is a ground end, and when the earphone is a four-section earphone, the end to be detected is a microphone end. I.e. the MIC terminal, can reflect whether the earphone has a microphone terminal or not through the detection of the type detection register, e.g. when the signal detected by the type detection register is 1, it is determined that the earphone has a microphone terminal, i.e. the earphone is a four-segment type earphone, and when the signal detected by the type detection register is 0, it is determined that the earphone does not have a microphone terminal, i.e. the earphone is a three-segment type earphone.
In this embodiment, only need dispose a small amount of registers, trigger the power supply earphone power supply through configuring power register promptly, detect the plug state of earphone through configuring earphone plug detection register, through configuring type detection register, when earphone plug detection register detects the earphone and is the plug-in state, then continue to detect whether the earphone has the microphone end, thereby can judge the concrete type of earphone through the detected signal of register, this embodiment does not need complicated operation, can detect the concrete type of earphone through the simple reading of a small amount of registers, detection time has been practiced thrift and detection cost has also been reduced.
In a specific embodiment, the earphone type identification device further comprises a detection trigger register for triggering the opening type detection register.
In this embodiment, the start of the detection trigger register is used as a precondition for starting the type detection register, so that the registers can be controlled step by step, each register can be managed conveniently, and the registers can be debugged conveniently at a later stage.
In a specific embodiment, as shown in fig. 1, 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 of the capacitor is grounded.
In this embodiment, through setting up buffer resistor, can avoid when the earphone inserts, the too big earphone that burns out of voltage in the earphone end, through setting up electric capacity, can improve the stability of the first level between detection moral power and the first pull-up resistance, let first level change slowly when synthesizing to make the earphone insert or extract.
The embodiment also provides a method for recognizing a type of a headset, which is implemented based on the device for recognizing a type of a headset, as shown in fig. 2, and the method for recognizing a type of a headset includes:
step 101, responding to the connection of a sound channel end of an earphone and a detection circuit, and triggering a power supply to supply power to the earphone through a power supply register;
102, detecting a first level between a power supply and a first pull-up resistor through an earphone plugging detection register: if the first level is less than or equal to the first preset level, go to step 103;
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, go to step 105; if the second level is greater than the second preset level, go to step 106;
step 105, confirming that the type of the earphone is a three-section type earphone;
and 106, determining that the type of the earphone is a four-section earphone.
In a specific implementation manner, step 102 may obtain a second detection signal of the earphone plugging/unplugging detection register, when the second detection signal is a third target signal, it is determined that the earphone is plugged in, and step 103 is continuously performed, and when the second detection signal is a second target signal, it indicates that the earphone is not plugged in, where the third target signal represents a signal whose first level is less than or equal to the first preset level, and the second target signal represents a signal whose first level is greater than the first preset level.
In one embodiment, step 103 has a plurality of ways to detect the type of earphone, and two specific ways are exemplified below:
the first method is as follows: acquiring a first detection signal of the type detection register, and when the first detection signal is a first target signal, indicating that the earphone is a three-section earphone, wherein the first target signal indicates a signal of which the second level is less than or equal to a second preset level; if the detected first detection signal is a signal indicating that the second level is greater than the second preset level, the earphone is a four-section earphone.
The second method comprises the following steps:
acquiring a first detection signal of the type detection register at intervals of first preset time;
when the number of the acquired first detection signals reaches a first preset number:
if the number of the first target signals in the acquired first detection signals is larger than or equal to a second preset number, determining that the type of the earphone is a three-section type earphone; and if the number of the first target signals in the acquired first detection signals is smaller than a second preset number, determining that the type of the earphone is a four-section type earphone.
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 signal is greater than or equal to the second preset number, it is determined that the type of the earphone is a three-segment type earphone, and if the number is less than the second preset number, it is determined that the type of the earphone is a four-segment type earphone.
In a preferred embodiment, the first predetermined level may be determined according to the first pull-up resistor and an internal resistance of the earphone. Specifically, the step that the first level is greater than or equal to the first preset level further includes:
and determining a first preset level according to the first pull-up resistor and the internal resistance of the earphone.
In this embodiment, the node for determining whether the earphone is inserted may be determined according to an actual situation by the first pull-up resistor and the internal resistor of the earphone, so that the applicability of the determination of earphone insertion is wider.
In a preferred embodiment, the second predetermined level may be determined according to the second pull-up resistor and the internal resistance of the earphone. Specifically, the step that the second level is greater than or equal to the second preset level further comprises the following steps:
and determining a second preset level according to the second pull-up resistor and the internal resistance of the earphone.
In this embodiment, the node for judging whether the earphone includes the microphone end may be determined according to an actual situation by the second pull-up resistor and the internal resistor of the earphone, so that the applicability of the judgment of the earphone type is wider.
For a better understanding of the present embodiment, reference is made to the following description, by way of a specific example, with reference to fig. 1:
in this example, a left channel detection mechanism (or a right channel detection mechanism in other examples) is specifically adopted, that is, when the earphone is plugged in, the left channel L is connected with the first pull-up resistor, and the HP _ DET is a pin for triggering hardware interrupt of the earphone plugged in on a chip. First, a pull-up resistor R2 is connected to the elastic sheet of the earphone left channel contact to pull up the voltage to 2.8v, and at the same time, the HP _ DET pin of the chip is connected, and at this time, since the earphone is not inserted, the GPIO (general purpose input output) pin corresponding to HP _ DET is at high level.
When the earphone is inserted, since the internal resistance of the left channel of the earphone is equal to 1 32 ohms (the internal resistance of the earphone is 32 ohms, and also 8 ohms and 1000 kilo-ohms, the embodiment specifically takes the earphone with the internal resistance of 32 ohms as an example for convenience of description) and GND (ground) are connected. Because the left channel contact is connected with the GPIO pin corresponding to HP _ DET, the impedance of a coil on the earphone is 32 ohms, the HP _ DET pin is pulled to be low level, software interrupt is caused, and the internal comparator of the chip generates interrupt and updates the state of the earphone plug detection register (the value of the first detection signal RG _ AUD _ HEAD _ INSERT is updated to be a first target signal 1). Because the left sound channel is arranged at the innermost part of the earphone seat, the insertion and the extraction of the earphone can be accurately judged.
Similarly, when the earphone is a three-section earphone, because the end to be detected is a ground end, when the three-section earphone is connected, a second level between a second pull-up resistor and the ground end is pulled down, so that a first target signal is generated in a triggering mode, and therefore the earphone can be determined to be the three-section earphone without a microphone end; when the earphone is a four-segment earphone, the end to be detected is a microphone end and has corresponding internal resistance, and the second level between the second pull-up resistor of the second level and the ground end is higher and is greater than or equal to the second preset level, so that the earphone can be determined to be the four-segment earphone with the microphone end.
In a specific embodiment, step 102 may specifically include the following steps:
acquiring a second detection signal of the earphone plugging detection register;
and if the second detection signal is a second target signal, returning to the step of acquiring the second detection signal of the earphone plugging detection register at intervals of second preset time until the second detection signal is a third target signal.
In this embodiment, if the second detection signal is the second target signal, it indicates that the earphone is not inserted into the terminal, and in this case, the second detection signal of the earphone plugging/unplugging detection register is obtained again at 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 accuracy of subsequent earphone type detection can be ensured.
In a specific embodiment, step 103 may further include the following steps: the detection trigger register is turned on.
In this embodiment, the start detection trigger register is used as a precondition for starting detection of the type detection register, so that the registers can be controlled step by step, each register can be managed conveniently, and debugging of the registers in a later stage is facilitated.
For a better understanding of the present embodiment, the following description is given by way of a specific example:
after the earphone is inserted, the registers, namely the power supply starting register, the power distribution register, the earphone plugging detection register, the detection trigger register and the type detection register are initialized.
And if the earphone plugging and unplugging detection register detects that the second detection signal is the third target signal, confirming that the earphone is inserted, if the second detection signal is the second target signal, indicating that the earphone insertion state is unstable, waiting for 1 second, detecting the second detection signal again until the second detection signal is the third target signal, and then executing the subsequent steps.
Reading a first detection signal of the type detection register every 1 millisecond, adding 1 to the value of the counter if the first detection signal is a first target signal, confirming that the earphone is a three-section type earphone if the value of the counter is more than or equal to 10 when the first detection signal is read for 50 times, and confirming that the earphone is a four-section type earphone if the value of the counter is less than 10, thus completing earphone type detection.
In order to save energy consumption, if the earphone is confirmed to be a three-section type earphone, registers related to the detection microphone end, namely a power supply register, a detection trigger register and a type detection register, are closed.
Example 2
The present embodiment provides an electronic device, which may be represented in the form of a computing device (for example, may be a server device), and includes a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor executes the computer program to implement the method for recognizing the type of the headset in embodiment 1.
Fig. 3 shows a schematic diagram of a hardware structure of the present embodiment, and as shown in fig. 3, the electronic device 9 specifically includes:
at least one processor 91, at least one memory 92, and a bus 93 for connecting the various system components (including the processor 91 and the memory 92), wherein:
the bus 93 includes a data bus, an address bus, and a control bus.
Memory 92 includes volatile memory, such as Random Access Memory (RAM)921 and/or cache memory 922, and can further include Read Only Memory (ROM) 923.
Memory 92 also includes programs/utilities 925 having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 91 executes various functional applications and data processing, such as the headphone type identification method in embodiment 1 of the present invention, by executing the computer program stored in the memory 92.
The electronic device 9 may further communicate with one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). Such communication may be through an input/output (I/O) interface 95. Also, the electronic device 9 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 96. The network adapter 96 communicates with the other modules of the electronic device 9 via the bus 93. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 3
The present embodiment provides a computer-readable storage medium on which a computer program is stored, the program implementing the method for headset type identification in embodiment 1 when executed by a processor.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the method for headset type identification of the implementation example 1, when said program product is run on said terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (10)

1. An earphone type recognition apparatus for detecting a type of an earphone based on a detection circuit, the detection circuit comprising:
a power supply for supplying power to the headset;
the first pull-up resistor is used for connecting the power supply and the sound channel end of the earphone;
the second pull-up resistor is used for connecting the power supply and a to-be-detected end of the earphone, and the to-be-detected end comprises a microphone end or a ground end;
the earphone type recognition apparatus includes:
the power supply register is used for triggering the power supply to supply power to the earphone;
the earphone plugging detection register is used for detecting a first level between the power supply and the first pull-up resistor;
and the type detection register is used for detecting a second level between the second pull-up resistor and the end to be detected.
2. The apparatus for recognizing a type of an earphone as claimed in claim 1, wherein the power supply includes a main power supply for supplying power to the earphone and a sub power supply for supplying power to the microphone terminal;
the power register comprises a main power register and a sub power register, the main power register is used for triggering the main power to supply power to the earphone, and the sub power register is used for triggering the sub power to supply power to the microphone end.
3. The headset type recognition apparatus of claim 1, further comprising a detection trigger register for triggering the turning on of the type detection register.
4. The headset type recognition apparatus according to any one of claims 1 to 3, wherein the detection circuit further comprises a buffer resistor and/or a capacitor;
the buffer resistor is connected with the first pull-up resistor;
one end of the capacitor is connected with the first pull-up resistor, and the other end of the capacitor is grounded.
5. A headset type identification method, characterized in that the headset type identification method is based on the headset type identification device of any of claims 1-4, the headset type identification method comprising:
responding to the connection of the sound channel end of the earphone and the detection circuit, and triggering a power supply to supply power to the earphone through the power supply register;
detecting a first level between the power supply and a first pull-up resistor through an earphone plugging detection register;
if the first level is less than or equal to a first preset level, detecting a second level between a second pull-up resistor and the end to be detected through a type detection register: if the second level is less than or equal to a second preset level, determining that the type of the earphone is a three-section type earphone; and/or if the second level is greater than the second preset level, determining that the type of the earphone is a four-section type earphone.
6. The headset type recognition method of claim 5, wherein the step of detecting the second level between the second pull-up resistor and the terminal to be detected through the type detection register comprises:
acquiring a first detection signal of the type detection register at intervals of first preset time;
when the number of the acquired first detection signals reaches a first preset number: if the number of the first target signals in the acquired first detection signals is larger than or equal to a second preset number, determining that the type of the earphone is a three-section type earphone; and/or if the number of the first target signals in the acquired first detection signals is smaller than the second preset number, determining that the type of the earphone is a four-section type earphone;
the first target signal represents a signal of which the second level is less than or equal to a second preset level.
7. The headset type recognition method of claim 5, wherein the detecting of the first level between the power supply and the first pull-up resistor through the headset plug detection register comprises:
acquiring a second detection signal of the earphone plugging detection register;
and if the second detection signal is a second target signal, returning to the step of acquiring the second detection signal of the earphone plugging detection register at an interval of second preset time until the second detection signal is a third target signal, wherein the second target signal represents a signal of which the first level is less than the first preset level, and the third target signal represents a signal of which the first level is greater than or equal to the first preset level.
8. The headset type recognition method according to any one of claims 5 to 7, wherein the step of the first level being greater than or equal to a first preset level further comprises:
determining the first preset level according to the first pull-up resistor and the internal resistance of the earphone; and/or the presence of a gas in the gas,
the step that the second level is greater than or equal to the second preset level further comprises the following steps:
determining the second preset level according to the second pull-up resistor and the internal resistance of the earphone; and/or the presence of a gas in the gas,
before the step of detecting the second level between the second pull-up resistor and the end to be detected through the type detection register, the method further comprises the following steps: the detection trigger register is turned on.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the headset type recognition method of any one of claims 5 to 8 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the headset type recognition method of any one of claims 5 to 8.
CN202210509408.6A 2022-05-10 2022-05-10 Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium Pending CN114979925A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210509408.6A CN114979925A (en) 2022-05-10 2022-05-10 Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210509408.6A CN114979925A (en) 2022-05-10 2022-05-10 Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium

Publications (1)

Publication Number Publication Date
CN114979925A true CN114979925A (en) 2022-08-30

Family

ID=82981402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210509408.6A Pending CN114979925A (en) 2022-05-10 2022-05-10 Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium

Country Status (1)

Country Link
CN (1) CN114979925A (en)

Similar Documents

Publication Publication Date Title
US10860425B2 (en) Method for recovering basic input/output system image file of a computer system and the computer system
US8954628B2 (en) Portable device and peripheral extension dock
CN114003538B (en) Identification method of intelligent network card and intelligent network card
CN108920397B (en) Device identification method and device, storage medium and electronic device
US8438374B2 (en) Computer system and control method of the same
CN108681514A (en) Equipment detection method, device, storage medium and electronic equipment
US20030233507A1 (en) Electronic card with multiple interfaces
CN115273955A (en) Data testing method and device for power failure in eMMC busy time
US20120054391A1 (en) Apparatus and method for testing smnp cards
CN113204456A (en) Test method, tool, device and equipment for VPP interface of server
CN114979925A (en) Earphone type recognition device, earphone type recognition method, earphone type recognition device, and storage medium
CN117331760A (en) Equipment debugging method and device based on USB interface and storage medium
CN116994635A (en) Flash memory power failure detection method and system, electronic equipment and storage medium
CN115391260A (en) PCIe bandwidth configuration device, method, server and readable storage medium
US8406069B2 (en) Data writing method and writing device for an electronic erasable read only dynamic memory
CN114020283A (en) Firmware burning method, burning circuit, device, equipment and readable storage medium
CN110442539B (en) Mobile phone OTG switching method and device
CN108984447B (en) Control method of electronic equipment and electronic equipment
CN104143350A (en) Electronic apparatus
CN112598830A (en) Intelligent terminal of gate
CN109388217B (en) Method, device and system for determining duration of unpowered hard disk
US10615550B2 (en) Earphone recognition and connection methods and circuits and storage medium
CN221283383U (en) Accessory, lighting device and system
TWI757923B (en) Pre-boot execution environment determination system and method thereof
CN114121138B (en) Memory voltage testing method, device, computing equipment and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination