Universal serial bus concentrator

文档序号:1286912 发布日期:2020-08-28 浏览:6次 中文

阅读说明:本技术 通用串行总线集线器 (Universal serial bus concentrator ) 是由 游添为 詹澄胜 陈俊旭 段人杰 于 2017-10-13 设计创作,主要内容包括:通用串行总线USB集线器,包括:上游端口;第一USB装置控制单元,以进行分组格式转换;先入先出电路,暂存由第一主机传来的数据;第二USB装置控制单元,以进行分组格式转换;及多个下游端口,耦接至第二USB装置控制单元。当任一下游端口耦接至移动装置时,如果第一主机下令移动装置从装置角色切换至主机角色,移动装置暂时断开与USB集线器之间的连接,且该第一主机下令USB集线器以切换其内部绕线路径,当移动装置切换至主机角色后,第一主机仍扮演主机角色,第一USB装置控制单元扮演该装置角色,移动装置扮演主机角色,第二USB装置控制单元扮演装置角色,第一主机与USB装置控制单元为成对,移动装置与第二USB装置控制单元为成对。(A universal serial bus USB hub, comprising: an upstream port; a first USB device control unit to perform packet format conversion; the first-in first-out circuit temporarily stores data transmitted from the first host; a second USB device control unit to perform packet format conversion; and a plurality of downstream ports coupled to the second USB device control unit. When any downstream port is coupled to the mobile device, if the first host commands the mobile device to switch from the device role to the host role, the mobile device temporarily disconnects from the USB hub, and the first host commands the USB hub to switch its internal winding path.)

1. A universal serial bus, USB, hub, the USB hub comprising:

an upstream port coupled to a first host;

a hub function module coupled to the upstream port for performing a hub function;

a host-to-host function module coupled to the upstream port, wherein when a mobile device connected to the USB hub performs a device role, a signal between the first host and the mobile device flows through a bypass path or the host-to-host function module under the control of the hub function module, and the host-to-host function module implements a "host-to-host mode";

at least one control module, coupled to the upstream port, for controlling at least one connected device;

a virtual hub function unit coupled to the hub function module, the host-to-host function module, and the at least one control module, the virtual hub function unit supporting a virtual hub function and having a function of storing a relationship between USB addresses and related devices, the virtual hub function unit storing a plurality of USB addresses; and

a plurality of downstream ports coupled to the second USB device control unit,

according to the USB address appointed by the first host, the virtual hub function unit appoints each virtual USB address of the hub function module, the host-to-host function module and the at least one control module.

2. The USB hub according to claim 1,

according to the interface field in the command transmitted by the first host, the USB hub determines the transmission target of the command.

Technical Field

The present invention relates to a composite Universal Serial Bus (USB) hub (hub) with host-to-host functionality.

Background

In the past, when a mobile device is connected to a host (a notebook computer, a desktop computer, or a Car system) through a Universal Serial Bus (USB), the mobile device is regarded as a device (i.e., a slave device).

However, mobile devices (such as smart phones) are becoming popular and have powerful hardware functions, so that the mobile devices may gradually replace the roles of notebook computers, desktop computers, Car systems, and the like. That is, the mobile device has been transitioned from the device to the host (host).

In addition, since USB is very widely used, devices with USB host function (such as mobile phone/desktop computer/pen phone) may need to connect to a USB Hub (Hub) to connect to other peripheral USB devices. However, in the original design of the USB hub, the USB hub has an upstream port (upstream port) for connecting to the host and a plurality of downstream ports (downstream ports) for connecting to other peripheral USB devices. However, the downstream port of the USB hub only has host-to-device functions and does not have host-to-host functions. However, with the rapid development of mobile devices, the operation mode of the host has become a necessary trend.

That is, there is a need for a new USB hub design that can support both "host-to-host" and "host-to-device" modes of operation. When in host-to-host mode, the mobile device is connected to the downstream port of the USB hub design, but the mobile device is still operating in the host role.

Disclosure of Invention

