CN112527712A - USB3.0Type C interface control method, device and medium - Google Patents

USB3.0Type C interface control method, device and medium Download PDF

Info

Publication number
CN112527712A
CN112527712A CN201910876821.4A CN201910876821A CN112527712A CN 112527712 A CN112527712 A CN 112527712A CN 201910876821 A CN201910876821 A CN 201910876821A CN 112527712 A CN112527712 A CN 112527712A
Authority
CN
China
Prior art keywords
channel
interface
state
taking
receiving
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910876821.4A
Other languages
Chinese (zh)
Inventor
张斯沁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Priority to CN201910876821.4A priority Critical patent/CN112527712A/en
Publication of CN112527712A publication Critical patent/CN112527712A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Abstract

The invention discloses a USB3.0Type C interface control method, a device and a medium, wherein the method comprises the following steps: acquiring the state of an external device inserted into a USB3.0Type C interface, wherein the state comprises the following steps: forward insertion or backward insertion; when the acquired state is positive insertion, taking the first channel as a receiving channel and taking the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel. The invention can reduce the complexity of the USB3.0Type C interface.

Description

USB3.0Type C interface control method, device and medium
Technical Field
The present invention relates to, but not limited to, electronic circuit technologies, and in particular, to a Universal Serial Bus (USB) 3.0Type C interface control method, apparatus, and storage medium.
Background
The USB3.0Type C interface is a hardware interface of a universal serial bus; the upper end and the lower end of the USB interface are completely consistent, and compared with the traditional USB3.0 interface, the USB interface does not distinguish the front side and the back side any more, so that better experience is provided for users. However, the USB3.0Type C interface needs to support two sets of transceiving paths to cope with the function of the Type C interface. When an external device is inserted into the device, one of the two groups of transceiving paths works, and the other group of transceiving path does not work; when the external device is inserted into the device reversely, the transmitting/receiving path in the working state and the transmitting/receiving path in the non-working state are opposite to those when the external device is inserted into the device.
The two sets of transceiving paths are arranged in the USB3.0Type C interface, which causes the increase of interface hardware logic, and further causes the increase of cost and power consumption.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method, a device and a storage medium for controlling a USB3.0Type C interface, which can reduce the complexity of the USB3.0Type C interface.
The application provides a universal serial bus USB 3.0C Type C interface control method, including:
acquiring the state of an external device inserted into a USB3.0Type C interface, wherein the state comprises the following steps: forward insertion or backward insertion;
when the acquired state is positive insertion, taking the first channel as a receiving channel and taking the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
The application also provides a control device of a universal serial bus USB 3.0C Type C interface, which comprises
Positive reverse plug detection module for obtain the state that external equipment inserted USB3.0Type C interface, the state includes: forward insertion or backward insertion;
the switching module is used for taking the first channel as a receiving channel and taking the second channel as a sending channel when the acquired state is the positive insertion; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
The present application 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 USB3.0Type C interface control method are implemented as described above.
Compared with the prior art, the invention comprises the following steps: acquiring the state of an external device inserted into a USB3.0Type C interface, wherein the state comprises the following steps: forward insertion or backward insertion; when the acquired state is positive insertion, taking the first channel as a receiving channel and taking the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel. The invention can reduce the complexity of the USB3.0Type C interface.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the example serve to explain the principles of the invention and not to limit the invention.
Fig. 1 is a flowchart of a USB3.0Type C interface control method according to an embodiment of the present invention;
fig. 2 is a block diagram of a USB3.0Type C interface control device according to an embodiment of the present invention;
fig. 3 is a composition diagram of another USB3.0Type C interface control device according to an embodiment of the present invention;
fig. 4 is a composition diagram of another USB3.0Type C interface control device according to an embodiment of the present invention;
fig. 5 is a block diagram of another USB3.0Type C interface control device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
The embodiment of the invention provides a Universal Serial Bus (USB) 3.0Type C interface control method, which comprises the following steps of:
s101, acquiring the state of inserting an external device into a USB3.0Type C interface, wherein the state comprises the following steps: forward insertion or backward insertion;
the mode of acquiring the state of the external device inserted into the Type C interface can refer to related technologies, for example, a USB3.0Type C socket judges the state of the external device inserted according to a CC1/CC2 pin, and a USB3.0Type C plug judges the state of the external device inserted according to a CC pin;
s102, when the acquired state is positive insertion, taking the first channel as a receiving channel and taking the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
The method provided by the embodiment of the application can switch the receiving and sending states of a group of receiving and sending channels according to the state that the external equipment is inserted into the USB3.0Type C interface, further meets the requirement of bidirectional communication of the USB3.0Type C interface, and reduces the complexity of the USB3.0Type C interface because two groups of receiving and sending channels are not needed.
In an illustrative example, before the obtaining of the state of the external device plugged into the USB3.0Type C interface, the method further includes:
and judging that the equipment where the USB3.0Type C interface is located is the Host and the USB3.0Type C interface is in a powered state.
The device where the USB3.0Type C interface is located can be a Host or a device; according to the method, the state that the external device is inserted into the USB3.0Type C interface is acquired when the device where the USB3.0Type C interface is located is the Host according to the relevant protocol specification.
The determining whether the USB3.0Type C interface is in a powered state may include: when the VBUS line is powered, the USB3.0Type C interface can be determined to be in a powered state; the VBUS line is the power line that the HOST or repeater HUB supplies to the USB3.0Type C interface, and when supplied, typically applies a voltage of 5V to it.
In an exemplary embodiment, the manner of determining that the device in which the USB3.0Type C interface is located is Host and the USB3.0Type C interface is in a powered state includes:
judging whether equipment where a USB3.0Type C interface is located is Host or not according to an Identification PAD (Identification PAD) at preset time intervals; the ID PAD is a part of the USB3.0Type C interface, and the equipment where the USB3.0Type C interface is located is judged to be Host or device according with the relevant protocol regulation through the ID PAD;
and counting every time the Host is judged, and when the count value is greater than a first preset value, sending a power supply instruction to the USB3.0Type C interface to the Host.
After the Host receives the instruction of supplying power to the USB3.0Type C interface, the Host pressurizes the VBUS line, namely, supplies power to the USB3.0Type C interface. Therefore, by default, the USB3.0Type C interface is in a powered state only after the command for supplying power to the USB3.0Type C interface is sent.
In an exemplary embodiment, for step S102, when the acquired status is positive insertion, the first channel is taken as a receiving channel, and the second channel is taken as a sending channel; when the acquired state is reverse insertion, taking the first channel as a sending channel and the second channel as a receiving channel, including:
when the obtained state is a positive insertion state, starting a counter to count, and when the count value reaches a second preset value, outputting a positive insertion state indicating signal; when the acquired state is reverse insertion, starting a counter to count, and when the count value reaches a second preset value, outputting a reverse insertion state indicating signal; after the state that the external equipment is inserted into the USB3.0Type C interface is obtained, the state indicating signal is sent after waiting for a period of time, and the state that the external equipment is inserted into the USB3.0Type C interface can be ensured to be a stable state;
after receiving the forward insertion state indication signal, taking the first channel as a receiving channel and taking the second channel as a sending channel; and after receiving the reverse insertion state indication signal, taking the first channel as a sending channel and taking the second channel as a receiving channel. After receiving the forward insertion state indication signal, if the current receiving channel is judged to be a first channel and the current sending channel is judged to be a second channel, the continuity of the current channel is kept; and if the current receiving channel is judged to be the second channel and the current sending channel is judged to be the first channel, sending a channel switching request, and starting to convert the sending channel and the receiving channel after the USB PHY receives the switching request. When the reverse insertion state indication signal is received, the subsequent operation can refer to the operation after the forward insertion state indication signal is received, if the current transceiving channel meets the requirement, the continuity of the current channel is kept, and if the current transceiving channel does not meet the requirement, a channel switching request is sent.
An embodiment of the present invention provides a control device for a universal serial bus USB 3.0C Type C interface, as shown in fig. 2, the device includes:
the positive and negative insertion detection module 201 is used for acquiring the state that the external device is inserted into the USB3.0Type C interface, and the state includes: forward insertion or backward insertion;
a switching module 202, configured to, when the obtained state is positive insertion, use the first channel as a receiving channel, and da uses the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
The device that this application embodiment provided can insert the state of USB3.0Type C interface according to external equipment and switch the operation to the receiving and dispatching state of a set of receiving and dispatching passageway, and then satisfies USB3.0Type C interface both way communication's requirement, owing to do not need two sets of receiving and dispatching passageways, has reduced the complexity of USB3.0Type C interface.
In an exemplary embodiment, as shown in fig. 3, the apparatus further comprises:
the role detection module 203 is configured to send a notification to the forward and reverse insertion detection module after determining that the device where the USB3.0Type C interface is located is the Host and the USB3.0Type C interface is in a powered state;
the forward and reverse insertion detection module 201 is further configured to obtain a state of the external device inserted into the USB3.0Type C interface after receiving the notification.
The device where the USB3.0Type C interface is located can be a Host or a device; the device described in the embodiment of the application acquires the state of the USB3.0Type C interface inserted by the external device when the device where the USB3.0Type C interface is located is the Host.
The role detection module 203 determines whether the USB3.0Type C interface is in a power-supplied state, which may include: when the VBUS line is powered, the USB3.0Type C interface can be determined to be in a powered state; the VBUS line is the power line that the HOST or repeater HUB supplies to the USB3.0Type C interface, and when supplied, typically applies a voltage of 5V to it.
In an exemplary embodiment, as shown in fig. 4, the apparatus further comprises: a first counting module 204;
role detection module 203 for judge the equipment that USB3.0Type C interface belongs to be Host and the mode that USB3.0Type C interface is in by power supply state, include: judging whether equipment where a USB3.0Type C interface is located is Host or not according to an Identification PAD (Identification PAD) at preset time intervals; when the Host is determined once, the first counting module 204 is notified to count; after receiving the notification of the first counting module 204, sending a notification to the forward and backward insertion detection module 201;
the first counting module 204 is configured to send, to the Host, an instruction to supply power to the USB3.0Type C interface when the count value is greater than a first preset value, and notify the role detection module 203.
After the Host receives the instruction of supplying power to the USB3.0Type C interface, the Host pressurizes the VBUS line, namely, supplies power to the USB3.0Type C interface. Therefore, by default, the USB3.0Type C interface is in a powered state only after the command for supplying power to the USB3.0Type C interface is sent.
In an exemplary embodiment, as shown in fig. 5, the apparatus further comprises: a second counting module 205;
the second counting module 205 is configured to start a counter to count when the acquired state is a positive insertion state, and output a positive insertion state indicating signal when the count value reaches a second preset value; when the acquired state is reverse insertion, starting a counter to count, and when the count value reaches a second preset value, outputting a reverse insertion state indicating signal;
the switching module 202 is configured to, after receiving the forward insertion state indication signal, use the first channel as a receiving channel and use the second channel as a sending channel; and after receiving the reverse insertion state indication signal, taking the first channel as a sending channel and taking the second channel as a receiving channel.
After the switching module 202 completes the switching, a notification init _ start that the normal enumeration process can be started is sent to the USB3.0 controller.
An embodiment of the present invention further provides a computer readable and writable storage medium, where the medium stores computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the USB3.0Type C interface control method according to the foregoing embodiment.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is 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 tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies 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 includes any information delivery media as known to those skilled in the art.

