USB3.0 Type C interface control method, device and medium
By dynamically switching the channel role of the USB3.0 Type C interface, the problems of interface complexity and cost are solved, efficient bidirectional communication is achieved, and the complexity and power consumption of the USB3.0 Type C interface are reduced.
Patent Information
- Application Number
- CN201910876821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-17
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2039-09-17
AI Technical Summary
The USB3.0 Type C interface needs to support two sets of transceiver paths to cope with the functional changes of the Type C interface, resulting in an increase in the interface hardware logic, thereby increasing cost and power consumption.
By obtaining the status of the external device plugged into the USB3.0 Type C interface, dynamically switch the channel role. When plugging forward, use the first channel as the receiving channel and the second channel as the sending channel; when plugging backward, use the first channel as the sending channel, The second channel is used as a receiving channel, which avoids the use of two groups of transceiver channels.
Reduces the complexity of USB3.0 Type C interface, reduces cost and power consumption, and meets bidirectional communication requirements.
Smart Images

Figure CN112527712B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to but are not limited to electronic circuit technology, and in particular to a universal serial bus (USB) 3.0 Type C interface control method, device and storage medium. Background Art
[0002] The USB3.0 Type C interface is a hardware interface of the universal serial bus; its upper and lower ends are completely consistent, and compared with the traditional USB3.0 interface, it no longer distinguishes between the front and back sides, providing a better experience for users. However, the USB3.0 Type C interface needs to support two sets of transceiver paths to cope with the functions of the Type C interface. When an external device is inserted into the device, one of the two sets of transceiver paths works, and the other of the two sets of transceiver paths does not work; when the external device is reversely inserted into the device, the transceiver paths in the working state and the transceiver paths in the non-working state are opposite to when the external device is inserted into the device.
[0003] Setting two groups of transceiver paths in the USB3.0 Type C interface will increase the interface hardware logic, which in turn leads to an increase in cost and power consumption. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a USB3.0 Type C interface control method, device, and storage medium, which can reduce the complexity of the USB3.0 Type C interface.
[0005] The present application provides a universal serial bus USB3.0 Type C interface control method, including:
[0006] Get the state of the external device being inserted into the USB3.0 Type C interface, including: forward insertion or reverse insertion;
[0007] When the acquired state is positive insertion, the first channel is used as the receiving channel and the second channel is used as the sending channel; when the acquired state is reverse insertion, the first channel is used as the sending channel and the second channel is used as the receiving channel.
[0008] The present application also provides a control device for a universal serial bus USB3.0 Type C interface, comprising
[0009] A forward and reverse insertion detection module is used to obtain the state of an external device being inserted into a USB3.0 Type C interface, wherein the state includes: forward insertion or reverse insertion;
[0010] The switching module is used to use the first channel as a receiving channel and the second channel as a sending channel when the acquired state is a forward insertion; and use the first channel as a sending channel and the second channel as a receiving channel when the acquired state is a reverse insertion.
[0011] The present application also provides a computer-readable and writable storage medium, characterized in that the medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the universal serial bus USB3.0 Type C interface control method as described above are implemented.
[0012] Compared with the prior art, the present invention comprises: obtaining the state of an external device being inserted into a USB3.0 Type C interface, the state comprising: forward insertion or reverse insertion; when the obtained state is forward insertion, using the first channel as a receiving channel and the second channel as a sending channel; when the obtained state is reverse insertion, using the first channel as a sending channel and the second channel as a receiving channel. The present invention can reduce the complexity of the USB3.0 Type C interface.
[0013] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.
[0015] Figure 1 A flow chart of a USB3.0 Type C interface control method provided by an embodiment of the present invention;
[0016] Figure 2 A composition diagram of a USB3.0 Type C interface control device provided by an embodiment of the present invention;
[0017] Figure 3 A composition diagram of another USB3.0 Type C interface control device provided by an embodiment of the present invention;
[0018] Figure 4 A composition diagram of another USB3.0 Type C interface control device provided by an embodiment of the present invention;
[0019] Figure 5 A composition diagram of another USB3.0 Type C interface control device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention more clear, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.
[0021] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.
[0022] The embodiment of the present invention provides a universal serial bus USB3.0 Type C interface control method, such as Figure 1 As shown, the method includes:
[0023] S101 obtains a state where an external device is inserted into a USB3.0 Type C interface, where the state includes: forward insertion or reverse insertion;
[0024] The method of obtaining the state of the external device inserted into the Type C interface may refer to related technologies, such as the USB3.0 Type C socket determines the state of the external device inserted according to the CC1 / CC2 pins, and the USB3.0 Type C plug determines the state of the external device inserted according to the CC pin;
[0025] S102: When the acquired state is positive insertion, the first channel is used as a receiving channel and the second channel is used as a sending channel; when the acquired state is reverse insertion, the first channel is used as a sending channel and the second channel is used as a receiving channel.
[0026] The method provided in the embodiment of the present application can switch the transceiver status of a group of transceiver channels according to the status of the external device inserted into the USB3.0 Type C interface, thereby meeting the requirements of bidirectional communication of the USB3.0 Type C interface. Since two groups of transceiver channels are not required, the complexity of the USB3.0 Type C interface is reduced.
[0027] In an exemplary embodiment, before obtaining the state of the external device being inserted into the USB 3.0 Type C interface, the method further includes:
[0028] It is determined that the device where the USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state.
[0029] The device where the USB3.0 Type C interface is located can be a host Host or a device. According to relevant protocol provisions, the method described in the embodiment of the present application obtains the status of the external device being inserted into the USB3.0 Type C interface only when the device where the USB3.0 Type C interface is located is a host Host.
[0030] The method for judging whether the USB3.0 Type C interface is in a powered state may include: when the VBUS line is powered, it can be determined that the USB3.0 Type C interface is in a powered state; the VBUS line is a power line that the host HOST or the repeater HUB uses to supply power to the USB3.0 Type C interface, and when the VBUS line is powered, a 5V voltage is generally applied thereto.
[0031] In an exemplary embodiment, a method for determining that a device where a USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state includes:
[0032] At preset intervals, the device where the USB3.0 Type C interface is located is judged to be a host according to the identification pin (ID PAD); the ID PAD is a part of the USB3.0 type C interface, and judging whether the device where the USB3.0 Type C interface is located is a host or a device according to the ID PAD complies with the relevant protocol regulations;
[0033] Each time the Host is determined, a count is performed, and when the count value is greater than a first preset value, an instruction to supply power to the USB3.0 Type C interface is sent to the Host.
[0034] After receiving the instruction to supply power to the USB 3.0 Type C interface, the host increases the voltage on the VBUS line, that is, supplies power to the USB 3.0 Type C interface. Therefore, by default, as long as the instruction to supply power to the USB 3.0 Type C interface is sent, the USB 3.0 Type C interface is in a powered state.
[0035] In an exemplary embodiment, for step S102, when the acquired state is positive insertion, the first channel is used as a receiving channel and the second channel is used as a sending channel; when the acquired state is reverse insertion, the first channel is used as a sending channel and the second channel is used as a receiving channel, including:
[0036] When the acquired state is a forward insertion, the counter is started to count, and when the count value reaches a second preset value, a forward insertion state indication signal is output; when the acquired state is a reverse insertion, the counter is started to count, and when the count value reaches a second preset value, a reverse insertion state indication signal is output; after acquiring the state of the external device being inserted into the USB3.0 Type C interface, the application sends a state indication signal after waiting for a period of time, which can ensure that the indicated state is a stable state of the external device being inserted into the USB3.0 Type C interface;
[0037] After receiving the positive insertion status indication signal, the first channel is used as the receiving channel and the second channel is used as the sending channel; after receiving the reverse insertion status indication signal, the first channel is used as the sending channel and the second channel is used as the receiving channel. After receiving the positive insertion status indication signal, if it is determined that the current receiving channel is the first channel and the current sending channel is the second channel, the continuity of the current channel is maintained; if it is determined that the current receiving channel is the second channel and the current sending channel is the first channel, a channel switching request is sent, and the USB PHY receives the switching request and starts to convert the sending and receiving channels. When the reverse insertion status indication signal is received, the subsequent operations can refer to the operations after receiving the positive insertion status indication signal. If the current transceiver channel meets the requirements, the continuity of the current channel is maintained. If the current transceiver channel does not meet the requirements, a channel switching request is sent.
[0038] The embodiment of the present invention provides a control device for a universal serial bus USB3.0 Type C interface, such as Figure 2 As shown, the device comprises:
[0039] A forward and reverse insertion detection module 201 is used to obtain a state of an external device being inserted into a USB 3.0 Type C interface, wherein the state includes: forward insertion or reverse insertion;
[0040] The switching module 202 is used to use the first channel as the receiving channel and the second channel as the sending channel when the acquired state is the forward insertion; and use the first channel as the sending channel and the second channel as the receiving channel when the acquired state is the reverse insertion.
[0041] The device provided in the embodiment of the present application can switch the transceiver status of a group of transceiver channels according to the status of the external device inserted into the USB3.0 Type C interface, thereby meeting the requirements of bidirectional communication of the USB3.0 Type C interface. Since two groups of transceiver channels are not required, the complexity of the USB3.0 Type C interface is reduced.
[0042] In an exemplary embodiment, Figure 3 As shown, the device also includes:
[0043] A role detection module 203 is used to send a notification to the forward and reverse insertion detection module after determining that the device where the USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state;
[0044] The forward and reverse insertion detection module 201 is also used to obtain the status of the external device being inserted into the USB3.0 Type C interface after receiving the notification.
[0045] The device where the USB3.0 Type C interface is located can be a host Host or a device; the apparatus described in the embodiment of the present application obtains the status of the external device being inserted into the USB3.0 Type C interface only when the device where the USB3.0 Type C interface is located is the host Host.
[0046] The way in which the role detection module 203 determines whether the USB3.0 Type C interface is in a powered state may include: when the VBUS line is powered, it can be determined that the USB3.0 Type C interface is in a powered state; the VBUS line is a power line that the host HOST or the repeater HUB uses to supply power to the USB3.0 Type C interface, and when the VBUS line is powered, a 5V voltage is generally applied thereto.
[0047] In an exemplary embodiment, Figure 4 As shown, the device further includes: a first counting module 204;
[0048] The role detection module 203 is used to determine whether the device where the USB3.0 Type C interface is located is the Host and the USB3.0 Type C interface is in a powered state, including: determining whether the device where the USB3.0 Type C interface is located is the Host according to the identification pin (ID PAD) at a preset time; notifying the first counting module 204 to count each time the Host is determined; and after receiving the notification from the first counting module 204, sending a notification to the forward and reverse insertion detection module 201;
[0049] The first counting module 204 is configured to send an instruction to the Host to supply power to the USB 3.0 Type C interface and notify the role detection module 203 when the count value is greater than a first preset value.
[0050] After receiving the instruction to supply power to the USB 3.0 Type C interface, the host increases the voltage on the VBUS line, that is, supplies power to the USB 3.0 Type C interface. Therefore, by default, as long as the instruction to supply power to the USB 3.0 Type C interface is sent, the USB 3.0 Type C interface is in a powered state.
[0051] In an exemplary embodiment, Figure 5 As shown, the device further includes: a second counting module 205;
[0052] The second counting module 205 is used to start the counter counting when the acquired state is forward insertion, and output the forward insertion state indication signal when the count value reaches the second preset value; when the acquired state is reverse insertion, start the counter counting, and output the reverse insertion state indication signal when the count value reaches the second preset value;
[0053] The switching module 202 is used to use the first channel as the receiving channel and the second channel as the sending channel after receiving the positive insertion state indication signal; and use the first channel as the sending channel and the second channel as the receiving channel after receiving the reverse insertion state indication signal.
[0054] After the switching module 202 completes the switching, it sends a notification init_start to the USB 3.0 controller to start the normal enumeration process.
[0055] An embodiment of the present invention further provides a computer-readable and writable storage medium, wherein the medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the universal serial bus USB3.0 Type C interface control method as described in the previous embodiment are implemented.
[0056] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A universal serial bus USB3.0 Type C interface control method, comprising: Get the state of the external device being inserted into the USB3.0 Type C interface, including: forward insertion or reverse insertion; When the acquired state is forward insertion, the counter is started to count, and when the count value reaches the second preset value, the forward insertion state indication signal is output, and after receiving the forward insertion state indication signal, the first channel is used as the receiving channel and the second channel is used as the sending channel; when the acquired state is reverse insertion, the counter is started to count, and when the count value reaches the second preset value, the reverse insertion state indication signal is output, and after receiving the reverse insertion state indication signal, the first channel is used as the sending channel and the second channel is used as the receiving channel.
2. The method for controlling a USB 3.0 Type C interface according to claim 1, characterized in that: Before obtaining the state of the external device being inserted into the USB 3.0 Type C interface, the method further includes: It is determined that the device where the USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state.
3. The method for controlling a USB 3.0 Type C interface according to claim 2, wherein: Methods for determining that the device where the USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state include: At preset intervals, determine whether the device where the USB3.0 Type C interface is located is the Host based on the ID pad; Each time the Host is determined, a count is performed, and when the count value is greater than a first preset value, an instruction to supply power to the USB3.0 Type C interface is sent to the Host.
4. A control device for a universal serial bus USB3.0 Type C interface, comprising: A forward and reverse insertion detection module is used to obtain the state of an external device being inserted into a USB3.0 Type C interface, wherein the state includes: forward insertion or reverse insertion; A switching module, used to use the first channel as a receiving channel and the second channel as a sending channel when the acquired state is a forward insertion; and use the first channel as a sending channel and the second channel as a receiving channel when the acquired state is a reverse insertion; A second counting module is used to start the counter counting when the acquired state is a forward insertion, and output a forward insertion state indication signal when the count value reaches a second preset value; when the acquired state is a reverse insertion, start the counter counting, and output a reverse insertion state indication signal when the count value reaches the second preset value; The switching module is also used to use the first channel as a receiving channel and the second channel as a sending channel after receiving a positive insertion state indication signal; and use the first channel as a sending channel and the second channel as a receiving channel after receiving a reverse insertion state indication signal.
5. The control device of the universal serial bus USB3.0 Type C interface according to claim 4, characterized in that: The device also includes: A role detection module, configured to send a notification to the forward and reverse insertion detection module after determining that the device where the USB 3.0 Type C interface is located is a host and the USB 3.0 Type C interface is in a powered state; The forward and reverse insertion detection module is also used to obtain the status of the external device being inserted into the USB3.0 Type C interface after receiving the notification.
6. The control device of the universal serial bus USB3.0 Type C interface according to claim 5, characterized in that: The device further comprises: a first counting module; A role detection module, used for determining whether the device where the USB3.0 Type C interface is located is a host and the USB3.0 Type C interface is in a powered state, including: determining whether the device where the USB3.0 Type C interface is located is a host according to an ID pad at preset intervals; notifying the first counting module to count each time the host is determined; and sending a notification to the forward and reverse insertion detection module after receiving a notification from the first counting module; The first counting module is used to send an instruction to the Host to supply power to the USB 3.0 Type C interface and notify the role detection module when the count value is greater than a first preset value.
7. A computer-readable and writable storage medium, characterized in that: The medium stores computer executable instructions, and when the computer executable instructions are executed by a processor, the steps of the universal serial bus USB3.0 Type C interface control method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
USB connection device and terminal device including same
CN109426638A