According to an example of the present application, a Universal Serial Bus (USB) hub is provided, the USB hub comprising: an upstream port coupled to a first host; a first USB device control unit coupled to the upstream port for performing packet format conversion; a FIFO circuit coupled to the first USB device control unit for temporarily storing the data transmitted from the first host; a second USB device control unit coupled to the FIFO circuit for performing packet format conversion; and a plurality of downstream ports coupled to the second USB device control unit. When any one of the downstream ports is coupled to a mobile device, if the first host commands the mobile device to switch from a device role to a host role, the mobile device temporarily disconnects from the USB hub, and the first host commands the USB hub to switch its internal winding path, after the mobile device switches to the host role, the first host still plays the host role, the first USB device control unit plays the device role, the mobile device plays the host role, the second USB device control unit plays the device role, the first host and the first USB device control unit are paired, and the mobile device and the second USB device control unit are paired.

According to another example of the present application, a Universal Serial Bus (USB) hub is provided, the USB hub comprising: an upstream port coupled to a first host; a hub function module coupled to the upstream port for performing a hub function; a host-to-host functional module coupled to the upstream port, wherein when a mobile device connected to the USB hub performs a device role, a signal between the first host and the mobile device flows through a bypass path or the host-to-host functional module under the control of the hub functional module, and the host-to-host functional module implements a "host-to-host mode"; at least one control module, coupled to the upstream port, for controlling at least one connected device; a virtual hub function unit coupled to the hub function module, the host-to-host function module, and the at least one control module, the virtual hub function unit supporting a virtual hub function and having a function of storing relationships between USB addresses and related devices, the virtual hub function unit storing a plurality of virtual USB addresses; and a plurality of downstream ports coupled to the second USB device control unit. According to a USB address designated by the first host, the virtual hub function unit designates each virtual USB address of the hub function module, the host-to-host function module, and the at least one control module.

In order to better appreciate the above and other aspects of the present invention, the following detailed description of the embodiments is provided in conjunction with the accompanying drawings.

Drawings

FIG. 1 is a block diagram of a USB hub according to an embodiment of the present application.

FIG. 2 is a block diagram of a USB hub according to an embodiment of the present application.

FIG. 3 is a block diagram of a FIFO circuit according to an embodiment of the present application.

Fig. 4A to 4C are schematic diagrams illustrating an application according to an embodiment of the present application.

[ notation ] to show

110: the first host 120: mobile device

130: the USB hub 131: upstream port

132-134: downstream port 141: concentrator function module

142: host-to-host function module 143: first control module

144: second control modules 151 and 152: interface

BY: bypass path

200: the USB hub 210: repeating circuit

212: the transmission translation circuit 214: wound logic circuit

216: state machine

218. 224: USB device control unit

220: virtual hub function 222: first-in first-out circuit

226: the storage control unit 228: sound effect control unit

242: upstream ports 244_1-244_ N: downstream port

246_1-246_ 2: interfaces P1, P2, P3: route of travel

302 and 304: FIFOs 306, 308, 312: multiplexer

310: direct Memory Access (DMA) circuit

320: the buffer 322: central Processing Unit (CPU)

Detailed Description

The technical terms in the specification refer to the common terms in the technical field, and if the specification explains or defines a part of the terms, the explanation of the part of the terms is subject to the explanation or definition in the specification. Various embodiments of the present disclosure each have one or more technical features. A person skilled in the art may selectively implement some or all of the features of any of the embodiments, or selectively combine some or all of the features of the embodiments, where possible.

Referring now to FIG. 1, therein is shown a block diagram of a USB hub according to an embodiment of the present application. As shown in fig. 1, the USB hub 130 includes: an upstream port 131, a plurality of downstream ports 132, a hub function block 141, a host-to-host function block 142, a first control block 143, a second control block 144, and interfaces 151 and 152. A first host (e.g., a desktop computer, a notebook computer, an in-vehicle system, etc.) 110 is connected to an upstream port 131 of the USB hub 130 via a USB interface, and a mobile device (e.g., a smartphone, etc.) 120 is connected to a downstream port 132 of the USB hub 130 via a USB interface.

The hub function module 141 is used to perform general hub functions (i.e., signal transmission between host and device, for example).