Claims (9)

1. A universal serial bus USB 3.0C Type C interface control method comprises the following steps:
acquiring the state of an external device inserted into a USB3.0Type C interface, wherein the state comprises the following steps: forward insertion or backward insertion;
when the acquired state is positive insertion, taking the first channel as a receiving channel and taking the second channel as a sending channel; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
2. The universal serial bus USB3.0Type C interface control method of claim 1,
before the obtaining of the state of the external device plugged into the USB3.0Type C interface, the method further includes: and judging that the equipment where the USB3.0Type C interface is located is the Host and the USB3.0Type C interface is in a powered state.
3. The method for controlling the USB3.0Type C interface according to claim 2, wherein the determining that the device where the USB3.0Type C interface is located is Host and the USB3.0Type C interface is in a powered state includes:
judging whether equipment where the USB3.0Type C interface is located is Host or not according to the ID pad of the identity pin at preset time intervals;
and counting every time the Host is judged, and when the count value is greater than a first preset value, sending a power supply instruction to the USB3.0Type C interface to the Host.
4. The universal serial bus USB3.0Type C interface control method of claim 1 or 3, wherein when the acquired state is a 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, taking the first channel as a sending channel and the second channel as a receiving channel, including:
when the obtained state is a positive insertion state, starting a counter to count, and when the count value reaches a second preset value, outputting a positive insertion state indicating signal; when the acquired state is reverse insertion, starting a counter to count, and when the count value reaches a second preset value, outputting a reverse insertion state indicating signal;
after receiving the forward insertion state indication signal, taking the first channel as a receiving channel and taking the second channel as a sending channel; and after receiving the reverse insertion state indication signal, taking the first channel as a sending channel and taking the second channel as a receiving channel.
5. A control device for USB 3.0C Type C interface comprises
Positive reverse plug detection module for obtain the state that external equipment inserted USB3.0Type C interface, the state includes: forward insertion or backward insertion;
the switching module is used for taking the first channel as a receiving channel and taking the second channel as a sending channel when the acquired state is the positive insertion; and when the acquired state is reverse insertion, taking the first channel as a sending channel and taking the second channel as a receiving channel.
6. The control device of the universal serial bus USB3.0Type C interface according to claim 5, further comprising:
the role detection module is used for sending a notification to the positive and negative insertion detection module after judging that the equipment where the USB3.0Type C interface is located is a Host and the USB3.0type C interface is in a power supply state;
and the positive and negative insertion detection module is also used for receiving the notification and acquiring the state of the external equipment inserted into the USB3.0Type C interface.
7. The apparatus for controlling a USB3.0Type C Type interface according to claim 6, further comprising: a first counting module;
role detection module for judge that the equipment that USB3.0Type C interface belongs to be Host and USB3.0Type C interface and be in the mode by power supply state, include: judging whether equipment where the USB3.0Type C interface is located is Host or not according to the ID pad of the identity pin at preset time intervals; when the Host is judged once, the first counting module is informed to count; after receiving the notification of the first counting module, sending a notification to the forward and backward insertion detection module;
and the first counting module is used for sending a power supply instruction to the USB3.0Type C interface to the Host when the counting value is larger than a first preset value, and informing the role detection module.
8. The control device of a universal serial bus USB3.0Type C interface according to claim 5 or 6, wherein the device further comprises: a second counting module;
the second counting module is used for starting the counter to count when the acquired state is positive insertion, and outputting a positive insertion state indicating signal when the count value reaches a second preset value; when the acquired state is reverse insertion, starting a counter to count, and when the count value reaches a second preset value, outputting a reverse insertion state indicating signal;
the switching module is used for taking the first channel as a receiving channel and taking the second channel as a sending channel after receiving the forward-inserting state indication signal; and after receiving the reverse insertion state indication signal, taking the first channel as a sending channel and taking the second channel as a receiving channel.
9. A computer readable and writable storage medium, characterized in that the medium stores computer executable instructions which, when executed by a processor, implement the steps of a universal serial bus USB3.0Type C interface control method according to any one of claims 1 to 4.
CN201910876821.4A 2019-09-17 2019-09-17 USB3.0Type C interface control method, device and medium Pending CN112527712A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910876821.4A CN112527712A (en) 2019-09-17 2019-09-17 USB3.0Type C interface control method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910876821.4A CN112527712A (en) 2019-09-17 2019-09-17 USB3.0Type C interface control method, device and medium

