Charging method, terminal device, and storage medium
By disabling the control of D+ and D- by USBPHY and PMIC when the connection cable type is debug cable and the device is an adapter, the problem of DEBUG line interference with fast charging communication in the combination of ADSP and VOOCPHY is solved, achieving efficient fast charging communication and saving hardware switches.
Patent Information
- Application Number
- CN202110684978.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-21
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-06-21
AI Technical Summary
The fast charging method based on the combination of ADSP and VOOCPHY has the problem of DEBUG line interference with fast charging communication, which leads to a decrease in charging performance and efficiency.
When establishing a connection with an external device, if the connection cable type is a debug cable and the device type is an adapter, set the pins of the USB interface to a high-impedance state, disable the USBPHY and PMIC control of D+ and D-, start a timer, disable PMIC control after the timer expires, and activate the adapter to establish fast charging communication.
This avoids interference from the DEBUG line with fast charging communication, improves charging performance and efficiency, saves on hardware switch settings, and meets the requirement of the DEBUG line to support fast charging.
Smart Images

Figure CN115576877B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of charging, in particular to a charging method, a terminal device and a storage medium. BACKGROUND
[0002] The fast charging is realized based on a microcontroller unit (MCU), a printed circuit board (PCB) is arranged with an external fast charging control chip, referred to as a fast charging MCU, and the MCU is used for controlling the logic implementation of fast charging. In the 8350 platform of Qualcomm, a charging control module is transplanted into an analog-digital signal processing chip (ADSP) subsystem, and in order to save costs, the chip of the MCU needs to be removed, and the hardware transceiving logic of fast charging communication data is realized by a VOOCPHY physical layer integrated into PM8350B.
[0003] However, although the fast charging mode based on the combination of ADSP and VOOCPHY can save costs, due to the change of the hardware scheme, the fast charging communication is interfered by the DEBUG line, so that the DEBUG line cannot support the fast charging function, and the charging performance and charging efficiency are reduced. SUMMARY
[0004] The embodiments of the present application provide a charging method, a terminal device and a storage medium, which can ensure the successful establishment of a voice service and improve the reliability of the voice service.
[0005] The technical scheme of the embodiments of the present application is implemented as follows:
[0006] In a first aspect, the embodiments of the present application provide a charging method, and the method comprises the following steps:
[0007] When a connection with an external device is established, a connection line type of a connection line between the external device is determined;
[0008] If the connection line type is a debugging line and a device type of the external device is an adapter, a pin of a USB interface is set to a high-impedance state to inhibit the control of the USB PHY on the pin of the USB interface, and a first timer is started at the same time;
[0009] After the running time of the first timer is exceeded, the control of the PMIC on the pin of the USB interface is inhibited;
[0010] The adapter is activated to establish fast charging communication.
[0011] In a second aspect, the embodiments of the present application provide a terminal device, the terminal device comprising: a determination unit, a setting unit, a disabling unit, and an activation unit,
[0012] The determination unit is configured to determine a connection line type of a connection line between the terminal device and the external device when the connection is established with the external device.
[0013] The setting unit is configured to set a pin of a USB interface to a high-impedance state to disable control of the pin of the USB interface by a USB PHY if the connection line type is a debug line and a device type of the external device is an adapter, and simultaneously start a first timer.
[0014] The disabling unit is configured to disable control of the pin of the USB interface by a PMIC after a running time of the first timer is exceeded.
[0015] The activation unit is configured to activate the adapter to establish fast charging communication.
[0016] In a third aspect, the embodiments of the present application provide a terminal device, the terminal device comprising a processor and a memory storing instructions executable by the processor, and when the instructions are executed by the processor, the charging method of the first aspect is implemented.
[0017] In a fourth aspect, the embodiments of the present application provide a computer-readable storage medium, the computer-readable storage medium storing a program, and when the program is executed by a processor, the charging method of the first aspect is implemented.
[0018] The embodiments of the present application provide a charging method, a terminal device, and a storage medium. When a connection is established with an external device, a connection line type of a connection line between the terminal device and the external device is determined. If the connection line type is a debug line and a device type of the external device is an adapter, a pin of a USB interface is set to a high-impedance state to disable control of the pin of the USB interface by a USB PHY. Meanwhile, a first timer is started. Control of the pin of the USB interface by a PMIC is disabled after a running time of the first timer is exceeded. The adapter is activated to establish fast charging communication. As can be seen, in the embodiments of the present application, the terminal device can determine the device type and the connection line type of the external device, and further determine whether to disable control of D+ and D- by the USB PHY and the PMIC according to the device type and the connection line type. Specifically, after it is determined that the external device is an adapter, the external device is connected to the terminal device through a DEBUG line, and the external device is not used for wireless charging, the terminal device can select to disable control of D+ and D- by the USB PHY and the PMIC, so that only VOOCPHY can control D+ and D-. Thus, the DEBUG line can be prevented from interfering with fast charging communication, the requirement of supporting fast charging using the DEBUG line can be met, and charging performance and charging efficiency are greatly improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 A schematic diagram of a fast charging communication flow in an embodiment of the present application is shown in FIG. 1.
[0020] Figure 2 A schematic diagram of a principle of implementing fast charging in an MCU mode is shown in FIG. 2.
[0021] Figure 3 A schematic diagram of a principle of implementing fast charging in an ADSP and VOOCPHY combined mode is shown in FIG. 3.
[0022] Figure 4 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 4. Figure 1
[0023] Figure 5 A schematic diagram of a pin interface of TYPE-C is shown in FIG. 5.
[0024] Figure 6 A schematic diagram of a resistance connection case is shown in FIG. 6.
[0025] Figure 7 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 7. Figure 2
[0026] Figure 8 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 8. Figure 3
[0027] Figure 9 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 9. Figure 4
[0028] Figure 10 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 10. Figure 5
[0029] Figure 11 A schematic diagram of an implementation flow of a charging method proposed in an embodiment of the present application is shown in FIG. 11. Figure 6
[0030] Figure 12 A schematic diagram of a composition structure of a terminal device proposed in an embodiment of the present application is shown in FIG. 12. Figure 1
[0031] Figure 13 A schematic diagram of a composition structure of a terminal device proposed in an embodiment of the present application is shown in FIG. 13. Figure 2 DETAILED DESCRIPTION
[0032] With reference to the drawings and the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be pointed out that, for the convenience of description, only the parts related to the application are shown in the drawings.
[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing the embodiments of the present application only, and is not intended to limit the present application.
[0034] In the following description, “some embodiments” are related to a subset of all possible embodiments, but it can be understood that “some embodiments” can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. It should be pointed out that the terms “first\second\third” related to the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that “first\second\third” can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0035] At present, common fast charging technologies mainly include VOOC3.0 flash charging technology of 5V / 6A, SUPERVOOC2.0 fast charging technology of 65W, and fast charging technology based on Programmable Power Supply (PPS) of 125W.
[0036] When the terminal is fast charging, it needs to realize the function of flash charging through a customized adapter and a battery. In general, the adapter used for flash charging is configured with a Microcontroller Unit (MCU) intelligent chip, so the adapter is an upgradeable intelligent charger.
[0037] Further, in the embodiments of the present application, Figure 1 The fast charging communication flowchart in the embodiments of the present application is shown as Figure 1 The adapter can mainly include the following five stages in the process of fast charging the terminal.
[0038] Stage 1: The terminal detects the type of the adapter, the adapter starts the handshake communication between the adapter and the terminal, the adapter sends an instruction to inquire whether the terminal starts the fast charging mode, and when the terminal agrees to start the fast charging, the fast charging communication flow enters stage 2.
[0039] Wherein, the terminal can detect the adapter type through D+, D-, when detecting that the adapter is a charging device of non-USB type, the current absorbed by the terminal can be greater than a preset current value I2. When the adapter detects that the output current of the adapter is greater than or equal to I2 within a preset time period, the adapter considers that the terminal has completed the adapter type identification, the adapter opens the handshake communication between the adapter and the terminal, and the adapter sends an instruction to inquire whether the terminal opens the fast charging mode. When the adapter receives the reply instruction of the terminal indicating that the terminal does not agree to open the fast charging mode, the output current of the adapter is detected again, and when the output current of the adapter is still greater than or equal to I2, the request is initiated again to inquire whether the terminal opens the fast charging mode, and the above steps of stage 1 are repeated until the terminal replies to agree to open the fast charging mode or the output current of the adapter no longer meets the condition of being greater than or equal to I2.
[0040] Stage 2: The adapter sends another instruction to the terminal to inquire whether the output voltage of the adapter matches, and the terminal replies to the adapter that the output voltage is too high, too low or matches, the adapter adjusts the output voltage until the output voltage is appropriate.
[0041] Wherein, the voltage output by the adapter can include multiple gears, the adapter can send an instruction to the terminal to inquire whether the output voltage of the adapter is suitable as the charging voltage in the fast charging mode, if the adapter receives the feedback of the terminal that the output voltage of the adapter is too high or too low, the adapter adjusts the output voltage by one gear, and sends an instruction to the terminal again to inquire whether the output voltage of the adapter matches.
[0042] Stage 3: The adapter sends another instruction to the terminal to inquire the maximum charging current currently supported by the terminal, the terminal replies to the adapter the maximum charging current, and enters stage 4.
[0043] Stage 4: The adapter can set the output current to be the maximum charging current currently supported by the terminal, and enters the constant current stage, i.e. stage 5.
[0044] Stage 5: When entering the constant current stage, the adapter can send another instruction to inquire the current voltage of the terminal battery every interval, the terminal can feed back the current voltage of the terminal battery to the adapter, and the adapter can judge whether the contact is good and whether the current charging current value of the terminal needs to be reduced according to the feedback of the terminal about the current voltage of the terminal battery.
[0045] It should be noted that the constant current stage does not mean that the output current of the adapter remains unchanged in stage 5, and the so-called constant current is segmented constant current, i.e. remaining unchanged in a period of time.
[0046] The MCU-based fast charging scheme has two-stage switching, and the hardware cuts off the path of USBPHY control D+ and D-, so when it is connected to the DEBUG line, no special treatment is needed to fast charge. Figure 2 The principle diagram for implementing fast charging by MCU is shown in FIG. 1. Figure 2 As shown in FIG. 1, a central processing unit (CPU) directly controls a platform power management IC (PMIC) to charge: the CPU directly operates the register of the platform PMIC through a system power management interface (SPMI) bus to control the fast charging, and only an audio module is in an analog digital singal processor (ADSP), and data is exchanged between the CPU and the ADSP through an application processor (AP) and ADSP communication link GLINK bus.
[0047] When the MCU-based fast charging scheme is implemented, when no adapter is connected, i.e., VBUS=0, switch 1 controls SW1, which is connected to SW2 by default, and when the terminal is directly connected to the serial port line, the switch 2 control SW2 is connected to the serial port controller during software initialization, so that the terminal can output the serial port log from D+ and D- by default; when the adapter is powered on, the fast switch 1 control SW1 is connected to the platform PMIC, and when the ASPD identifies that the charger type is a dedicated charging port (DCP) of battery charging v1.2 (BC1.2), the software sets the switch 1 control SW1 to be connected to SW2, and the switch 2 control SW2 is set to be connected to the MCU, so that the MCU<---->SW2<---->SW1<---->adapter is directly connected through D+ and D- for communication. Since the fast switch 1 control SW1 is connected to SW2, the PMIC and the USBPHY cannot interfere with the fast charging communication, and the switch 2 control SW2 is connected to the MCU, so the serial port output cannot interfere with the fast charging communication.
[0048] The MCU-based fast charging scheme has two-stage switching, and the hardware cuts off the path of USBPHY control D+ and D-, so when it is connected to the DEBUG line, no special treatment is needed to fast charge.
[0049] Figure 3A schematic diagram of the principle of realizing fast charging in the manner of ADSP combined with VOOCPHY is shown in FIG. 8. Figure 3 As shown in FIG. 8, the ADSP subsystem directly controls the charging module. Specifically, the ADSP subsystem controls the charging logic related to PM8350B. PM8350, VOOCPHY and USBPHY are integrated on the ADSP. The ADSP exchanges charging state information and USB related state information through the GLINK bus. Compared with the MCU type fast charging scheme, the fast charging scheme of ADSP combined with VOOCPHY has only switch 1 as the hardware switch, that is, when VBUS is not powered, it is connected to the serial port module, and when VBUS is powered, it is connected to the port shared by PM8350, VOOCPHY and USBPHY. Such a logic architecture results in that even during fast charging, PMIC and USBPHY can control D+ and D- data communication. If it is connected to the DEBUG line, the fast charging communication is disturbed because the hardware is not disconnected. The information sent by the adapter through D+ and D- will interfere with the half high level, resulting in that the data received by VOOCPHY is incorrect and fast charging cannot be performed.
[0050] It can be seen that although the fast charging mode of ADSP combined with VOOCPHY can reduce the setting of hardware switches and save costs, due to the change of the hardware scheme, there is a problem of DEBUG line interfering with fast charging communication, which makes the DEBUG line unable to support fast charging function, and reduces the charging performance and charging efficiency.
[0051] In order to solve the above problems, in the embodiments of the present application, the terminal can determine the device type and connection line type of the external device, so as to further determine whether to prohibit the control of D+ and D- by USBPHY and PMIC according to the device type and connection line type. Specifically, after determining that the external device is an adapter, the external device is connected to the terminal through the DEBUG line, and it is not wireless charging, the terminal can select to prohibit the control of D+ and D- by USBPHY and PMIC, so as to ensure that only VOOCPHY can control D+ and D-, thereby avoiding the interference of the DEBUG line with fast charging communication, meeting the demand of supporting fast charging using the DEBUG line, and greatly improving the charging performance and charging efficiency.
[0052] That is, due to the significant change of the fast charging hardware scheme, for the DEBUG line, the terminal can adapt in software to support the fast charging function when the DEBUG line is identified, and then realize the fast charging scheme based on the physical logic module VOOCPHY receiving and sending VOOC fast charging information.
[0053] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application.
[0054] An embodiment of the present application provides a charging method, Figure 4 An implementation flow of the charging method provided by an embodiment of the present application is shown in the figure Figure 1 As shown in the figure, Figure 4 In an embodiment of the present application, the method for charging of the terminal can include the following steps:
[0055] In step 101, when a connection with an external device is established, the type of a connection line between the terminal and the external device is determined.
[0056] In an embodiment of the present application, when a connection with an external device is established, the terminal can first determine the type of a connection line between the terminal and the external device. The type of the connection line can be a debugging line (DEBUG line) or a TYPE-C line.
[0057] It should be noted that in an embodiment of the present application, the terminal can be any terminal device with communication and storage functions, such as a tablet computer, a mobile phone, an e-book reader, a remote controller, a personal computer (PC), a notebook computer, a vehicle-mounted device, a network television, a wearable device, a personal digital assistant (PDA), a portable media player (PMP), a navigation device, and the like.
[0058] It should be noted that in an embodiment of the present application, the terminal can be configured with an analog-digital signal processing chip ADSP and an application processor AP, where the communication link between the ADSP and the AP is GLINK.
[0059] It can be understood that in an embodiment of the present application, the terminal can support a normal charging mode and a fast charging mode, where the charging current of the fast charging mode is greater than that of the normal charging mode, and the charging speed of the fast charging mode is greater than that of the normal charging mode.
[0060] Optionally, in an embodiment of the present application, the external device can be a device for charging the terminal. Specifically, the external device can perform wireless charging on the terminal by establishing a wireless connection with the terminal, or perform wired charging on the terminal by establishing a physical connection with the terminal. For example, the external device can be an adapter, a power supply, or the like, and the external device can also be a charging base or the like.
[0061] Optionally, in an embodiment of the present application, the external device can also be a device for communicating with the terminal.
[0062] Furthermore, in the embodiments of this application, the terminal and the external device can be connected via a Universal Serial Bus (USB) interface. This USB interface can be a standard USB interface, a microUSB interface, or a USB interface, etc. The power line in the USB interface is used by the external device to charge the terminal. This power line can be the VBus line and / or ground line of the USB interface. The data line in the USB interface is used for bidirectional communication between the external device and the terminal. This data line can be the D+ line and / or D- line of the USB interface. Bidirectional communication refers to the exchange of information between the external device and the terminal.
[0063] It should be noted that in the embodiments of this application, the USB interface has three different appearances: Type-A, Type-B, and Type-C. Type-C is much smaller than both Type-A and Type-B and is the latest USB interface form factor standard. Furthermore, Type-C is an interface type that can be used in both PCs (host devices) and external devices (slave devices, such as mobile phones). The Type-C port has 4 pairs of transmit (TX) / receive (RX) lines, 2 pairs of USB D+ / D- lines, one SBU line, 2 CC lines (CC1, CC2), 4 VBUS lines, and 4 ground lines.
[0064] For example, in this application, Figure 5 This is a schematic diagram of the TYPE-C pinout, as shown below. Figure 5 As shown in the pinout diagram of TYPE-C, its pins are symmetrical, thus supporting reversible insertion. TYPE-C supports protocols such as USB and DP, and its symmetrical CC1 and CC2 pins are used to identify the connected device. The CC pin requires pull-up / pull-down resistors inside both the Downstream Facing Port (DPF) and the Upstream Facing Port (UFP) to identify their respective functions. The load information can be confirmed based on the different pull-up / pull-down resistors. Inside the DFP, CC is pulled up to the power supply through different pull-up resistors Rp, while inside the UFP, CC is pulled down to ground (GND) through a 5.1K resistor. The DFP is the downstream port, which can be considered a host device, power adapter, etc.; the UFP can be considered a slave device, such as a USB flash drive, powered device, etc.
[0065] The resistor connections for CC1 and CC2 differ depending on the type of TYPE-C or OTG (On-The-Go) cable. Figure 6As a schematic diagram of a resistance connection case, it is assumed that a mobile phone is taken as a DFP, and a U disk is connected through an OTG line, as shown in Figure 6
[0066] When the terminal is connected to the adapter through a standard TYPE-C line, there is only one pull-up resistor on the standard TYPE-C line CC, and the other CC is open. From the perspective of the adapter as a HOST, CC1 and CC2 are in the states of OPEN and RD, respectively. The terminal is taken as a SINK device, and is connected to a standard TYPE-C line. When the charger type is identified as a standard downstream port (SDP) / charging downstream port (CDP) through BC1.2, the ADSP will notify the AP to pull up D+ to 3.3V to enumerate the device. When the terminal is connected to a non-standard TYPE-C line, there are pull-up resistors on both CCs. From the perspective of the adapter as a HOST, CC1 and CC2 are in the states of RD. It will be identified as a DEBUG AccessoryMode attached. Once it is identified as a DEBUG line, the ADSP will immediately notify the AP to pull up D+ to enumerate, that is, the AP end will control the USB PHY to act on D+ 3.3V high level.
[0067] It can be understood that in the embodiments of the present application, after the terminal establishes a connection with the external device through the connection line, the specific connection line type of the connection line can be determined first, so that whether to establish fast charging communication can be further determined based on the connection line type.
[0068] Optionally, in the present application, when the terminal establishes a connection with the external device, the connection line type of the connection line can be determined by triggering a Type-C interrupt. The connection line type can be a debugging line (DEBUG line) or a TYPE-C line.
[0069] For example, in the embodiments of the present application, when an external device is inserted, the terminal can first trigger a TYPE-C interrupt. Specifically, after triggering the Type-C interrupt, in the interrupt processing function, the inserted external device can be determined to be connected to a standard TYPE-C line or a DEBUG line by reading the corresponding TYPE-C register. If it is a DEBUG line, the ADSP can send a notify message to the AP through the GLINK bus to inform the AP that the connection line corresponding to the inserted external device is a DEBUG line.
[0070] In step 102, if the connection line type is a debug line and the device type of the external device is an adapter, the pin of the USB interface is set to a high-impedance state to disable the control of the USB PHY on the pin of the USB interface; and a first timer is started.
[0071] In the embodiments of the present application, when a terminal establishes a connection with an external device, after determining the connection line type of the connection line between the terminal and the external device, if the connection line type of the external device is a debug line, and if the device type of the external device is an adapter, the terminal can select to set the pin of the USB interface to a high-impedance state, thereby disabling the control of the USB PHY on the pin of the USB interface; and the terminal can also select to start a first timer, thereby determining the time period of disabling the control of the PMIC on the pin of the USB interface through the running time of the first timer.
[0072] It should be noted that, in the embodiments of the present application, if the connection line type of the connection line between the terminal and the external device is a debug line, and the device type of the external device is an adapter, in order to prevent the ADSP from informing the AP to pull up the D+ to enumerate the device, that is, to prevent the AP end from controlling the USB PHY to act on the high level of D+ 3.3V, the terminal needs to set the pin of the USB interface to a high-impedance state, thereby disabling the control of the USB PHY on the pin of the USB interface, and thus solving the problem that the DEBUG line does not support fast charging in the case of ADSP+VOOCPHY.
[0073] It can be understood that, in the embodiments of the present application, the pin of the USB interface is D+ and D- of the USB interface. Accordingly, when the connection line between the terminal and the adapter is identified as a DEBUG line, since the AP end will control the USB PHY to act on the high level of D+ 3.3V, the information sent by the adapter through D+ and D- will interfere with the half-high level, and thus fast charging cannot be performed. Accordingly, in order to avoid the interference of the DEBUG line with fast charging communication, when the terminal determines that the adapter is connected through the DEBUG line, the terminal can select to directly ignore the communication of the USB PHY to disable the control of the USB PHY on D+ and D-.
[0074] It should be noted that, in the embodiments of the present application, the high-impedance state can be a state that can be logically ANDed with other states, where the logical AND means that two output ends (including two or more) are directly interconnected to realize the logical function of AND. The above-mentioned other states can represent other states of controlling D+ and D-, which can specifically include the low-high level state of 01 loaded on D+ and D- by the VOOCPHY and the adapter.
[0075] Optionally, in the embodiment of the present application, after determining that the external device is an adapter and the connection line between the terminal and the external device is a debugging line, the AP in the terminal can act on the USB PHY of the ADSP through the GLINK, so as to set the states of D+ and D- to high-impedance states, thereby realizing the inhibition of the control of the USB PHY on D+ and D-.
[0076] Further, in the embodiment of the present application, Figure 7 The implementation flow of the charging method proposed in the embodiment of the present application is shown in Figure 2 As shown in Figure 7 When establishing a connection with an external device, after determining the connection line type of the connection line between the terminal and the external device, that is, after step 101, and before inhibiting the control of the PMIC on the pins of the USB interface, that is, before step 103, the method for charging the terminal can further include the following steps:
[0077] Step 105: If the connection line type is a debugging line, the device type is the adapter, and the charging mode is wired charging, the pins of the USB interface are set to high-impedance states to inhibit the control of the USB PHY on the pins of the USB interface; and the first timer is started at the same time.
[0078] In the embodiment of the present application, the terminal can first determine the charging mode, and then further determine whether the control of the USB PHY on the pins of the USB interface needs to be inhibited in combination with the charging mode, the connection line type, and the device type.
[0079] It can be understood that in the present application, the charging mode can include wireless charging and wired charging.
[0080] Correspondingly, in the embodiment of the present application, when the terminal determines that the connection line type of the connection line between the terminal and the external device is a debugging line, the device type of the external device is an adapter, and the charging mode is wired charging, the terminal can choose to ignore the communication of the USB PHY. Specifically, the terminal can set the pins of the USB interface to high-impedance states, thereby inhibiting the control of the USB PHY on D+ and D-, and further avoiding the interference of the debugging line (DEBUG line) on fast charging communication.
[0081] It can be understood that in the present application, since wireless charging is coupled to the VBUS through a wireless coil, it will also generate an action similar to the charger type identification of wired charging, therefore, the terminal can also exclude the misidentification under wireless charging through the confirmation of the charging mode.
[0082] Step 103: Inhibit the control of the PMIC on the pins of the USB interface after the running time of the first timer is exceeded.
[0083] In the embodiments of the present application, if the connection line type corresponding to the external device is a debugging line, and if the device type of the external device is an adapter, the terminal can disable the control of the PMIC on the pins of the USB interface after the running time of the first timer is exceeded after starting the first timer.
[0084] It should be noted that in the embodiments of the present application, the terminal can set the running time of the first timer in advance, for example, the running time of the first timer can be set to 800 ms. The running time of the first timer can be the conversion time between wireless charging and wired charging, and accordingly, the running time of the first timer can be used to determine the timing of starting VOOCPHY for fast charging communication.
[0085] Optionally, in the embodiments of the present application, since the OTG mode of wireless reverse charging works is changed to the general charging mode when the wired fast charging is connected again after the wireless reverse charging, that is, the wireless charging to wired charging conversion process, the PMIC needs a certain conversion time, therefore, after the terminal determines that the external device is an adapter and the connection line between the terminal and the external device is a debugging line, the terminal does not immediately start VOOCPHY for fast charging communication, nor does it immediately disable the control of the PMIC on the pins of the USB interface, but needs to start and run the first timer to ensure that the conversion between wireless charging and wired charging has been completed before disabling the control of the PMIC on the pins of the USB interface.
[0086] That is, in the embodiments of the present application, when the running time of the first timer is exceeded, it can be considered that the wireless charging to wired charging conversion process has been completed, at this time, the terminal can select to disable the control of the PMIC on the pins of the USB interface.
[0087] Optionally, in the embodiments of the present application, the terminal can achieve the requirement of disabling the control of the PMIC on D+ and D- by disabling the identification function of high-voltage dedicated charging port (HVDCP) and BC1.2.
[0088] For example, in the present application, after the connection line between the terminal and the adapter is identified as a DEBUG line, the ADSP in the terminal can start a first timer with a running time of 800 ms, and when the running time of 800 ms of the first timer is exceeded, to avoid the control of the PMIC on D+ and D-, the terminal can directly disable the identification of HVDCP and BC1.2, so that the PMIC cannot control D+ and D-.
[0089] Furthermore, in embodiments of this application, the terminal can further determine whether it is necessary to disable the PMIC's control over the pins of the USB interface by considering the charging mode, connection cable type, and device type.
[0090] Specifically, in this application, when the terminal determines that the connection cable type between the terminal and the external device is a test cable, the device type of the external device is an adapter, and the charging mode is wired charging (i.e., wired charging), it can choose to disable the identification functions of HVDCP and BC1.2, thereby disabling the PMIC's control over D+ and D-.
[0091] Therefore, in the embodiments of this application, after determining that the external device is an adapter and that the external device is connected to the terminal via a debug cable, the terminal can either choose to disable the USBPHY from controlling D+ and D-, or simultaneously disable the PMIC from controlling D+ and D-. In this case, only the VOOCPHY can control D+ and D-, thereby avoiding interference from the debug cable (DEBUG cable) with fast charging communication.
[0092] Step 104: Activate the adapter to establish fast charging communication.
[0093] In the embodiments of this application, after the terminal completes the process of disabling USBPHY and PMIC control of D+ and D-, it can activate the adapter, thereby establishing fast charging communication with the adapter.
[0094] Optionally, in embodiments of this application, the terminal may choose to activate the adapter by sending a pulse train through the enable level shift function, and after activating the adapter, establish normal fast charging communication with the adapter through the debugging line.
[0095] In summary, through the charging method proposed in steps 101 to 104 above, after the terminal determines that the external device is an adapter, the external device is connected to the terminal via a DEBUG cable, and it is not for wireless charging, it can disable the USBPHY's control over D+ and D- by setting D+ and D- to a high-impedance state. It can also disable the PMIC's control over D+ and D- by disabling the identification functions of HVDCP and BC1.2, thereby ensuring the establishment of fast charging communication. In other words, for the fast charging method combining ADSP and VOOCPHY, when a DEBUG cable is detected, the terminal can choose to disable the USBPHY and PMIC's control over D+ and D-, ensuring that only the VOOCPHY can control D+ and D-. This avoids interference from the DEBUG cable with fast charging communication and meets the requirement of supporting fast charging using a DEBUG cable.
[0096] It can be seen that the charging method provided in the application can realize the requirement that the DEBUG line can support fast charging based on the combination of ADSP and VOOCPHY. Compared with the fast charging scheme based on MCU, the fast charging scheme based on MCU can remove a hardware switch while ensuring that the DEBUG line supports the fast charging function, thereby saving costs.
[0097] It should be noted that the charging method provided in the application is also applicable to subsequent MCU schemes. The MCU fast charging scheme can also save costs by saving a hardware switch.
[0098] The embodiment of the application provides a charging method. When a connection with an external device is established, the connection line type of a connection line between the external device and the terminal is determined. If the connection line type is a debugging line and the device type of the external device is an adapter, the pin of the USB interface is set to a high-impedance state to inhibit the control of the USB PHY on the pin of the USB interface. Meanwhile, a first timer is started. After the running time of the first timer is exceeded, the control of the PMIC on the pin of the USB interface is inhibited. The adapter is activated to establish fast charging communication. It can be seen that in the embodiment of the application, the terminal can determine the device type of the external device and the connection line type, so as to further determine whether to inhibit the control of the USB PHY and the PMIC on D+ and D- according to the device type and the connection line type. Specifically, after it is determined that the external device is an adapter, the external device and the terminal are connected through a DEBUG line, and the external device is not a wireless charger, the terminal can select to inhibit the control of the USB PHY and the PMIC on D+ and D-, so as to ensure that only the VOOCPHY can control D+ and D-, thereby avoiding the interference of the DEBUG line on the fast charging communication, meeting the requirement of supporting fast charging using the DEBUG line, and greatly improving the charging performance and the charging efficiency.
[0099] Based on the above embodiment, another embodiment of the application provides a charging method, Figure 8 The implementation process of the charging method provided in the embodiment of the application is shown in the following table. Figure 3 As shown in the table, when a connection with an external device is established, the terminal can determine the connection line type of a connection line between the external device and the terminal. After the connection line type is determined, the terminal can further determine the device type of the external device. Figure 8 The terminal can further determine the device type of the external device, that is, whether the external device is an adapter.
[0100] Step 106: Determine the device type of the external device.
[0101] In the embodiment of the application, after the terminal determines the connection line type of a connection line between the external device and the terminal when a connection with the external device is established, the terminal can further determine the device type of the external device, that is, whether the external device is an adapter.
[0102] It should be noted that in the embodiments of the present application, before determining whether to establish fast charging communication, the terminal needs to first determine the device type of the external device. The device type of the external device can be an adapter, and can also be a non-adapter.
[0103] Specifically, in the embodiments of the present application, the method for the terminal to determine the device type of the external device can include the following steps:
[0104] Step 106a, after triggering the Type-C interrupt, start a second timer.
[0105] In the embodiments of the present application, after the terminal determines the connection line type of the connection line by triggering the Type-C interrupt, the terminal can first start the second timer.
[0106] It should be noted that in the embodiments of the present application, the terminal can set the running time of the second timer in advance, for example, the running time of the second timer can be set to 200ms. The running time of the second timer can be used to determine the triggering time of the APSD interrupt.
[0107] Step 106b, after exceeding the running time of the second timer, determine the port information corresponding to the external device by triggering the APSD interrupt.
[0108] In the embodiments of the present application, after starting the second timer, after exceeding the running time of the second timer, the terminal can further determine the port information corresponding to the external device by triggering the APSD interrupt.
[0109] It should be noted that in the embodiments of the present application, after triggering the Type-C interrupt and reaching the running time of the second timer, the terminal can trigger the APSD interrupt, wherein the APSD interrupt can be used to obtain the port information corresponding to the external device through the BC1.2 (Battery Charging v1.2) charger type identification protocol.
[0110] Wherein, BC1.2 is a protocol formulated by the BC (Battery Charging) group under USB-IF, mainly used to standardize the requirements of battery charging, and the protocol is implemented based on USB2.0 protocol at first.
[0111] Specifically, the three ports of BC1.2 mainly include a standard downstream port SDP, a DCP, and a charging downstream port CDP. The D+ and D- lines of the SDP port have a 15kΩ pull-down resistor. The current limiting value is as discussed above: 2.5mA when suspended, 100mA when connected, and 500mA when connected and configured for higher power. The DCP port does not support any data transmission, but can provide a current of 1.5A or more. The D+ and D- lines of the port are short-circuited. This type of port supports higher charging capacity wall chargers and car chargers, without enumeration. The CDP port supports both high-current charging and fully compatible USB2.0 data transmission. The port has a 15kΩ pull-down resistor necessary for D+ and D- communication, and also has an internal circuit for charger detection stage switching. The internal circuit allows the portable device to distinguish the CDP from other types of ports.
[0112] Step 106c, determining the device type according to the port information.
[0113] In the embodiment of the present application, after the terminal determines the port information corresponding to the external device by triggering the APSD interrupt after the running time of the second timer exceeds, the terminal can further determine the device type of the external device according to the port information.
[0114] For example, in the present application, if the port information corresponding to the external device is DCP, the terminal can determine that the device type is an adapter.
[0115] Further, in the embodiment of the present application, Figure 9 The implementation flow of the charging method proposed in the embodiment of the present application is shown in Figure 4 As shown in Figure 9 After determining the connection line type of the connection line between the terminal and the external device, i.e., after step 101, the method for charging of the terminal when establishing a connection with the external device can further include the following steps:
[0116] Step 107, if the connection line type is a Type-C line and the device type of the external device is an adapter, activating the adapter to establish fast charging communication.
[0117] In the embodiment of the present application, after determining the connection line type of the connection line between the terminal and the external device when establishing a connection with the external device, if the connection line type corresponding to the external device is a standard Type-C line, and if the device type of the external device is an adapter, the terminal can select to directly activate the adapter, so as to establish fast charging communication through the Type-C line.
[0118] Optionally, in the embodiment of the present application, after determining that the external device is an adapter and the connection line between the terminal and the external device is a standard Type-C line, the VOOCPHY control D+ and D- can be determined, at this time, the terminal can send a pulse train to activate the adapter through the enable level shift function, so that normal fast charging communication with the adapter can be established after the adapter is activated.
[0119] Further, in the embodiment of the present application, after establishing a connection with the external device and determining the connection line type of the connection line between the terminal and the external device, i.e., after step 101, the method for the terminal to charge can further include the following steps:
[0120] Step 108, when the connection with the external device is disconnected, the first timer and the second timer are closed, and the connection line identifier, the first control identifier and the second control identifier are initialized.
[0121] In the embodiment of the present application, after the terminal establishes a connection with the external device, when the connection with the external device is disconnected, the terminal can select to close the first timer and the second timer, and the terminal can also initialize the connection line identifier, the first control identifier and the second control identifier.
[0122] It should be noted that, in the embodiment of the present application, if the terminal is disconnected from the external device, the terminal does not need to prohibit the PMIC from controlling the pins of the USB interface, so it is not necessary to monitor the conversion time between wireless charging and wired charging, and thus the first timer can be selected to be closed.
[0123] Correspondingly, in the embodiment of the present application, if the terminal is disconnected from the external device, the terminal does not need to determine the device type of the external device by triggering the APSD interrupt, so it is not necessary to determine the triggering time of the APSD interrupt, and thus the second timer can be selected to be closed.
[0124] Further, in the embodiment of the present application, the connection line identifier can be used to determine the data line type. Specifically, the connection line identifier can be used to determine whether it is a DEBUG line.
[0125] For example, in the present application, the variable DEBUG_flag can be used to represent the connection line identifier. When the value of DEBUG_flag is 1 or true, it indicates that the data line is a DEBUG line; when the value of DEBUG_flag is 0 or false, it indicates that the data line is not a DEBUG line.
[0126] Correspondingly, in the embodiments of the present application, when a terminal establishes a connection with an external device, after determining the connection line type of the connection line between the terminal and the external device, if the connection line type corresponding to the external device is a debug line, the terminal can set the value of the connection line identifier to a first value. The first value can be 1 or true.
[0127] Further, in the embodiments of the present application, the first control identifier can be used to determine whether to prohibit the USB PHY from controlling D+ and D- before charging.
[0128] For example, in the present application, the variable USB_ROLE can be used to represent the first control identifier. When the value of USB_ROLE is NONE, it means that the communication of the USB PHY needs to be ignored, that is, the USB PHY is prohibited from controlling D+ and D-.
[0129] Further, in the embodiments of the present application, the second control identifier can be used to determine whether to prohibit the USB PHY from controlling D+ and D- before and during charging.
[0130] For example, in the present application, the variable ignore_usb_flag can be used to represent the second control identifier. When the value of ignore_usb_flag is 1 or true, it means that the state of setting the USB as HOST or DEVICE is ignored, and the USB PHY is released from the control of D+ and D- before fast charging, and it also means that the USB PHY is prohibited from controlling D+ and D- during the subsequent charging process of the current connection. When the value of ignore_usb_flag is 0 or false, it means that the USB PHY is allowed to control D+ and D- before and during charging.
[0131] Correspondingly, in the embodiments of the present application, the terminal can set the value of the first control identifier to a second value, and / or set the value of the second control identifier to a third value, so as to prohibit the USB PHY from controlling the pins of the USB interface. The second value can be NONE, and the third value can be 1 or true.
[0132] The embodiment of the present application provides a charging method, when a connection with an external device is established, the connection line type between the external device is determined; if the connection line type is a debugging line, and the device type of the external device is an adapter, the pin of the USB interface is set to a high resistance state to prohibit the control of the USB PHY on the pin of the USB interface; and the first timer is started at the same time; after the running time of the first timer is exceeded, the control of the PMIC on the pin of the USB interface is prohibited; and the adapter is activated to establish fast charging communication. Therefore, in the embodiment of the present application, the terminal can determine the device type corresponding to the external device and the connection line type, so that whether the control of the USB PHY and the PMIC on D+ and D- is prohibited can be further determined according to the device type and the connection line type. Specifically, after it is determined that the external device is an adapter, the external device is connected with the terminal through the DEBUG line, and the external device is not wirelessly charged, the terminal can select to prohibit the control of the USB PHY and the PMIC on D+ and D-, so that only the VOOCPHY can control D+ and D-, thereby the interference of the DEBUG line on the fast charging communication can be avoided, the demand of supporting fast charging using the DEBUG line can be met, and the charging performance and the charging efficiency are greatly improved.
[0133] Based on the above embodiment, another embodiment of the present application provides a charging method, which is applied to a terminal, wherein the terminal can be configured with an analog-digital signal processing chip ADSP and an application processor AP, and a communication link between the ADSP and the AP is GLINK. Figure 10 Implementation process of the charging method provided by the embodiment of the present application Figure 5 As shown in the embodiment of the present application, the method for the terminal to charge can further include the following steps: Figure 10 As shown in the embodiment of the present application, the method for the terminal to charge can further include the following steps:
[0134] Step 201, a connection with an external device is established.
[0135] Step 202, a TYPE-C interrupt is triggered, and a connection line type is determined.
[0136] Step 203, whether the connection line type is a DEBUG line is judged, if yes, steps 204 and 205 are executed, otherwise, step 215 is executed.
[0137] In the embodiment of the present application, after the terminal establishes a connection with the external device through the connection line, the specific connection line type of the connection line can be determined first, so that whether the establishment of the fast charging communication is further determined based on the connection line type. Specifically, the terminal can determine the connection line type of the connection line by triggering the Type-C interrupt. The connection line type can be a debugging line (DEBUG line) or a TYPE-C line.
[0138] Exemplarily, in the present application, when the external device is inserted, the terminal will first have a TYPE-C interrupt triggered, in which, in the interrupt processing function, the corresponding TYPE-C register will be read to determine whether the inserted is a standard TYPE-C line or a DEBUG line.
[0139] Step 204, start timer 1.
[0140] Step 205, set the value of the connection line identifier to true.
[0141] In the embodiment of the present application, after determining that the connection line type is a DEBUG line, the terminal can first start timer 1, and can set the value of the connection line identifier to true.
[0142] Exemplarily, in the present application, if the terminal is connected with the external device through the DEBUG line, the ADSP can send a notify message to the AP through the GLINK bus to inform the AP that the currently inserted connection line is a DEBUG line, and accordingly, the AP can set the value of the connection line identifier DEBUG_flag to true, that is, set DEBUG_flag=true.
[0143] Step 206, when the running time of timer 1 is reached, trigger the APSD interrupt to determine the device type.
[0144] Step 207, determine whether the device type is an adapter, if yes, execute step 208, otherwise execute step 215.
[0145] Step 208, start timer 2.
[0146] In the embodiment of the present application, after the running time of timer 1 is reached, the terminal can determine the device type of the external device by triggering the APSD interrupt. If it is determined that the device type is an adapter, the terminal selects to start timer 2. The running time of timer 1 is used to determine the triggering time of the APSD interrupt.
[0147] Optionally, in the present application, after the TYPE-C interrupt, the terminal can select to trigger the APSD interrupt after a period of time (the running time of timer 1, such as several hundred ms), wherein the APSD interrupt is the result obtained through the BC1.2 charger type identification protocol. When the DCP is identified, it indicates that the device type of the external device at this time is an adapter, so the APSD needs to send a notify message to the AP through the GLINK bus again to inform the AP that the currently inserted external device is an adapter.
[0148] Further, in the present application, the ADSP can start a timer 2 with a running time of 800 ms, so as to ensure the completion of the conversion process from wireless charging to wired charging.
[0149] Step 209, judge whether the condition of prohibiting the control of D+ and D- is met, if yes, execute step 210, step 211, step 212 and step 213, otherwise execute step 215.
[0150] Step 210, set D+ and D- to high impedance state.
[0151] Step 211, set the value of the first control identifier to NONE.
[0152] Step 212, set the value of the second control identifier to true.
[0153] Step 213, when the running time of the timer 2 is reached, prohibit the identification function of PMIC and BC1.2.
[0154] In the embodiment of the present application, the terminal can judge whether the condition of prohibiting the control of D+ and D- is met, if yes, the terminal can select to set D+ and D- to high impedance state, set the value of the first control identifier to NONE, set the value of the second control identifier to true, and prohibit the identification function of PMIC and BC1.2 after the running time of the timer 2 is reached. The terminal can further select to determine whether the control of D+ and D- needs to be prohibited in combination with the charging mode, the connection line type and the device type.
[0155] Specifically, when the terminal determines that the connection line type of the connection line between the terminal and the external device is the debugging line, the device type of the external device is the adapter, and the charging mode is wired charging, the terminal can set D+ and D- to high impedance state, so as to prohibit the control of USBPHY on D+ and D-. Then, after the running time of the timer 2 is exceeded, the control of PMIC on D+ and D- is prohibited.
[0156] For example, in the present application, the AP in the terminal can judge whether the condition of prohibiting the control of D+ and D- is met in combination with the connection line type, the device type and the charging mode that have been acquired. When DEBUG_flag=true, the external device is the adapter, and it is not wireless charging, the AP can determine that the communication of USBPHY needs to be ignored at this time, therefore the AP can directly set the value of the first control identifier USB_ROLE to NONE, and then set D+ and D- to high impedance state through GLINK acting on the USBPHY of the ADSP.
[0157] It should be noted that in the present application, since wireless charging is coupled to the vbus through a wireless coil, an action similar to the charger type identification of wired charging will also occur, and therefore the charging mode of wireless charging needs to be excluded.
[0158] It can be understood that in the present application, the high resistance state represents that the state can be wired with other control D+, D- states, and the other states are the low high level state of VOOCPHY and the 01 loaded by the adapter on D+, D-.
[0159] Further, in the embodiment of the present application, in order to prohibit the USBPHY from controlling D+ and D- during fast charging, the terminal can also set a second control identifier, wherein the second control identifier ignore_usb_flag is a flag indicating that the state of setting the USB as HOST or DEVICE will be ignored. Accordingly, when the connection line is the DEBUG line, the right of the USBPHY to control D+ and D- is released before fast charging, and at the same time, the subsequent USBPHY of this connection is also prohibited from controlling D+ and D- through the second control identifier ignore_usb_flag, thereby realizing the requirement of the DEBUG line supporting fast charging.
[0160] It should be noted that in the embodiment of the present application, since the OTG mode of wireless reverse charging is changed to the general charging mode when wired fast charging is connected after wireless reverse charging, the PMIC needs a certain conversion time during the conversion process from wireless charging to wired charging, and therefore the terminal will select to prohibit the identification function of the PMIC and BC1.2 only after the running time of the timer 2 is reached.
[0161] Optionally, in the present application, the ADSP can enable the VOOCPHY for fast charging communication after starting the timer 2 with a running time of 800 ms. When the running time of the timer 2 is reached, the identification of the HVDCP and BC1.2 can be directly prohibited, thereby avoiding the control of the PMIC on D+ and D-.
[0162] That is, in the present application, after determining that the external device is an adapter and that the external device is connected to the terminal through the debugging line, the terminal can select to prohibit the USBPHY from controlling D+ and D-, or can select to prohibit the PMIC from controlling D+ and D- at the same time, at this time only the VOOCPHY can control D+ and D-, thereby avoiding the interference of the debugging line (DEBUG line) on fast charging communication.
[0163] Step 214, activating the adapter and establishing fast charging communication.
[0164] In the embodiment of the present application, after the terminal completes the process of prohibiting the USB PHY and the PMIC from controlling D+ and D-, the terminal can activate the adapter, so as to establish fast charging communication with the adapter.
[0165] Optionally, in the present application, the terminal can select to deactivate the adapter by means of the enable level shift function by sending a pulse train. After the fast charging adapter is activated, normal fast charging communication can be achieved.
[0166] Step 215: Do not prohibit the USB PHY and the PMIC from controlling D+ and D-.
[0167] Further, in the embodiment of the present application, Figure 11 Implementation flow of the charging method proposed in the embodiment of the present application Figure 6 As shown in Figure 11 After the connection with the external device is established, that is, after step 201, the charging method of the terminal can further include the following steps:
[0168] Step 216: After the connection with the external device is disconnected, turn off the timer 1 and the timer 2.
[0169] Step 207: Initialize the connection line identifier, the first control identifier, and the second control identifier.
[0170] In the embodiment of the present application, after the external device is disconnected from the terminal, the terminal can select to turn off the timer 1 and the timer 2, and can also select to initialize the connection line identifier, the first control identifier, and the second control identifier, that is, in the plug-out interruption, the USB_ROLE, the DEBUG_flag, the ignore_usb_flag, and the timer can be cleared, and the terminal can return to the most initial state.
[0171] The embodiment of the present application provides a charging method, a terminal device and a storage medium. When a connection with an external device is established, a connection line type of a connection line between the terminal device and the external device is determined; if the connection line type is a debugging line and a device type of the external device is an adapter, a pin of a USB interface is set to a high-impedance state to inhibit control of the pin of the USB interface by a USB PHY; meanwhile, a first timer is started; after a running time of the first timer is exceeded, control of the pin of the USB interface by a PMIC is inhibited; and the adapter is activated to establish fast charging communication. Therefore, in the embodiment of the present application, the terminal device can determine the device type corresponding to the external device and the connection line type, so as to further determine whether to inhibit control of D+ and D- by the USB PHY and the PMIC according to the device type and the connection line type. Specifically, after it is determined that the external device is the adapter, the external device is connected to the terminal device through the debugging line, and wireless charging is not used, the terminal device can select to inhibit control of D+ and D- by the USB PHY and the PMIC, so as to ensure that only VOOCPHY can control D+ and D-, thereby avoiding interference of the debugging line on the fast charging communication, meeting the requirement of supporting fast charging by using the debugging line, and greatly improving charging performance and charging efficiency.
[0172] Based on the above embodiment, in another embodiment of the present application, Figure 12 The terminal device provided in the embodiment of the present application has the structure as shown in Figure 1 As shown in Figure 12 The terminal device 10 provided in the embodiment of the present application can include a determination unit 11, a setting unit 12, an inhibition unit 13, and an activation unit 14.
[0173] The determination unit 11 is configured to determine a connection line type of a connection line between the terminal device and an external device when a connection with the external device is established.
[0174] The setting unit 12 is configured to, if the connection line type is a debugging line and a device type of the external device is an adapter, set a pin of a USB interface to a high-impedance state to inhibit control of the pin of the USB interface by a USB PHY; and start a first timer at the same time.
[0175] The inhibition unit 13 is configured to, after a running time of the first timer is exceeded, inhibit control of the pin of the USB interface by a PMIC.
[0176] The activation unit 14 is configured to activate the adapter to establish fast charging communication.
[0177] In the embodiment of the present application, further, Figure 13 The terminal device provided in the embodiment of the present application has the structure as shown in Figure 2 As shown in Figure 13As shown, the terminal device 10 proposed in the embodiments of the present application can further include a processor 15, a memory 16 storing executable instructions of the processor 15, further, the terminal device 10 can further include a communication interface 17, and a bus 18 for connecting the processor 15, the memory 16 and the communication interface 17.
[0178] In the embodiments of the present application, the processor 15 can be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It can be understood that, for different devices, the electronic device for implementing the functions of the processor can also be other devices, and the embodiments of the present application are not limited specifically. The terminal device 10 can further include a memory 16, which can be connected with the processor 15, wherein the memory 16 is configured to store executable program codes, the program codes including computer operation instructions, and the memory 16 can include a high-speed RAM memory and can also include a non-volatile memory, for example, at least two disk memories.
[0179] In the embodiments of the present application, the bus 18 is configured to connect the communication interface 17, the processor 15 and the memory 16, and the mutual communication among these devices.
[0180] In the embodiments of the present application, the memory 16 is configured to store instructions and data.
[0181] Further, in the embodiments of the present application, the processor 15 is configured to determine a connection line type of a connection line between the terminal device and an external device when a connection with the external device is established; if the connection line type is a debugging line and a device type of the external device is an adapter, set a pin of a USB interface to a high-impedance state to prohibit control of the pin of the USB interface by a USB PHY; at the same time, start a first timer; after the running time of the first timer is exceeded, prohibit control of the pin of the USB interface by a PMIC; and activate the adapter to establish fast charging communication.
[0182] In practical applications, the memory 16 can be a volatile memory, such as a random-access memory (RAM), or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or a combination of the above types of memories, and provides instructions and data to the processor 15.
[0183] In addition, each functional module in the embodiment can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional module.
[0184] If the integrated unit is realized in the form of a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiment can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the embodiment method. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0185] The embodiment of the present application provides a terminal device, when a connection with an external device is established, the connection line type of the connection line between the terminal device and the external device is determined; if the connection line type is a debugging line and the device type of the external device is an adapter, the pin of the USB interface is set to a high-impedance state to prohibit the control of the USB PHY on the pin of the USB interface; meanwhile, a first timer is started; after the running time of the first timer is exceeded, the control of the PMIC on the pin of the USB interface is prohibited; and the adapter is activated to establish fast charging communication. Therefore, in the embodiment of the present application, the terminal device can determine the device type corresponding to the external device and the connection line type, so as to further determine whether to prohibit the control of the USB PHY and the PMIC on D+ and D- according to the device type and the connection line type. Specifically, after it is determined that the external device is an adapter, the external device is connected with the terminal device through a DEBUG line, and the external device is not used for wireless charging, the terminal device can select to prohibit the control of the USB PHY and the PMIC on D+ and D-, so as to ensure that only the VOOCPHY can control D+ and D-, thereby avoiding the interference of the DEBUG line on the fast charging communication, meeting the requirement of supporting fast charging using the DEBUG line, and greatly improving the charging performance and the charging efficiency.
[0186] The embodiment of the present application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the charging method.
[0187] Specifically, the program instruction corresponding to the charging method in the embodiment can be stored on a storage medium such as an optical disc, a hard disk, a U disk, etc., and when the program instruction corresponding to the charging method in the storage medium is read or executed by an electronic device, the following steps are included:
[0188] When a connection with an external device is established, the connection line type of the connection line between the terminal device and the external device is determined;
[0189] If the connection line type is a debugging line and the device type of the external device is an adapter, the pin of the USB interface is set to a high-impedance state to prohibit the control of the USB PHY on the pin of the USB interface; meanwhile, a first timer is started;
[0190] After the running time of the first timer is exceeded, the control of the PMIC on the pin of the USB interface is prohibited;
[0191] The adapter is activated to establish fast charging communication.
[0192] Those skilled in the art will appreciate that embodiments of the application can be further implemented in a computer program product tangibly embodied in a machine-readable storage medium (e.g., memory storage) including instructions defining tasks to be performed by a processing system. Those skilled in the art will further appreciate that embodiments of the application can be further implemented in a system including a processing system and a memory coupled to the processing system, the memory storing one or more programs defining tasks to be performed by the processing system. Those skilled in the art will further appreciate that embodiments of the application can be further implemented in a system including a processing system and a memory coupled to the processing system, the memory storing one or more programs defining tasks to be performed by the processing system. Those skilled in the art will further appreciate that embodiments of the application can be further implemented in a system including a processing system and a memory coupled to the processing system, the memory storing one or more programs defining tasks to be performed by the processing system. Those skilled in the art will further appreciate that embodiments of the application can be further implemented in a system including a processing system and a memory coupled to the processing system, the memory storing one or more programs defining tasks to be performed by the processing system.
[0193] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0194] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0195] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks.
[0196] The above-described embodiments are merely possible implementations of the present application, and are not used to limit the protection scope of the present application.
Claims
1. A charging method characterized by, The method comprises: When a connection with an external device is established, a connection line type of a connection line between the external device is determined; If the connection line type is a debugging line and a device type of the external device is an adapter, a pin of a universal serial bus (USB) interface is set to a high-impedance state to disable control of the pin of the USB interface by a USB PHY; and a first timer is started at the same time; After a running time of the first timer is exceeded, control of the pin of the USB interface by a power management integrated circuit (PMIC) is disabled; The adapter is activated to establish fast charging communication.
2. The method of claim 1, wherein, The determination of the connection line type of the connection line between the external device when the connection with the external device is established comprises: When the connection with the external device is established, the connection line type of the connection line is determined by triggering a Type-C interrupt.
3. The method according to claim 1 or 2, characterized in that, After the determination of the connection line type of the connection line between the external device when the connection with the external device is established, the method further comprises: If the connection line type is a Type-C line and the device type of the external device is the adapter, the adapter is activated to establish the fast charging communication.
4. The method of claim 2, wherein, After the determination of the connection line type of the connection line between the external device when the connection with the external device is established, the method further comprises: The device type of the external device is determined.
5. The method of claim 4, wherein, The determination of the device type of the external device comprises: After the Type-C interrupt is triggered, a second timer is started; After a running time of the second timer is exceeded, port information corresponding to the external device is determined by triggering an APSD interrupt; The device type is determined according to the port information.
6. The method of claim 5, wherein, The determination of the device type according to the port information comprises: If the port information is a dedicated charging port (DCP), the device type is determined to be the adapter.
7. The method of claim 5, wherein, After the determination of the connection line type of the connection line between the external device when the connection with the external device is established, the method further comprises: When the connection with the external device is disconnected, the first timer and the second timer are closed, and a connection line identifier, a first control identifier, and a second control identifier are initialized.
8. The method of claim 7, wherein, The method further comprises: If the connection line type is the debugging line, a value of the connection line identifier is set to a first value.
9. The method of claim 7, wherein, The method further comprises: A value of the first control identifier is set to a second value, and / or a value of the second control identifier is set to a third value to disable the control of the pin of the USB interface by the USB PHY.
10. The method of claim 1, wherein, The method further comprises: If the connection line type is the debugging line, the device type is the adapter, and a charging mode is wired charging, the pin of the USB interface is set to the high-impedance state to disable the control of the pin of the USB interface by the USB PHY; and the first timer is started at the same time.
11. A terminal device, comprising: The terminal device comprises a determination unit, a setting unit, a disabling unit, and an activating unit, The determination unit is configured to determine a connection line type of a connection line between an external device when a connection with the external device is established. The setting unit is configured to set the pin of the USB interface to a high-impedance state to disable control of the pin of the USB interface by a USB PHY if the connection line type is a debug line and the device type of the external device is an adapter; and start a first timer at the same time. The disabling unit is configured to disable control of the pin of the USB interface by a PMIC after a running time of the first timer is exceeded. The activating unit is configured to activate the adapter to establish fast charging communication.
12. A terminal device, comprising: The terminal device comprises a processor and a memory storing instructions executable by the processor, and when the instructions are executed by the processor, the method of any one of claims 1-10 is implemented.
13. A computer-readable storage medium having stored thereon a program, characterized in that, The program is executed by the processor, and the method of any one of claims 1-10 is implemented.
Citation Information
Patent Citations
Apparatus and methods for USB connection in a multi-processor device
CN102640130A
Cable and use method thereof
CN111400220A