When a mobile device (e.g., a smart phone, etc.) 120 connected to the USB hub 130 performs a device role, signals between the first host 110 and the mobile device 120 flow through the bypass path BY and do not flow through the host-to-host function module 142 under the control of the hub function module 141. Conversely, when the mobile device (e.g. a smart phone, etc.) 120 connected to the USB hub 130 switches from the device role to the host role, the signals between the first host 110 and the mobile device 120 flow through the host-to-host function module 142 and not through the bypass path BY under the control of the hub function module 141. That is, in the embodiment of the present application, the "host-to-host mode" can be implemented by the host-to-host function module 142, and the details thereof will be described below.

The first control module 143 and the second control module 144 control connected devices through the interfaces 151 and 152. For example, the first control module 143 may have storage device control functions, while the second control module 144 may have audio device control functions. Although fig. 1 shows 2 control modules 143 and 144, the present application is not limited thereto. In other possible embodiments of the present application, the hub 130 may include a greater number of control modules.

Referring now to FIG. 2, therein is shown a block diagram of a USB hub 200 according to an embodiment of the present application. As shown in fig. 2, a USB hub 200 according to an embodiment of the present application includes: a repeater circuit (repeater)210, a transfer translator circuit (transfer translator)212, a routing logic circuit (routing logic)214, a state machine (statemachine)216, a USB device control unit 218, a virtual hub function unit 220, a FIFO (first in first out) circuit 222, a USB device control unit 224, a memory control unit 226, an audio control unit 228, an upstream port 242, a plurality of downstream ports 244_1-244_ N (N is a positive integer), and interfaces 246_1 and 246_ 2.

The repeating circuit 210 is used to copy the signals/data transmitted from the first host and transmit the signals/data to the transmission translation circuit 212 or the routing logic circuit 214. The architecture and details of the repetitive circuit 210 may not be described in great detail herein.

The transport translation circuit 212 controls data transactions between high-speed and low/full-speed data transactions, performs data packet conversion between upstream and downstream ports at different speeds, and performs other functions to ensure that data at different speeds on the bus can be correctly transmitted. When performing the transfer translation, the packet from the first host flows through the repeating circuit 210 and the transfer translation circuit 212 to the routing logic 214; when no translation is required, packets from the first host flow through the repetition circuit 210 to the routing logic 214. The structure and details of the transport translation circuit 212 are not described in detail herein.

The routing logic 214 is responsible for routing data between the upstream port 242 and the downstream ports 244_1-244_ N. The structure and details of the routing logic 214 are not described in detail herein.

The state machine 216 decodes the signal/data transmitted from the primary host to determine which downstream port the signal/data should be transmitted to. The state machine 216 may be comprised of hardware stiffeners. The architecture and details of the state machine 216 may not be described in great detail herein.

The USB device control unit 218 may be implemented by hardware or firmware. When a packet from the first host is to be sent to a USB peripheral device of a different USB type, the USB device control unit 218 performs format conversion on the packet. Similarly, when a packet transmitted from a USB peripheral device of a different USB type is to be sent to the first host, the USB device control unit 218 performs format conversion on the packet. The structure and details of the USB device control unit 218 are not described herein.

The virtual hub function 220 is used to enable the USB hub to support compound devices and/or composite devices, the details of which will be described below. In addition, in the embodiment of the present application, the Virtual hub function unit 220 supports a Virtual hub (Virtual hub) function and has a function of specifying a Virtual USB address. There are multiple virtual USB addresses stored in the virtual hub function unit 220. The state machine 216, the USB device control unit 218, and the virtual hub function unit 220 may constitute a hub control unit (hub control unit).

A FIFO (first in first out) circuit 222 is interposed between the USB device control units 218 and 224 (or between the USB device control unit 218 and the storage control unit 226, or between the USB device control unit 218 and the sound effect control unit 228) for temporarily storing data transmitted from the first host and/or the USB peripheral device and/or the mobile device and transmitting the data to the first host and/or the USB peripheral device and/or the mobile device. The details of which will be described below with reference to fig. 3.

