Disclosure of Invention
The embodiment of the invention provides a cascade communication method and a cascade circuit, which at least solve the technical problem that in the prior art, one VBUS in USBType-C application cannot simultaneously supply power to a plurality of Type-C interface devices.
According to an aspect of the embodiments of the present invention, there is provided a cascade communication method, including: detecting a level of a first CC interface; judging whether PD Sink equipment is accessed according to the level of the first CC interface; under the condition that the PD Sink equipment is judged to be accessed, acquiring the power supply requirement of the PD Sink equipment; sending a first power supply request to the PD Source equipment, wherein the first power supply request carries the power supply requirement of the PD Sink equipment and the power supply requirement of the PD Middle equipment, and after the PD Source equipment receives the first power supply request, supplying power to the PD Middle equipment according to the first power supply request; receiving power provided by the PD Source device.
Further, after receiving the power provided by the PD Source device, the method further comprises: and opening the analog switch, wherein after the analog switch is opened, the PD Source equipment and the PD Sink equipment can directly communicate.
Further, when it is determined that the PD Sink device is accessed, acquiring the power supply requirement of the PD Sink device includes: and under the condition that the PD Sink equipment is judged to be accessed, carrying out PD interactive communication with the PD Sink equipment to acquire the power supply requirement of the PD Sink equipment.
Further, in the case that it is determined that there is a PD Sink device accessing, the method further includes: judging the insertion direction of the PDsink equipment; and changing Rd pull-down setting according to the insertion direction of the PD Sink equipment.
Further, after receiving the power provided by the PD Source device, the method further comprises: redetecting a level of the first CC interface; judging whether the PD Sink equipment is removed or not according to the redetected level of the first CC interface; and sending a second power supply request to the PD Source equipment under the condition that the PD Sink equipment is judged to be removed, wherein the second power supply request carries the power supply requirement of the PD Middle equipment, and after the PD Source equipment receives the second power supply request, supplying power to the PD Middle equipment according to the second power supply request.
Further, determining whether the PD Sink device has been removed according to the redetected level of the first CC interface includes: judging whether the level of the first CC interface is stable to be a high level; determining that the PD Sink device has been removed if the level of the first CC interface stabilizes to a high level.
Further, after determining that the PD Sink device has been removed, the method further comprises: and turning off the analog switch, wherein after the analog switch is turned off, the PD Source equipment and the PD Sink equipment cannot communicate.
According to another aspect of the embodiments of the present invention, there is also provided a cascade circuit, including: the PD Middle equipment is connected with the PD Sink equipment through a first CC interface, and is connected with the PD Source equipment through a second CC interface; the PD Source equipment is connected with the second CC interface of the PD Middle equipment; and the PD Sink equipment is connected with the first CC interface of the PD Middle equipment, and the PD Source equipment is connected with the PD Sink equipment through an analog switch.
In the embodiment of the invention, the PD Middle device judges whether a PDsink device is accessed or not according to the detected level of the CC interface, if the PD Sink device is accessed, the power supply requirement of the PD Sink device is acquired, a first power supply request is sent to the PD Source device according to the power supply requirement of the PD Sink device and the power supply requirement of the PD Sink device, the PD Source device performs power supply configuration according to the received first power supply request so as to simultaneously supply power to the PD Middle device and the PD Sink device, the cascading of the PD interfaces of the Type-C interface is realized, the technical effect that one VBUS in the USB Type-C application can simultaneously supply power to a plurality of Type-C interface devices is achieved, and the technical problem that one VBUS in the USB Type-C application in the prior art can not simultaneously supply power to a plurality of Type-C interface devices is solved.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a PD Source cascade communication method, it should be noted that the steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown.
Fig. 1 is a flowchart of a method for cascade communication according to an embodiment of the present invention.
The method is performed by a PD Middle device. Two devices, namely Power Source and Power Sink, are defined in the PD protocol, and a new type intermediate device (PD Middle) is defined, the device can be used as the PD Sink independently to support the attributes of all Power Sink devices, and in addition, it has an extra CC interface to support DRP, and can be used to implement CC detect to discover the access of another Power Sink device. The first CC interface of the PD Middle device is connected with a display (PD Sink) device, the second CC interface of the PD Middle device is connected with a power supply (PD Source) device, and the PD Source device is connected with the PD Sink device through an analog switch.
As shown in fig. 1, the PD Source cascade communication method provided in the embodiment of the present invention includes the following steps:
step S102, detecting a level of the first CC interface.
And step S104, judging whether PD Sink equipment is accessed according to the level of the first CC interface.
And S106, acquiring the power supply requirement of the PD Sink equipment under the condition that the PD Sink equipment is judged to be accessed.
Step S108, a first power supply request is sent to the PD Source equipment, wherein the first power supply request carries the power supply requirement of the PDsink equipment and the power supply requirement of the PD Middle equipment, and after the PD Source equipment receives the first power supply request, the PD Middle equipment is supplied with power according to the first power supply request.
Step S110, receiving power provided by the PD Source device.
In the embodiment of the invention, the PD Middle device judges whether a PDsink device is accessed or not according to the detected level of the CC interface, if the PD Sink device is accessed, the power supply requirement of the PD Sink device is acquired, a first power supply request is sent to the PD Source device according to the power supply requirement of the PD Sink device and the power supply requirement of the PD Sink device, the PD Source device performs power supply configuration according to the received first power supply request so as to simultaneously supply power to the PD Middle device and the PD Sink device, the cascading of the PD interfaces of the Type-C interface is realized, the technical problem that one VBUS in the USB Type-C application in the prior art cannot simultaneously supply power to a plurality of Type-C interface devices is solved, and the technical effect that one VBUS in the USB Type-C application simultaneously supplies power to a plurality of Type-C interface devices is achieved.
Fig. 2 is a schematic diagram of a PD Middle device according to an embodiment of the present invention.
Optionally, after receiving the power provided by the PD Source device, the method further comprises: and opening the analog switch, wherein after the analog switch is opened, the PD Source equipment and the PD Sink equipment can directly communicate. Optionally, after determining that the PD Sink device has been removed, the method further includes: and turning off the analog switch, wherein after the analog switch is turned off, the PDSource equipment and the PD Sink equipment cannot communicate.
Optionally, when it is determined that there is a PD Sink device accessing, the method further includes: judging the insertion direction of the PD Sink equipment; and changing Rd pull-down setting according to the insertion direction of the PD Sink equipment. Optionally, when it is determined that the PD Sink device is accessed, acquiring the power supply requirement of the PD Sink device includes: and carrying out PD interactive communication with the PD Sink equipment under the condition that the PD Sink equipment is judged to be accessed, so as to obtain the power supply requirement of the PD Sink equipment.
The method comprises the steps of detecting the CC level of a USB Type-C port connected with the PD Sink, judging that the PD Sink is accessed, learning the insertion direction of the PD Sink through the CC level, changing the pull-down setting of the Rd (the CC1 has the Rd indicating forward insertion, and the CC2 has the Rd indicating reverse insertion), and then carrying out PD interactive communication with the CC' between the CC and the Sink to obtain the power supply requirement of the Sink.
Optionally, after receiving the power provided by the PD Source device, the method further comprises: redetecting a level of the first CC interface; judging whether the PD Sink equipment is removed or not according to the redetected level of the first CC interface; and under the condition that the PD Sink device is removed, sending a second power supply request to the PD Source device, wherein the second power supply request carries the power supply requirement of the PD Middle device, and after the PD Source device receives the second power supply request, supplying power to the PD Middle device according to the second power supply request. And if the Sink equipment is judged to be removed, the CC analog switch is turned off, and the CC' connection is disconnected. The PD Middle sends a power supply request (second power supply request) to the Source again according to the requirement of the PD Middle, and the PD Source receives the request and reconfigures the output of the VBUS power supply.
Optionally, the determining whether the PD Sink device has been removed according to the redetected level of the first CC interface includes: judging whether the level of the first CC interface is stable to be a high level; in the case where the level of the first CC interface is stabilized to a high level, it is determined that the PD Sink device has been removed. And (3) the PD Middle detects that the CC level becomes 3.3V, namely only the Rp provided by the PDSource on the CC bus waits for 1ms, the unstable factor is eliminated, and if the CC level is stable to be high, the Sink device is judged to be removed.
According to another aspect of the embodiment of the invention, a PD Source cascade circuit is also provided.
As shown in fig. 3, the cascade circuit includes: intermediate device (PD Middle), power supply (PD Source), display (PD Sink).
And a first CC interface of the PD Middle equipment is connected with the PD Sink equipment, and a second CC interface is connected with the PD Source equipment.
The PD Source device is connected with the second CC interface of the PD Middle device.
The PD Sink equipment is connected with a first CC interface of the PD Middle equipment, and the PD Source equipment is connected with the PD Sink equipment through an analog switch.
Taking three Type-C interface devices as an example, one is a Power Source device, the other two are Power Sink devices, and CC pins of the three Type-C devices cannot be directly connected together, so that one Power Sink device is divided into two CC interfaces, one CC interface (a second CC interface) is connected with the Power Source, and the other CC interface (a first CC interface) is connected with the other Power Sink device to replace the Power Source to complete the forwarding of the CC detect and the PD message. In order to solve the problem, the order of device insertion, which is the PD sink device inserted first or the PD Middle device inserted first, needs to be considered, so that the normal operation of the original connection is not damaged as much as possible, and the newly connected device is seamlessly accessed.
The CC' connection between the Power Source and the general Power Sink is connected by an analog switch, a control Gate of the analog switch is provided with a weak pull-up (NMOS) or pull-down (PMOS) CC Middle device, the analog switch is additionally arranged on a CC pin, when the Sink device is directly connected, the analog switch is switched on, the Sink device is directly communicated with the Power Source, and when the PD Middle device is connected, the PD Middle device can control the analog switch to be switched on or off after finishing the USB-C PD message interaction and finishing the Power supply configuration.
The PD Sink firstly accesses a Sink port of the PD Middle device, and then the PD Sink and the PD Middle device pass through the Source of the PD Middle device together. After the PD Middle device is inserted into the PD Source, firstly, a VBUS power Source is obtained from a bus to start working, then, the CC level of a USB Type-C port connected with the PD Sink is detected, the PD Sink is judged to be accessed, the insertion direction of the PD Sink is known through the CC level, the pull-down setting of the self Rd is changed (the CC1 has Rd indicating positive insertion, and the CC2 has Rd being reverse insertion), then, PD interactive communication is carried out through CC' between the PD Middle and the Sink, the power supply requirement of the Sink is obtained, a power supply request (a first power supply request) is sent to the PD Source by adding the self requirement of the PDMiddle, when the PD Source provides VBUS according to the requirement of the Sink + Middle, the PD Middle opens an analog switch, the PD Sink and the PD Source can directly communicate to complete control between the PD Sink and the PD Source except the power supply request, then the PD Middle removes the pull-down resistor on the self on the CC, and only the pull-down resistor is provided by the bus, the Sink device can communicate with the Source device.
And removing the PD Sink after the PD Middle and the PD Sink are accessed, detecting by the PD Middle to find that the CC level is changed into 3.3V, namely only Rp provided by the PD Source on the CC bus waits for 1ms, eliminating unstable factors, judging that the Sink equipment is removed if the CC level is stable to be high, turning off the CC analog switch, and disconnecting the CC' link. The PD Middle sends a power supply request (second power supply request) to the Source again according to the requirement of the PD Middle, and the PD Source receives the request and reconfigures the output of the VBUS power supply.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed technical contents can be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.