Electronic device, control method and related device
By setting the switch unit on the external interface of the electronic device to disconnect the data transmission path, the fast charging and communication failure problems caused by high-voltage DC are solved, and the stable charging and communication of the device is achieved.
Patent Information
- Application Number
- CN202310686990.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-06-09
AI Technical Summary
During use, electronic devices may have problems such as being unable to fast charge or being unable to communicate through external interfaces, especially due to damage to the communication chip and fast charge chip caused by high voltage DC.
By setting a switch unit between the data transmission pin of the external interface and the communication chip, the transmission path is disconnected to prevent high-voltage DC transmission, ensuring that the path is disconnected when the charger is connected, preventing chip damage, and switching when the headset is connected Circuit to reduce interference.
It effectively reduces the probability that electronic devices cannot be fast charging or communication failure, prevents high-voltage DC from damaging the fast charging chip and communication unit, and ensures that the equipment operates stably during charging and communication.
Smart Images

Figure CN117708013B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an electronic device, a control method and related devices. Background Art
[0002] In a possible implementation, the electronic device is provided with an external interface, such as a type-C interface, etc. The electronic device can be charged and communicated with headphones or other electronic devices through the external interface.
[0003] However, during the use of electronic devices, it may happen that the electronic devices cannot be quickly charged or the electronic devices cannot communicate with each other through external interfaces. Summary of the invention
[0004] The embodiments of the present application provide an electronic device, a control method and related devices, which are applied to the field of terminal technology. When the external interface is connected to the charger, the transmission path formed by the first data transmission pin of the external interface and the communication chip is disconnected, and the transmission path formed by the second data transmission pin and the communication chip is disconnected, so as to reduce the possibility of high-voltage direct current that may be generated when the external interface is connected to a fast-charging charger and burn out the communication chip and the fast-charging chip, thereby reducing the probability of the electronic device failing to fast charge or the electronic devices failing to communicate through the external interface during use.
[0005] In a first aspect, an embodiment of the present application provides an electronic device, comprising: an external interface, a first switch unit, a second switch unit, a third switch unit, and a fourth switch unit;
[0006] The external interface includes a first data transmission pin and a second data transmission pin;
[0007] The first switch unit is connected between the second switch unit and the first data transmission pin, and the third switch unit is connected between the fourth switch unit and the second data transmission pin; the second switch unit and the fourth switch unit are both connected to the communication unit of the electronic device;
[0008] Wherein, when the first switch unit and the third switch unit are both turned on, the first data transmission pin and the second data transmission pin are used as a universal serial bus USB interface; when the first switch unit and the third switch unit are both turned off, the first data transmission pin and the second data transmission pin are used as a headphone interface;
[0009] The electronic device is used for controlling the second switch unit and the fourth switch unit to be turned off when the external interface of the electronic device is connected to a charger.
[0010] In this way, by turning off the second switch unit and the fourth switch unit, the high-voltage direct current can be blocked from being transmitted to the fast-charging chip and the communication unit, thereby preventing the high-voltage direct current from burning the fast-charging chip and / or the communication unit.
[0011] In a possible implementation, a fifth switch unit is further included; the fifth switch unit is connected between the ground terminal and the control terminal of the second switch unit, and the control terminal of the second switch unit is connected to the control terminal of the fourth switch unit;
[0012] When the external interface is connected to a charger, the electronic device is used to control the fifth switch unit to be turned on, so that the second switch unit and the fourth switch unit are both turned off.
[0013] In this way, by controlling the fifth switch unit, the second switch unit and the fourth switch unit can be turned off at the same time, preventing high-voltage direct current from burning out the fast charging chip and / or the communication unit.
[0014] In a possible implementation, a first audio branch is further included, the first audio branch includes a sixth switch unit and a seventh switch unit; the sixth switch unit is connected between the ground terminal and the control terminal of the first switch unit, and the control terminal of the first switch unit, the control terminal of the second switch unit, the control terminal of the third switch unit, and the control terminal of the fourth switch unit are connected;
[0015] When the external interface is connected to an analog headset, the sixth switch unit is turned on, so that the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are all turned off;
[0016] The seventh switch unit is connected between the first data transmission pin and the audio processing unit of the electronic device;
[0017] When the external interface is connected to an analog headset, the seventh switch unit is turned on, so that communication is achieved between the first data transmission pin and the audio processing unit.
[0018] In this way, by controlling the sixth switch unit, the first switch unit, the second switch unit, the third switch unit and the fourth switch unit can be turned off, thereby reducing the interference of the paths where the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are located in the communication between the first data transmission pin and the audio processing unit.
[0019] In a possible implementation, the electronic device is specifically configured to control the sixth switch unit to be turned on, so that the second switch unit and the fourth switch unit are both turned off, when the external interface of the electronic device is connected to a charger.
[0020] In this way, by controlling the sixth switch unit, the second switch unit and the fourth switch unit are turned off, preventing the high-voltage direct current from burning out the fast charging chip and / or the communication unit.
[0021] In a possible implementation, the first audio branch further includes: a first magnetic bead, a second magnetic bead, a third magnetic bead, a first resistor, a second resistor, a third resistor, a first capacitor, and a second capacitor;
[0022] One end of the first magnetic bead is connected to the first data transmission pin, and the other end of the first magnetic bead is connected to one end of the seventh switch unit and one end of the first resistor; the control end of the seventh switch unit is connected to the second resistor, and the other end of the seventh switch unit is connected to the audio processing unit through the second magnetic bead; the first capacitor is connected between the control end of the seventh switch unit and the other end of the seventh switch unit; the other end of the first resistor is connected to one end of the third resistor and one end of the third magnetic bead; the other end of the third resistor is connected to the audio processing unit through the second magnetic bead; the other end of the third magnetic bead is connected to the control end of the first switch unit through the second capacitor.
[0023] In this way, the interference to the first audio branch when transmitting data can be reduced.
[0024] In a possible implementation, the electronic device further includes a fast charging chip, a fourth resistor and a fifth resistor;
[0025] One pin of the fast charging chip is connected between the first switch unit and the second switch unit through a fourth resistor, and another pin of the fast charging chip is connected between the third switch unit and the fourth switch unit through a fifth resistor;
[0026] The fast charging chip is used to communicate with the fast charging charger when the external interface is connected to the fast charging charger.
[0027] In this way, the current limiting effect of the fourth resistor and the fifth resistor can reduce the possibility of the fast charging chip being burned out by high-voltage direct current.
[0028] In a possible implementation, the electronic device further includes a power management unit and a sixth resistor;
[0029] The sixth resistor is connected between the power management unit and the control end of the second switch unit, and the control end of the second switch unit is connected to the control end of the fourth switch unit;
[0030] The power management unit is also connected to the control end of the first switch unit and the control end of the third switch unit;
[0031] The power management unit is used to control the first switch unit and the third switch unit to be turned on when the external interface of the electronic device is connected to a charger.
[0032] In this way, the power management unit controls the conduction of the first switch unit and the third switch unit, and the sixth resistor can prevent the turned-off second switch unit and the fourth switch unit from pulling down the voltage at one end of the power management unit.
[0033] In a possible implementation, the electronic device further includes a third capacitor;
[0034] One end of the third capacitor is connected between the power management unit and the control end of the first switch unit, and the other end of the third capacitor is grounded.
[0035] In this way, the voltage at which the power management unit turns on the first switch unit can be stabilized.
[0036] In a possible implementation manner, the electronic device further includes a seventh resistor, an eighth resistor and / or a ninth resistor;
[0037] One end of the seventh resistor is connected to the power management unit;
[0038] The control end of the first switch unit is connected to the other end of the seventh resistor through the eighth resistor, and the control end of the third switch unit is connected to the other end of the seventh resistor through the ninth resistor.
[0039] In this way, the power management unit can control the conduction of the first switch unit and the third switch unit, and can also prevent the turned-off first switch unit and the turned-off third switch unit from lowering the voltage at one end of the power management unit.
[0040] In a possible implementation, the electronic device is further used to determine whether the charging type of the charger is fast charging when the external interface is connected to the charger;
[0041] If the charging type of the charger is fast charging, the electronic device controls the second switch unit and the fourth switch unit to be turned off, and after the second switch unit and the fourth switch unit are turned off, instructs the charger to increase the voltage.
[0042] In this way, when the external interface is connected to a fast charging charger, the second switch unit and the fourth switch unit are turned off to prevent the possible high voltage direct current from burning out the communication chip and the fast charging chip.
[0043] In a possible implementation, if the charging type of the charger is not fast charging, the electronic device controls the first switch unit, the second switch unit, the third switch unit and the fourth switch unit to be turned on.
[0044] In this way, when the charger connected to the external interface is not a fast charging charger, the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are turned on to achieve communication between the charger and the communication unit.
[0045] In a possible implementation, the electronic device further includes a fast charging chip, a tenth resistor, and an eleventh resistor;
[0046] One pin of the fast charging chip is connected between the first data transmission pin and the first switch unit through a tenth resistor, and another pin of the fast charging chip is connected between the second data transmission pin and the third switch unit through an eleventh resistor;
[0047] The fast charging chip is used to communicate with the fast charging charger when the external interface is connected to the fast charging charger.
[0048] In this way, the current limiting effect of the tenth resistor and the eleventh resistor can reduce the possibility of the fast charging chip being burned out by high-voltage direct current.
[0049] In a possible implementation, it further includes a first voltage clamping module and a second voltage clamping module;
[0050] The first voltage clamping module is connected between the first data transmission pin and the ground terminal, and the second voltage clamping module is connected between the second data transmission pin and the ground terminal.
[0051] In this way, the voltage of static electricity and / or surge transmitted to the fast charging chip can be lower than the maximum tolerance voltage of the fast charging chip, and the voltage of static electricity and / or surge transmitted to the communication unit can be lower than the maximum tolerance voltage of the communication unit.
[0052] In a possible implementation, it further includes a third voltage clamping module and a fourth voltage clamping module;
[0053] One end of the third voltage clamping module is connected between the second switch unit and the communication unit, and the other end of the third voltage clamping module is grounded; one end of the fourth voltage clamping module is connected between the fourth switch unit and the communication unit, and the other end of the fourth voltage clamping module is grounded;
[0054] The clamping voltage of the third voltage clamping module is lower than the clamping voltage of the first voltage clamping module, and the clamping voltage of the fourth voltage clamping module is lower than the clamping voltage of the second voltage clamping module.
[0055] In this way, the voltage of static electricity and / or surge transmitted to the fast charging chip can be lower than the maximum tolerance voltage of the fast charging chip, and the voltage of static electricity and / or surge transmitted to the communication unit can be lower than the maximum tolerance voltage of the communication unit.
[0056] In a possible implementation, a current limiting unit is further included; the current limiting unit includes a resistor, an inductor, or a resistor and an inductor connected in series;
[0057] The current limiting unit is connected between the second switch unit and the communication unit; the current limiting unit is also connected between the fourth switch unit and the communication unit.
[0058] In this way, high-voltage direct current, static electricity and surges can be divided and current limited, so that the fast charging chip and the communication unit are not damaged by any of the high-voltage direct current, static electricity and surges transmitted to the fast charging chip and the communication unit.
[0059] In a possible implementation, a filtering unit is further included; the filtering unit is connected between the second switch unit and the communication unit; and the filtering unit is also connected between the fourth switch unit and the communication unit.
[0060] In this way, high-voltage direct current, static electricity and surges can be divided and current limited, so that the fast charging chip and the communication unit are not damaged by any of the high-voltage direct current, static electricity and surges transmitted to the fast charging chip and the communication unit.
[0061] In a possible implementation manner, the method further includes a second audio branch, wherein the second audio branch includes an eighth switch unit;
[0062] The eighth switch unit is connected between the second data transmission pin and the audio processing unit of the electronic device;
[0063] When the external interface is connected to an analog headset, the eighth switch unit is turned on, so that communication is achieved between the second data transmission pin and the audio processing unit.
[0064] In this way, when the external interface is connected to an analog headset, communication between the second data transmission pin and the audio processing unit can be achieved through the second audio branch.
[0065] In a second aspect, an embodiment of the present application provides a control method, which is applied to the electronic device as described in the first aspect, and the method includes:
[0066] When the external interface is connected to a charger, determine whether the charging type of the charger is fast charging;
[0067] If the charging type of the charger is fast charging, the second switch unit and the fourth switch unit are controlled to be turned off, and after the second switch unit and the fourth switch unit are turned off, the charger is instructed to increase the voltage.
[0068] In this way, when the external interface is connected to a fast charging charger, the second switch unit and the fourth switch unit are turned off to prevent the possible high voltage direct current from burning out the communication chip and the fast charging chip.
[0069] In a possible implementation, the method further includes: if the charging type of the charger is not fast charging, controlling the first switch unit, the second switch unit, the third switch unit, and the fourth switch unit to be turned on.
[0070] In this way, when the charger connected to the external interface is not a fast charging charger, the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are turned on to achieve communication between the charger and the communication unit.
[0071] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
[0072] Memory stores computer-executable instructions;
[0073] The processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the method of the second aspect.
[0074] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the second aspect is implemented.
[0075] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method of the second aspect.
[0076] In a sixth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute a method as in the second aspect.
[0077] It should be understood that the third to sixth aspects of the present application correspond to the technical solutions of the second aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 A schematic diagram of a scenario provided for an embodiment of the present application;
[0079] Figure 2 A schematic diagram of a Type-C interface of an electronic device provided in an embodiment of the present application;
[0080] Figure 3 is a schematic diagram of a switching circuit of the electronic device 100 in a possible implementation;
[0081] Figure 4 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 1 ;
[0082] Figure 5 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 2 ;
[0083] Figure 6 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 3 ;
[0084] Figure 7Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 4 ;
[0085] Figure 8 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 5 ;
[0086] Fig. 9 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 6 ;
[0087] Fig.10 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 7 ;
[0088] Fig.11 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 8 ;
[0089] Fig.12 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 9 ;
[0090] Fig.13 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 ;
[0091] Fig.14 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 one;
[0092] Fig.15 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 two;
[0093] Fig.16 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 three;
[0094] Fig.17 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 Four;
[0095] Fig.18 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 five;
[0096] Fig.19 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;
[0097] Fig. 20 A software structure block diagram of the electronic device 100 provided in an embodiment of the present application;
[0098] Fig.21 A flow chart of a control method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0099] In order to clearly describe the technical solutions of the embodiments of the present application, some technical terms and techniques involved in the embodiments of the present application are briefly introduced below.
[0100] 1. Common mode inductor
[0101] The common mode inductor may also be called a common mode choke. The common mode inductor may include a magnetic core and at least two windings. The at least two windings are wound on the same magnetic core. The common mode inductor may be used to filter electromagnetic interference signals.
[0102] For example, a common-mode inductor includes two windings, the two windings include a first winding and a second winding. Due to the influence of the process, there may be a certain difference in the impedance of the first winding and the second winding. Therefore, the maximum voltage that the first winding and the second winding of the common-mode inductor can withstand may be different. For example, the impedance of the first coil may be 1Ω greater than the impedance of the second coil, the maximum voltage that the first coil can withstand may be 10V, and the maximum voltage that the second coil can withstand may be 9.2V.
[0103] 2. Transient voltage suppression diode (TVS)
[0104] TVS diodes can also be called transient voltage suppressors or avalanche breakdown diodes. When the circuit is working normally, the TVS diode does not work and is in the cut-off state (high resistance state). When an abnormal overvoltage occurs in the circuit and the voltage value reaches the breakdown voltage of the TVS diode, the TVS diode can suddenly change from a high resistance state to a low resistance state, that is, the TVS diode is turned on. The instantaneous overcurrent caused by the abnormal overvoltage can flow to the ground terminal through the TVS diode. At the same time, the TVS diode can clamp the voltage at a lower voltage value to protect the subsequent circuit.
[0105] 3. Electronic equipment
[0106] The electronic device of the embodiment of the present application may be any form of electronic device. For example, the electronic device may include a handheld device, a vehicle-mounted device, etc. with an image processing function. For example, some electronic devices are: mobile phones, tablet computers, PDAs, laptop computers, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, electronic devices in 5G networks or future evolved public land mobile communication networks (public land mobile The electronic devices in the network (PLMN) and the like are not limited to this in the embodiments of the present application.
[0107] As an example but not limitation, in the embodiments of the present application, the electronic device may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also powerful functions achieved through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include full-featured, large-sized, and fully or partially independent of smartphones, such as smart watches or smart glasses, as well as devices that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
[0108] In addition, in the embodiments of the present application, the electronic device may also be an electronic device in an Internet of Things (IoT) system. IoT is an important part of the future development of information technology. Its main technical feature is to connect objects to the network through communication technology, thereby realizing an intelligent network that interconnects people and machines and things.
[0109] The electronic devices in the embodiments of the present application may also be referred to as: terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or user device, etc.
[0110] 4. In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0111] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0112] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0113] Figure 1 A schematic diagram of a scenario provided in an embodiment of the present application. In order to enable an electronic device to be connected to an external device, the electronic device may include: Figure 1The external interface shown. External devices such as chargers, analog headphones (with 3.5mm headphone jack) or other electronic devices.
[0114] Other electronic devices, such as electronic devices without a charging function, may include a fast charging charger and a non-fast charging charger.
[0115] like Figure 1 As shown, the scenario may include an electronic device 100, a charger 101 and a charging cable 102. The electronic device 100 and the charger 101 may be connected via the charging cable 102. Both the electronic device 100 and the charging cable 102 are provided with an external interface. The external interface may be a universal serial bus (USB) interface.
[0116] In the embodiment of the present application, an external interface is taken as an example of a universal serial bus Type-C (universal serial bus Type-C, USB Type-C) interface (hereinafter referred to as Type-C interface). The charger 101 can be connected to the Type-C interface on the electronic device 100 through the Type-C interface on the charging cable 102 to charge the electronic device, wherein the Type-C interface on the charging cable 102 can be called a Type-C male head, and the Type-C interface on the electronic device 100 can be called a Type-C female head.
[0117] It should be understood that Figure 1 The Type-C interface of the electronic device shown in the figure is only an example and does not limit the form of the external interface of the electronic device 100 in the present application. In addition, the charger and charging cable in the embodiment of the present application can also be replaced by other external devices connected to the electronic device, and the external device can be connected to the electronic device through the Type-C interface.
[0118] For example, Figure 2 A schematic diagram of a Type-C interface of an electronic device 100 is shown.
[0119] like Figure 2 As shown in the figure, the Type-C interface includes 24 pins, namely A1-A12 and B1-B12. Because the functions of A1-A12 and B1-B12 are similar, the following takes pins A1-A12 as an example to explain the function of each pin.
[0120] Pins A1 and A12: Ground pins, also called GND pins.
[0121] Pins A2 and A3: data transmission pins, also known as TX1+ pin and TX1- pin, can be used for compatibility with USB3.0 and USB3.1.
[0122] Pins A4 and A9: connected to the power supply module in the terminal device so that the terminal device can power the Type-C interface, that is, the terminal device provides VBUS for the Type-C interface, also known as the VBUS pin.
[0123] Pin A5: External device detection pin, also known as CC1 pin, used to detect the type of external device, where the type of external device may include: downstream facing port (DFP) device and upstream facing port (UFP) device.
[0124] Pins A6 and A7: Data transmission pins, also known as D+ and D- pins, are used to transmit audio and video streams or files. Electronic devices can also output voltage signals to the charger through the D+ and D- pins based on the fast charging protocol. The USB decoding chip built into the charger can determine the voltage that the charger needs to output based on the voltage signal to quickly charge the electronic device. In normal charging mode (not using fast charging), the charging voltage transmitted by the above VBUS pin is generally not more than 5V. In fast charging mode, the charging voltage transmitted can be as high as 20V.
[0125] In the embodiment of the present application, the D+ pin may also be referred to as a first data transmission pin, and the D- pin may also be referred to as a second data transmission pin.
[0126] Pins A6 and A7 can be used for compatibility with USB2.0.
[0127] Pin A8: Function expansion pin, also known as SBU1 pin.
[0128] Pins A10 and A11: data receiving pins, also known as RX2+ pin and RX2- pin, can be used for compatibility with USB3.0 and USB3.1.
[0129] The functions of B1-B12 correspond to A1-A12, and will not be repeated here. B1-B12 can be called: GND, TX2+, TX2-, VBUS, CC2, D+, D-, SBU2, VBUS, RX1+, RX1-, GND respectively.
[0130] Pins A1-A12 correspond to the A-layer gold fingers, and pins B1-B12 correspond to the B-layer gold fingers. Figure 2 It can be seen that the A-layer gold finger and the B-layer gold finger are asymmetric at CC1, SBU2, CC2 and SBU1, and the signals are symmetric at other places.
[0131] In the electronic device, the external interface is connected to the switching circuit of the analog headset and the USB, so that when the charger is connected to the external interface of the electronic device, the charger charges the electronic device, and when the analog headset is connected to the external interface of the electronic device, the analog headset communicates with the electronic device.
[0132] In the embodiment of the present application, the switching circuit between the analog headset and the USB may be referred to as a switching circuit.
[0133] Figure 3 FIG. 1 is a schematic diagram showing a switching circuit of the electronic device 100 in a possible implementation. Figure 3 The external interface 201 is shown. Figure 3 As shown, the switching circuit connected to the external interface 201 includes a first switch unit 202, a third switch unit 203, a first audio branch, and a second audio branch. The first switch unit 202 is connected between the D+ pin of the external interface 201 and the communication unit 208 of the electronic device 100. The first switch unit 202 can also be connected between the D+ pin of the external interface 201 and the fast charging chip 209 of the electronic device 100. The third switch unit 203 is connected between the D- pin of the external interface 201 and the communication unit 208 of the electronic device 100. The third switch unit 203 can also be connected between the D- pin of the external interface 201 and the fast charging chip 209 of the electronic device 100. The first audio branch is connected between the D+ pin of the external interface 201 and the audio processing unit 207 of the electronic device 100. The second audio branch is connected between the D- pin of the external interface 201 and the audio processing unit 207 of the electronic device 100.
[0134] The communication unit 208 may include a system on chip (SoC). The audio processing unit 207 may include an audio processing chip.
[0135] When the external interface 201 is connected to the analog earphone, the first switch unit 202 and the third switch unit 203 are turned off, and the analog earphone communicates with the audio processing unit 207 through the first audio branch and the second audio branch.
[0136] When the external interface 201 is connected to other electronic devices, the first switch unit 202 and the third switch unit 203 are turned on, and the other electronic devices communicate with the communication unit 208 .
[0137] When the external interface 201 is connected to the fast charging charger, the first switch unit 202 and the third switch unit 203 are turned on, and the fast charging charger communicates with the fast charging chip 209 to instruct the fast charging charger to boost the voltage and fast charge the electronic device.
[0138] However, if the VBUS pin of the external interface 201 is corroded, the VBUS pin is connected to the D+ pin and / or the D- pin, and the high-voltage DC boosted and output by the fast-charge charger will be transmitted to the fast-charge chip 209 and the communication unit 208 through the D+ pin and / or the D- pin. The high-voltage DC will burn out the fast-charge chip 209 and / or the communication unit 208, and then the electronic device 100 cannot be fast-charged, and / or the electronic device 100 cannot communicate with other electronic devices through the external interface.
[0139] In view of this, an embodiment of the present application provides an electronic device, by setting a second switch unit between a first switch unit and a fast charging chip, or between the first switch unit and a communication unit, and setting a fourth switch unit between a third switch unit and a fast charging chip, or between the third switch unit and the communication unit, when an external interface is connected to a charger, turning off the second switch unit and the fourth switch unit can reduce the probability of the fast charging chip and / or the communication unit being burned out by high-voltage direct current, thereby reducing the probability of the electronic device being unable to fast charge, and / or the electronic device being unable to communicate with other electronic devices through an external interface.
[0140] The electronic device, control method and related devices provided in the embodiments of the present application are described below in combination with some embodiments.
[0141] Figure 4 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 1 .
[0142] like Figure 4 As shown, the electronic device 100 includes an external interface 201, a first switch unit 202, a second switch unit 211, a third switch unit 203, a fourth switch unit 212, a first audio branch, a second audio branch, an audio processing unit 207, a communication unit 208 and a fast charging chip 209. The external interface 201 includes a first data transmission pin and a second data transmission pin.
[0143] The first data transmission pin and the second data transmission pin may both be pins used for communication in an external interface. For example, in a Type-C interface, the first data transmission pin may include a D+ pin, and the second data transmission pin may include a D- pin.
[0144] The audio processing unit 207 may include an audio processing chip.
[0145] The communication unit 208 may include a system on chip (SoC) chip.
[0146] The first switch unit 202 is connected between the second switch unit 211 and the first data transmission pin.
[0147] The third switch unit 203 is connected between the fourth switch unit 212 and the second data transmission pin.
[0148] The second switch unit 211 and the fourth switch unit 212 are both connected to the communication unit 208 of the electronic device 100 .
[0149] The first audio branch is connected between the first data transmission pin and the audio processing unit 207 .
[0150] The second audio branch is connected between the second data transmission pin and the audio processing unit 207 .
[0151] When the first switch unit 202 and the third switch unit 203 are both turned on, the first data transmission pin and the second data transmission pin serve as a USB interface.
[0152] Exemplarily, when the external interface 201 is connected to another electronic device, the communication unit 208 may control the first switch unit 202 and the third switch unit 203 to be turned on, so that the other electronic device communicates with the communication unit 208 .
[0153] When the external interface 201 is connected to the charger, the charger can provide a conduction voltage to the first switch unit 202 and the third switch unit 203 through the VBUS pin of the external interface 201, so that the first switch unit 202 and the third switch unit 203 are turned on, thereby realizing communication between the charger and the fast charging chip 209, or realizing communication between the charger and the communication unit 208.
[0154] Exemplarily, if the charger is a fast charging charger, when the external interface 201 is connected to the fast charging charger, the fast charging charger can provide a turn-on voltage to the first switch unit 202 and the third switch unit 203 through the VBUS pin of the external interface 201, so that the first switch unit 202 and the third switch unit 203 are turned on, thereby realizing communication between the fast charging charger and the fast charging chip 209.
[0155] If the charger is a non-fast charging charger, when the external interface 201 is connected to the non-fast charging charger, the non-fast charging charger can provide a conduction voltage to the first switch unit 202 and the third switch unit 203 through the VBUS pin of the external interface 201, so that the first switch unit 202 and the third switch unit 203 are turned on, thereby realizing communication between the non-fast charging charger and the communication unit 208.
[0156] It is understandable that a non-fast charging charger can also be expanded to include electronic devices with non-fast charging functions, such as laptops, PDAs, computers, etc.
[0157] When other electronic devices or non-fast charging chargers communicate with the communication unit 208, and / or when the fast charging charger communicates with the fast charging chip 209, the first data transmission pin and the second data transmission pin are used as USB interfaces for data transmission.
[0158] When the first switch unit 202 and the third switch unit 203 are both turned off, the first data transmission pin and the second data transmission pin serve as a headphone interface.
[0159] For example, Figure 4 As shown, the first audio branch includes a sixth switch unit 204 and a seventh switch unit 205. The second audio branch includes an eighth switch unit 206.
[0160] The sixth switch unit 204 is connected between the ground terminal and the control terminal of the first switch unit 202 , and the control terminals of the first switch unit 202 , the second switch unit 211 , the third switch unit 203 and the fourth switch unit 212 are connected.
[0161] When the external interface 201 is connected to an analog headset, the sixth switch unit 204 is turned on, so that the first switch unit 202 , the second switch unit 211 , the third switch unit 203 and the fourth switch unit 212 are all turned off.
[0162] The seventh switch unit 205 is connected between the first data transmission pin and the audio processing unit 207 of the electronic device 100. When the external interface 201 is connected to an analog headset, the seventh switch unit 205 is turned on, so that the first data transmission pin and the audio processing unit 207 can communicate with each other, and the analog headset can communicate with the audio processing unit 207 through the first audio branch.
[0163] The eighth switch unit 206 is connected between the second data transmission pin and the audio processing unit 207 of the electronic device 100. When the external interface 201 is connected to an analog headset, the eighth switch unit 206 is turned on, so that the second data transmission pin and the audio processing unit 207 can communicate with each other, and the analog headset can communicate with the audio processing unit 207 through the second audio branch.
[0164] When the analog earphone communicates with the audio processing unit 207 through the first audio branch and the second audio branch, the first data transmission pin and the second data transmission pin are used as earphone interfaces for data transmission.
[0165] The electronic device 100 is used to control the second switch unit 211 and the fourth switch unit 212 to be turned off when the external interface 201 of the electronic device 100 is connected to a charger.
[0166] For example, Figure 4As shown, the electronic device further includes a fifth switch unit 213. The fifth switch unit 213 is connected between the ground terminal and the control terminal of the second switch unit 211, and the control terminal of the second switch unit 211 is connected to the control terminal of the fourth switch unit 212.
[0167] In order to prevent high-voltage direct current from being transmitted to the fast-charge chip 209 and the communication unit 208 through the D+ pin and / or the D- pin, thereby burning out the fast-charge chip 209 and the communication unit 208, when the external interface 201 is connected to a charger, the electronic device 100 can control the fifth switch unit 213 to be turned on, so that the second switch unit 211 and the fourth switch unit 212 are both turned off. Exemplarily, the electronic device 100 can identify whether the electronic device connected to the external interface is a charger through the CC1 pin and / or the CC2 pin of the external interface 201.
[0168] Alternatively, if Figure 4 As shown, a sixth resistor R6 is set between the control end of the first switch unit 202 and the control end of the second switch unit 211, so that when the fifth switch unit 213 is turned on, the second switch unit 211 and the fourth switch unit 212 are turned off without turning off the first switch unit 202 and the third switch unit 203.
[0169] The fast charging chip 209 is used to communicate with the fast charging charger when the external interface 201 is connected to the fast charging charger. If one pin of the fast charging chip 209 is connected between the second switch unit 211 and the communication unit 208, and another pin of the fast charging chip 209 is connected between the fourth switch unit 212 and the communication unit 208, when the second switch unit 211 and the fourth switch unit 212 are both turned off, the fast charging chip 209 cannot communicate with the fast charging charger through the D+ pin and the D- pin of the external interface 201.
[0170] In this regard, Figure 4As shown, the electronic device 100 also includes a fourth resistor R4 and a fifth resistor R5. One pin of the fast charging chip 209 is connected between the first switch unit 202 and the second switch unit 211 through the fourth resistor R4. Another pin of the fast charging chip 209 is connected between the third switch unit 203 and the fourth switch unit 212 through the fifth resistor R5. In this way, when the second switch unit 211 and the fourth switch unit 212 are both turned off, the fast charging chip 209 can also communicate with the fast charging charger through the D+ pin and the D- pin of the external interface 201. Since the fourth resistor R4 and the fifth resistor R5 can divide the high-voltage DC, the current limiting effect of the fourth resistor R4 and the fifth resistor R5 can prevent the fast charging chip 209 from being burned by the high-voltage DC flowing through the D+ pin and / or the D- pin. Exemplarily, the fourth resistor R4 and the fifth resistor R5 can be kilo-ohm resistors, for example, the fourth resistor R4 and the fifth resistor R5 can be 1KΩ resistors.
[0171] As described above, in order to realize that the first data transmission pin and the second data transmission pin are used as USB interfaces for data transmission, the first switch unit 202 and the third switch unit 203 need to be turned on. Figure 5 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 2 .like Figure 5 As shown, in Figure 4 On the basis of, the electronic device 100 further includes a power management unit (power management unit, PMU) 210 and a sixth resistor R6.
[0172] The sixth resistor R6 is connected between the power management unit 210 and the control terminal of the second switch unit 211 .
[0173] A control end of the second switch unit 211 is connected to a control end of the fourth switch unit 212 .
[0174] The power management unit 210 is also connected to the control end of the first switch unit 202 and the control end of the third switch unit 203;
[0175] The power management unit 210 is used to control the first switch unit 202 and the third switch unit 203 to be turned on when the external interface 201 of the electronic device 100 is connected to a charger.
[0176] Exemplarily, the VBUS pin on the external interface 201 is connected to the power management unit 210. When the external interface 201 is connected to a charger, the charger provides a voltage to the VBUS pin on the external interface 201, and the voltage on the VBUS pin is converted into a turn-on voltage for turning on the first switch unit 202 and the third switch unit 203 through the power management unit 210, so that the first switch unit 202 and the third switch unit 203 are turned on.
[0177] In order to stabilize the on-state voltage transmitted from the power management unit 210 to the control end of the first switch unit 202 and the control end of the third switch unit 203, as shown in FIG. Figure 5 As shown, in Figure 4 On the basis of, the electronic device 100 further includes a third capacitor C3. One end of the third capacitor C3 is connected between the power management unit 210 and the control end of the first switch unit 202. The other end of the third capacitor C3 is grounded.
[0178] Optionally, in order to reduce the influence of the voltage of the control end of the first switch unit 202 and the control end of the third switch unit 203 on the power management unit 210 when the first switch unit 202 and the third switch unit 203 are turned off, as shown in FIG. Figure 5 As shown, in Figure 4 On the basis of the present invention, the electronic device 100 further includes a seventh resistor R7. One end of the seventh resistor R7 is connected to the power management unit 210. The other end of the seventh resistor R7 is connected to the control end of the first switch unit 202, and the other end of the seventh resistor R7 is also connected to the control end of the third switch unit 203. The seventh resistor R7 can block the turned-off first switch unit 202 and the third switch unit 203 from pulling down the voltage at one end of the power management unit 210.
[0179] Alternatively, if Figure 5 As shown, in Figure 4 On the basis of, the electronic device 100 also includes an eighth resistor R8 and / or a ninth resistor R9. The control end of the first switch unit 202 is connected to the other end of the seventh resistor R7 through the eighth resistor R8, and the control end of the third switch unit 203 is connected to the other end of the seventh resistor R7 through the ninth resistor R9. In this way, when the external interface 201 is connected to the charger, the voltage provided by the charger to the VBUS pin is converted into a turn-on voltage for turning on the first switch unit 202 and the third switch unit 203 through the power management unit 210, so that the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212 are all turned on, so that the communication unit 208 can communicate with the charger. Exemplarily, when the charger is a non-fast charging charger, the communication unit 208 can communicate with the non-fast charging charger.
[0180] In one possible scenario, electrostatic discharge (ESD), surge, and other events may occur at the external interface 201 of the electronic device 100, causing the voltage of the D+ pin and the D- pin of the external interface 201 to be too large. When the electronic device 100 is connected to a high-power electronic device through the external interface 201, surges are easily generated at the external interface 201. Both static electricity and surges may damage the communication unit 208 and the fast charging chip 209.
[0181] In this regard, Figure 6 The switching circuit of the electronic device 100 provided in the embodiment of the present application is shown in FIG. Figure 3 . Figure 7 The switching circuit of the electronic device 100 provided in the embodiment of the present application is shown in FIG. Figure 4 .
[0182] like Figure 6 As shown, in Figure 5 On the basis of, the electronic device 100 further includes a first voltage clamping module 214 and a second voltage clamping module 215 .
[0183] The first voltage clamp module 214 is connected to the first data transmission pin (such as Figure 7 between the D+ pin shown) and ground.
[0184] The second voltage clamp module 215 is connected to the second data transmission pin (such as Figure 7 between the D- pin shown) and ground.
[0185] In this way, the electrostatic voltage and / or surge voltage transmitted to the communication unit 208 can be lower than the maximum tolerance voltage of the communication unit 208; the electrostatic voltage and / or surge voltage transmitted to the fast charging chip 209 can also be lower than the maximum tolerance voltage of the fast charging chip 209.
[0186] Alternatively, if Figure 7 As shown, in Figure 6 On the basis of the present invention, the electronic device 100 not only includes the first voltage clamping module 214 and the second voltage clamping module 215 , but also includes the third voltage clamping module 216 and the fourth voltage clamping module 217 .
[0187] The first voltage clamp module 214 is connected to the first data transmission pin (such as Figure 8 between the D+ pin shown) and ground.
[0188] The second voltage clamp module 215 is connected to the second data transmission pin (such as Figure 8 between the D- pin shown) and ground.
[0189] One end of the third voltage clamping module 216 is connected between the second switch unit 211 and the communication unit 208 , and the other end of the third voltage clamping module 216 is grounded.
[0190] One end of the fourth voltage clamping module 217 is connected between the fourth switch unit 212 and the communication unit 208 , and the other end of the fourth voltage clamping module 217 is grounded.
[0191] The clamping voltage of the third voltage clamping module 216 is lower than the clamping voltage of the first voltage clamping module 214 . The clamping voltage of the fourth voltage clamping module 217 is lower than the clamping voltage of the second voltage clamping module 215 .
[0192] The higher the clamping voltage of the voltage clamping module, the less likely it is to be damaged by high voltage DC. Figure 8 In the illustrated embodiment, if the maximum withstand voltage of the communication unit 208 is 6.5V, the clamping voltage of the first voltage clamping module 214 and the clamping voltage of the second voltage clamping module 215 may both be 20V, and the clamping voltage of the third voltage clamping module 216 and the clamping voltage of the fourth voltage clamping module 217 may be 6V.
[0193] In this way, the electrostatic voltage and / or surge voltage transmitted to the communication unit 208 can be lower than the maximum tolerance voltage of the communication unit 208; the electrostatic voltage and / or surge voltage transmitted to the fast charging chip 209 can also be lower than the maximum tolerance voltage of the fast charging chip 209.
[0194] Furthermore, in order to divide the static electricity and surge voltage so that the communication unit 208 is not damaged by the static electricity and / or surge, as shown in FIG. Figure 8 As shown, in Figure 7 On the basis of, the electronic device 100 may further include a current limiting unit 218. The current limiting unit 218 includes a resistor, an inductor, or a resistor and an inductor connected in series.
[0195] The current limiting unit 218 is connected between the second switch unit 211 and the communication unit 208. The current limiting unit 218 is also connected between the fourth switch unit 212 and the communication unit 208.
[0196] Alternatively, if Figure 8 As shown, in Figure 7 On the basis of, the electronic device 100 may further include a filtering unit 219. The filtering unit is such as a common mode inductor, an LC filter, etc. The filtering unit 219 is connected between the second switch unit 211 and the communication unit 208. The filtering unit 219 is also connected between the fourth switch unit 212 and the communication unit 208. Similarly, the filtering unit 219 also has a voltage dividing function, which can divide the static electricity and surge, so that the communication unit 208 is not damaged by the static electricity and / or surge.
[0197] like Fig. 9 As shown, in Figure 8 On the basis of, the first audio branch further includes: a first magnetic bead B1, a second magnetic bead B2, a third magnetic bead B3, a first resistor R1, a second resistor R2, a third resistor R3, a first capacitor C1 and a second capacitor C2.
[0198] One end of the first magnetic bead B1 is connected to the first data transmission pin (or D+ pin), and the other end of the first magnetic bead B1 is connected to one end of the seventh switch unit 205 and one end of the first resistor R1; the control end of the seventh switch unit 205 is connected to the second resistor R2, and the other end of the seventh switch unit 205 is connected to the audio processing unit 207 through the second magnetic bead B2; the first capacitor C1 is connected between the control end of the seventh switch unit 205 and the other end of the seventh switch unit 205; the other end of the first resistor R1 is connected to one end of the third resistor R3 and one end of the third magnetic bead B3; the other end of the third resistor R3 is connected to the audio processing unit 207 through the second magnetic bead B2. The other end of the third magnetic bead B3 is connected to the control end of the first switch unit 202 through the second capacitor C2.
[0199] The first magnetic bead B1 and the third magnetic bead B3 are used to block the D+ pin and the D- pin as a USB interface and transmit data, and the high-frequency signal corresponding to the transmitted data is transmitted to the seventh switch unit 205 and the first resistor R1. The first magnetic bead B1 and the third magnetic bead B3 are also used to pass low-frequency signals. Audio signals are usually low-frequency signals.
[0200] The second magnetic bead B2 is used for noise reduction of the audio signal and voltage division of static electricity.
[0201] The first resistor R1 , the second resistor R2 , and the third resistor R3 can all divide the voltage of static electricity and surge, so that the audio processing unit 207 is not damaged by static electricity and / or surge.
[0202] The first capacitor C1 is used to prevent a signal corresponding to the audio data from being transmitted to the control end of the seventh switch unit 205 when the first audio branch transmits audio data.
[0203] The second capacitor C2 is used to block the audio signal to reduce the influence of the positive pressure and negative pressure of the audio signal on the first switch unit 202 and the third switch unit 203 .
[0204] Similarly, if Fig. 9 As shown, in Figure 8 On the basis of, the second audio branch further includes: a fourth magnetic bead B4, a fifth magnetic bead B5, a sixth magnetic bead B6, a twelfth resistor R12, a thirteenth resistor R13, a fourteenth resistor R14, a fourth capacitor C4 and a fifth capacitor C5.
[0205] One end of the fourth magnetic bead B4 is connected to the second data transmission pin (or D-pin), and the other end of the fourth magnetic bead B4 is connected to one end of the eighth switch unit 206 and one end of the twelfth resistor R12; the control end of the eighth switch unit 206 is connected to the thirteenth resistor R13, and the other end of the eighth switch unit 206 is connected to the audio processing unit 207 through the fifth magnetic bead B5; the fourth capacitor C4 is connected between the control end of the eighth switch unit 206 and the other end of the eighth switch unit 206; the other end of the twelfth resistor R12 is connected to one end of the fourteenth resistor R14 and one end of the sixth magnetic bead B6; the other end of the fourteenth resistor R14 is connected to the audio processing unit 207 through the fifth magnetic bead B5. One end of the sixth magnetic bead B6 is connected to the control end of the third switch unit 203 through the fifth capacitor C5.
[0206] The fourth magnetic bead B4 and the sixth magnetic bead B6 are used to block the D+ pin and the D- pin as a USB interface and transmit data, and the high-frequency signal corresponding to the transmitted data is transmitted to the eighth switch unit 206 and the twelfth resistor R12. The fourth magnetic bead B4 and the sixth magnetic bead B6 are also used to pass low-frequency signals. Audio signals are usually low-frequency signals.
[0207] The fifth magnetic bead B5 is used for noise reduction of audio signals and voltage division of static electricity.
[0208] The twelfth resistor R12 , the thirteenth resistor R13 , and the fourteenth resistor R14 can all divide the static electricity and surge, so that the audio processing unit 207 is not damaged by the static electricity and / or surge.
[0209] The fourth capacitor C4 is used to prevent a signal corresponding to the audio data from being transmitted to the control end of the eighth switch unit 206 when the first audio branch transmits audio data.
[0210] The fifth capacitor C5 is used to block the audio signal to reduce the influence of the positive pressure and negative pressure of the audio signal on the first switch unit 202 and the third switch unit 203.
[0211] Optionally, the first switch unit 202, the second switch unit 211, the third switch unit 203, the fourth switch unit 212, the fifth switch unit 213, the sixth switch unit 204, the seventh switch unit 205 and the eighth switch unit 206 can all be constructed by field effect devices, and can also be constructed by other switching devices that can turn the circuit on or off. The embodiments of the present application do not impose specific restrictions on this.
[0212] The field effect device may include: a single metal oxide semiconductor field effect transistor (MOSFET), a plurality of MOSFETs that jointly realize a switching function, etc. The MOSFET may be an N-type field effect transistor (negative channel MOS, NMOS) or a P-type field effect transistor (positive channel MOS, PMOS).
[0213] Fig.10 The switching circuit of the electronic device 100 provided in the embodiment of the present application is shown in FIG. Figure 7 The following combination Fig.10 ,exist Fig. 9 Based on the embodiment, the electronic device 100 provided by the embodiment of the present application is described by taking the first switch unit 202, the second switch unit 211, the third switch unit 203, the fourth switch unit 212, the fifth switch unit 213, the sixth switch unit 204, the seventh switch unit 205 and the eighth switch unit 206, all of which are single MOSFETs. MOSFET includes a gate terminal (gate, G), a source terminal (source, S) and a drain terminal (drain, D). The gate terminal (gate, G) can be called a control terminal.
[0214] The first switch unit 202 is Fig.10 The second switch unit 211 is as shown in Fig.11 The third switch unit 203 is as shown in FIG. Fig.11 The fourth switch unit 212 is as shown in M3. Fig.11 The fifth switch unit 213 is as shown in FIG. Fig.11 The sixth switch unit 204 is as shown in M5. Fig.10 The seventh switch unit 205 is as shown in M6. Fig.10 The eighth switch unit 206 is as shown in M7. Fig.10 M8 shown.
[0215] The drain end of M1 is connected to the drain end of M2, and the drain end of M3 is connected to the drain end of M4. In this way, when M1 and M3 are turned off, the leakage current of M1 and M3 can be prevented from being transmitted to the communication unit 208, which will adversely affect the operation of the communication unit 208.
[0216] Exemplarily, M1, M2, M3 and M4 are all NMOS. M5, M6, M7 and M8 are all NMOS.
[0217] When the external interface 201 is connected to an analog headset, the voltages of the M6 control terminal, the M7 control terminal and the M8 control terminal are all pulled up, and M6, M7 and M8 are all turned on. Since one end of M6 is grounded, when M6 is turned on, the voltages of the M1 control terminal and the M3 control terminal are all pulled down, and M1 and M3 are turned off.
[0218] The communication unit 208 may be a SoC chip.
[0219] When the external interface 201 is connected to a fast charging charger, the SoC chip of the electronic device 100 can pull up the general purpose input / output port voltage (GPIO), thereby pulling up the voltage of the M5 control terminal, so that M5 is turned on. Since one end of M5 is grounded, when M5 is turned on, the voltage of the M2 control terminal and the voltage of the M4 control terminal are both pulled down, and M2 and M4 are turned off.
[0220] Alternatively, if Fig.10 As shown, the first voltage clamping module 214 may include a transient voltage suppression diode (TVS), or may include a plurality of TVSs connected in series. The first voltage clamping module 214 is, for example, TVS1.
[0221] The second voltage clamping module 215 may include one TVS or multiple TVSs connected in series. The second voltage clamping module 215 is, for example, TVS2.
[0222] The third voltage clamping module 216 may include one TVS or multiple TVSs connected in series. The third voltage clamping module 216 is, for example, TVS3.
[0223] The fourth voltage clamping module 217 may include one TVS or multiple TVSs connected in series. The fourth voltage clamping module 217 is, for example, TVS4.
[0224] The current limiting unit 218 may include Fig.10 The filter unit 219 may include a fifteenth resistor R15 and a sixteenth resistor R16. Fig.10 The common mode inductor can include Fig.10 Winding 1 and Winding 2 are shown.
[0225] The fifteenth resistor R15 is connected in series with the winding 1, and is connected between M2 and the SoC chip. The sixteenth resistor R16 is connected in series with the winding 2, and is connected between M4 and the SoC chip.
[0226] Fig.10 The specific implementation principle and technical effect of the embodiment shown are Fig. 9The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0227] Alternatively, if Fig.11 As shown, in Fig.10 Based on the embodiment, one pin of the fast charging chip 209 can be connected between the first switch unit 202 and the D+ pin of the external interface 201 through the tenth resistor R10. Another pin of the fast charging chip 209 is connected between the third switch unit 203 and the D- pin of the external interface 201 through the eleventh resistor R11. Exemplarily, the tenth resistor R10 and the eleventh resistor R11 can be kilo-ohm resistors, for example, the tenth resistor R10 and the eleventh resistor R11 can be 1KΩ resistors.
[0228] The tenth resistor R10 and the eleventh resistor R11 have the same function as Figure 4 The fourth resistor R4 and the fifth resistor R5 shown in the figure have similar functions. Fig.11 The implementation principle and technical effect of the embodiment are Fig.10 The implementation principle and technical effect of the embodiment are similar and will not be described in detail.
[0229] It can also be seen from the above that if the external interface 201 is not connected to a charger, there is no voltage on the VBUS pin of the external interface 201. If in this case, the communication unit 208 does not provide a conduction voltage to the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212, for example, the external interface 201 is not connected to other electronic devices, then the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212 will be in an off state, which can reduce the possibility of the fast charging chip 209 and the communication unit 208 being damaged by high voltage DC, static electricity or surges.
[0230] Next, combine Figure 12-Figure 18 , the electronic device provided in the embodiments of the present application is described.
[0231] Fig.12 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 9 .like Fig.12 As shown, the electronic device 100 includes an external interface 201, a first switch unit 202, a second switch unit 211, a third switch unit 203, a fourth switch unit 212, a first audio branch, a second audio branch, an audio processing unit 207, a communication unit 208, a fast charging chip 209, a sixth resistor R6, a tenth resistor R10 and an eleventh resistor R11. The external interface 201 includes a first data transmission pin and a second data transmission pin. The first audio branch includes a sixth switch unit 204 and a seventh switch unit 205. The second audio branch includes an eighth switch unit 206.
[0232] The first data transmission pin includes a D+ pin. The second data transmission pin includes a D- pin.
[0233] The audio processing unit 207 may include an audio processing chip.
[0234] The communication unit 208 may include a SoC chip.
[0235] The first switch unit 202 is connected between the second switch unit 211 and the first data transmission pin.
[0236] The third switch unit 203 is connected between the fourth switch unit 212 and the second data transmission pin.
[0237] The second switch unit 211 and the fourth switch unit 212 are both connected to the communication unit 208 of the electronic device 100 .
[0238] The sixth switch unit 204 is connected between the ground terminal and the control terminal of the first switch unit 202, and the control terminal of the first switch unit 202, the control terminal of the second switch unit 211, the control terminal of the third switch unit 203 and the control terminal of the fourth switch unit 212 are connected. A sixth resistor R6 is provided between the control terminal of the first switch unit 202 and the control terminal of the second switch unit 211.
[0239] The seventh switch unit 205 is connected between the first data transmission pin and the audio processing unit 207 of the electronic device 100 .
[0240] The eighth switch unit 206 is connected between the second data transmission pin and the audio processing unit 207 of the electronic device 100 .
[0241] One pin of the fast charging chip 209 is connected between the first switch unit 202 and the D+ pin of the external interface 201 through the tenth resistor R10. Another pin of the fast charging chip 209 is connected between the third switch unit 203 and the D- pin of the external interface 201 through the eleventh resistor R11.
[0242] When the external interface 201 is connected to an analog headset, the sixth switch unit 204 is turned on, so that the first switch unit 202 , the second switch unit 211 , the third switch unit 203 and the fourth switch unit 212 are all turned off.
[0243] When an analog headset is connected to the external interface 201 , the seventh switch unit 205 is turned on, so that communication is achieved between the first data transmission pin and the audio processing unit 207 .
[0244] When an analog headset is connected to the external interface 201 , the eighth switch unit 206 is turned on, so that communication is achieved between the second data transmission pin and the audio processing unit 207 .
[0245] When the external interface 201 is connected to a charger, the communication unit 208 of the electronic device 100 can control the sixth switch unit 204 to be turned on, so that the second switch unit 211 and the fourth switch unit 212 are both turned off. Exemplarily, when the external interface 201 is connected to a charger, the communication unit 208 of the electronic device 100 can control the sixth switch unit 204 to be turned on, so that the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212 are all turned off.
[0246] Fig.12 and Figure 4 The differences include: Fig.12 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced.
[0247] Fig.12 The implementation principle and technical effect of the embodiment shown are similar to Figure 4 The implementation principle and technical effect of the embodiment are similar and will not be described in detail.
[0248] Fig.13 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 .like Fig.13 As shown, in Fig.12 On the basis of, the electronic device 100 further includes a power management unit (PMU) 210, a third capacitor C3, a seventh resistor R7, an eighth resistor R8 and a ninth resistor R9.
[0249] Similarly, Fig.13 and Figure 5 The differences include: Fig.13 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.13 The specific implementation principle and technical effect of the embodiment shown are Figure 5 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0250] Fig.14 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 1. As Fig.14 As shown, in Fig.13 On the basis of, the electronic device 100 further includes a first voltage clamping module 214 and a second voltage clamping module 215 .
[0251] Similarly, Fig.14 and Figure 6 The differences include: Fig.14 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.14The specific implementation principle and technical effect of the embodiment shown are Figure 6 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0252] Fig.15 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 2. As Fig.15 As shown, in Fig.14 On the basis of , the electronic device 100 includes not only the first voltage clamping module 214 and the second voltage clamping module 215 , but also the third voltage clamping module 216 and the fourth voltage clamping module 217 .
[0253] Similarly, Fig.15 and Figure 7 The differences include: Fig.15 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.15 The specific implementation principle and technical effect of the embodiment shown are Figure 7 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0254] Fig.16 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 3. As Fig.16 As shown, in Fig.15 On the basis of, the electronic device 100 further includes a current limiting unit 218 and a filtering unit 219.
[0255] Similarly, Fig.16 and Figure 8 The differences include: Fig.14 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.16 The specific implementation principle and technical effect of the embodiment shown are Figure 8 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0256] Fig.17 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 4. Fig.17 As shown, in Fig.16 On the basis of, the first audio branch also includes: a first magnetic bead B1, a second magnetic bead B2, a third magnetic bead B3, a first resistor R1, a second resistor R2, a third resistor R3, a first capacitor C1 and a second capacitor C2. The second audio branch also includes: a fourth magnetic bead B4, a fifth magnetic bead B5, a sixth magnetic bead B6, a twelfth resistor R12, a thirteenth resistor R13, a fourteenth resistor R14, a fourth capacitor C4 and a fifth capacitor C5.
[0257] Similarly, Fig.17 and Fig. 9 The differences include: Fig.14 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.17 The specific implementation principle and technical effect of the embodiment shown are Fig. 9 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0258] Fig.18 Schematic diagram of a switching circuit of an electronic device 100 provided in an embodiment of the present application Figure 10 5. If Fig.18 As shown, in Fig.17 On the basis of, the first switch unit 202, the second switch unit 211, the third switch unit 203, the fourth switch unit 212, the fifth switch unit 213, the sixth switch unit 204, the seventh switch unit 205 and the eighth switch unit 206 can all be constructed by field effect devices, and can also be constructed by other switching devices that can realize conduction or disconnection of the circuit.
[0259] The first switch unit 202 is M1. The second switch unit 211 is M2. The third switch unit 203 is M3. The fourth switch unit 212 is M4. The fifth switch unit 213 is M5. The sixth switch unit 204 is M6. The seventh switch unit 205 is M7. The eighth switch unit 206 is M8. M1, M2, M3 and M4 are all NMOS. M5, M6, M7 and M8 are all NMOS.
[0260] The communication unit 208 is, for example, a SoC chip.
[0261] The first voltage clamping module 214 may include one TVS or multiple TVSs connected in series. The first voltage clamping module 214 is, for example, TVS1.
[0262] The second voltage clamping module 215 may include one TVS or multiple TVSs connected in series. The second voltage clamping module 215 is, for example, TVS2.
[0263] The third voltage clamping module 216 may include one TVS or multiple TVSs connected in series. The third voltage clamping module 216 is, for example, TVS3.
[0264] The fourth voltage clamping module 217 may include one TVS or multiple TVSs connected in series. The fourth voltage clamping module 217 is, for example, TVS4.
[0265] The current limiting unit 218 includes, for example, a fifteenth resistor R15 and a sixteenth resistor R16. The filtering unit 219 includes, for example, a common mode inductor. The common mode inductor includes a winding 1 and a winding 2.
[0266] Alternatively, if Fig.18 As shown, the control end of M6 can also be connected to a seventeenth resistor R17. Through the voltage dividing effect of the seventeenth resistor R17, M6 can be turned on under various control voltages to improve the application range and surge protection capability of M6.
[0267] Similarly, Fig.18 and Fig.10 The differences include: Fig.14 The fifth switch unit 213 is not included. In this way, the consumption of electronic device resources can be reduced. Fig.18 The specific implementation principle and technical effect of the embodiment shown are Fig.10 The specific implementation principles and technical effects of the embodiments are similar and will not be repeated here.
[0268] Optionally, the electronic device 100 is further configured to determine whether the charging type of the charger is fast charging when the external interface 201 is connected to the charger.
[0269] If the charging type of the charger is fast charging, the electronic device 100 controls the second switch unit 211 and the fourth switch unit 212 to be turned off, and after the second switch unit 211 and the fourth switch unit 212 are turned off, instructs the charger to boost the voltage to fast charge the electronic device 100. It can be understood that when the charger fast charges the electronic device 100, the charging voltage provided by the charger can charge the electronic device 100 through a dedicated transmission channel.
[0270] In this way, the high voltage direct current flowing through the D+ pin and the D- pin of the external interface 201 can be prevented from burning the communication unit 208 and the fast charging chip 209, and the fast charging chip 209 can also communicate with the charger during the process of fast charging the electronic device 100.
[0271] If the charging type of the charger is not fast charging, high voltage DC will not appear at the D+ pin and D- pin of the external interface 201, and the electronic device 100 can control the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212 to be turned on, so as to realize the communication between the communication unit 208 and the charger. The charging type of the charger is not fast charging, such as the charger is a laptop, a PDA or a computer.
[0272] In order to better understand the embodiments of the present application, Fig.19 and Fig. 20 , the structure of the electronic device in the embodiment of the present application is described.
[0273] Fig.19 A schematic structural diagram of an electronic device 100 is shown.
[0274] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0275] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0276] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
[0277] Fig. 20 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0278] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0279] The application layer can include a series of application packages.
[0280] like Fig. 20As shown, the application package may include applications such as camera, gallery, game, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0281] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0282] like Fig. 20 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0283] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0284] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0285] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display panel can be composed of one or more views. For example, a display panel including a text notification icon can include a view for displaying text and a view for displaying images.
[0286] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0287] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0288] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0289] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0290] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0291] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0292] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0293] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0294] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0295] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0296] A 2D graphics engine is a drawing engine for 2D drawings.
[0297] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0298] The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.
[0299] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer to capture static images or videos through the camera 193.
[0300] An embodiment of the present application provides a control method, which is applied to the electronic device as described above. Fig.21 This is a flow chart of the control method provided in the embodiment of the present application. Fig.21 As shown, the method includes:
[0301] When the external interface is connected to a charger, determine whether the charging type of the charger is fast charging;
[0302] If the charging type of the charger is fast charging, the second switch unit 211 and the fourth switch unit 212 are controlled to be turned off, and after the second switch unit 211 and the fourth switch unit 212 are turned off, the charger is instructed to increase the voltage.
[0303] In this way, high-voltage direct current can be prevented from being transmitted to the communication unit 208 and the fast-charging chip 209 through the second switch unit 211 and the fourth switch unit, so as to burn out the communication unit 208 and the fast-charging chip 209 .
[0304] Optionally, the control method provided in the embodiment of the present application also includes: if the charging type of the charger is not fast charging, controlling the first switch unit 202, the second switch unit 211, the third switch unit 203 and the fourth switch unit 212 to be turned on to enable communication between the communication unit 208 and the charger.
[0305] The control method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0306] An embodiment of the present application provides an electronic device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the above method.
[0307] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0308] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0309] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0310] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0311] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0312] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. An electronic device, It is characterized in that include: An external interface, a first switch unit, a second switch unit, a third switch unit and a fourth switch unit; The external interface includes a first data transmission pin and a second data transmission pin; The first switch unit is connected between the second switch unit and the first data transmission pin, and the third switch unit is connected between the fourth switch unit and the second data transmission pin; the second switch unit and the fourth switch unit are both connected to the communication unit of the electronic device; Wherein, when the first switch unit and the third switch unit are both turned on, the first data transmission pin and the second data transmission pin are used as a universal serial bus USB interface; when the first switch unit and the third switch unit are both turned off, the first data transmission pin and the second data transmission pin are used as a headphone interface; The electronic device is used to control the second switch unit and the fourth switch unit to be turned off when the external interface of the electronic device is connected to a charger.
2. The electronic device according to claim 1, It is characterized in that It also includes a fifth switch unit; the fifth switch unit is connected between the ground terminal and the control terminal of the second switch unit, and the control terminal of the second switch unit is connected to the control terminal of the fourth switch unit; Wherein, when the external interface is connected to the charger, the electronic device is used to control the fifth switch unit to be turned on, so that the second switch unit and the fourth switch unit are both turned off.
3. The electronic device according to claim 1 or 2, It is characterized in that The first audio branch includes a sixth switch unit and a seventh switch unit; the sixth switch unit is connected between a ground terminal and a control terminal of the first switch unit, and the control terminal of the first switch unit, the control terminal of the second switch unit, the control terminal of the third switch unit, and the control terminal of the fourth switch unit are connected; Wherein, when the external interface is connected to an analog headset, the sixth switch unit is turned on, so that the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are all turned off; The seventh switch unit is connected between the first data transmission pin and the audio processing unit of the electronic device; When the analog headset is connected to the external interface, the seventh switch unit is turned on, so that communication is achieved between the first data transmission pin and the audio processing unit.
4. The electronic device according to claim 3, It is characterized in that The electronic device is specifically used to control the sixth switch unit to be turned on when the external interface of the electronic device is connected to a charger, so that the second switch unit and the fourth switch unit are both turned off.
5. The electronic device according to claim 3 or 4, It is characterized in that The first audio branch further includes: a first magnetic bead, a second magnetic bead, a third magnetic bead, a first resistor, a second resistor, a third resistor, a first capacitor and a second capacitor; One end of the first magnetic bead is connected to the first data transmission pin, and the other end of the first magnetic bead is connected to one end of the seventh switch unit and one end of the first resistor; the control end of the seventh switch unit is connected to the second resistor, and the other end of the seventh switch unit is connected to the audio processing unit through the second magnetic bead; the first capacitor is connected between the control end of the seventh switch unit and the other end of the seventh switch unit; the other end of the first resistor is connected to one end of the third resistor and one end of the third magnetic bead; the other end of the third resistor is connected to the audio processing unit through the second magnetic bead; the other end of the third magnetic bead is connected to the control end of the first switch unit through the second capacitor.
6. The electronic device according to any one of claims 1 to 5, It is characterized in that The electronic device further includes a fast charging chip, a fourth resistor and a fifth resistor; One pin of the fast charging chip is connected between the first switch unit and the second switch unit through the fourth resistor, and another pin of the fast charging chip is connected between the third switch unit and the fourth switch unit through the fifth resistor; The fast charging chip is used to communicate with the fast charging charger when the external interface is connected to the fast charging charger.
7. The electronic device according to any one of claims 1 to 6, It is characterized in that The electronic device further includes a power management unit and a sixth resistor; The sixth resistor is connected between the power management unit and the control end of the second switch unit, and the control end of the second switch unit is connected to the control end of the fourth switch unit; The power management unit is also connected to the control end of the first switch unit and the control end of the third switch unit; The power management unit is used to control the first switch unit and the third switch unit to be turned on when the external interface of the electronic device is connected to the charger.
8. The electronic device according to claim 7, It is characterized in that The electronic device further includes a third capacitor; One end of the third capacitor is connected between the power management unit and the control end of the first switch unit, and the other end of the third capacitor is grounded.
9. The electronic device according to claim 8, It is characterized in that The electronic device further includes a seventh resistor, an eighth resistor and / or a ninth resistor; One end of the seventh resistor is connected to the power management unit; The control end of the first switch unit is connected to the other end of the seventh resistor through the eighth resistor, and the control end of the third switch unit is connected to the other end of the seventh resistor through the ninth resistor.
10. The electronic device according to any one of claims 1 to 9, It is characterized in that The electronic device is further used to determine whether the charging type of the charger is fast charging when the external interface is connected to the charger; If the charging type of the charger is the fast charge, the electronic device controls the second switch unit and the fourth switch unit to be turned off, and after the second switch unit and the fourth switch unit are turned off, instructs the charger to increase the voltage.
11. The electronic device according to claim 10, It is characterized in that The electronic device is also used to control the first switch unit, the second switch unit, the third switch unit and the fourth switch unit to be turned on if the charging type of the charger is not the fast charge.
12. The electronic device according to any one of claims 1 to 5, It is characterized in that The electronic device further includes a fast charging chip, a tenth resistor and an eleventh resistor; One pin of the fast charging chip is connected between the first data transmission pin and the first switch unit through the tenth resistor, and another pin of the fast charging chip is connected between the second data transmission pin and the third switch unit through the eleventh resistor; The fast charging chip is used to communicate with the fast charging charger when the external interface is connected to the fast charging charger.
13. The electronic device according to any one of claims 1 to 12, It is characterized in that Also includes a first voltage clamping module and a second voltage clamping module; The first voltage clamping module is connected between the first data transmission pin and the ground terminal, and the second voltage clamping module is connected between the second data transmission pin and the ground terminal.
14. The electronic device according to any one of claims 1 to 13, It is characterized in that Also includes a third voltage clamping module and a fourth voltage clamping module; One end of the third voltage clamping module is connected between the second switch unit and the communication unit, and the other end of the third voltage clamping module is grounded; one end of the fourth voltage clamping module is connected between the fourth switch unit and the communication unit, and the other end of the fourth voltage clamping module is grounded; The clamping voltage of the third voltage clamping module is lower than the clamping voltage of the first voltage clamping module, and the clamping voltage of the fourth voltage clamping module is lower than the clamping voltage of the second voltage clamping module.
15. The electronic device according to any one of claims 1 to 14, It is characterized in that It also includes a current limiting unit; the current limiting unit includes a resistor, an inductor, or a resistor and an inductor connected in series; The current limiting unit is connected between the second switch unit and the communication unit; the current limiting unit is also connected between the fourth switch unit and the communication unit.
16. The electronic device according to any one of claims 1 to 15, It is characterized in that It also includes a filtering unit; the filtering unit is connected between the second switch unit and the communication unit; the filtering unit is also connected between the fourth switch unit and the communication unit.
17. The electronic device according to any one of claims 1 to 16, It is characterized in that Also comprising a second audio branch, wherein the second audio branch comprises an eighth switch unit; The eighth switch unit is connected between the second data transmission pin and the audio processing unit of the electronic device; When an analog headset is connected to the external interface, the eighth switch unit is turned on, so that communication is achieved between the second data transmission pin and the audio processing unit.
18. A control method, It is characterized in that Applied to the electronic device according to any one of claims 1 to 17, the method comprising: When the external interface is connected to the charger, determining whether the charging type of the charger is fast charging; If the charging type of the charger is the fast charge, the second switch unit and the fourth switch unit are controlled to be turned off, and after the second switch unit and the fourth switch unit are turned off, the charger is instructed to increase the voltage.
19. The method according to claim 18, It is characterized in that Also includes: If the charging type of the charger is not the fast charge, the first switch unit, the second switch unit, the third switch unit and the fourth switch unit are all controlled to be turned on.
20. An electronic device, It is characterized in that include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to claim 18 or 19.
21. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to claim 18 or 19 is implemented.
22. A computer program product, It is characterized in that It comprises a computer program which, when being executed, causes a computer to execute the method as claimed in claim 18 or 19.
