Universal serial bus bridge
This invention relates to connecting electronic devices, and more particularly to connecting electronic devices using a Universal Serial Bus (USB).
Many types of electronic device need to be connected to other devices, if their full range of functions is to be available. For example, printers obviously need to be connected to sources of data, in order to be able to operate. Similarly, devices such as digital cameras need to be connected to printers, if a user is to be able to print the photographs which he has taken, or need to be connected to another device for storage or manipulation of the photograph.
Devices operating in accordance with the Universal Serial Bus (USB) standard have become very widespread, allowing interconnection of those devices.
In its basic form, as defined in the USB specification 2.0, the USB standard defines a USB host device, which can control multiple USB peripheral devices. These peripheral devices are not able to communicate with each other, except through the host device, while the host device is able to communicate with all of the peripheral devices.
For example, if a personal computer is enabled to act as a USB host device, it is then able to communicate with various USB-enabled peripheral devices, such as a printer, a personal digital assistant (PDA), and a digital camera.
It has been recognized that this arrangement has the disadvantage that, in order to allow such communication between two devices, one of them must be enabled to act as a USB host device. However, the USB specification 2.0 places strict criteria on a device which is to act as a USB host device. For example, the device must have sufficient memory, and sufficient processing capability, to be able to handle multiple peripheral devices simultaneously. In many devices, in particular, but not exclusively, small battery-powered portable devices, these requirements cannot practically be met, and so the device cannot be enabled to act as a USB host device.
However, there are still situations when it would be useful for such devices to be able to communicate with other USB devices, without requiring the involvement of a USB host device. For example, in the case of a digital camera, it may not be justified to enable the camera to act as a USB host device, but it would be useful for the camera to be able to
communicate with, for example, a printer, without requiring the involvement of a fully enabled USB host device, for example such as a personal computer.
In order to allow such communication, a supplement to the USB specification 2.0 has been developed. This supplement is commonly referred to as "On The Go" (OTG).
When an OTG device is connected to a USB host device, then it operates as a conventional USB peripheral device. However, when an OTG device is connected to a standard peripheral device, it is able to operate as a host, so that these two devices can communicate with each other. However, the OTG supplement gives limited functionality to the OTG host, for example, it does not require that a device be able to communicate with multiple peripheral devices, and so it places much less strict criteria on the OTG device, in order for it to be able to act as a USB host.
US Patent Application No. US 2004/0019732 discloses a USB hub apparatus, that is compatible with the OTG supplement. The hub includes a number of ports, to which external devices can be connected. The hub includes a controller for selectively allowing one of the ports to act as a host port, while the other ports act as device ports.
According to one embodiment of the present invention, there is provided a controller, for use in an electronic device, the controller having two ports. A first port acts as a device port, allowing the electronic device to be connected to a host device. A second port acts as a host port, allowing the electronic device to be connected to a peripheral device. When a host device is connected to the first port and a peripheral device is connected to the second port, the peripheral device can be shared simultaneously between the electronic device and the host device.
This has the advantage that the peripheral device can be connected to the host device (the remote host) through the electronic device (the local host), and either the remote host or the local host can control the peripheral device, as required, without needed to change any connections.
Reference will now be made to the accompanying drawings, in which:
Fig. 1 is a schematic illustration of a system, including a device in accordance with the present invention.
Fig. 2 is a block diagram, illustrating in more detail the logical structure of the control circuitry in the device of Fig. 1.
Fig. 3 is a flow chart, illustrating the method of operation of the device according to the present invention.
Figure 1 shows a collection of electronic devices. Specifically, Figure 1 shows a first electronic device 10, which includes a USB controller 20 in accordance with an aspect of the present invention. A second electronic device 30 may be a conventional USB host device, and includes a USB host controller 32. A third electronic device 40 may be a conventional USB peripheral device, and includes a USB peripheral controller 42.
In Figure 1, the first electronic device 10 is identified as a camera, the second electronic device 30 is identified as a PC, and the third electronic device 40 is identified as a printer. It will be apparent that these specific types of device are mentioned purely as examples, and that the invention is not limited in its application to these devices.
The USB controller 20 of the first electronic device 10 has a USB device port 22, a USB On The Go (OTG) host port 24, and control circuitry 26. These are able to operate in conventional ways. That is, when the first electronic device 10 is connected to the second electronic device 30 by means of a connection between the USB device port 22 and the USB host controller 32, the first electronic device 10 can function as a USB peripheral device. Further, when the first electronic device 10 is connected to the third electronic device 40 by means of a connection between the USB OTG host port 24 and the USB peripheral controller 42, the first electronic device 10 can function as a USB OTG host.
In this illustrated embodiment of the present invention, however, when the first electronic device 10 is connected to the second electronic device 30 by means of a connection between the USB device port 22 and the USB host controller 32, and is connected to the third electronic device 40 by means of a connection between the USB OTG host port 24 and the USB peripheral controller 42, the first electronic device 10 can function as a USB OTG host, and as a bridge between the second electronic device 30 and the third electronic device 40.
In this situation, the peripheral device 40 can be controlled both by the first electronic device 10, acting as a local host, and by the second electronic device 30, acting as a remote host. Moreover, a user of the remote host 30 is able to control the peripheral device 40 exactly as if they are connected directly, and without requiring any modification of the peripheral 30. The connection can be set up in a configurable manner, as described in more detail below.
Figure 2 is a block diagram, illustrating in more detail the logical structure of the control circuitry 26. The structure of the control circuitry 26, and the operation of the interlace blocks shown in Figure 2 will be generally well known to the person skilled in the art, and will not be described in further detail.
Figure 1 shows a situation in which the first electronic device 10 is connected to a single peripheral device 40. However, in one application of the invention, the first electronic device 10 can be connected to a hub, and through the hub to multiple peripheral devices. In that case, each of these peripheral devices can be controlled both by the first electronic device 10, acting as a local host, and by the second electronic device 30, acting as a remote host.
Figure 3 is a flow chart, illustrating a method of operation of the system of Figure 1. In step 50 of the process, whenever a new device is connected to the USB controller 20, it is enumerated in a registry 262 in the control block 26. The registry stores the complete details of the devices connected to the USB controller 20, organized in the system tree format.
In step 52, when a user of the first electronic device 10 fires up the OTG application, the user is presented by means of a user interface 12 on the first electronic device 10 with a list of the available peripheral devices that can be controlled. In step 54, the control circuitry 26 receives the user's selection, via the user interface 12, of a peripheral device. The user is also presented with possible configuration options, and the control circuitry 26 also receives the user's selection from amongst these configuration options. For example, the user can select a permanent or a volatile connection.
Further, the user is presented with options regarding the control of the peripheral devices. For example, regarding the control of a specific peripheral device connected to the USB OTG host port 24, the user can be presented with the option of sharing control of that peripheral device with a remote host connected to the USB device port 22. For the purposes of further explanation, it will be assumed that the user wishes to be able to share control of the peripheral device 40 between the local host device 10 and the remote host 30.
In step 56, a USB function driver in the control circuitry 26 configures the device connection using the information in the registry 262. The control circuitry 26 helps the USB device controller 42 to set up the device stack, using the application setting data to configure the device port 22. This ensures the same look and feel of the local device to the remote device.
Specifically, if the device is connected to the remote host with a high speed mode and the device connected to the local port is a low speed device it will give look and feel of the high speed to remote host. If the device is connected to remote host as Full/low speed and the device connected to the local host is high speed it shall give look and feel of Full/low speed to remote host.
Further, even if the device 40 is not supported by the remote host 30, the control circuitry 26 can operate to translate so that it can be virtually supported.
The configuration can be set up according to a default setting, regardless of the connected device. Alternatively, the OTG application 263 can cause the configuration to be set up to allow a specific function to be performed. As a further alternative, the configuration can be set up to replicate the device present on the local host controller, so that the device is configured for the remote host controller.
This connection remains active until it is dismantled.
That is, whenever the peripheral device 40 is connected to the device 10, it will set up the configuration so that control of the peripheral device 40 can be shared between the local host device 10 and the remote host 30, even if the remote host 30 is not connected to the local host 10 at that time.
When control of the peripheral device 40 is being shared between the local host device 10 and the remote host 30, the OTG application 263 takes steps to ensure that this control does not disrupt operation of the device 40. For example, if the device 40 is a printer, data will be sent to the device 40 such that multiple print jobs from the local host device 10 and the remote host 30 can be sent to the device 40 during the same time period, but such that they are cached in memory as required, so that the print jobs do not become mixed at the printer.
As another example, where the device 40 is a storage device, the device may simply have two open files, being accessed by different applications, with one of these applications on the local host device 10 and one on the remote host 30.
The USB controller therefore allows the control of a peripheral device by a local host and by a remote host, in a configurable manner.