The USB device control unit 224 may be executed by hardware or firmware. The USB device control unit 224 has the same or similar functions as the USB device control unit 218. In addition, in the present embodiment, when the mobile device 120 switches from the device role to the host role, the USB device control units 218 and 224 both play the device role (wherein the first host 110 and the USB device control unit 218 are paired, and the mobile device and the USB device control unit 224 are paired), so as to implement the host-to-host mode of the present embodiment. In detail, assume that the mobile device 120 is connected to the downstream port 244_ 1. When the mobile device 120 plays a device role, the signal path between the first host 110 and the mobile device 120 is: the upstream port 242, the repeat circuit 210 (and/or the transfer translation circuit 212), the routing logic 214, and the downstream port 244_ 1.

When the first host 110 commands the mobile device 120 to switch from the device role to the host role, the mobile device 120 temporarily disconnects from the hub 200, and the first host 110 also commands the USB hub 200. In response to this command, the routing logic 214 switches its internal routing path. After the mobile device 120 switches to the master role, the signal path between the first host 110 and the mobile device 120 is: the upstream port 242, the repeating circuit 210, the USB device control unit 218, the FIFO 222, the USB device control unit 224, the routing logic 214, and the downstream port 244_ 1. That is, after the mobile device 120 switches to the host role, the first host 110 still plays the host role, and the USB device control unit 218 still plays the device role; on the other hand, the mobile device 120 plays a host role, and the USB device control unit 224 still plays a device role. Therefore, the embodiment of the application can achieve the host-to-host mode.

The memory control unit 226 may be a card reader controller for memory card cards for controlling the memory card cards externally connected to the interface 246_1 of the USB hub 200. Alternatively, the storage control unit 226 may be an external hard disk controller for controlling a hard disk drive externally connected to the interface 246_1 of the USB hub 200. Of course, the present application is not so limited. The architecture and details of the memory control unit 226 are not described herein.

The sound effect control unit 228 can be used for controlling peripheral sound effect devices (such as speakers or microphones) externally connected to the interface 246_2 of the USB hub 200. The structure and details of the sound effect control unit 228 will not be described herein.

The upstream port 242 may be connected to a first host (e.g., the first host 110 of FIG. 1). These downstream ports 244_1-244_ N can be connected to USB peripheral devices (such as, but not limited to, USB flash drives, USB external hard drives, etc.). In addition, any of the downstream ports 244_1-244_ N may be connected to the mobile device 120.

Now please refer to fig. 1 and fig. 2 again. In FIG. 1, the hub function block 141 is implemented by, for example, a repeating circuit 210, a transfer translation circuit 212, and routing logic 214. The host-to-host function module 142 is implemented by, for example, a USB device control unit 218, a FIFO 222 and a USB device control unit 224. The first control module 143 is implemented by, for example, the USB device control unit 218, the fifo 222 and the storage control unit 226. The second control module 144 is implemented by, for example, the USB device control unit 218, the FIFO 222 and the sound effect control unit 228. That is, in the embodiment of the present application, the hub function module 141, the host-to-host function module 142, the first control module 143, and the second control module 144 may share some units with each other.

The USB device control unit 218, FIFO (first-in-first-out) circuit 222 and USB device control unit 224 may perform host-to-host mode or built-in data buffering for the USB hub 200. How embodiments of the present application implement the "host-to-host mode" has been described above.

In the present embodiment, when the role of the mobile device is to be switched from the device to the host, the first host sends a custom command (Vendor command) to the USB hub 200 to change the internal signal path of the USB hub 200 (as described above) to implement the "host-to-host function", but not affect other downstream ports 244_1-244_ N and/or upstream port 242 in transmission.

Alternatively, in the USB hub 200 of the present embodiment, the USB Device control unit 224 may automatically determine the USB Device Descriptor (USB Device Descriptor) of the mobile Device connected to any of the downstream ports 244_1-244_ N (if the USB Device Descriptor indicates that the mobile Device can play the role of host), to determine whether it is necessary to switch from the host-to-Device transfer mode to the host-to-host transfer mode (change the internal signal path of the USB hub 200, as described above) and initiate the Device mode switch, without affecting other transmitting downstream ports 244_1-244_ N and/or upstream port 242.