Publications (1)

Publication Number Publication Date
CN112527712A true CN112527712A (en) 2021-03-19

Family

ID=74974651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910876821.4A Pending CN112527712A (en) 2019-09-17 2019-09-17 USB3.0Type C interface control method, device and medium

Country Status (1)

Country Link
CN (1) CN112527712A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115994109A (en) * 2023-03-21 2023-04-21 合肥集创微电子科技有限公司 Data transmission method based on Type-C physical interface and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115994109A (en) * 2023-03-21 2023-04-21 合肥集创微电子科技有限公司 Data transmission method based on Type-C physical interface and electronic equipment

Similar Documents

Publication Publication Date Title
US10673261B2 (en) Power adapter and mobile terminal
CN112449694B (en) Load balancing in multiport power transfer applications
US10587113B2 (en) Electronic device and method of controlling the same
US7447922B1 (en) Supplying power from peripheral to host via USB
EP3131171A1 (en) Power adaptor, terminal and charging system
US9647475B2 (en) Charger, terminal, charging system, and charging control method
JP2013536965A (en) Charging port
US20130080797A1 (en) Usb power supply method and device, and end device and system using the same
CN107480086B (en) Terminal and control method thereof
CN108228509B (en) USB interface switching device and electronic equipment
US20180292880A1 (en) Electronic device and controlling method for the same
CN104135053A (en) Electric quantity sharing method and device
EP3148039A1 (en) Fast charging method, power source adapter and mobile terminal
EP3018556A1 (en) System for controlling peripherals connected to a docking station
CN110941580B (en) Method for reading information and serial small computer system interface SAS expander
CN108513688B (en) Switching device, equipment identification method and equipment identification device
CN112799985B (en) USB interface control method, USB control circuit and intelligent networking equipment mainboard
WO2022068397A1 (en) Charging control circuit and charging device
WO2016097689A1 (en) A device capable of being operated in different modes
CN112527712A (en) USB3.0Type C interface control method, device and medium
CN110716892A (en) Board management method and device and communication board
EP2180410A1 (en) USB device able to automatically adapt to USB capability of a connected host
US20210294766A1 (en) Terminal and type c interface anti-corrosion method
CN106774769B (en) Terminal working mode switching method and device and handheld terminal
WO2016179944A1 (en) Function multiplexing method and apparatus for communication interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination