USB interface multiplexing method, circuit, electronic device, and storage medium
The USB interface multiplexing method and circuit enable one USB interface to communicate with multiple processor ports in multi-processor terminals, simplifying design and improving debugging efficiency by using level signals to determine target ports and adapt to different serial buses.
Patent Information
- Application Number
- JP2023540749
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2021-03-09
- Filing Date
- 2022-02-28
- Publication Date
- 2026-02-25
- Estimated Expiration
- 2042-02-28
AI Technical Summary
In multi-processor terminals, the need for multiple interfaces for debugging and data communication complicates the design and requires separate debug boards and destructive operations, such as device disassembly, due to each processor having its own interface.
A method and circuit for multiplexing a USB interface that uses level signals other than the service data and ground signals to determine a target processor port, allowing one USB interface to transmit data to multiple processor ports without additional interfaces, and can adapt to different serial bus types and switch targets based on signal changes.
Simplifies product interface design, expands functionality, and enhances debugging efficiency by enabling data communication and troubleshooting with one USB interface across multiple processors, reducing the need for test points and debug connectors.
Smart Images

Figure 0007820388000003 
Figure 0007820388000004 
Figure 0007820388000005
Abstract
Description
[Technical Field]
[0001] This application is filed based on and claims priority from a Chinese patent application bearing application number 202110258065.6 and filed on March 9, 2021, the entire contents of which are incorporated herein by reference.
[0002] The present application relates to the field of communications, and more particularly to a multiplexing method, circuit, electronic device, and storage medium for a USB interface. [Background technology]
[0003] With the development of wireless terminal products, the integration of products is becoming stronger and the functions are becoming richer. In particular, in data terminal products, in order to improve product performance and competitiveness, the processors within the terminals are gradually upgraded from single-core to multi-core, e.g., from modem to microcontroller unit (MCU) + modem, access point (AP) + modem, etc. Each processor in a multiprocessor has its own function, and each processor has its own interface for debugging and data communication, such as a universal serial bus (USB) interface, a universal asynchronous receiver / transmitter (UART) interface, and a serial peripheral interface (SPI). Summary of the Invention The problem that the invention aims to solve
[0004] However, if a terminal has multiple processors, each with its own processor interface for debugging and data communication, or if a terminal has one processor with at least two processor interfaces, then in order to realize processor debugging and data communication, it is necessary to provide multiple interfaces for peripheral device access in the terminal, and transmit data for debugging and communication to the corresponding processor ports. Taking a dual-processor product as an example, each processor has one port for debugging and communication, such as a UART interface and a USB interface, in this case, the terminal product needs to design at least four interfaces for peripheral device access to transmit data for debugging and communication to the processor ports. The formats of the interfaces for peripheral device access are complex, including standard USB interfaces, commissioning connectors, test points, etc. In particular, some products require a separate debug board, and subsequent destructive operations, such as device disassembly, must be performed during debugging or troubleshooting. Therefore, some products need to design dual USB interfaces for peripheral device access, or design a single USB interface at the expense of functionality for peripheral device access. [Means for solving the problem]
[0005] An embodiment of the present application provides a method for multiplexing a USB interface, in which an electronic device to which the USB interface belongs includes multiple ports of one processor or multiple processors, each of the processors including at least one port, the method including: acquiring at least one level signal other than a service data signal and a ground signal in the USB interface; determining a target port of a target processor corresponding to the logical result as a transmission target of the USB interface based on a predefined correspondence including a logical result of the at least one level signal and a logical result of the at least one level signal uniquely corresponding to each port of each processor; transmitting the received data to the transmission target via the USB interface, and transmitting data to be sent by the transmission target via the USB interface.
[0006] An embodiment of the present application further provides a multiplexing circuit for a USB interface, the multiplexing circuit including: a USB interface for transmitting signals; a decoder for obtaining at least one level signal other than a service data signal and a ground signal in the USB interface, and determining, based on a logical result of the at least one level signal and a predefined correspondence including the logical result of the at least one level signal uniquely corresponding to each port of each processor, a target port of a target processor corresponding to the logical result as a transmission target of the USB interface; and a multi-way switch for strobing a transmission channel between the USB interface and the transmission target, so that data received by the USB interface is transmitted to the transmission target and data to be sent by the transmission target is transmitted via the USB interface.
[0007] An embodiment of the present application further provides an electronic device including the above-described USB interface multiplexing circuit.
[0008] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, realizes the above-mentioned USB interface multiplexing method. [Brief explanation of the drawings]
[0009] One or more embodiments are illustrated by way of example only in the accompanying drawing figures, and are not intended to be limiting of these illustrative embodiments. [Figure 1] 1 is a flowchart of a method for multiplexing a USB interface according to a first embodiment of the present invention. [Figure 2] 10 is a flowchart of a method for multiplexing a USB interface according to a second embodiment of the present invention. [Figure 3] 10 is a flowchart of a method for multiplexing a USB interface according to a third embodiment of the present application. [Figure 4] FIG. 10 is a schematic diagram illustrating the configuration of a multiplexing circuit of a USB interface according to a fourth embodiment of the present invention. [Figure 5] FIG. 4 is a schematic diagram 1 illustrating an application of a multiplexing circuit of a USB interface according to a fourth embodiment of the present invention. [Figure 6] FIG. 5 is a schematic diagram 2 illustrating the application of the multiplexing circuit of the USB interface according to the fourth embodiment of the present invention shown in FIG. [Figure 7] FIG. 10 is a schematic diagram illustrating the configuration of an electronic device according to a fifth embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0010] The main purpose of the embodiments of this application is to propose a USB interface multiplexing method, circuit, electronic device, and storage medium for realizing USB interface multiplexing within a multi-processor terminal. This enables data to be transmitted to different types of ports of multiple processors using only one standard USB interface, without the need for interfaces for access by multiple peripheral devices such as test points or debug connectors, making it possible to realize functions such as data communication and debugging, which is very advantageous for simplifying the design of product interfaces, expanding functions, and later debugging and troubleshooting of the entire device.
[0011] To clarify the objectives, technical solutions, and advantages of the embodiments of the present application, the following detailed description of each embodiment will be provided with reference to the accompanying drawings. However, as will be understood by those skilled in the art, many technical details are proposed in each embodiment of the present application to help readers better understand the present application. However, the technical solutions claimed and protected by the present application can be realized without these technical details or various changes or modifications based on the following embodiments. The division of the following embodiments is merely for ease of explanation and does not limit the present application to specific embodiments. Each embodiment can be combined with other embodiments as long as there is no contradiction.
[0012] The first embodiment of the present application relates to a method for multiplexing a USB interface that is applied to an electronic device and enables one USB interface to transmit data to multiple ports of one processor or to each port of multiple processors included in the electronic device through multiplexing. The electronic device here may be a wireless terminal device such as a tracker or CPE, and as shown in Figure 1, specifically includes steps 101, 102, and 103.
[0013] Step 101: Obtain at least one level signal other than a service data signal and a ground signal in a USB interface.
[0014] Specifically, in a Universal Serial Bus (USB) interface, the USB_DP and USB_DM pins are used to transmit service data, and the signals provided by the USB_DP and USB_DM pins are called service data signals, while the GND pin is used for grounding, and the signal provided by the GND pin is called a ground signal. Because the service data and ground signals in the USB interface cannot be arbitrarily adjusted during communication, only signals other than the service data and ground signals of the USB interface can be selected for subsequent processor port selection. That is, a level signal provided by at least one different pin other than the USB_DP, USB_DM, and GND pins of the USB interface is obtained.
[0015] More specifically, if the USB interface is a Micron USB interface, the signals provided by the USB interface include a service data signal, a ground signal, a USB_VBUS signal, and a USB_ID signal. In this case, the acquired level signal is the USB_VBUS signal and / or the USB_ID signal. If the USB interface is a Type-C USB interface, the signals provided by the USB interface include a signal for transmitting service data, a ground signal, a USB_VBUS signal, an SBU1 signal, an SBU2 signal, a CC1 signal, a CC2 signal, and a USB_ID signal, and the acquired signal is any one or a combination of the USB_VBIS signal, an SBU1 signal, an SBU2 signal, a CC1 signal, and a CC2 signal. For example, the CC1 signal is acquired, or the CC1 signal and the SBU2 signal are acquired, or the CC1 signal, the USB_VBIS signal, and the CC2 signal are acquired. Of course, the above are only specific examples, and in actual use, at least one signal other than the signal for transmitting service data and the ground signal in other types of USB interfaces may be included, and detailed description thereof will be omitted here.
[0016] In one example, to meet the actual needs of a user, the method further includes a step of setting the high / low level state of at least one level signal according to the needs before performing step 101. At the same time, to set the level signal, a control switch can be designed to control the high / low state of the level signal in the USB port, for example, by selectively setting it in the form of a switch on the USB cable or USB debug board. Of course, the above is only a specific example, and in actual use, the level signal can be set in other ways, and detailed description thereof will be omitted here.
[0017] In the above signal descriptions, the signals are named by pin; for example, the CC2 signal is the signal provided by the CC2 pin of the USB interface.
[0018] Step 102: Based on the logical result of at least one level signal and a predefined correspondence including the logical result of at least one level signal uniquely corresponding to each port of each processor, a target port of a target processor corresponding to the logical result is determined as a transmission target of the USB interface.
[0019] Specifically, the processor port includes a USB interface, a UART interface, an I2C interface, an SPI interface, etc. Of course, the above are only specific examples, and in actual use, the processor interface may include other interfaces that can transmit the service data to be transmitted through the USB interface after being converted, and detailed descriptions thereof will be omitted here.
[0020] In one specific example, the correspondence defines a one-to-one correspondence between each port of each processor and various possible logics of at least one level signal. For example, the logical expression of the CC1 signal corresponding to the USB1 port of processor 1 is 0, and the logical expression of the CC1 signal corresponding to the USB2 port of processor 1. Suppose the logical expression of the level signal of the CC1 signal obtained after performing step 101 is 0, then it is uniquely determined based on the correspondence that the transmission target is the USB1 port of processor 1. When multiple level signals are acquired, the logical result refers to the logical combination result of the multiple level signals. For example, it may be a logical combination 00 of two level signals corresponding to the USB port of processor 1, a logical combination 01 of two level signals corresponding to a Universal Asynchronous Receiver / Transmitter (UART) interface of processor 1, and a logical combination 11 of two level signals corresponding to the USB port of processor 2. Suppose the two level signals are obtained by performing step 101 and the logical combination result is 00, then it is uniquely determined based on the correspondence that the transmission target is the USB port of processor 1.
[0021] Note that in the correspondence, the total number of ports of the processor is less than or equal to the total number of different possible logical outcomes of at least one level signal.
[0022] Step 103: The received data is transmitted to the transmission target via the USB interface, and the data to be transmitted by the transmission target is transmitted via the USB interface.
[0023] Specifically, after performing step 102 to determine the transmission target, a data transmission path is established between the USB interface and the transmission target, and the peripheral device transmits data in the peripheral device to the target processor via the USB interface, the data transmission path, and the transmission target in turn. The target processor then performs corresponding processing on the received data, and transmits the processing result as data to be transmitted to the peripheral device via the transmission target, the data transmission path, and the USB interface in turn.
[0024] Compared with the prior art, the embodiment proposed by the present application obtains at least one level signal other than the service data signal and the ground signal in the USB interface, and then, based on the logical combination result of the at least one level signal, selects one target port of a target processor from the various ports of all processors as a transmission target of the USB interface based on the logical result of the at least one level signal uniquely corresponding to each port of each processor and the logical result of the at least one level signal, thereby transmitting received data to the transmission target via the USB interface and transmitting data from the transmission target via the USB interface. Because all processor ports in a terminal can be transmission targets, the one-to-one correspondence between USB interfaces and processor ports used by peripheral devices on the terminal is broken. Instead, one USB interface can communicate with each port of all processors in the terminal, realizing USB interface multiplexing in a multi-processor terminal. Furthermore, data can be transmitted to multiple processor ports using only one standard USB interface without the need for test points or debug connectors, thereby achieving functions such as data communication and debugging, which is very advantageous for simplifying product interface design, function expansion, and later-stage debugging and fault handling of the entire device.
[0025] A second embodiment of the present application relates to a method for multiplexing a USB interface. In this embodiment, before transmitting received data to a transmission target via a USB interface and transmitting data to be transmitted by the transmission target via the USB interface, it is further determined whether the transmission target uses a two-wire serial bus. As shown in FIG. 2, the method specifically includes steps 201, 202, 203, 204, and 205.
[0026] Step 201: Obtain at least one level signal other than the service data signal and the ground signal in the USB interface.
[0027] Specifically, step 201 in this embodiment is substantially the same as step 101 in the first embodiment, and a detailed description thereof will be omitted here.
[0028] Step 202: Based on the logical result of at least one level signal and a predefined correspondence including the logical result of at least one level signal uniquely corresponding to each port of each processor, a target port of a target processor corresponding to the logical result is determined as a transmission target of the USB interface.
[0029] Specifically, step 202 in this embodiment is substantially the same as step 102 in the first embodiment, and a detailed description thereof will be omitted here.
[0030] Step 203: Detect whether the transmission target uses a two-wire serial bus; if yes, execute step 204; if not, execute step 205;
[0031] Specifically, the interface type indicates the type of bus used by the interface, for example, an SPI interface uses a four-wire serial bus, a two-wire UART interface uses a two-wire serial bus, etc. Therefore, the step of detecting whether the transmission target uses a two-wire serial bus can be realized by detecting the type of the interface of the transmission target.
[0032] Step 204: The received data is adjusted to a format that can be received by the transmission target, and the data to be sent is adjusted to a format that can be received by the USB interface.
[0033] Specifically, because a two-wire serial bus transmits two pieces of data at a time and a four-wire serial bus transmits four pieces of data at a time, when data is transmitted between two interfaces using different types of serial buses, it cannot be transmitted directly from one interface to the other, and so the data must be processed to ensure normal transmission and reception between the two interfaces using different types of serial buses.By adjusting the received data into a format that can be received by the transmission target and the transmitted data into a format that can be received by the USB interface, when data is transmitted between interfaces using different types of serial buses, the data on the transmitting side is converted into data that can be received by the receiving side, thereby enabling normal data transmission.
[0034] In one example, data stored in an interface using one type of serial bus can be converted into data that can be received by an interface using another type of serial bus by introducing a bridge chip to process the stored data; for example, data sent by a USB interface can be converted into a format that can be received by an SPI interface via a USB-to-SPI bridge chip.
[0035] Step 205: Transmit the received data to the transmission target via the USB interface, and transmit data to be sent by the transmission target via the USB interface.
[0036] Specifically, if the transmission target and the USB interface use different types of serial buses, the received and adjusted data is transmitted to the transmission target via the USB interface, and the transmission target's adjusted data to be transmitted is sent via the USB interface. If the transmission target and the USB interface use the same type of serial bus, the received data is directly transmitted to the transmission target via the USB interface, and the transmission target's data to be transmitted is directly sent via the USB interface.
[0037] Compared with the prior art, this embodiment of the present invention achieves the beneficial effects of the first embodiment, and can detect whether the USB interface and the transmission target can communicate directly. If direct communication is not possible, the received data is adjusted to a format that can be received by the transmission target, and the transmitted data is adjusted to a format that can be received by the USB interface. This enables data transmission between interfaces using different types of serial buses to be performed by converting the data on the sending side into data that can be received by the receiving side, thereby enabling normal data transmission. This avoids data transmission errors caused by a mismatch between the USB interface and the transmission target, and improves the accuracy of data transmission.
[0038] The third embodiment of the present application relates to a method for multiplexing a USB interface, in which the received data is transmitted to a transmission target via the USB interface, and the data to be transmitted by the transmission target is transmitted via the USB interface, after which the transmission target can be further switched. As shown in FIG. 3, specifically, the method includes steps 301, 302, 303, and 304.
[0039] Step 301: Obtain at least one level signal other than the service data signal and the ground signal in the USB interface.
[0040] Specifically, step 301 in this embodiment is substantially the same as step 101 in the first embodiment, and a detailed description thereof will be omitted here.
[0041] Step 302: Based on the logical result of at least one level signal and a predefined correspondence including the logical result of at least one level signal uniquely corresponding to each port of each processor, a target port of a target processor corresponding to the logical result is determined as a transmission target of the USB interface.
[0042] Specifically, step 302 in this embodiment is substantially the same as step 102 in the first embodiment, and a detailed description thereof will be omitted here.
[0043] Step 303: The received data is transmitted to the transmission target via the USB interface, and the data to be transmitted by the transmission target is transmitted via the USB interface.
[0044] Specifically, step 303 in this embodiment is substantially the same as step 103 in the first embodiment, and a detailed description thereof will be omitted here.
[0045] Step 304: If it is detected that the high / low level state of the level signal has changed, the USB interface multiplexing method is executed again based on the changed level signal.
[0046] Specifically, the high / low level state of the level signal uniquely determines the logical result of at least one level signal, and further uniquely determines the transmission target based on the correspondence, so a change in the high / low level state of the level signal signifies a change in the uniquely determined transmission target. The high / low level state of the at least one level signal acquired in step 301 can be detected in real time or periodically, and if any level signal of the at least one level signal changes, the USB interface multiplexing method is re-executed, thereby re-determining the transmission target and realizing the switching of the transmission target.
[0047] Furthermore, if the user needs to switch the transmission target without changing the conditions of the electronic device and peripheral devices, etc., he or she can simply reset the high / low level state of the level signal acquired in step 301 based on his or her own needs and correspondence, and the USB interface multiplexing method provided by this embodiment can control the switching of the debugging and communication ports of the processor in the terminal, or the switching of different processors, without the need to replace the USB interface. This achieves smooth switching of the USB port between each processor and processor port, reduces the waste of resources such as manpower and time, and improves the efficiency of data transmission and debugging.
[0048] Compared with the prior art, this embodiment of the present invention achieves the beneficial effects of the first embodiment, and furthermore, when any level signal of at least one level signal changes, the USB interface multiplexing method can be re-executed, thereby re-determining the transmission target and realizing the transmission target switching. Furthermore, by resetting the high / low level state of the level signal, the user can control the switching of the debugging and communication ports of the processor in the terminal, or the switching of different processors, eliminating the need to replace the USB interface and realizing smooth switching of the USB port between each processor and processor port, reducing the waste of resources such as manpower and time, and improving the efficiency of data transmission and debugging.
[0049] It is also understood that the division of steps in each of the above methods is merely for clarity of explanation, and that during implementation, they may be combined into one step or divided into multiple steps, and as long as they contain the same logical relationship, they are within the scope of protection of this patent; and adding non-significant changes or introducing non-significant designs to an algorithm or process without changing the core design of the algorithm or process is also within the scope of protection of the patent.
[0050] The fourth embodiment of the present invention relates to a multiplexing circuit for a USB interface, which includes a USB interface 401, a decoder 402, and a multi-way switch 403, as shown in FIG.
[0051] The USB interface 401 is used to transmit signals.
[0052] The decoder 402 is used to obtain at least one level signal other than the service data signal and the ground signal in the USB interface, and determine the target port of the target processor corresponding to the logical result as the transmission target of the USB interface based on the logical result of the at least one level signal and a predefined correspondence including the logical result of the at least one level signal that uniquely corresponds to each port of each processor.
[0053] Specifically, if the USB interface 401 is a Micron USB interface, the pins of the USB interface include a USB_DP pin, a USB_DM pin, a USB_ID pin, a USB_VBUS pin, and a USB_ID pin. If the electronic device to which the USB interface 401 belongs includes two processors, each of which includes two ports, and the processors are AP1 and AP2, respectively, the AP1 port includes an AP1 USB port and an AP1 UART port, and the AP2 port includes an AP2 USB port and an AP2 UART port, the decoder 402 can select and use a 2-4 decoder. In this case, the USB_DP, USB_DM, and USB_ID pins in the USB interface are used normally, and the level signals provided by the USB_VBUS and USB_ID pins are input to the decoder 402 (corresponding to the logical result of at least one level signal). The decoder 402 then outputs a control signal after decoding to control the strobe state of the multi-way switch 403. As shown in FIG. 5, the circuits where each switch of the multi-way switch 403 is located are connected to different processor ports. Based on the connection relationship shown in FIG. 5, the correspondence relationship represented by the logical combination result of at least one level signal that uniquely corresponds to each port of each processor is as follows: [Table 1]
[0054] The decoder 402 receives the USB_VBUS signal and USB_ID signal provided by the USB_VBUS pin and USB_ID pin as input each time, and then, according to the above table, uniquely determines one port from among the AP1 USB port, the AP1 UART port, the AP2 USB port, and the AP2 UART port as the transmission target. For example, when the level signals of the USB_VBUS pin and the USB_ID pin input to the decoder 402 are 10, the decoder 402 determines according to the above table that the processor port is the AP2 USB port, and generates control signal 2 for controlling the multi-way switch to gate SWITCH2 and transmit data.
[0055] Similarly, if the USB interface 401 is a Type-C USB interface, the pins of the USB interface include an SBU1 pin, an SBU2 pin, a CC1 pin, a CC2 pin, a USB_DP pin, a USB_DM pin, a USB_ID pin, a USB_VBUS pin, and a USB_ID pin. If the electronic device to which the USB interface 401 belongs includes two processors, with a total of seven processor ports, and the processors are AP1 and AP2, respectively, as shown in FIG. 6 , the ports of AP1 include an AP1 USB1 port, an AP1 Communication UART port, an AP1 Debug_UART port, an AP1 USB2 port, and an AP1 SPI port, and the ports of AP2 include an AP2 USB port and an AP2 UART port, the decoder 402 can select and use a 3-8 decoder. In this case, the USB_DP, USB_DM, and USB_ID pins in the USB interface are used normally, and three pins are selected from the SBU1, SBU2, CC1, CC2, and USB_VBUS pins to provide input signals to decoder 402. The unselected pins remain in normal use. Here, an example is taken where the SBU1, SBU2, and USB_VBUS pins are selected to provide input signals to decoder 402. The level signals provided by the SBU1, SBU2, and USB_VBUS pins are input to decoder 402 (corresponding to the logical result of at least one level signal), and then decoder 402 outputs a control signal after decoding to control the strobe state of multi-way switch 403. As shown in Figure 6, the circuits in which each switch of multi-way switch 403 is located are connected to different processor ports. Based on the connection relationship shown in Figure 6, the correspondence relationship represented by the logical combination result of at least one level signal uniquely corresponding to each port of each processor is as follows: [Table 2]
[0056] In this case, as shown in FIG. 6, a Type-C USB cable or plug board is further provided for connecting a switch, button, etc. to realize artificial setting of the high / low level states of the SBU1 pin, SBU2 pin, and USB_VBUS pin in the USB interface 401. Each time the Type-C USB cable or plug board sets the high / low level states of the SBU1 pin, SBU2 pin and USB_VBUS pin, the decoder 402 obtains a corresponding input, and then uniquely determines one of the seven processor ports shown in FIG. 6 as the transmission target according to the above table. For example, the Type-C USB cable or plug board controls the switches of the encoder to switch the logic levels of the VBUS pin, SUB1 pin and SBU2 pin to all 0, and the decoder 402 outputs a control signal 0, thereby controlling the multi-way switch to strobe the switch SWITCH0 corresponding to the AP1 USB1 port. In this case, an external USB_VBUS power supply is required to power the AP1 VBUS port, i.e., to provide enumeration and realize data communication between the USB interface 401 and the AP1 USB1 port. Or, the Type-C The encoder switches are controlled by the USB cable or plug board to sequentially change the logic levels of the VBUS pin, SUB1 pin, and SBU2 pin to "110", and the decoder 402 outputs control signal 6, which controls the multi-way switch to gate the switch SWITCH6 corresponding to the AP2 UART port, thereby realizing data communication between the USB interface 401 and the AP2 UART port. In this case, the USB_VBUS power supply of AP2 needs to be turned off.
[0057] Of course, the above are only specific examples, and in actual use, the decoder 402 can also receive signals provided by other types of decoders and other pins accessed by the USB interface 401 as inputs, and detailed descriptions thereof will be omitted here.
[0058] The multi-way switch 403 is used to gate the transmission channel between the USB interface and the transmission target, so that data received by the USB interface is transmitted to the transmission target, and data sent by the transmission target is transmitted via the USB interface.
[0059] Specifically, the multi-way switch 403 further includes a data transmission path established between the USB interface and the transmission target. When communicating based on the multiplexing capability of the USB interface 401, data enters the USB interface 401 from the peripheral device, and then the decoder 402 determines the gate state of the multi-way switch. The data in the USB interface 401 then passes through the multi-way switch 403 to the corresponding processor port, and finally enters the processor for processing. After the processor processes the data, it transmits the processing results, etc. to the peripheral device via the processor port, the multi-way switch 403, and the USB interface 401 in order.
[0060] It goes without saying that this embodiment is an embodiment of a USB interface multiplexing circuit corresponding to the first embodiment, and this embodiment can be implemented in conjunction with the first embodiment. The relevant technical details of the first embodiment are still valid in this embodiment, and to reduce repetition, detailed descriptions will be omitted here. Correspondingly, the relevant technical details of this embodiment can also be applied to the first embodiment.
[0061] Furthermore, in order to emphasize the innovative aspects of the present invention, the present embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in the present embodiment.
[0062] The fifth embodiment of the present application relates to an electronic device, and as shown in FIG. 7, an electronic device 701 includes a USB interface multiplexing circuit 702. The USB interface multiplexing circuit 702 in this embodiment is substantially the same as that in the fourth embodiment, and therefore a detailed description thereof will be omitted here.
[0063] A sixth embodiment of the present invention relates to a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method embodiment described above.
[0064] That is, those skilled in the art can understand that all or part of the steps in the above-described embodiment methods can be completed by issuing instructions to relevant hardware through a program, and the program is stored in a storage medium and includes multiple instructions for causing a device (which may be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The above-described storage medium includes various media capable of storing program code, such as a USB memory, a mobile disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0065] As will be understood by those skilled in the art, the above-described embodiments are specific examples for realizing the present application, and various changes in form and details may be made in actual applications without departing from the spirit and scope of the present application.
Claims
1. A method for multiplexing a USB interface, wherein an electronic device to which the USB interface belongs includes a plurality of processor ports, the method comprising: acquiring at least one level signal other than a service data signal and a ground signal in a USB interface; determining a target port of a target processor corresponding to the logical result as a transmission target of the USB interface based on a logical result of the at least one level signal and a predefined correspondence including the logical result of the at least one level signal uniquely corresponding to each port of each processor; transmitting the received data to the transmission target via the USB interface, and transmitting data to be transmitted by the transmission target via the USB interface; before the step of acquiring at least one level signal other than a service data signal and a ground signal in the USB interface; further comprising the step of setting a high / low level state of the at least one level signal; A method for multiplexing a USB interface, comprising:
2. 2. The method for multiplexing a USB interface according to claim 1, wherein the USB interface is a Micro USB interface, and the level signal is a USB_VBUS signal or a USB_ID signal.
3. 2. The method of claim 1, wherein the USB interface is a Type-C USB interface, and the level signal is a USB_VBUS signal, an SBU1 signal, an SBU2 signal, a CC1 signal, or a CC2 signal.
4. Before the step of transmitting the received data to the transmission target via the USB interface and transmitting data to be transmitted by the transmission target via the USB interface, detecting whether the transmission target uses a two-wire serial bus; If not, the method further comprises the steps of adjusting the received data into a format that can be received by the transmission target, and adjusting the data to be transmitted into a format that can be received by the USB interface.
5. After the step of transmitting the received data to the transmission target via the USB interface and transmitting data to be transmitted by the transmission target via the USB interface, The USB interface multiplexing method according to any one of claims 1 to 4, further comprising the step of, when it is detected that the high / low level state of at least one of the level signals has changed, re-executing the USB interface multiplexing method based on the level signal after the change.
6. 6. The method for multiplexing a USB interface according to claim 1, wherein the target port is a UART interface, an I2C interface, or an SPI interface.
7. A multiplexing circuit for a USB interface, comprising: a USB interface for transmitting signals; a decoder for acquiring at least one level signal other than a service data signal and a ground signal in a USB interface, and determining a target port of a target processor corresponding to a logical result based on a predefined correspondence including a logical result of the at least one level signal and a logical result of the at least one level signal uniquely corresponding to each port of each processor, as a transmission target of the USB interface; a multi-way switch for strobing a transmission channel between the USB interface and the transmission target so that data received by the USB interface is transmitted to the transmission target and data to be transmitted by the transmission target is transmitted via the USB interface; Before acquiring at least one level signal other than the service data signal and the ground signal in the USB interface, setting a high / low level state of the at least one level signal; A multiplexing circuit for a USB interface, comprising:
8. An electronic device comprising the USB interface multiplexing circuit according to claim 7.
9. A computer-readable storage medium on which a computer program is stored, the computer-readable storage medium realizing the USB interface multiplexing method according to any one of claims 1 to 6 when the computer program is executed by a processor.
Citation Information
Patent Citations
Reusable interface
CN201927859U
Semiconductor integrated circuit device
JP2007148754A
Interface sharing device and method, and mobile communication terminal
JP2015519641A
Integration connecting apparatus in mobile terminal and method for operating the same
US20120159036A1
System and circuit using USB type-c interface
US20160156137A1