For example, assume that the downstream port 244_1 is connected to a mobile device and the downstream port 244_2 is connected to a USB flash drive. When the mobile device is still in the device role, the signal of the mobile device goes through the path P1 and the signal of the USB flash drive goes through the path P2 in the routing logic 214 (see fig. 2). When the mobile device switches to the host role, the signal from the mobile device changes path P3 in routing logic 214 (see FIG. 2), while the signal from the USB drive still moves path P2. That is, in the embodiment of the present application, when the first host commands the role of the mobile device to be switched from the device role to the host role, data transmission to other downstream ports is not affected.

FIG. 3 is a block diagram of a FIFO circuit 222 according to an embodiment of the present application. As shown in fig. 3, the FIFO circuit 222 includes: FIFOs 302 and 304, multiplexers 306 and 308, DMA Direct Memory Access (DMA) circuit 310, and multiplexer 312. The FIFO 302 is coupled between the USB device control units 218 and 224. In addition, the FIFO304 is coupled to the USB device control units 218 and 224 through multiplexers 306 and 308, respectively.

In the present embodiment, the FIFO circuit 222 supports a fast data transmission path, which allows data to be transmitted between the USB device control unit 218, the FIFO 302, the multiplexer 312 and the USB device control unit 224 (and/or the memory control unit 226 and/or the audio control unit 228) quickly, without modification of the data by the CPU 322.

In addition, in the embodiment of the present application, if the data may need to be processed by the central processing unit 322 before being transmitted to the other end, the data transmission process is as follows. For example, the data is transmitted from the first host to the mobile device, and those skilled in the art can deduce the flow of the data from the mobile device to the first host accordingly. Data sent by the first host is written into the FIFO304 through the USB device control unit 218 and the multiplexer 306. Then, the DMA circuit 310 temporarily stores the data from the FIFO304 and the multiplexer 308 to the buffer 320 of the first host 110. After the Central Processing Unit (CPU)322 of the first host 110 processes/modifies the data in the buffer 320, the Central Processing Unit (CPU)322 informs the DMA circuit 310. The modified/processed data is written from the buffer 320 to the FIFO304 by the DMA circuit 310 through the multiplexer 306, and the data in the FIFO304 is sent to the USB device control unit 224 to be sent to the mobile device, or sent to the storage control unit 226 to be sent to the storage device (not shown), or sent to the audio control unit 228 to be sent to the audio device (not shown) by the FIFO304 through the multiplexer 308 and through the multiplexer 312.

Alternatively, in the embodiment of the present application, if the CPU322 wants to transmit data to the mobile device, the storage device or the audio device, the CPU322 can store the data in the buffer 320, then temporarily store the data in the FIFO304 through the DMA circuit 310 and the multiplexer 306, and then transmit the data in the FIFO304 to the USB device control unit 224 through the multiplexer 312 for transmitting to the mobile device, or to the storage control unit 226 for transmitting to the storage device (not shown), or to the audio control unit 228 for transmitting to the audio device (not shown).

Alternatively, in the embodiment of the present application, the data is written into the FIFO304 by the first host through the USB device control unit 218 and the multiplexer 306, then the DMA circuit 310 stores the data from the multiplexer 308 into the buffer 320, and after the CPU322 finishes modifying/processing the data, the CPU322 informs the DMA circuit 310, and the DMA circuit 310 reads the modified/processed data from the buffer 320 and writes the modified/processed data into the FIFO304 through the multiplexer 306, but does not transmit the modified/processed data to the USB device control unit 224, the storage control unit 226 and the sound effect control unit 228. The modified/processed data is stored in the FIFO304 and can be read out after a later date.

In the embodiment of the present application, a mobile device (e.g., a smart phone) can be used as a host or a device.

Referring now to fig. 4A-4C, schematic diagrams of an application according to an embodiment of the present application are shown. In the application of fig. 4A, for the first host 110, the first host 110 can know that the "hub function module 141, the host-to-host function module 142, the first control module 143, and the second control module 144 belong to the same layer, i.e. belong to the same Composite device (Composite device)" through the report of the USB hub 200. In the implementation of the application illustration of fig. 4A, the first host assigns a USB address (for example, but not limited to, the USB address is 5) to the integrated device (the integrated device includes the hub function module 141, the host-to-host function module 142, the first control module 143, and the second control module 144). That is, the hub function module 141, the host-to-host function module 142, the first control module 143, and the second control module 144 share the USB address 5.

