Charging method and device, electronic equipment, chip and medium
By detecting insertion and switching signals, the initial role of Type-C USB device is determined using the DPDM handshake method, which solves the charging problems caused by the randomness of the initial role and CC abnormality during device interconnection, and improves the user experience.
Patent Information
- Application Number
- CN202411367478.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-31
AI Technical Summary
The randomness of the initial role of the DRP device in the Type-C USB protocol causes the device to be plugged and unplugged repeatedly when interconnecting, which affects the user experience, and the CC line cannot be charged normally when it is abnormal or is not in place.
By detecting port insertion and switching signals, actively selecting the power supply mode, and using DPDM handshake to determine the initial role of the device, avoiding relying on CC lines, and determining the initial role configuration.
It solves the problem of initial role randomness in the Type-C protocol, avoids the problem of inability to charge due to CC exceptions or non-location, and improves the user experience of device interconnection.
Smart Images

Figure CN119231702A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communications, and in particular to a charging method and device, an electronic device, a chip, and a medium. Background Art
[0002] In Type-C USB (Universal Serial Bus) communication, the initial SRC (Source) / DFP (Downstream Facing Port) and SINK (Sink) / UFP (Upstream Facing Port) of the DRP (Dual Role Port) device are random, which will cause troubles for the interconnection of DRP devices. When device A charges device B or acts as a data host, it needs to be plugged and unplugged repeatedly to determine the correct role, affecting the user experience. Summary of the invention
[0003] The present disclosure provides a charging method and device, an electronic device, a chip and a medium, which determine the initial roles of devices at both ends by detecting port insertion or a switch signal for active selection of a section role, thereby not relying on a CC line and avoiding random determination of the initial role.
[0004] A first aspect embodiment of the present disclosure proposes a charging method, which is executed by a first device, where the first device is a dual-role port device, including: detecting whether a second device is inserted, and / or detecting whether a switch signal of the first device is received, the switch signal indicating whether the first device is in power supply mode; when the insertion of the second device is detected and / or the switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection; when the initial role configuration of the first device is a power supply device or a master device, the first device charges the second device.
[0005] In some embodiments of the present disclosure, when the insertion of the second device is detected and / or a switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: when it is detected that the second device is connected through the initial connection, starting a timer and determining whether a switch signal is detected; when the switch signal is detected, turning off the Type-C connection function of the first device and continuing to send a handshake signal to the second device through the DP channel; detecting whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0006] In some embodiments of the present disclosure, when the insertion of the second device is detected and / or a switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: when the insertion of the second device is detected, turning off the Type-C connection function of the first device, and continuously detecting whether a VBUS signal is received; when the VBUS signal is detected, detecting whether a handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0007] In some embodiments of the present disclosure, detecting whether a handshake is completed with the second device to determine the initial role configurations of the first device and the second device includes: detecting whether a confirmation signal is received from the second device via a DM channel within the timing of a timer; determining that a handshake is completed with the second device when a confirmation signal is received from the second device via the DM channel; determining that the initial role configuration of the first device is a power supply device or a master device, and the initial role configuration of the second device is a charging device or a slave device; converting the initial connection to a first connection, and the first device charges the second device via the first connection.
[0008] In some embodiments of the present disclosure, the method also includes: if no confirmation signal is received from the second device via the DM channel within the timing time of the timer, turning on the Type-C connection function of the first device; through the Type-C connection function, determining that the initial role of the first device is configured as a charging device or a slave device, and the initial role of the second device is configured as a power supply device or a master device, and the second device charges the first device via the Type-C connection.
[0009] In some embodiments of the present disclosure, when the insertion of the second device is detected and / or a switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: when it is detected that the second device is inserted through the initial connection, determining whether the switch signal is detected; when the switch signal is detected, pulling up the signal of the initial connection and short-circuiting the DP channel and the DM channel; determining that the initial role configuration of the first device is a power supply device or a master device, and the initial role configuration of the second device is a charging device or a slave device, and the first device charges the second device through a Type-C connection.
[0010] In some embodiments of the present disclosure, when the insertion of the second device is detected and / or a switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: when it is detected that the second device is inserted through the initial connection, determining whether the switch signal is detected; when the switch signal is detected, converting the VBUS signal from a low level to a high level, and short-circuiting the DP channel and the DM channel; determining that the initial role configuration of the first device is a power supply device or a master device, and the initial role configuration of the second device is a charging device or a slave device, and the first device charges the second device through the first connection.
[0011] A second aspect embodiment of the present disclosure proposes a charging method, which is executed by a first device, where the first device is a dual-role port device, including: detecting whether a switch signal of the first device is received, the switch signal indicating whether the first device is in power supply mode; when the switch signal is detected, controlling an indication signal of the first device, the indication signal is used by the second device to determine that the first device is in power supply mode or to broadcast that the first device is in power supply mode; when it is detected that the second device is inserted, determining the initial role configuration of the first device and the second device, and the first device charges the second device under the current connection.
[0012] In some embodiments of the present disclosure, controlling the indication signal of the first device includes: pulling up the signal of the current connection; and short-circuiting the DP channel and the DM channel of the first device.
[0013] In some embodiments of the present disclosure, controlling the indication signal of the first device includes: converting the VBUS signal of the first device from a low level to a high level; and short-circuiting the DP channel and the DM channel of the first device.
[0014] In some embodiments of the present disclosure, when the insertion of the second device is detected, determining the initial role configuration of the first device and the second device includes: starting a timer, turning off the Type-C connection function of the first device and continuously sending a handshake signal to the second device through the DP channel; within the timing time of the timer, detecting whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0015] In some embodiments of the present disclosure, whether a handshake with a second device is completed is detected within the timing of a timer, including: within the timing of the timer, detecting whether a confirmation signal is received from the second device via a DM channel; determining that a handshake with the second device is completed when a confirmation signal is received from the second device via a DM channel; determining that an initial role of the first device is configured as a power supply device or a master device, and an initial role of the second device is configured as a charging device or a slave device; converting the current connection to a first connection, and the first device charges the second device via the first connection.
[0016] The third aspect embodiment of the present disclosure proposes a communication device, including: a detection module, used to detect whether a second device is inserted, and / or detect whether a switch signal of a first device is received, the switch signal indicating whether the first device is in power supply mode; a determination module, used to determine the initial role configuration of the first device and the second device under the current connection when the insertion of the second device is detected and / or the switch signal is detected; a charging module, used when the initial role of the first device is configured as a power supply device or a master device, the first device charges the second device.
[0017] The fourth aspect embodiment of the present disclosure proposes a charging device, including: a detection module, used to detect whether a switch signal of a first device is received, the switch signal indicating whether the first device is in power supply mode; a processing module, used to control an indication signal of the first device when the switch signal is detected, the indication signal is used by the second device to determine that the first device is in power supply mode or to broadcast that the first device is in power supply mode; a charging module, used to determine the initial role configuration of the first device and the second device when it is detected that the second device is inserted, and the first device charges the second device under the current connection.
[0018] The fifth aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein when the processor is used to run the computer program, it executes the method described in any one of the embodiments of the first aspect or the second aspect of the present disclosure.
[0019] The sixth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to enable a computer to execute the method described in any one of the embodiments of the first aspect or the second aspect of the present disclosure.
[0020] The seventh aspect embodiment of the present disclosure proposes a chip, including at least one processor and a communication interface, the communication interface is used to receive signals input into the chip or output signals from the chip, the processor communicates with the communication interface and implements the method described in any one of the first aspect or the second aspect through logic circuits or execution code instructions.
[0021] In summary, the charging method and apparatus, electronic device, chip and medium proposed in the present disclosure include: the first device detects whether the second device is inserted, and / or detects whether a switch signal of the first device is received, the switch signal indicates whether the first device is in power supply mode; when the second device is detected to be inserted and / or the switch signal is detected, the initial role configuration of the first device and the second device under the current connection is determined; when the initial role of the first device is configured as a power supply device or a master device, the first device charges the second device. By adding a detection insertion, or adding a switch for actively selecting a power supply mode to determine the initial role of the devices at both ends, the problem of randomness in determining the initial role by the Type-C protocol is solved. At the same time, through the DPDM handshake method, the initial role configuration is determined without relying on the CC line, so that charging can be performed through other connection methods, solving the problem of CC abnormality or failure to charge when not in place.
[0022] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0024] Figure 1 A schematic diagram of a charging method according to an embodiment of the present disclosure;
[0025] Figure 2 A schematic diagram of a process for determining initial role configurations of a first device and a second device proposed in an embodiment of the present disclosure;
[0026] Figure 3 A schematic diagram of a process for determining initial role configurations of a first device and a second device proposed in an embodiment of the present disclosure;
[0027] Figure 4 A schematic diagram of a process for determining an initial role configuration proposed in an embodiment of the present disclosure;
[0028] Figure 5 A schematic diagram of a process for determining an initial role configuration proposed in an embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of a process for determining initial role configurations of a first device and a second device proposed in an embodiment of the present disclosure;
[0030] Figure 7 A schematic diagram of a process for determining initial role configurations of a first device and a second device proposed in an embodiment of the present disclosure;
[0031] Figure 8A schematic diagram of a charging method according to an embodiment of the present disclosure;
[0032] Fig. 9 A schematic diagram of a flow chart of an indication signal for controlling a first device proposed in an embodiment of the present disclosure;
[0033] Fig.10 A schematic diagram of a flow chart of an indication signal for controlling a first device proposed in an embodiment of the present disclosure;
[0034] Fig.11 A schematic diagram of a process for determining initial role configurations of a first device and a second device proposed in an embodiment of the present disclosure;
[0035] Fig.12 A schematic diagram of a process for detecting whether a handshake is completed with a second device according to an embodiment of the present disclosure;
[0036] Fig.13A A schematic diagram of a charging method provided by the present invention;
[0037] Fig. 13B A schematic diagram of a handshake waveform diagram provided by the present disclosure;
[0038] Fig. 13C A schematic diagram of a switch form provided for the present disclosure;
[0039] Fig.13D The handshake waveform TX trigger waveform diagram provided by the present disclosure using Type-C detection insertion;
[0040] Fig.13E A schematic diagram of a handshake waveform diagram provided by the present disclosure;
[0041] Fig.14 A schematic diagram of the structure of a charging device proposed in an embodiment of the present disclosure;
[0042] Fig.15 A schematic diagram of the structure of a charging device proposed in an embodiment of the present disclosure;
[0043] Fig.16 A schematic diagram of the structure of an electronic device proposed in an embodiment of the present disclosure;
[0044] Fig.17 A schematic diagram of the structure of a chip proposed in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0045] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0046] First, the professional terms involved in this disclosure are introduced:
[0047] 1. DRP: Dual Role Port. DRP devices can act as both DFP and UFP, and can dynamically switch between DFP and UFP. Typical DRP devices are notebook computers. In the Type-C interface, DRP refers to the dual role port, which can act as DFP or UFP as needed and support data transmission and power support.
[0048] 2. SRC (Source) / DFP (Downstream Facing Port): It can be understood as Host. DFP refers to the downlink transmission of data. It is a device for data downlink and external power supply. A typical DFP device is a power supply.
[0049] 3. SINK (power consumption end / sucking end) / UFP (Upstream Facing Port): It can be understood as Device. UFP can charge and provide data. Typical UFPs include USB flash drives and mobile hard drives.
[0050] 4. CC: Configuration Channel, configuration channel, is a key channel in USB Type-C, composed of two pins on the Type-C connector. When the Type-C interface is inserted into a device, the CC channel transmits two different voltages to detect the direction of the connector and determine the type of device. CC can not only detect the forward and reverse insertion, but also detect how much voltage the USB connection can provide.
[0051] 5. PD: Power Deliver, a communication protocol, is a new power and communication connection method that allows USB devices to transmit up to 100W (20V / 5A) of power between each other. It can also change the properties of the port, switch the port between DFP and UFP, and communicate to obtain the properties of the cable.
[0052] 6. VBUS: Voltage Bus, bus voltage, is used to represent the voltage bus in the USB interface, which is used to provide power supply voltage and transmission power related information. In the USB connection, VBUS carries the power supply signal and provides the required power for the connected device.
[0053] Type-C USB determines the initial role of the port device through the CC line. If it is a DRP device, the RP on the CC line will act as SRC, and the RD on the CC line will act as SINK. However, from the CC architecture of DRP, whether the CC is RP or RD when it is first inserted is random, and it has a lot to do with the proportion of RP when toggling the device design. It may cause the correct role to not be achieved after multiple consecutive insertions. In addition, if the Type-C interface is not connected to the CC line or the CC line is abnormal, the initial role judgment will fail, making it impossible for the other device to charge / power normally, seriously affecting the user experience of such devices.
[0054] In summary, in order to solve the technical problems in the related art, the embodiments of the present disclosure provide a charging method. Through a handshake method of a new DRP device, it is not necessary to rely on the CC line, and it can also reduce randomness. The initial role judgment can be realized according to the needs. Different from USB Type-C, this method can be used for new public charging protocols or private protocols.
[0055] The charging method provided in the present application will be described in detail below with reference to the accompanying drawings.
[0056] Figure 1 Schematic diagram of a charging method according to an embodiment of the present disclosure, the method is executed by a first device, the first device is a dual-role port device, such as Figure 1 As shown, the method comprises the following steps:
[0057] Step 101, detecting whether a second device is plugged in, and / or detecting whether a switch signal of a first device is received.
[0058] In some embodiments, the switch signal indicates whether the first device is in power supply mode.
[0059] In some embodiments, detecting whether the second device is inserted may be triggered by a CC line connection or in other ways.
[0060] In some embodiments, the second device may be a charging device or a DRP device, that is, the second device may be a single-role device or a dual-role device.
[0061] In some embodiments, the method for detecting whether the second device is inserted can be through a CID insertion detection method, for example, the four D interfaces of Type-C, one of the four D interfaces is float, and the other interfaces are connected together. When a second device is inserted, the four D interfaces will be connected to the ground, and the float D interface will change from a high level to a low level. When this change is detected, it means that the insertion of the second device is detected.
[0062] In some embodiments, detecting whether a switch signal of the first device is received may be setting a switch on the first device to actively select a power supply mode. When a user manually clicks on the first device to select, the first device may detect the switch signal.
[0063] In some embodiments, the switch for actively selecting the power supply mode set by the first device may be in the form of a software UI or in the form of a physical button.
[0064] In some embodiments, detecting whether a switch signal of the first device is received may be that the user of the first device actively selects the switch to trigger the switch signal, or the user does not actively select the switch to not trigger the switch signal. In other words, the user can select the initial role of the first device through the switch for actively selecting the power supply mode set on the first device. When the user selects, the initial role of the first device has a bias towards becoming a power supply device. When the user does not select, the initial role of the first device has a bias towards becoming a charging device. Whether to actively select does not directly affect the initial role configuration of the first device.
[0065] In some embodiments, the insertion of the second device and / or the presence or absence of a switch signal is a trigger condition for confirming the initial role configuration.
[0066] For example, a switch is made on the DRP device, and the user can use the switch to select whether to be a power supply device, that is, SRC or DFP or host / data host.
[0067] For example, the DRP device detects whether there is a device inserted. When the insertion is detected, a switch option for selecting a power supply mode pops up on the DRP device, and the user selects it to detect whether the first device has a switch signal.
[0068] Step 102: When the insertion of the second device and / or the switch signal is detected, the initial role configuration of the first device and the second device under the current connection is determined.
[0069] In some embodiments, the current connection may be decoupled from the Type-C communication mode.
[0070] In some embodiments, the current connection may be a new public charging protocol or a private protocol, which is different from the existing Type-C protocol and can determine the initial role configuration without using the CC line.
[0071] In some embodiments, the current connection may be a connection method according to an existing charging protocol, which may or may not be decoupled from Type-C, and this disclosure is not limited to this.
[0072] In some embodiments, when the insertion of a second device is detected, the initial role configuration of the first device and the second device under the current connection is determined. This can be when the first device detects the insertion of the second device through the CC line or other detection methods, based on the DP / DM handshake detection, to determine the initial role configuration of the first device and the second device.
[0073] In some embodiments, when the insertion of a second device is detected, a switch signal is detected. When the switch signal is detected, the initial role configuration of the first device and the second device is determined. This may be after the second device is inserted, the user actively selects a power supply mode on the first device, thereby triggering the switch signal, and then determining the initial role configuration of the first device and the second device through handshake detection.
[0074] In some embodiments, when the insertion of the second device is detected, the initial role configuration of the first device and the second device is determined through handshake detection. In this case, no switch is set on the first device.
[0075] In some embodiments, when the insertion of the second device is detected, the switch signal is detected, and when the switch signal is not detected, the initial role configuration of the first device and the second device is determined. It can be that after the second device is inserted, the user does not actively select the power supply mode on the first device, or does not actively press the option to become the power supply mode, then the first device does not detect the switch signal, and the first device and the second device perform a handshake detection to determine the initial role configuration of the first device and the second device.
[0076] For example, a switch for actively selecting a power supply mode is set on the DRP device. When a device is detected to be plugged in and the user actively chooses to become a power supply device, the DRP device will continue to send handshake signals and determine the initial role configuration of the first device and the second device by detecting whether the handshake is successful.
[0077] For example, a switch for actively selecting a power supply mode is set on the DRP device. When a device is detected to be plugged in and the user does not actively select the power supply device, the DRP device and the peer device will determine the initial role configuration of the devices at both ends through handshake detection.
[0078] For example, a switch for actively selecting a power supply mode is not set on the DRP device. When a device is detected to be plugged in, the DRP device and the peer device will determine the initial role configurations of both ends through handshake detection, or determine the initial role configurations of the devices at both ends through the Type-C confirmation process.
[0079] Step 103: When the initial role of the first device is configured as a power supply device or a master device, the first device charges the second device.
[0080] In some embodiments, the first device determines the initial role configuration through the above step 102, and may be determined as a power supply device or a charging device.
[0081] In some embodiments, when the first device is determined to be a power supply device or a master device, the first device charges the second device as a power supply device.
[0082] In some embodiments, when the first device is determined to be a charging device or a slave device, the second device serves as a power supply device to charge the first device.
[0083] In the above embodiment, by detecting whether the second device is inserted and / or whether there is a switch signal, the judgment of the initial role configuration is triggered. When the initial role of the first device is configured as a power supply device or a master device, the second device is charged under the current connection, avoiding the randomness problem of the Type-C protocol determining the initial role configuration.
[0084] Figure 2 A schematic diagram of a process for determining the initial role configuration of a first device and a second device proposed in an embodiment of the present disclosure, Figure 2 based on Figure 1 The embodiment shown, Figure 1 Step 102 in the further definition is as follows: Figure 2 As shown, the following steps are included:
[0085] Step 201: When it is detected that a second device is plugged in through an initial connection, a timer is started and it is determined whether a switch signal is detected.
[0086] In some embodiments, an option of whether to actively select a power supply mode is set on the first device. The option can be set on the display interface of the first device in the form of a software UI, or can be set on the physical host of the first device in the form of a physical button.
[0087] In some embodiments, the initial connection may be a CC connection or other connection modes, which is not limited in the present disclosure.
[0088] In some embodiments, the timer may be a timer for continuously performing handshake detection, the timing time of which may be a preset duration, and the start time of the timer is the time when the second device is inserted through the initial connection mode.
[0089] For example, when the insertion is detected, Twait is started, and it is determined whether the user actively chooses to become a power supply device.
[0090] In some embodiments, when it is detected that the second device is inserted through the initial connection, the first device pops up an option of whether to change to the power supply mode, and the user of the first device selects it, so that the first device detects whether there is a switch signal.
[0091] Step 202: When a switch signal is detected, the Type-C connection function of the first device is turned off and a handshake signal is continuously sent to the second device through the DP channel.
[0092] In some embodiments, when the switch signal is detected, the user of the first device may actively select the power supply mode.
[0093] For example, after the DRP device detects that a device is plugged in, an option to select a power supply mode or to start reverse fast charging pops up on the interface. The device user makes a selection through the UI switch option or physical button, and the DRP device detects the switch signal.
[0094] In some embodiments, when the first device detects a switch signal, it indicates that the first device has a tendency to become a power supply mode, and the Type-C connection function is turned off, and the initial role configuration of the devices at both ends may not be determined through the Type-C protocol.
[0095] In some embodiments, turning off the Type-C module and continuously sending a handshake signal to the second device through the DP channel may be to determine the initial role configuration of the devices at both ends not through the Type-C protocol, but through handshake detection to determine the initial role configuration of the first device and the second device.
[0096] In some embodiments, the handshake signal is continuously sent to the second device via the DP channel, which may be as follows: Fig. 13B As shown in the waveform diagram, the handshake signal can be two consecutive segments or multiple consecutive segments. The interval time between each pulse can be a preset duration, and its value can be arbitrarily selected between the minimum value and the maximum value. The probability of the initial role can be changed by changing the interval time.
[0097] In some embodiments, the handshake signal is continuously sent to the second device via the DP channel, and the first device may be preset as a power supply device to send the handshake signal to the second device.
[0098] In some embodiments, when the switch signal is not detected, it can be equivalent to not setting a switch option for actively selecting the power supply mode on the first device, that is, using Figure 3 The determination method of the illustrated embodiment determines the initial role configurations of the first device and the second device.
[0099] Step 203: Detect whether the handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
[0100] In some embodiments, a handshake signal is continuously sent to the second device via the DP channel, and whether the second device has completed the handshake with the first device is determined by detecting whether the timer has timed out or whether the VBUS signal is detected, thereby determining the initial role configuration of the first device and the second device under the current connection.
[0101] In some embodiments, a handshake signal is continuously sent to the second device via the DP channel, and the first device continuously performs handshake detection within the timing of the timer. When the timer times out, it detects whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0102] In some embodiments, a handshake signal is continuously sent to the second device via the DP channel. When the first device detects the VBUS signal, it detects whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0103] In the above embodiment, by detecting the insertion of the second device, a switch for actively selecting the power supply mode is added to the first device, and then a handshake detection is performed to determine the initial role configuration of the first device and the second device, thereby avoiding the randomness of determining the initial role configuration through the Type-C communication protocol, and determining the correct role without repeated plugging and unplugging, thereby improving the user experience.
[0104] Figure 3 A schematic diagram of a process for determining the initial role configuration of a first device and a second device proposed in an embodiment of the present disclosure, Figure 3 based on Figure 1 The embodiment shown, Figure 1 Step 102 in the further definition is as follows: Figure 3 As shown, the following steps are included:
[0105] Step 301, when it is detected that the second device is inserted, the Type-C connection function of the first device is turned off, and it is continuously detected whether a VBUS signal is received.
[0106] In some embodiments, no switch for actively selecting a power supply mode is provided on the first device or the second device.
[0107] In some embodiments, when the first device detects that the second device is inserted, the first device turns off the Type-C connection function of the first device. This can avoid using the Type-C protocol to determine the initial role configuration of the devices at both ends, and determine the initial role configuration of the devices at both ends through handshake detection.
[0108] In some embodiments, when the second device detects that the first device is inserted, it turns off the Type-C connection function of the second device. This can avoid using the Type-C protocol to determine the initial role configuration of the devices at both ends, and determine the initial role configuration of the devices at both ends through handshake detection.
[0109] For example, when the DRP device detects insertion, it performs a handshake detection and determines whether the handshake is successful by detecting whether there is a VBUS signal.
[0110] In some embodiments, the VBUS signal is not powered before the initial role confirmation is completed. Through handshake detection, when the handshake is successful, the VBUS on the device that first receives the confirmation signal of the handshake signal is powered on, thereby determining the initial role configuration of the devices at both ends by detecting the VBUS signal.
[0111] Step 302: When the VBUS signal is detected, it is detected whether the handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
[0112] In some embodiments, the VBUS signal may be a case where one end sends a handshake signal and the other end sends a confirmation signal, and the VBUS signal at the device end receiving the confirmation signal changes from a low level to a high level, thereby enabling the end to detect the VBUS signal.
[0113] In some embodiments, when a VBUS signal is detected, it indicates that the handshake between the first device and the second device is successful. This detection is performed by sending a handshake signal at one end and a confirmation signal at the other end. When the handshake is successful, the VBUS of the device on the end receiving the confirmation signal is powered on, thereby determining that the party sending the handshake signal is the power supply device, and the party sending the confirmation signal is the charging device.
[0114] In some embodiments, the first device and the second device send a handshake signal simultaneously, and at the device end that first detects the corresponding confirmation signal, the VBUS signal is converted from a low level to a high level, thereby detecting the VBUS signal, and then determining that the end that detects the VBUS signal is the power supply device and the other end is the charging device.
[0115] In some embodiments, when the first device does not detect the VBUS signal, it can choose whether to enter the power supply mode through Trouse, so that the VBUS signal is converted from a low level to a high level, and continue to detect whether the handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
[0116] In the above embodiment, the switch for actively selecting the power supply mode is not set on the first device. By detecting whether there is an insertion and then performing handshake detection to determine the initial role configuration of the devices at both ends, the randomness of determining the initial role configuration using the Type-C protocol can be avoided.
[0117] Figure 4 A schematic diagram of a process for determining an initial role configuration according to an embodiment of the present disclosure. Figure 1-3 The embodiment shown, Figure 4 right Figure 2 Step 203, Figure 3 Step 302 in is further defined, such as Figure 4 As shown, including:
[0118] Step 401: within the timing time of the timer, detect whether a confirmation signal replied by the second device through the DM channel is received.
[0119] In some embodiments, detecting whether a confirmation signal replied by the second device through the DM channel is received within the timing time of the timer can be used to confirm whether the two end devices have successfully handshaked within the timing time of the timer, thereby determining the initial role configuration of the two end devices.
[0120] In some embodiments, Figure 2 In the illustrated embodiment, the first device continuously sends a handshake signal to the second device via the DP channel, and detects whether a confirmation signal is received from the second device via the DM channel within the timing time of the timer.
[0121] For example, a switch for actively selecting the power supply mode is made on the DRP device, such as Fig. 13B As shown, at the beginning, there is no signal in DP / DM, and the DRP device user actively chooses to be the SRC. After the DRP device starts the SRC mode, the SRC will actively send a handshake signal on the DP, and detect whether a confirmation signal is received from the other device within the timing time of the timer.
[0122] In some embodiments, Figure 3 In the illustrated embodiment, the first device continuously sends a handshake signal to the second device through the DP channel, and the second device also continuously sends a handshake signal to the first device through the DP channel. The first device detects whether a confirmation signal from the second device is received within the timing period of the timer, and the second device also detects whether a confirmation signal from the first device is received within the timing period.
[0123] For example, when a switch for actively selecting a power supply mode is not set on the DRP device, when the DRP device detects insertion, both devices at both ends send a handshake signal and perform a handshake detection.
[0124] In some embodiments, whether a confirmation signal is received is detected within a timing period to determine whether the first device and the second device have completed handshaking.
[0125] In some embodiments, detecting whether a confirmation signal is received within a timing period may be detecting whether a VBUS signal is received to determine whether the first device and the second device have completed a handshake.
[0126] Step 402: upon receiving a confirmation signal replied by the second device through the DM channel, determining that the handshake with the second device is completed.
[0127] In some embodiments, Figure 2 In the illustrated embodiment, when a confirmation signal is received from the second device via the DM channel, it indicates that the first device and the second device have successfully shaken hands within the timing time of the timer.
[0128] For example, a switch for actively selecting the power supply mode is made on the DRP device, such as Fig. 13B As shown, at the beginning, there is no signal on DP / DM, and the DRP device user actively chooses to be the SRC. After the DRP device starts the SRC mode, the SRC will actively send a handshake signal on DP. After receiving the handshake signal, the other device replies with a handshake signal on DM, thereby determining the initial role configuration of the devices at both ends.
[0129] In some embodiments, Figure 3 In the illustrated embodiment, when the first device first receives a confirmation signal replied by the second device through the DM channel, the first device completes the handshake with the second device.
[0130] In some embodiments, Figure 3 In the illustrated embodiment, when the second device first receives a confirmation signal replied by the first device through the DM channel, the first device completes the handshake with the second device.
[0131] For example, when the switch for actively selecting the power supply mode is not set on the DRP device, when the DRP device detects insertion, both devices at both ends will send a handshake signal and perform a handshake detection. The party that completes the handshake detection first will detect the VBUS signal, and this end will act as the SRC and the other end as the SINK.
[0132] Step 403: determine that the initial role of the first device is configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device.
[0133] In some embodiments, after the handshake is completed, the initial role configuration of the first device and the second device may be determined.
[0134] In some embodiments, Figure 2In the illustrated embodiment, when the first device receives a confirmation signal replied by the second device through the DM channel within the timing time of the timer, the VBUS signal can be detected, thereby determining that the first device is a power supply device and the second device is a charging device.
[0135] In some embodiments, Figure 3 In the illustrated embodiment, the first device first detects a confirmation signal replied by the second device through the DM channel within the timing time of the timer, and then the first device detects the VBUS signal, thereby determining that the first device is a power supply device and the second device is a charging device.
[0136] In some embodiments, Figure 3 In the described embodiment, the second device first detects the confirmation signal replied by the first device through the DM channel within the timing time of the timer, and then the second device detects the VBUS signal, and then determines that the second device is a power supply device and the first device is a charging device.
[0137] Step 404: convert the initial connection into a first connection.
[0138] In some embodiments, the first device charges the second device via the first connection.
[0139] In some embodiments, the first connection may be a connection mode under other charging protocols, which is not limited in the present disclosure.
[0140] In some embodiments, the first connection may be a connection mode that is decoupled from the Type-C communication mode.
[0141] In some embodiments, the first connection may be a connection coupled with a Type-C communication mode.
[0142] In some embodiments, when the initial role configuration of the first device and the second device is determined by this method, the first device and the second device may be communicatively connected via the first connection.
[0143] In the above embodiment, after detecting the insertion of the second device and the switch signal, the first device is triggered to determine the initial role configuration of the first device and the second device through DPDM handshake detection, which solves the randomness problem of the Type-C protocol determining the initial role, and can also solve the problem of CC abnormality or non-existence causing charging failure.
[0144] Figure 5 A schematic diagram of a process for determining an initial role configuration according to an embodiment of the present disclosure, based on Figure 1-3 The embodiment shown, Figure 5 right Figure 2 Step 203, Figure 3 Step 302 in the further definition is as follows: Figure 5 As shown, including:
[0145] Step 501: When no confirmation signal is received from the second device via the DM channel within the timing time of the timer, the Type-C connection function of the first device is enabled.
[0146] In some embodiments, if the confirmation signal of the second device via the DM channel is not received within the timer, the confirmation signal may be as follows: Figure 2 In the illustrated embodiment, the timer times out and the handshake between the first device and the second device fails.
[0147] In some embodiments, if no confirmation signal is received from the second device via the DM channel within the timer, it may be as follows: Figure 2 In the illustrated embodiment, when the timer times out and no confirmation signal is received from the second device via the DM channel, the handshake between the first device and the second device fails.
[0148] In some embodiments, if the confirmation signal of the second device via the DM channel is not received within the timer, the confirmation signal may be as follows: Figure 3 In the illustrated embodiment, if neither the first device nor the second device detects the VBUS signal, the handshake between the first device and the second device fails.
[0149] In some embodiments, enabling the Type-C connection function of the first device may be determining the initial role configuration by enabling the Type-C connection function when a handshake between the first device and the second device fails.
[0150] Step 502: through the Type-C connection function, determine that the initial role of the first device is configured as a charging device or a slave device, the initial role of the second device is configured as a power supply device or a master device, and the second device charges the first device through the Type-C connection.
[0151] In some embodiments, determining the initial role configuration of the first device and the second device through the Type-C connection function can be to determine the initial role configuration of the devices at both ends through the Type-C protocol. In other words, the problem of initial role configuration can be solved through existing communication protocols.
[0152] In some embodiments, the Type-C connection function can be achieved by Figure 6 He Ru Figure 7 The illustrated embodiment determines the initial role configurations of the first device and the second device.
[0153] In the above embodiment, when the determination of the initial role configuration cannot be completed by handshake detection, the initial role configuration of the devices at both ends can be determined by the existing communication protocol Type-C protocol as a next best option.
[0154] Figure 6 A schematic diagram of a process for determining the initial role configuration of a first device and a second device according to an embodiment of the present disclosure. Figure 1 The embodiment shown, Figure 6 right Figure 1 Step 102 in the above is further defined. Figure 6 As shown, including:
[0155] Step 601: When it is detected that a second device is plugged in through an initial connection, it is determined whether a switch signal is detected.
[0156] In some embodiments, the initial connection may be in CC connection mode.
[0157] In some embodiments, the initial connection may be a connection mode under other charging protocols, which is not limited in the present disclosure.
[0158] In some embodiments, the initial connection may be a connection mode coupled with Type-C or a connection mode decoupled from Type-C, which is not limited in the present disclosure.
[0159] In some embodiments, a switch for actively selecting a power supply mode is provided on the first device. When it is detected that a second device is inserted through an initial connection, it is determined whether a switch signal is detected. This can be when it is detected that the second device is inserted, it is determined whether a user of the first device has turned on the active selection of the power supply mode.
[0160] In some embodiments, the option for actively selecting the power supply mode set on the first device may be set on the display interface of the first device in the form of a software UI, or may be set on the physical host of the first device in the form of a physical button.
[0161] For example, a switch for actively selecting a power supply mode is added to the terminal device. After detecting that a device is plugged in, an option pops up for the user to choose whether to use it as a power supply device.
[0162] Step 602: When a switch signal is detected, the signal of the initial connection is pulled high, and the DP channel and the DM channel are short-circuited.
[0163] In some embodiments, when a switch signal is detected, the initial connection signal is pulled high, which can be done by pulling up the RP of the CC to determine that the first device is a power supply device. Even if the other device does not perform PD communication, it can broadcast the power supply capability through the first device to determine its own initial role configuration.
[0164] In some embodiments, pulling up the currently connected signal can be through the Toggle mode of TRYSOURCE DRP. In this mode, the currently connected signal is in the form of a pull-up (RP)-pull-down (RD) pulse, and the frequency remains consistent. By detecting the insertion timing of the second device, when the second device is inserted at a low position (RD), the currently connected signal is forced to be pulled high (i.e., changed to RP). When the second device is inserted at a high position (RP), the currently connected signal is kept at a high position, thereby causing the first device to enter the power supply mode.
[0165] In some embodiments, the method of pulling up the currently connected signal may also be other implementations, which are not limited in the present disclosure.
[0166] In some embodiments, shorting the DP channel with the DM channel may be performed by shorting with a RDCP_DAT resistor.
[0167] For example, Fig.13E As shown in the waveform diagram, when the user of the terminal device clicks the switch, the terminal device will act as SRC, and the controller will pull up the RP of CC and short-circuit the DPDM in the communication module. After the other device is connected, even if PD communication is not performed, the subsequent charging communication can be completed through DCP role judgment.
[0168] Step 603: Determine that the initial role of the first device is configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device.
[0169] In some embodiments, the first device charges the second device via a Type-C connection.
[0170] In some embodiments, by means of a switch provided on the first device and by controlling related signals, the first device determines the initial role configuration of the devices at both ends, thereby completing the charging communication of the first device.
[0171] In the above embodiment, by turning on the device switch option on the first device, after clicking the switch, the relevant indication signal on the first device is controlled so that the first device and the opposite device determine the initial role configuration of the devices at both ends, thereby determining the initial roles of the devices at both ends without handshake detection.
[0172] Figure 7 A schematic diagram of a process for determining the initial role configuration of a first device and a second device according to an embodiment of the present disclosure. Figure 1 The embodiment shown, Figure 7 right Figure 1 Step 102 in the above is further defined. Figure 7 As shown, including:
[0173] Step 701: When it is detected that a second device is plugged in through an initial connection, it is determined whether a switch signal is detected.
[0174] In some embodiments, the initial connection may be a CC connection or other communication connection modes, which is not limited in the present disclosure.
[0175] In some embodiments, the initial connection may be a connection mode coupled with Type-C or a connection mode decoupled from Type-C, which is not limited in the present disclosure.
[0176] In some embodiments, a switch for actively selecting a power supply mode is provided on the first device. When it is detected that a second device is inserted through an initial connection, it is determined whether a switch signal is detected. This can be when it is detected that the second device is inserted, it is determined whether a user of the first device has turned on the active selection of the power supply mode.
[0177] In some embodiments, the option for actively selecting the power supply mode set on the first device may be set on the display interface of the first device in the form of a software UI, or may be set on the physical host of the first device in the form of a physical button.
[0178] For example, a switch for actively selecting a power supply mode is added to the terminal device. After detecting that a device is plugged in, an option pops up for the user to choose whether to use it as a power supply device.
[0179] Step 702: When a switch signal is detected, the VBUS signal is converted from a low level to a high level and the DP channel and the DM channel are short-circuited.
[0180] In some embodiments, when a switch signal is detected, that is, the user of the first device actively selects a power supply mode, triggering the switch signal so that the first device detects the switch signal. In this case, the first device acts as a power supply device.
[0181] In some embodiments, shorting the DP channel with the DM channel may be performed by shorting with a RDCP_DAT resistor.
[0182] In some embodiments, by converting the VBUS signal from a low level to a high level and short-circuiting the DP channel and the DM channel, the controller can power on the VBUS and short-circuit the DPDM in the communication module, so that the second device can determine that the first device is a power supply device, and then determine its own initial role configuration.
[0183] Step 703: determine that the initial role configuration of the first device is a power supply device or a master device, and the initial role configuration of the second device is a charging device or a slave device.
[0184] In some embodiments, the first device charges the second device via a first connection, the first connection being different than the initial connection.
[0185] In some embodiments, the first connection may be a connection mode decoupled from the Type-C communication mode.
[0186] In some embodiments, the first connection may be a connection mode under other charging protocols, which may or may not be decoupled from the Type-C communication mode, which is not limited in the present disclosure.
[0187] In some embodiments, the first device determines through a switch that it has a tendency to become a power supply device, and through VBUS power-on and DPDM short-circuiting, the first device is a power supply device and the second device is a charging device under the first connection, and then the first device charges the second device through the first connection.
[0188] In the above embodiment, the first device can determine the initial role configuration of the first device and the second device and charge the second device through the first connection only through switch control and controller control related signals without sending a handshake waveform.
[0189] Figure 8 A schematic diagram of a charging method according to an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, the following steps are included:
[0190] Step 801: Detect whether a switch signal from a first device is received.
[0191] In some embodiments, the switch signal indicates whether the first device is in power supply mode.
[0192] In some embodiments, detecting whether a switch signal of the first device is received may be setting a switch on the first device to actively select a power supply mode, which may be set in the form of software or in the form of a mechanical button.
[0193] For example, Fig. 13C As shown, a switch option for actively selecting a power supply mode is set on a DRP device through a software UI. When the option is slid, it means that the user actively selects the power supply mode.
[0194] In some embodiments, detecting whether a switch signal of the first device is received may be detecting whether a switch signal triggered by a user of the first device actively selecting a power supply mode is received.
[0195] Step 802: When a switch signal is detected, control the indication signal of the first device.
[0196] In some embodiments, the indication signal is used by the second device to determine that the first device is in power supply mode, or is used to broadcast that the first device is in power supply mode.
[0197] In some embodiments, the indication signal of the first device may be controlled by pulling up a level corresponding to a signal capable of indicating that the first device is in power supply mode.
[0198] In some embodiments, the indication signal of the first device may be a signal of a CC connection or a signal of other connections, which is not limited in the present disclosure.
[0199] In some embodiments, the indication signal of the first device may be a supply voltage signal, for example, a VBUS signal.
[0200] In some embodiments, the indication signal of the first device may be a differential voltage signal, for example, a signal between a DP channel and a DM channel.
[0201] For example, a user of the DRP device clicks a switch, so that the controller adjusts the relevant indication signal of the DRP device to indicate that the device is in power supply mode or broadcasts that the device is in power supply mode.
[0202] Step 803: When the insertion of the second device is detected, the initial role configuration of the first device and the second device is determined.
[0203] In some embodiments, the first device charges the second device under the current connection.
[0204] In some embodiments, when the insertion of the second device is detected, the second device parses the indication signal and determines that the first device is a power supply device, and the second device is a charging device, thereby determining that the first device is charging the second device.
[0205] In some embodiments, the current connection may be a CC connection or other communication connection modes, which is not limited in the present disclosure.
[0206] In some embodiments, when the insertion of the second device is detected, the initial role configuration of the first device and the second device can also be determined by handshake detection.
[0207] In the above embodiment, a switch is set on the first device, so that when the switch is clicked, the first device is determined as a power supply device by controlling the indication signal of the first device. After the second device is inserted, it can be charged by the first device as a charging device, so as to determine the initial role configuration of the devices at both ends, avoid the randomness of determining the initial role configuration through the Type-C protocol, and further improve the user experience.
[0208] Fig. 9 A schematic diagram of a flow chart of controlling an indication signal of a first device according to an embodiment of the present disclosure, based on Figure 8 The embodiment shown, Fig. 9 right Figure 8 Step 802 in the embodiment is further defined as Fig. 9 As shown, the following steps are included:
[0209] Step 901, pull the currently connected signal high.
[0210] In some embodiments, the current connection may be a CC connection, a Type-C connection, or other connection modes, which are not limited in the present disclosure.
[0211] In some embodiments, the currently connected signal may be pulled high by pulling up the RP, that is, the CC signal is converted from a low level to a high level.
[0212] For example, after the user of the DRP device clicks the switch, the device acts as an SRC, and at this time, the RP of the CC is pulled high.
[0213] In some embodiments, pulling up the currently connected signal can be through the Toggle mode of TRYSOURCE DRP. In this mode, the currently connected signal is in the form of a pull-up (RP)-pull-down (RD) pulse, and the frequency remains consistent. By detecting the insertion timing of the second device, when the second device is inserted at a low position (RD), the currently connected signal is forced to be pulled high (i.e., changed to RP). When the second device is inserted at a high position (RP), the currently connected signal is kept at a high position, thereby causing the first device to enter the power supply mode.
[0214] In some embodiments, the method of pulling up the currently connected signal may also be other implementations, which are not limited in the present disclosure.
[0215] Step 902: Short-circuit the DP channel and the DM channel of the first device.
[0216] In some embodiments, shorting the DP channel and the DM channel of the first device may be performed by shorting through a RDCP-DAT resistor.
[0217] In some embodiments, shorting the DP channel and the DM channel of the first device may eliminate or significantly reduce the differential signal.
[0218] In the above embodiment, by adding a switch option to the device, when the user clicks the switch, the indication signal on the device can be controlled so that the inserted counterpart device can determine that the device is a power supply device by analyzing the indication signal, thereby determining the initial role configuration of the devices at both ends, thereby achieving the purpose of determining the initial role without handshake detection.
[0219] Fig.10 A schematic diagram of a flow chart of controlling an indication signal of a first device according to an embodiment of the present disclosure, based on Figure 8 The embodiment shown, Fig.10 right Figure 8 Step 802 in the embodiment is further defined as Fig.10 As shown, the following steps are included:
[0220] Step 1001: convert the VBUS signal of the first device from a low level to a high level.
[0221] In some embodiments, converting the VBUS signal of the first device from a low level to a high level may be directly powering on VBUS when a switch signal is detected, thereby changing the power supply state of the first device, ie, converting the first device to a power supply mode.
[0222] Illustratively, a user of a DRP device flips a switch so that the controller directly powers up VBUS of the device.
[0223] Step 1002: short-circuit the DP channel and the DM channel of the first device.
[0224] In some embodiments, shorting the DP channel and the DM channel of the first device may be performed by shorting through a RDCP-DAT resistor.
[0225] In some embodiments, shorting the DP channel and the DM channel of the first device may eliminate or significantly reduce the differential signal.
[0226] In the above embodiment, by adding a switch option to the device, when the user clicks the switch, the indication signal on the device can be controlled so that the inserted counterpart device can determine that the device is a power supply device by analyzing the indication signal, thereby determining the initial role configuration of the devices at both ends, thereby achieving the purpose of determining the initial role without handshake detection.
[0227] Fig.11 A schematic diagram of a process for determining the initial role configuration of a first device and a second device according to an embodiment of the present disclosure, based on Figure 8 The embodiment shown, Fig.11 right Figure 8 Step 803 in the further definition is as follows: Fig.10 As shown, the following steps are included:
[0228] Step 1101, start a timer, turn off the Type-C connection function of the first device and continue to send a handshake signal to the second device through the DP channel.
[0229] In some embodiments, the timer may be a timer for continuously performing handshake detection, the timing time of which may be a preset duration, and the start time of the timer is the time when the second device is inserted through the initial connection mode.
[0230] For example, when insertion is detected, Twait is turned on, and the Type-C connection function is turned off, and the handshake signal is continuously sent.
[0231] In some embodiments, when the insertion of the second device is detected, a timer is started, and a handshake signal is continuously sent to the second device through the DP channel within the timing time of the timer.
[0232] In some embodiments, when the first device detects a switch signal, it indicates that the first device has a tendency to become a power supply mode. When the second device is inserted, the Type-C connection function of the first device is turned off. The initial role configuration of the devices at both ends may be determined without using the Type-C protocol.
[0233] In some embodiments, the handshake signal is continuously sent to the second device via the DP channel, which may be as follows: Fig. 13B As shown in the waveform diagram, the handshake signal can be two consecutive segments or multiple consecutive segments. The interval time between each pulse can be a preset duration, and its value can be arbitrarily selected between the minimum value and the maximum value. The probability of the initial role can be changed by changing the interval time.
[0234] In some embodiments, the handshake signal is continuously sent to the second device via the DP channel, and the first device may be preset as a power supply device to send the handshake signal to the second device.
[0235] In some embodiments, the specific implementation of starting the timer, turning off the Type-C connection function of the first device and continuously sending the handshake signal to the second device through the DP channel can be seen in Figure 2 The specific implementation method of step 202 in will not be repeated here.
[0236] In some embodiments, after the second device is inserted, the timer is started and the Type-C connection function is turned off, or the second device continues to send a handshake signal to the first device through the DP channel. In some embodiments, the Type-C connection function of the first device is turned off and the handshake signal is continuously sent to the second device through the DP channel, or when the insertion of the second device is detected, the Type-C connection function of the first device is turned off and the VBUS signal is continuously detected.
[0237] In some embodiments, the specific implementation of turning off the Type-C connection function of the first device and continuously detecting whether the VBUS signal is received may be as follows: Figure 3The specific implementation manner shown in step 301 is shown.
[0238] In some embodiments, after detecting that the second device is inserted, the first device and the second device may be implemented as follows: Figure 2 or Figure 3 The specific implementation of the embodiment shown in will not be repeated here.
[0239] Step 1102: within the timing time of the timer, detect whether the handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
[0240] In some embodiments, within the timing of the timer, detecting whether the handshake with the second device is completed may be that the first device continuously detects whether there is a confirmation signal replied by the second device on the DM channel to detect whether the handshake with the second device is completed.
[0241] In some embodiments, within the timing time of the timer, it is detected whether the handshake with the second device is completed to determine the specific implementation method of the initial role configuration of the first device and the second device. Figure 2 The specific implementation method of step 203 in will not be repeated here.
[0242] In some embodiments, within the timing of the timer, detecting whether the handshake with the second device is completed can be that the first device and the second device both continue to send handshake signals, and by determining the device that first detects the confirmation signal, it is determined that the first device and the second device have completed the handshake, and then the initial role configuration of the first device and the second device is determined.
[0243] In some embodiments, detecting whether the handshake with the second device is completed within the timing time of the timer may be detecting whether the handshake with the second device is completed when a VBUS signal is detected.
[0244] In some embodiments, when the VBUS signal is detected, the specific implementation method of detecting whether the handshake with the second device is completed can be found in Figure 3 The specific implementation method of step 302 in will not be repeated here.
[0245] In the above embodiment, by detecting the switch signal and the insertion of the second device, the initial role configuration of the first device and the second device is determined by handshake detection, thereby solving the problem of randomness of initial role determination by the Type-C protocol.
[0246] Fig.12 A schematic diagram of a process for detecting whether a handshake is completed with a second device according to an embodiment of the present disclosure, based on Figure 8 , Fig.11 The embodiment shown, Fig.12 right Fig.11 Step 1102 in is further defined as Fig.12 As shown, the following steps are included:
[0247] Step 1201: within the timing of the timer, detect whether a confirmation signal replied by the second device through the DM channel is received.
[0248] In some embodiments, detecting whether a confirmation signal replied by the second device through the DM channel is received within the timing time of the timer can be used to confirm whether the two end devices have successfully handshaked within the timing time of the timer, thereby determining the initial role configuration of the two end devices.
[0249] In some embodiments, Fig.11 In the illustrated embodiment, the first device continuously sends a handshake signal to the second device via the DP channel, and detects whether a confirmation signal is received from the second device via the DM channel within the timing time of the timer.
[0250] For example, a switch for actively selecting the power supply mode is made on the DRP device, such as Fig. 13B As shown, at the beginning, there is no signal in DP / DM, and the DRP device user actively chooses to be the SRC. After the DRP device starts the SRC mode, the SRC will actively send a handshake signal on the DP, and detect whether a confirmation signal is received from the other device within the timing time of the timer.
[0251] In some embodiments, Fig.11 In the illustrated embodiment, the first device continuously sends a handshake signal to the second device through the DP channel, and the second device also continuously sends a handshake signal to the first device through the DP channel. The first device detects whether a confirmation signal from the second device is received within the timing period of the timer, and the second device also detects whether a confirmation signal from the first device is received within the timing period.
[0252] For example, when the user of the DRP device does not actively select a power supply mode, when the DRP device detects insertion, both devices at both ends will send a handshake signal and perform a handshake detection.
[0253] In some embodiments, whether a confirmation signal is received is detected within a timing period to determine whether the first device and the second device have completed handshaking.
[0254] In some embodiments, detecting whether a confirmation signal is received within a time period may be detecting whether a VBUS signal is received to determine whether the first device and the second device have completed handshake. Step 1202: upon receiving a confirmation signal replied by the second device via a DM channel, determining that handshake with the second device is completed.
[0255] In some embodiments, Fig.11In the illustrated embodiment, when a confirmation signal is received from the second device via the DM channel, it indicates that the first device and the second device have successfully shaken hands within the timing time of the timer.
[0256] For example, a switch for actively selecting the power supply mode is made on the DRP device, such as Fig. 13B As shown, at the beginning, there is no signal on DP / DM, and the DRP device user actively chooses to be the SRC. After the DRP device starts the SRC mode, the SRC will actively send a handshake signal on DP. After receiving the handshake signal, the other device replies with a handshake signal on DM, thereby determining the initial role configuration of the devices at both ends.
[0257] In some embodiments, Fig.11 In the illustrated embodiment, when the first device first receives a confirmation signal replied by the second device through the DM channel, the first device completes the handshake with the second device.
[0258] In some embodiments, Fig.11 In the illustrated embodiment, when the second device first receives a confirmation signal replied by the first device through the DM channel, the first device completes the handshake with the second device.
[0259] For example, when the user of the DRP device does not actively select the power supply mode, when the DRP device detects the insertion, both devices will send a handshake signal and perform a handshake detection. The party that completes the handshake detection first will detect the VBUS signal, and then that end will act as the SRC and the other end as the SINK.
[0260] Step 1203 : Determine that the initial role configuration of the first device is a power supply device or a master device, and the initial role configuration of the second device is a charging device or a slave device.
[0261] In some embodiments, after the handshake is completed, the initial role configuration of the first device and the second device may be determined.
[0262] In some embodiments, Fig.11 In the illustrated embodiment, when the first device receives a confirmation signal replied by the second device through the DM channel within the timing time of the timer, the VBUS signal can be detected, thereby determining that the first device is a power supply device and the second device is a charging device.
[0263] In some embodiments, Fig.11 In the illustrated embodiment, the first device first detects a confirmation signal replied by the second device through the DM channel within the timing time of the timer, and then the first device detects the VBUS signal, thereby determining that the first device is a power supply device and the second device is a charging device.
[0264] In some embodiments, Fig.11 In the described embodiment, the second device first detects the confirmation signal replied by the first device through the DM channel within the timing time of the timer, and then the second device detects the VBUS signal, and then determines that the second device is a power supply device and the first device is a charging device.
[0265] Step 1204: convert the current connection to a first connection, and the first device charges the second device through the first connection.
[0266] In some embodiments, the first device charges the second device via the first connection.
[0267] In some embodiments, the first connection may be a connection mode under other charging protocols, which is not limited in the present disclosure.
[0268] In some embodiments, the first connection may be a connection mode that is decoupled from the Type-C communication mode.
[0269] In some embodiments, the first connection may be a connection coupled with a Type-C communication mode.
[0270] In some embodiments, when the initial role configuration of the first device and the second device is determined by this method, the first device and the second device can be communicatively connected through a first connection, that is, the first device can charge the second device through the first connection, or the second device can charge the first device through the first connection.
[0271] The specific implementation of the above steps 1201 to 1204 can be found in Figure 4 The specific implementation of the illustrated embodiment will not be described in detail here.
[0272] In the above embodiment, the method also includes turning on the Type-C connection function of the first device if no confirmation signal is received from the second device through the DM channel within the timing time of the timer; determining through the Type-C connection function that the initial role of the first device is configured as a charging device or a slave device, and the initial role of the second device is configured as a power supply device or a master device, and the second device charges the first device through the Type-C connection.
[0273] The specific implementation of the above embodiment can be found in Figure 5 The specific implementation of the illustrated embodiment will not be described in detail here.
[0274] In the above embodiment, after detecting the insertion of the second device and the switch signal, the first device is triggered to determine the initial role configuration of the first device and the second device through DPDM handshake detection, which solves the randomness problem of the Type-C protocol determining the initial role, and can also solve the problem of CC abnormality or non-existence causing charging failure.
[0275] Fig.13A A schematic diagram of a charging method provided by the present disclosure is shown in FIG. Fig.13A As shown, there are two solutions:
[0276] Solution 1:
[0277] This embodiment proposes a new type of handshake method for DRP devices. The handshake signal uses DP / DM as a channel. For a single device, when one DP or DM is TX, the other is RX. The handshake waveform is shown in FIG. Fig. 13B As shown, Fig. 13B In the example, DP is TX. Before the initial role confirmation is completed, VBUS is not powered. The handshake waveform is sent through TX. After receiving the handshake waveform, the other end RX sends a confirmation signal. The initial role can be established through the handshake waveform. Then VBUS is powered on, so that the condition for VBUS power-on changes from the initial connection to DPDM handshake. The role judgment condition of the handshake waveform is that whoever receives the handshake signal first replies with a confirmation signal on RX. Finally, the end that replies with a confirmation signal on RX is judged as SINK. The handshake signal is in the form of continuous pulses, and the pulse timing meets the preset requirements, such as Fig. 13B As shown, Tdet1 is the pulse duration, Tdet2 is the interval between consecutive pulses, Fig. 13B The handshake pulse can be two consecutive segments or multiple consecutive segments. Tretryhandshake is the interval time between two consecutive pulses. This time can be customized and selected from min to max. By changing this time, the probability of the initial role can be changed. The timing of the confirmation signal can be the same as the handshake pulse or different.
[0278] Method 1:
[0279] Make a switch (physical or software UI) on the DRP device. The switch can be in software form, such as Fig. 13C As shown, or in the form of mechanical buttons. At the beginning, the DP / DM signals are both low level, and the user decides whether to act as SRC. After starting the SRC mode on the DRP device, the SRC will actively send a handshake signal on the DP, while the SINK will not send it. After receiving the handshake signal, the SINK will reply with a confirmation signal on the DM, so that the handshake is successful and the initial role configuration of both parties is determined.
[0280] Method 2: No switch is set on the DRP device (physical or software UI). When the DRP device detects insertion (detection of insertion can be triggered by CC connection or other methods), the party that completes the handshake detection first will act as SRC, and the other end will act as SINK. At this time, VBUS is powered. If CC is in place, CC is switched to the corresponding level of the role, such as Fig.13DThe handshake waveform TX trigger waveform using Type-C detection insertion is shown.
[0281] Solution 2: This embodiment does not send a handshake waveform, but uses the existing communication protocol to solve the initial role problem.
[0282] Method 1: Add a switch to the terminal device. Click the switch to act as SRC. At this time, pull up the RP of CC or change it to the Toggle mode of TRY SOURCE DRP. At the same time, short the DPDM in the communication module. After the opposite device is connected, even if PD communication is not performed, the subsequent charging communication can be completed through DCP role judgment. The waveform is as follows Fig.13E As shown, this method cannot achieve decoupling from Type-C.
[0283] Method 2: Add a switch on the terminal device. When the switch is clicked, it will act as SRC. After clicking the switch, VBUS will be powered directly and DPDM will be short-circuited to achieve decoupling from Type-C.
[0284] The charging method proposed in the present disclosure has the following beneficial effects:
[0285] 1. Solve the problem of random initial role judgment of Type-C;
[0286] 2. Solve the problem of CC abnormality or failure to charge when it is not in place.
[0287] Fig.14 FIG. 1 is a schematic diagram of the structure of a charging device 1400 according to an embodiment of the present disclosure. Fig.14 As shown, the device includes: a detection module 1410, a determination module 1420, and a charging module 1430.
[0288] The detection module 1410 is used to detect whether the second device is plugged in and / or detect whether a switch signal of the first device is received, where the switch signal indicates whether the first device is in power supply mode.
[0289] The determination module 1420 is used to determine the initial role configuration of the first device and the second device under the current connection when the insertion of the second device is detected and / or the switch signal is detected.
[0290] The charging module 1430 is configured to enable the first device to charge the second device when the initial role of the first device is configured as a power supply device or a master device.
[0291] In some embodiments, the determination module is also used to start a timer and determine whether a switch signal is detected when it is detected that a second device is connected through an initial connection; when a switch signal is detected, turn off the Type-C connection function of the first device and continue to send a handshake signal to the second device through the DP channel; detect whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0292] In some embodiments, the determination module is also used to turn off the Type-C connection function of the first device when it is detected that the second device is inserted, and continuously detect whether the VBUS signal is received; when the VBUS signal is detected, detect whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0293] In some embodiments, the determination module is also used to detect whether a confirmation signal is received from the second device via the DM channel within the timing time of the timer; when a confirmation signal is received from the second device via the DM channel, determine that the handshake with the second device is completed; determine that the initial role of the first device is configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device; convert the initial connection to a first connection, and the first device charges the second device via the first connection.
[0294] In some embodiments, the determination module is also used to enable the Type-C connection function of the first device if no confirmation signal is received from the second device through the DM channel within the timing time of the timer; through the Type-C connection function, determine that the initial role of the first device is configured as a charging device or a slave device, and the initial role of the second device is configured as a power supply device or a master device, and the second device charges the first device through the Type-C connection.
[0295] In some embodiments, the determination module is also used to determine whether a switch signal is detected when it is detected that a second device is inserted through an initial connection; when a switch signal is detected, the signal of the initial connection is pulled high and the DP channel and the DM channel are short-circuited; determine that the initial role of the first device is configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device, and the first device and the second device are connected via a Type-C communication mode.
[0296] In some embodiments, the determination module is also used to determine whether a switch signal is detected when it is detected that a second device is inserted through an initial connection; when a switch signal is detected, the VBUS signal is converted from a low level to a high level, and the DP channel and the DM channel are short-circuited; the initial role of the first device is determined to be configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device, and the first device charges the second device through the first connection.
[0297] In summary, the charging device proposed in the present disclosure detects whether the second device is inserted and / or detects whether the switch signal of the first device is received through the detection module, and the switch signal indicates whether the first device is in power supply mode; the determination module determines the initial role configuration of the first device and the second device under the current connection when the second device is detected to be inserted and / or the switch signal is detected; when the charging module configures the initial role of the first device as a power supply device or a master device, the first device charges the second device. By adding the insertion detection or adding the switch to trigger the selection of the power supply mode to determine the initial role of the devices at both ends, the problem of randomness in determining the initial role by the Type-C protocol is solved. At the same time, through the DPDM handshake method, it does not rely on the CC line, thereby solving the problem of CC abnormality or failure to charge when it is not in place.
[0298] Fig.15 FIG. 1 is a schematic diagram of the structure of a charging device 1500 according to an embodiment of the present disclosure. Fig.15 As shown, the device includes: a detection module 1510, a processing module 1520, and a charging module 1530.
[0299] The detection module 1510 is used to detect whether a switch signal of the first device is received, and the switch signal indicates whether the first device is in power supply mode.
[0300] The processing module 1520 is used to control the indication signal of the first device when the switch signal is detected, and the indication signal is used by the second device to determine that the first device is in power supply mode or to broadcast that the first device is in power supply mode.
[0301] The charging module 1530 is used to determine the initial role configuration of the first device and the second device when it is detected that the second device is inserted, and the first device charges the second device under the current connection.
[0302] In some embodiments, the processing module is further used to pull up the signal of the current connection; and short-circuit the DP channel and the DM channel of the first device.
[0303] In some embodiments, the processing module is further used to convert the VBUS signal of the first device from a low level to a high level; and short-circuit the DP channel and the DM channel of the first device.
[0304] In some embodiments, the charging module is also used to start a timer, turn off the Type-C connection function of the first device and continue to send a handshake signal to the second device through the DP channel; within the timing of the timer, detect whether the handshake is completed with the second device to determine the initial role configuration of the first device and the second device.
[0305] In some embodiments, the charging module is also used to detect whether a confirmation signal is received from the second device via the DM channel within the timing time of the timer; when a confirmation signal is received from the second device via the DM channel, determine that a handshake with the second device is completed; determine that the initial role of the first device is configured as a power supply device or a master device, and the initial role of the second device is configured as a charging device or a slave device; convert the current connection to a first connection, and the first device charges the second device via the first connection.
[0306] In the above-mentioned device, a switch for actively selecting the power supply mode is added to the DRP device, and the switch signal is detected so that the controller controls the indication signal of the device, so that after the opposite device is inserted, the initial role configuration of the devices at both ends is determined, thereby achieving the purpose of determining the initial role without handshake detection.
[0307] Fig.16 is a schematic structural diagram of an electronic device 1600 for implementing the above charging method according to an exemplary embodiment.
[0308] Reference Fig.16 , the electronic device 1600 may include one or more of the following components: a processing component 1602 , a memory 1604 , a power component 1606 , a multimedia component 1608 , an audio component 1610 , an input / output (I / O) interface 1612 , a sensor component 1614 , and a communication component 1616 .
[0309] The processing component 1602 generally controls the overall operation of the electronic device 1600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1602 may include one or more processors 1620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1602 may include one or more modules to facilitate the interaction between the processing component 1602 and other components. For example, the processing component 1602 may include a multimedia module to facilitate the interaction between the multimedia component 1608 and the processing component 1602.
[0310] The memory 1604 is configured to store various types of data to support operations on the electronic device 1600. Examples of such data include instructions for any application or method operating on the electronic device 1600, contact data, phone book data, messages, pictures, videos, etc. The memory 1604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0311] The power supply component 1606 provides power to the various components of the electronic device 1600. The power supply component 1606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1600.
[0312] The multimedia component 1608 includes a screen that provides an output interface between the electronic device 1600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1608 includes a front camera and / or a rear camera. When the electronic device 1600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0313] The audio component 1610 is configured to output and / or input audio signals. For example, the audio component 1610 includes a microphone (MIC), and when the electronic device 1600 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1604 or sent via the communication component 1616. In some embodiments, the audio component 1610 also includes a speaker for outputting audio signals.
[0314] I / O interface 1612 provides an interface between processing component 1602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0315] The sensor assembly 1614 includes one or more sensors for providing various aspects of status assessment for the electronic device 1600. For example, the sensor assembly 1614 can detect the open / closed state of the electronic device 1600, the relative positioning of components, such as the display and keypad of the electronic device 1600, and the sensor assembly 1614 can also detect the position change of the electronic device 1600 or a component of the electronic device 1600, the presence or absence of user contact with the electronic device 1600, the orientation or acceleration / deceleration of the electronic device 1600, and the temperature change of the electronic device 1600. The sensor assembly 1614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0316] The communication component 1616 is configured to facilitate wired or wireless communication between the electronic device 1600 and other devices. The electronic device 1600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0317] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0318] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1604 including instructions, and the instructions can be executed by a processor 1620 of the electronic device 1600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0319] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the charging method described in the above embodiments of the present disclosure.
[0320] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the charging method described in the above embodiment of the present disclosure when a processor executes the computer program.
[0321] Fig.17 FIG. 1 is a schematic diagram of a chip 1700 for implementing the above-mentioned charging method according to an exemplary embodiment. Fig.17 The chip 1700 includes at least one communication interface 1701 and a processor 1702. The communication interface 1701 is used to receive a signal input to the chip 1700 or a signal output from the above chip 1700. The processor 1702 communicates with the communication interface 1701 and implements the charging method described in the above embodiments of the present disclosure through a logic circuit or executing code instructions.
[0322] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0323] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0324] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0325] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0326] It should be understood that the various parts of the embodiments of the present disclosure can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0327] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0328] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0329] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, substitute and vary the above embodiments within the scope of the present disclosure.
Claims
1. A charging method, characterized in that: The method is performed by a first device, where the first device is a dual-role port device, including: Detecting whether a second device is plugged in, and / or detecting whether a switch signal from the first device is received, the switch signal indicating whether the first device is in power supply mode; In case of detecting that the second device is inserted and / or detecting a switch signal, determining an initial role configuration of the first device and the second device under the current connection; When the initial role of the first device is configured as a power supply device or a master device, the first device charges the second device.
2. The method according to claim 1, characterized in that: In the case where the insertion of the second device is detected and / or the switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: When the second device is detected to be inserted through the initial connection, starting a timer and determining whether the switch signal is detected; When the switch signal is detected, turning off the Type-C connection function of the first device and continuously sending a handshake signal to the second device through the DP channel; Detect whether handshake with the second device is completed to determine initial role configuration of the first device and the second device.
3. The method according to claim 2, characterized in that In the case where the insertion of the second device is detected and / or the switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: When detecting that the second device is inserted, turning off the Type-C connection function of the first device, and continuously detecting whether a VBUS signal is received; When the VBUS signal is detected, it is detected whether handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
4. The method according to claim 2 or 3, characterized in that: The detecting whether handshake is completed with the second device to determine the initial role configuration of the first device and the second device includes: Within the timing time of the timer, detecting whether a confirmation signal replied by the second device through the DM channel is received; Upon receiving a confirmation signal replied by the second device through the DM channel, determining that a handshake with the second device is completed; Determine that an initial role configuration of the first device is a power supply device or a master device, and an initial role configuration of the second device is a charging device or a slave device; The initial connection is converted into a first connection, and the first device charges the second device through the first connection.
5. The method according to claim 4, characterized in that The method further comprises: If no confirmation signal is received from the second device through the DM channel within the timing time of the timer, enabling the Type-C connection function of the first device; Through the Type-C connection function, it is determined that the initial role of the first device is configured as a charging device or a slave device, the initial role of the second device is configured as a power supply device or a master device, and the second device charges the first device through the Type-C connection.
6. The method according to claim 1, characterized in that In the case where the insertion of the second device is detected and / or the switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: When it is detected that the second device is inserted through the initial connection, determining whether the switch signal is detected; When the switch signal is detected, the initial connection signal is pulled high, and the DP channel and the DM channel are short-circuited; It is determined that an initial role of the first device is configured as a power supply device or a master device, an initial role of the second device is configured as a charging device or a slave device, and the first device charges the second device through a Type-C connection.
7. The method according to claim 1, characterized in that: In the case where the insertion of the second device is detected and / or the switch signal is detected, determining the initial role configuration of the first device and the second device under the current connection includes: When it is detected that the second device is inserted through the initial connection, determining whether the switch signal is detected; When the switch signal is detected, the VBUS signal is converted from a low level to a high level, and the DP channel and the DM channel are short-circuited; It is determined that an initial role of the first device is configured as a power supply device or a master device, and an initial role of the second device is configured as a charging device or a slave device, and the first device charges the second device through a first connection.
8. A charging method, characterized in that: The method is performed by a first device, the first device is a dual-role port device, and the method includes: detecting whether a switch signal of the first device is received, the switch signal indicating whether the first device is in a power supply mode; In case of detecting the switch signal, controlling an indication signal of the first device, wherein the indication signal is used by the second device to determine that the first device is in power supply mode or to broadcast that the first device is in power supply mode; In the case of detecting that the second device is inserted, initial role configuration of the first device and the second device is determined, and the first device charges the second device under the current connection.
9. The method according to claim 8, characterized in that The indication signal for controlling the first device includes: Pulling the currently connected signal high; The DP channel and the DM channel of the first device are short-circuited.
10. The method according to claim 8, characterized in that The indication signal for controlling the first device includes: Convert the VBUS signal of the first device from a low level to a high level; The DP channel and the DM channel of the first device are short-circuited.
11. The method according to claim 8, characterized in that The determining, when detecting that the second device is inserted, the initial role configuration of the first device and the second device comprises: Starting a timer, turning off the Type-C connection function of the first device and continuously sending a handshake signal to the second device through the DP channel; Within the timing time of the timer, it is detected whether the handshake with the second device is completed to determine the initial role configuration of the first device and the second device.
12. The method according to claim 11, characterized in that The detecting whether handshake with the second device is completed within the timing time of the timer includes: Within the timing time of the timer, detecting whether a confirmation signal replied by the second device through the DM channel is received; Upon receiving a confirmation signal replied by the second device through the DM channel, determining that a handshake with the second device is completed; Determine that an initial role configuration of the first device is a power supply device or a master device, and an initial role configuration of the second device is a charging device or a slave device; The current connection is converted into a first connection, and the first device charges the second device through the first connection.
13. A charging device, characterized in that: include: a detection module, configured to detect whether a second device is plugged in, and / or detect whether a switch signal of the first device is received, the switch signal indicating whether the first device is in power supply mode; A determination module, configured to determine the initial role configuration of the first device and the second device under the current connection when the insertion of the second device is detected and / or a switch signal is detected; A charging module is used for enabling the first device to charge the second device when the initial role of the first device is configured as a power supply device or a master device.
14. A charging device, characterized in that: include: a detection module, configured to detect whether a switch signal of the first device is received, wherein the switch signal indicates whether the first device is in a power supply mode; a processing module, configured to control an indication signal of the first device when the switch signal is detected, wherein the indication signal is used by the second device to determine that the first device is in power supply mode or to broadcast that the first device is in power supply mode; The charging module is used to determine the initial role configuration of the first device and the second device when detecting that the second device is inserted, and the first device charges the second device under the current connection.
15. An electronic device, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when being used to run the computer program, executes the method of any one of claims 1-7 or 8-12.
16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7 or 8-12.
17. A chip, characterized in that: It includes at least one processor and a communication interface; the communication interface is used to receive a signal input to the chip or a signal output from the chip, and the processor communicates with the communication interface and implements the method as described in any one of claims 1-7 or 8-12 through a logic circuit or executing code instructions.