When the USB hub 200 receives the command/data from the first host, the hub function module 141 checks the interface field in the USB address of the command/data to determine to which of the hub function module 141, the host-to-host function module 142, the first control module 143, and the second control module 144 the command/data is to be sent.

Similarly, in the application-side illustration of fig. 4B, for the first host 110, the hub function module 141, the first control module 143 and the second control module 144 belong to the same layer, i.e., belong to the same integrated device. Logically, the host-to-host function 142 is considered by the first host 110 as being connected to the downstream port of the hub function 141.

In implementing the application schematic of fig. 4B, the first host assigns a USB address (for example, but not limited to, the USB address is 5) to the upper layer integrated device, which includes the hub function module 141, the first control module 143 and the second control module 144. That is, the hub function module 141, the first control module 143, and the second control module 144 share the USB address 5. Also, the first host may assign a USB address (e.g., without limitation, USB address 6) to the host-to-host function 142. The virtual hub function unit 220 of the USB hub 200 may store the relationship between USB addresses 5-6 and their corresponding devices.

When the USB hub 200 receives the command/data from the first host, the USB hub 200 checks the USB address of the command/data. If the USB address of the command/data is 6, the USB hub 200 transfers the command/data to the host-to-host function module 142, and if the USB address of the command/data is 5, the USB hub 200 does not transfer the command/data to the next layer but transfers the command/data to the upper layer integrated device. In addition, if the USB address of the command/data is 5, the USB hub 200 checks an interface field in the command/data to determine that the command/data is to be transmitted to one of the hub function module 141, the first control module 143, and the second control module 144.

Similarly, in the application-side illustration of fig. 4C, for the first host 110, the hub function module 141 is in its own layer, and the host-to-host function module 142, the first control module 143, and the second control module 144 belong to the same layer (the same integrated device). Logically, the first host 110 views the integrated device as being connected to the downstream port of the hub function module 141. In the implementation of the application schematic of fig. 4C, the first host assigns a USB address (for example, but not limited to, the USB address is 5) to the hub function module 141. Moreover, the first host assigns a USB address (for example, but not limited to, USB address 6) to the lower integrated device, which includes the host-to-host function module 142, the first control module 143 and the second control module 144. The virtual hub function unit 220 of the USB hub 200 stores the relationship between the USB addresses 5-6 and their corresponding devices.

When the USB hub 200 receives the command/data from the first host, the USB hub 200 checks the USB address of the command/data. If the USB address of the instruction/data is 5, the hub function module 141 receives the instruction/data. In addition, if the USB address of the command/data is 6, the USB hub 200 checks the "interface field" in the command to determine to which of the host-to-host function module 142, the first control module 143, and the second control module 144 the command/data is sent.

That is, in an application scenario, after the mobile device switches from the USB device mode to the USB host mode, the mobile device can support the first host, while the first host still maintains the USB host mode. In this way, the first host can be connected to other USB peripheral devices through other downstream ports of the USB hub 200 to perform transmission, application, and the like between the first host and the other USB peripheral devices. For example, when the first host is a car system, the mobile device can display a screen on the screen of the first host, and the user can operate the mobile device by operating on the first host, as if the user were directly operating the mobile device. For example, the user may operate on the first host machine to provide the functions of guiding the route, making a call, transmitting and receiving a message, and listening to music, etc. provided by the mobile device.

In summary, in the embodiment of the present invention, according to the custom command sent by the first host, the USB hub 200 can switch the internal signal path to support the host-to-host function, and the internal signal path switching does not affect the signal paths in other transmissions.

In addition, as described above, the virtual USB hub function (storing USB addresses) of the USB hub 200 can support multiple application scenarios (as shown in fig. 4A to 4C), thereby increasing flexibility in use.

While the present invention has been described with reference to the above embodiments, it is not intended to be limited thereto. Various modifications and alterations may be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the protection scope of the present invention is subject to the scope defined by the appended claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:USB时钟产生电路

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!