CN100476777C - USB interface with host/device function and control method thereof - Google Patents
USB interface with host/device function and control method thereof Download PDFInfo
- Publication number
- CN100476777C CN100476777C CNB2006100043159A CN200610004315A CN100476777C CN 100476777 C CN100476777 C CN 100476777C CN B2006100043159 A CNB2006100043159 A CN B2006100043159A CN 200610004315 A CN200610004315 A CN 200610004315A CN 100476777 C CN100476777 C CN 100476777C
- Authority
- CN
- China
- Prior art keywords
- port
- usb
- interface
- external equipment
- host
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000008878 coupling Effects 0.000 claims description 2
- 238000010168 coupling process Methods 0.000 claims description 2
- 238000005859 coupling reaction Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 12
- 239000002131 composite material Substances 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 150000001875 compounds Chemical class 0.000 description 5
- 238000004891 communication Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 229920001690 polydopamine Polymers 0.000 description 2
- 230000008054 signal transmission Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
Images
Landscapes
- Information Transfer Systems (AREA)
Abstract
Description
技术领域 technical field
本发明是关于一种通用串行总线(Universal Serial Bus,USB)的多功能界面及其控制方法,尤指一种具有USB主机/装置功能的USB界面及其控制方法。The present invention relates to a universal serial bus (Universal Serial Bus, USB) multifunctional interface and its control method, especially to a USB interface with USB host/device function and its control method.
背景技术 Background technique
为了解决传统中电脑及其辅助设备间连接界面繁杂的问题,通用串行总线(Universal Serial Bus,USB)规格于1996年间被提出,用以提供外部不同辅助设备一个单一规格的输出/输入界面。USB1.0规格释出之后,经过了许多次的增修以配合市场以及设计者的需要,例如于1998年释出的USB1.1增加了新传输规格(interrupt OUT),2000年释出的USB2.0则支援高速(Hi-speed)规格并增加了迷你B型界面(mini-B connector),也定义了新的描述元(descriptor),其后,USB OTG规格在2001年被提出,以实现更好的电源管理以及允许相同装置以不同形式工作的目的。In order to solve the problem of complex connection interfaces between computers and their auxiliary equipment in the traditional world, the Universal Serial Bus (USB) specification was proposed in 1996 to provide a single-standard output/input interface for different external auxiliary equipment. After the release of the USB1.0 specification, it has undergone many revisions to meet the needs of the market and designers. For example, the USB1.1 released in 1998 added a new transmission specification (interrupt OUT), and the USB2 released in 2000 .0 supports high-speed (Hi-speed) specifications and adds a mini-B interface (mini-B connector), and also defines a new descriptor (descriptor). Subsequently, the USB OTG specification was proposed in 2001 to achieve Better power management and the purpose of allowing the same device to work in different forms.
在USB规格演进的过程中,一直维持着主从式(Host-Device)的架构。请参照图1所示,为USB发展者论坛(USB Implementers Forum)于2000年提出的通用序列总线规格2.0版(Universal Serial Bus specification Revision 2.0)规格中所揭示的一USB物理总线拓朴(Physical Bus Topology)示意图。由图1中可知,一个USB系统100可由主机(Host)110、装置(Device)120通过总线连接界面(Inter-connection)所构成,其中所述装置120可分类为一般装置、复合式装置(Compound Device)以及混合式装置(Composite Device)。During the evolution of the USB specification, the host-device architecture has been maintained. Please refer to Figure 1, which is a USB Physical Bus topology (Physical Bus) disclosed in the Universal Serial Bus specification Revision 2.0 (Universal Serial Bus specification Revision 2.0) proposed by the USB Implementers Forum in 2000. Topology) schematic diagram. It can be seen from FIG. 1 that a
今对上述元件作一更详尽的定义:一主机具有一主机控制器(Hostcontroller)以及一根集线器(Root Hub),所述根集线器至少具有一个端口(Port),主机在USB系统中承担了大部分控制以及沟通的工作。功能(function)为提供一种特定能力(capability)给主机的辅助识别,例如鼠标、键盘等。一集线器(hub)具有一上行端口(up-stream port)以及至少一个下行端口(down-stream port),所述上行端口用以与一主机连接,所述下行端口用以分别与置入(embedded)或外部的装置进行连接。装置为一种功能、集线器或其组合,一复合式装置具有一集线器以及至少一功能,以此,一主机视连接的复合式装置为一集线器及所述集线器所连接的至少一实体装置(physical device),每一所述实体装置具有一独立地址,举例来说,键盘与轨迹球可被整合为一复合式装置,在此装置的内部,这些单独的功能被永久的连接至一集线器上,亦可称为一「复合式集线器」。在主机方面,一个复合式装置就像是一个单独的集线器上连结了其它功能,如图1中所示,右下方方块框起的部份即为一复合式集线器(CompoundHub)。所述集线器以及所述装置均具有一独立地址。一混合式装置为一具有复数个独立界面(Interface)的功能装置,所述界面借助一储存于所述装置中的描述元完成定义。一混合式装置仅有一地址,但每一所述界面具有一不同功能且可独立控制。举例来说,一混合式装置可同时具有一用于音效装置的界面以及另一用于控制面版的界面。Now make a more detailed definition of the above-mentioned components: a host has a host controller (Hostcontroller) and a hub (Root Hub), the root hub has at least one port (Port), and the host computer undertakes a large number of tasks in the USB system. Portion control works as well as communication. A function is to provide a specific capability (capability) for auxiliary identification of the host, such as a mouse, a keyboard, and the like. A hub (hub) has an up-stream port (up-stream port) and at least one down-stream port (down-stream port), and the up-stream port is used for connecting with a host, and the down-stream port is used for embedding ) or an external device for connection. A device is a function, a hub, or a combination thereof. A composite device has a hub and at least one function, so that a host regards the connected composite device as a hub and at least one physical device connected to the hub. device), each of the physical devices has an independent address. For example, a keyboard and a trackball can be integrated into a composite device. Inside the device, these individual functions are permanently connected to a hub, It can also be called a "composite hub". In terms of the host, a compound device is like a separate hub connected with other functions, as shown in Figure 1, the part framed by the box on the lower right is a compound hub (CompoundHub). Both the hub and the device have an independent address. A hybrid device is a functional device with a plurality of independent interfaces defined by a descriptor stored in the device. A hybrid device has only one address, but each of the interfaces has a different function and can be controlled independently. For example, a hybrid device may have both an interface for an audio device and another interface for a control panel.
USB系统工作原理简述于下:USB的总线连接界面是一种星状堆叠(tieredstar)拓朴,此种堆叠最多可达6层。每一堆叠的中心是集线器(HUB)。每一线段为主机与集线器/功能(function)、集线器与另一集线器/功能或者节点到节点之间的连接。图1所示的USB的拓朴排列,每一节点代表一装置或功能。当一USB系统致动时,所述系统中的装置地址均为0,随后所述系统进行装置寻找并依序将地址分配给装置,直到所有装置均具有指定地址,或者达到USB装置数上限为止。The working principle of the USB system is briefly described as follows: the bus connection interface of the USB is a tiered star topology, and this kind of stacking can reach up to 6 layers. At the center of each stack is a hub (HUB). Each line segment is a connection between a host and a hub/function, a hub and another hub/function, or node-to-node. In the topology arrangement of USB shown in FIG. 1 , each node represents a device or function. When a USB system is activated, the device addresses in the system are all 0, and then the system searches for devices and assigns addresses to devices sequentially until all devices have the specified address, or the upper limit of the number of USB devices is reached .
依上所述,可发现一个USB系统内的所有数据传输都必须由主机端控制起始作业,所有USB装置均为附属装置(Slaver),须听从既定的协定并回应来自Host的传输,后以标准的USB数据格式接收传送数据。相较于传统连接端口所使用的对等连接(peer-peer)架构,USB系统实现了主从式架构,利用一主机完成了复数个装置的控制。According to the above, it can be found that all data transmission in a USB system must be controlled by the host to start the operation, all USB devices are slave devices (Slaver), must obey the established agreement and respond to the transmission from the Host, and then use Standard USB data format for receiving and transmitting data. Compared with the peer-to-peer architecture used in traditional connection ports, the USB system implements a master-slave architecture, using a host to complete the control of multiple devices.
以此,USB架构利用一种传输线串接各类型的辅助设备,而取代传统的辅助设备需各类不同缆线,如打印机的并列端口缆线,数据机的串行端口缆线等,大大的简化了外部辅助设备与主机之间的连接,并具有诸如随插即用(Plug-and-Play)、「热插拔」(Hot Attach&Detach)、低耗电、高泛用性以及低成本等优点。In this way, the USB architecture uses a transmission line to connect various types of auxiliary equipment in series, and instead of traditional auxiliary equipment, various cables are needed, such as the parallel port cable of the printer, the serial port cable of the modem, etc. Simplifies the connection between external auxiliary devices and the host, and has advantages such as Plug-and-Play, "Hot Attach&Detach", low power consumption, high versatility, and low cost .
但是随着消费性电子,特别是移动式设备(例如手机、PDA以及多媒体播放器等)市场的兴起,基于移动式装置使用场合的复杂性,为了减低对于主机端的依赖,并使得移动式设备内的信息得以快速的被存取运用,USB规格必须进行修改,以提供更好的电源管理并允许设备能以主机和装置两种USB规格型态进行工作。However, with the rise of consumer electronics, especially the market of mobile devices (such as mobile phones, PDAs, and multimedia players, etc.), based on the complexity of mobile device usage occasions, in order to reduce the dependence on the host and make mobile devices In order for the information to be accessed quickly, the USB specification must be modified to provide better power management and allow the device to work as both a host and a device.
为此,USB发展者论坛于2001年12月推出了USB OTG 1.0,经过6次修定,于2003年6月推出了USB OTG 1.0a,正式成为一个实用性的规范。请见图2,为USB OTG所定义的装置类型功能图。USB OTG定义了两种装置类型:单设装置(Peripheral-Only Device,POD)以及双用角色装置(Dual-Role Device,DRD)。单设装置与一般装置的功能近似,而双用角色装置具有USB规格的主机以及装置两种功能,正因如此,双用角色装置必须有角色切换的新功能。由图2所示可知,具有双用角色装置功能的设备得以具有主机以及装置两种功能,例如一手机可与一主机端连接而成为一装置,亦可与一装置端连接成为驱动所述装置端的主机。To this end, the USB Developers Forum launched USB OTG 1.0 in December 2001. After six revisions, USB OTG 1.0a was launched in June 2003, officially becoming a practical specification. Please see Figure 2, the device type function diagram defined for USB OTG. USB OTG defines two device types: Peripheral-Only Device (POD) and Dual-Role Device (DRD). The function of a single device is similar to that of a general device, while a dual-purpose character device has two functions of a USB-standard host and a device. Because of this, the dual-purpose character device must have a new function of role switching. As shown in Figure 2, it can be seen that a device with a dual-purpose role device function can have two functions as a host and a device. For example, a mobile phone can be connected to a host to become a device, and can also be connected to a device to drive the device. end host.
OTG1.0作为USB2.0的补充,亦定义了三种接插件:Mini A插头和插座、MiniB插头和插座、Mini AB插座。在USB-OTG规范中,A装置代表主装置,充当主机的角色,一般指以主机方式工作的双用角色装置,B装置代表从装置,充当单设装置的角色。Mini AB插座则是为双用角色装置所设计的规格,以容许Mini A或Mini B插头插入,并借助所插入的插头,定义双用角色装置的初始角色(如主机或装置),以致动(enable)其主机或装置单元。Mini A插座是设计在主机上的,用于连接外设的Mini A插头,同理,Mini B插座设计在装置上,用以连接Mini B插头。因此,不同的插座类型,区分了不同的USB设备。As a supplement to USB2.0, OTG1.0 also defines three connectors: Mini A plug and socket, MiniB plug and socket, and Mini AB socket. In the USB-OTG specification, device A represents the master device and acts as a host, and generally refers to a dual-purpose device that works as a host, and device B represents a slave device and acts as a single device. The Mini AB socket is a specification designed for dual-purpose role devices to allow the insertion of Mini A or Mini B plugs, and with the help of the inserted plugs, defines the initial role of the dual-purpose role device (such as a host or device) to actuate ( enable) its host or device unit. The Mini A socket is designed on the host and used to connect the Mini A plug of the peripheral device. Similarly, the Mini B socket is designed on the device to connect the Mini B plug. Therefore, different socket types distinguish different USB devices.
在OTG规格中,两个双用角色装置进行连接时可交替以主机和从机的方式工作,这个特点相容了现有USB规格主机/装置的结构。OTG规格的主机同样负责初始化数据通信的任务。例如:总线重置(reset)、获取USB各种描述符和配置设备等。完成配置后,两OTG装置便可以分别以主机和从机方式传输信息。其中,两个装置间主从角色交换的过程由主机协商协定(Host negotiation protocol;HNP)定义。In the OTG specification, two dual-role devices can alternately work as a host and a slave when connected. This feature is compatible with the structure of the existing USB host/device. The host computer of OTG specification is also responsible for the task of initializing data communication. For example: bus reset (reset), obtain various USB descriptors and configure devices, etc. After the configuration is completed, the two OTG devices can transmit information in the mode of master and slave respectively. Wherein, the process of master-slave role exchange between two devices is defined by a host negotiation protocol (HNP).
此外,OTG设备中,仅具有一连接端口,其与主机端以及装置端的连接均通过所述连接端口实现,因此使得OTG设备欠缺扩充性,因而限制了OTG规格的应用与市场价值。In addition, in the OTG device, there is only one connection port, and the connection with the host end and the device end is realized through the connection port, so that the OTG device lacks expandability, thereby limiting the application and market value of the OTG specification.
发明内容 Contents of the invention
本发明的一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB界面可驱动复数个装置,建构一独立的USB系统。An object of the present invention is to provide a USB interface with a host/device function and a control method thereof. The USB interface can drive a plurality of devices to construct an independent USB system.
本发明的另一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB界面分别与复数个外接装置以及一外接主机连接,所述外接主机可使用所述USB界面以及所述外接装置的功能。Another object of the present invention is to provide a USB interface with a host/device function and a control method thereof, the USB interface is respectively connected to a plurality of external devices and an external host, and the external host can use the USB interface and The function of the external device.
本发明的又一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB界面与一外接主机连接时被视为一混合式装置,所述USB界面桥接复数个外接装置以及所述外接主机,所述主机视所述外接装置为所述USB界面的功能。Another object of the present invention is to provide a USB interface with host/device function and its control method. When the USB interface is connected to an external host, it is regarded as a hybrid device, and the USB interface bridges multiple external devices. As for the external host, the host regards the external device as a function of the USB interface.
本发明的再一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB界面包含一路由器(router)以及复数个连接端口,所述控制单元可定义任一所述连接端口为一上行端口或一下行端口。Another object of the present invention is to provide a USB interface with host/device function and its control method, the USB interface includes a router (router) and a plurality of connection ports, the control unit can define any of the connections The port is an uplink port or a downlink port.
本发明的另一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB设备包含一控制单元(Control Unit)、一主机单元(USB HostUnit)、一装置单元(USB Device Unit)以及一存储单元,所述控制单元控制传输至所述主机单元以及所述装置单元的数据,所述存储单元于所述USB界面进行数据处理时用以储存运算所需的数据。Another object of the present invention is to provide a USB interface with host/device function and its control method, the USB device includes a control unit (Control Unit), a host unit (USB HostUnit), a device unit (USB Device Unit) and a storage unit, the control unit controls the data transmitted to the host unit and the device unit, and the storage unit is used to store the data required for calculation when the USB interface performs data processing.
本发明的又一目的是提供一种具有主机/装置功能的USB界面及其控制方法,所述USB界面包含一路由器以及复数个连接端口,所述控制单元借助检测与任一所述连接端口连接的一外接设备是否提供电源予所述连接端口的方法,定义所述连接端口为一上行端口或一下行端口,当所述外接设备提供电源时,所述连接端口定义为一上行端口,当所述外接设备未提供电源时,所述连接端口定义为一下行端口。Another object of the present invention is to provide a USB interface with a host/device function and a control method thereof, the USB interface includes a router and a plurality of connection ports, and the control unit is connected to any of the connection ports by means of detection Whether an external device provides power to the method of the connection port, define the connection port as an uplink port or a downlink port, when the external device provides power, the connection port is defined as an uplink port, when the When the external device does not provide power, the connection port is defined as a downstream port.
本发明的再一目的是提供一种具有主机/装置功能的USB设备,所述USB界面可与功能电路结合以构成一具有USB主机/装置功能的USB设备(Apparatus)。Another object of the present invention is to provide a USB device with host/device function. The USB interface can be combined with functional circuits to form a USB device (Apparatus) with USB host/device function.
本发明的另一目的是提供一种具有主机/装置功能的USB设备,当所述USB设备仅与至少一外接装置连接时,所述USB设备可驱动复数个装置,建构一独立的USB系统,当所述USB设备与一外接主机以及至少一外接装置连接时,所述USB设备被视为一混合式装置,所述USB设备桥接所述外接装置以及所述外接主机,使得所述外接主机得以通过本发明直接使用所述外接装置,而无需额外的集线器。Another object of the present invention is to provide a USB device with a host/device function. When the USB device is only connected to at least one external device, the USB device can drive multiple devices to construct an independent USB system. When the USB device is connected to an external host and at least one external device, the USB device is regarded as a hybrid device, and the USB device bridges the external device and the external host so that the external host can The external device is directly used through the present invention without an additional hub.
本发明的又一目的是提供一种具有主机/装置功能的USB界面控制方法,借助检测与所述USB界面连接端口连接的外接设备是否提供电源,以定义所述连接端口为一上行端口或一下行端口。Another object of the present invention is to provide a USB interface control method with host/device functions, by detecting whether the external device connected to the USB interface connection port provides power, to define the connection port as an uplink port or an uplink port row port.
本发明的再一目的是提供一种具有主机/装置功能的USB界面控制方法,借助预先标定装置功能或以电性方式模拟解除连结(disconnect)与再连结(Re-connect)以便重新注册新的装置功能,实现USB设备的热插拔(Hot Plug)特性。Yet another object of the present invention is to provide a USB interface control method with host/device functions, by pre-calibrating device functions or simulating disconnection and re-connection in an electrical manner so as to re-register new The device function realizes the hot plug (Hot Plug) feature of the USB device.
为了实现上述目的,本发明提供一种具有主机/装置功能的USB界面,包含:In order to achieve the above object, the present invention provides a USB interface with a host/device function, comprising:
复数个连接端口,用以与USB设备连接;A plurality of connection ports for connecting with USB devices;
一路由器,与所述连接端口连接,控制单元定义所述连接端口为一上行端口以及一下行端口之一;A router, connected to the connection port, the control unit defines the connection port as one of an uplink port and a downlink port;
一主机单元,与所述路由器连接,当任一连接端口定义为一下行端口时,所述路由器桥接下行端口至主机单元;以及a host unit connected to the router, and when any connection port is defined as a downstream port, the router bridges the downstream port to the host unit; and
一装置单元,与所述路由器连接,当任一连接端口定义为一上行端口时,所述路由器桥接上行端口至所述装置单元,并定义其他连接端口为一下行端口;A device unit connected to the router, when any connection port is defined as an uplink port, the router bridges the uplink port to the device unit, and defines other connection ports as a downlink port;
一控制单元,与所述路由器、所述主机单元以及所述装置单元连接,接收连接端口状态以控制USB界面的数据流。A control unit, connected with the router, the host unit and the device unit, receives the status of the connection port to control the data flow of the USB interface.
借助单纯示范最适于实施本发明的模式中之一,熟悉本技术人士将可自以下说明了解本发明的特点及优势中之一或部分或全部,因此,附图及说明书基本上可视为范例性而非限制性。With the help of one of the modes most suitable for implementing the present invention through simple demonstration, those skilled in the art will be able to understand one or part or all of the features and advantages of the present invention from the following descriptions. Therefore, the accompanying drawings and the description can basically be regarded as Exemplary rather than limiting.
附图说明 Description of drawings
图1为一USB物理总线拓朴(Physical Bus Topology)示意图。FIG. 1 is a schematic diagram of a USB Physical Bus Topology.
图2为一USB OTG所定义的装置类型功能图。Figure 2 is a functional diagram of a device type defined by USB OTG.
图3为依据本发明一较佳实施例的一具有主机/装置功能的USB控制界面的方块示意图。FIG. 3 is a schematic block diagram of a USB control interface with host/device functions according to a preferred embodiment of the present invention.
图4为依据本发明一较佳实施例的一控制流程图。FIG. 4 is a control flow diagram according to a preferred embodiment of the present invention.
图5A以及图5B为所述USB控制界面300于独立(Stand Alone)模式下与USB外接装置的连接关系及工作示意图。5A and 5B are schematic diagrams of the connection relationship and work of the
图6A以及图6B,为所述USB控制界面300于装置(Device)模式下与USB外接装置的连接关系及工作示意图。FIG. 6A and FIG. 6B are schematic diagrams of the connection relationship and operation between the
具体实施方式 Detailed ways
图3所示为依据本发明一较佳实施例的一具有主机/装置功能的USB控制界面的方块示意图。所述USB控制界面300包含一控制单元310、一主机单元320、一装置单元330、一存储单元340、一路由器350以及复数个连接端口360A、360B。所述控制单元310分别与所述主机单元320、所述装置单元330、所述存储单元340以及所述路由器350连接,所述控制单元310控制所述USB控制界面中,例如命令(Command)、数据(Data)以及状态(Status)信号等信号流(flows),并依据所述控制单元310所定义的连接端口状态(例如为一上行端口或下行端口),将所述信号流依需要传输至所述主机单元320以及所述装置单元330。所述存储单元340储存所述USB控制界面运作时所需的数据。所述路由器350与所述连接端口360A以及360B连接,是由所述控制单元310定义所述连接端口360A以及360B为一上行端口或下行端口后,借助路由器350而与装置单元330或主机单元320耦接。而上行端口或下行端口的定义方法,为检测与所述连接端口360A以及360B连接的外接设备是否提供电源,当连接的所述外接设备提供电源时,所述连接端口定义为一上行端口,所述外接设备为一外接主机;当连接的所述外接设备未提供电源时,所述连接端口定义为一下行端口,所述外接设备为一外接装置,值得注意的是,所述连接端口的数量可为指定数目,不以两组为限,本实施例中的连接端口数目仅为说明所需,不应视为本发明的限制。所述主机单元320分别与所述控制单元310以及所述路由器350连接,通过所述路由器350与任一定义为一下行端口的所述连接端口连接,以与外接装置连接,此时所述USB控制界面的功能为一主机端界面。值得注意的是,所述主机单元320的数量可为指定数目,不以一个为限,本实施例中的所述主机单元320数目仅为说明所需,不应视为本发明的限制。所述装置单元330分别与所述控制单元310以及所述路由器350连接,通过所述路由器350与一定义为一上行端口的所述连接端口连接,借以与外接主机连接,此时所述控制单元310将其他连接端口定义为下行端口,所述USB控制界面的功能为一装置端界面。FIG. 3 is a schematic block diagram of a USB control interface with host/device functions according to a preferred embodiment of the present invention. The
由于定义连接端口360A与360B为上行端口或下行端口,是由控制单元310检测外接设备是否提供电源而定,再由控制单元310控制路由器350桥接上行端口于装置单元330、抑或是桥接下行端口至主机单元320等。因此,根据本发明,桥接器350仅是选择性(optional)元件,假若连接端口360A或360B为A或mini A型插座,则直接桥接至装置单元330;连接端口360A或360B为B或mini B型插座,则直接桥接至主机单元320,即无需设置路由器350。假若连接端口360A或360B为Mini-AB型插座,则因连接线上的接头外观相似,故可设置路由器350,经由控制单元310将上行端口桥接至装置单元330,将下行端口连接至主机单元320。Since the
请见图4所示,为依据本发明一较佳实施例的一控制流程图。步骤40利用所述控制单元310检测是否有外接设备连接所述连接端口360A或360B,当有外接设备连接时,步骤41检测所述外接设备是否通过与其连接的连接端口提供电源,如所述外接设备未提供电源时,于步骤42中以所述控制单元310定义与所述外接设备连接的连接端口为一下行端口,并桥接所述下行端口至所述主机单元320。如所述外接设备提供电源时,则进行步骤43,以控制单元310定义与所述外接设备连接的连接端口为一上行端口,并桥接所述上行端口至所述装置单元330。再于步骤44定义其余的连接端口为下行端口,并将所述下行端口桥接至主机单元320。然后,进行步骤45,持续检测所述连接端口,倘若有另一外接主机连接另一连接端口时,得以解决同时存在两个主机端的问题。Please refer to FIG. 4 , which is a control flow chart according to a preferred embodiment of the present invention.
以下对所述具有主机/装置功能的USB控制界面300于不同工作模式下,与外接设备间的连接关系及工作方式,作一更清楚的描述:The following is a more clear description of the connection relationship and working mode between the
请见图5A以及图5B,为所述USB控制界面300于独立(Stand Alone)模式下与USB外接装置的连接关系及工作示意图,为便于叙述,所述连接端口360A以及360B定义为第一连接端口360A’以及第二连接360B’。图5A中,一外接装置370与所述第一连接端口360A’连接,由于USB控制界面300检测知所述外接装置370未能提供电源,故所述第一连接端口360A’被定义为一下行端口,通过所述路由器350与所述主机单元320连接。因此,所述USB控制界面300可使用所述外接装置的功能,例如打印、扫描以及存取或播放数据等,但亦不以此为限。图5B中,所述外接装置370与所述第二连接端口360B’连接,由于USB控制界面300检测知所述外接装置370未能提供电源,故所述第二连接360B’被定义为一下行端口,通过所述路由器350与所述主机单元320连接。因此,所述USB控制界面300得以使用所述外接装置的功能,例如打印、扫描以及存取或播放数据等,但亦不以此为限。由图5A以及图5B显示的所述USB控制界面300工作示意图可知,借助所述路由器350的使用,无论一外接装置是与任一所述连接端口连接,均得以桥接至所述主机单元320,以此,所述USB控制界面300得以使用所述外接装置的功能。无论所述连接端口的数量以及所述外接装置所连接的所述连接端口有何变动,上述的所述USB控制界面300独立模式操作依然成立。Please refer to FIG. 5A and FIG. 5B, which are the connection relationship and working schematic diagram of the
请见图6A以及图6B,为所述USB控制界面300于装置(Device)模式下与USB外接装置的连接关系及工作示意图。图6A中,一外接主机380与所述第二连接端口360B’连接,由于USB控制界面300检测知所述外接主机380提供电源,故所述第二连接端口360B’被定义为一上行端口,通过所述路由器350与所述装置单元330连接,所述控制单元310并定义所述第一连接端口360A’为一下行端口,与所述外接装置370连接,所述外接装置370通过所述路由器350桥接至所述主机单元320。本实施例中,所述USB控制界面300于装置(Device)模式下被定义为一混合式装置(Composite Device)界面,所述外接装置370视为所述USB控制界面300的一功能,但亦不以此为限,举例来说,所述USB控制界面300于装置(Device)模式下亦可被定义为一复合式装置(Compound Device)界面。Please refer to FIG. 6A and FIG. 6B , which are schematic diagrams of the connection relationship and work of the
图6B中,一外接主机380与所述第一连接端口360A’连接,由于USB控制界面300检测知所述外接主机380提供电源,故所述第一连接端口360A’被定义为一上行端口,通过所述路由器350与所述装置单元330连接,所述控制单元310并定义所述第二连接端口360B’为一下行端口,与所述外接装置370连接,所述外接装置370通过所述路由器350桥接至所述主机单元320。In FIG. 6B, an
倘若根据本发明的USB控制界面300于独立(stand alone)模式下,有外接主机连接至USB控制界面300的连接端口时,则USB控制界面300会切换成为装置(Device)模式。但是,切换至装置模式前,可等待独立模式的操作完成,以确保数据的正确性。If the
于本实施例图5以及图6中的数据存取以及传输路径说明如下:外接主机经由所述上行端口连接所述路由器,并通过所述装置单元与控制单元沟通,控制单元再通过所述主机单元与下行端口,取得所述外接装置执行功能所需的信息与数据,并以所述存储单元储存运作及传输所需的数据。据此,所述外接主机即可于执行功能时,通过所述路径实现外接主机/外接装置间的操作关系。The data access and transmission paths in Fig. 5 and Fig. 6 of this embodiment are described as follows: an external host is connected to the router through the uplink port, and communicates with the control unit through the device unit, and the control unit then passes through the host The unit and the downlink port obtain the information and data required by the external device to perform functions, and use the storage unit to store the data required for operation and transmission. Accordingly, when the external host performs functions, the operation relationship between the external host/external device can be realized through the path.
值得注意的是,本实施例图5以及图6中所显示的特定类型USB装置仅为例举,不应视为本发明的限制,事实上,任何应用USB界面进行数据存取的装置,均可借助本发明实现外接主机与外接装置间的连接。It should be noted that the specific types of USB devices shown in FIG. 5 and FIG. 6 of this embodiment are only examples and should not be regarded as limitations of the present invention. In fact, any device that uses a USB interface for data access can be The invention can realize the connection between the external host and the external device.
另外,本发明提供两种控制方法,使得所述USB控制界面300于装置(Device)模式下,可实现USB界面热插拔(Hot Plug)的功能,今详述于下:In addition, the present invention provides two control methods, so that the
当外接装置的功能为事先预定(predefined)时,主机端可利用识别/驱动(enumeration)所述事先预定功能以实现USB的热插拔功能。首先,无论所述USB控制界面300是否与外接装置连接,当一外接主机与所述USB控制界面300连接时,即标记(Book)至少一事先预定功能。随后,当一事先预定的外接装置与所述USB控制界面300连接时,即可致动(Enabling)所述功能以使用所述外接装置。举例来说,可预先标记一移动储存功能(RemovableDisk Function)或一使用者界面功能(Human Interface Function),当随后插入的所述外接装置具有已标记功能时,即可立即使用。要注意的是,预先标记的功能数量以及种类可以系统需求以及效能决定,不以一个为限。When the function of the external device is predetermined, the host side can identify/enumerate the predetermined function to realize the hot plug function of the USB. Firstly, regardless of whether the
另一种USB界面热插拔方法是借助所述USB控制界面300的设计,于所述USB控制界面300以及一外接主机端连接(connecting)状态不变的情况下,当有另一外接装置通过所述USB控制界面300与所述外接主机连接时,借助所述USB控制界面300自动地与所述外接主机解除连接(Disconnect,即将D+与D-接脚连接至逻辑低准位)并再连接(Re-connect,即将D+或D-接脚连接至上拉(pull-up)电阻时),使所述外接主机得以利用所述USB界面装置标记所述外接装置为其界面之一,以检测到所述外接装置的存在,并对所述外接装置进行识别与驱动,以实现USB界面的热插拔功能。Another USB interface hot-swapping method is to use the design of the
值得一提的是,前述的连接一词非限于有线连接以及电连接,足以使各连接单元间依系统需要进行信号传递的连接方式,均应视为已被本发明所揭示,举例而言,例如无线USB规格(Wireless USB)中的信号传递方法,亦可为本发明所使用。It is worth mentioning that the aforementioned connection is not limited to wired connection and electrical connection, and the connection methods that are sufficient to enable signal transmission between each connection unit according to system requirements should be considered as disclosed by the present invention. For example, For example, the signal transmission method in the Wireless USB specification (Wireless USB) can also be used in the present invention.
本发明中所述的所述具有主机/装置功能的USB界面,得以与功能电路结合以构成一具有USB主机/装置功能的USB设备(Apparatus),换言之,经由本发明的使用,可整合于任何使用USB界面的电子设备,例如台式电脑、笔记本电脑、随身碟、数字影音播放器、手机、GPS设备、PDA设备以及各式输入以及输出设备等,为一具有USB主机/装置功能的USB设备,使得此USB设备不仅可直接使用所述位阶装置,亦可使一外接主机端除了使用所述USB设备本身的功能外,亦可通过所述USB设备与其他外接装置连接,直接使用所述外接装置的功能,而无需改变所述外接主机、所述USB设备与所述外接装置间的缆线连结。因此,通过所述USB界面的使用,前述的各种电子设备得以成为具有USB主机/装置功能的USB设备,因而有了极佳的使用便利性与相容性,更大大的提高了市场价值。The USB interface with host/device functions described in the present invention can be combined with functional circuits to form a USB device (Apparatus) with USB host/device functions. In other words, through the use of the present invention, it can be integrated into any Electronic devices that use USB interfaces, such as desktop computers, laptop computers, flash drives, digital audio-visual players, mobile phones, GPS devices, PDA devices, and various input and output devices, are USB devices with USB host/device functions. The USB device can not only directly use the above-mentioned level device, but also enable an external host to use the functions of the USB device itself, and can also be connected to other external devices through the USB device to directly use the external device. functions of the device without changing the cable connection between the external host, the USB device and the external device. Therefore, through the use of the USB interface, the aforementioned various electronic devices can become USB devices with USB host/device functions, thus having excellent convenience and compatibility, and greatly increasing the market value.
熟知此项技术人士应了解上述附图及说明中所示的本发明具体实施例只是范例性且非限制。Those skilled in the art should understand that the specific embodiments of the present invention shown in the above drawings and descriptions are exemplary and non-limiting.
本发明较佳具体实施例的前述说明是用于示范及说明目的。并非使本发明限于所述精确形式或已揭示的范例性具体实施例。因此,先前说明应视为示范性而非限制性。显然许多修正及变化对于熟悉此项技术人士将是很明显的。具体实施例的选择及描述为了更佳解释本发明的原理及其实际应用的最佳模式,从而允许熟悉此项技术人士理解用于各种具体实施例的本发明,且具有适合于特定使用或所涵盖实作的各种修改。本发明意于使其范畴由在此所附的本申请权利要求范围及其等同者定义,其中除非另有说明,否则所有权利要求请求项均包含其最广泛的合理范围。应了解到,可由熟悉此项技术者对于具体实施例进行改变,而不脱离由以下本申请权利要求范围所定义的本发明的范畴。The foregoing descriptions of preferred embodiments of the invention have been presented for purposes of illustration and description. The invention is not intended to be limited to the precise forms or exemplary embodiments disclosed. Accordingly, the foregoing description should be considered as illustrative rather than restrictive. Obviously many modifications and variations will be apparent to those skilled in the art. The selection and description of specific embodiments are in order to better explain the principles of the present invention and the best mode for its practical application, thereby allowing those skilled in the art to understand the present invention for various specific embodiments, and have the characteristics suitable for specific uses or Various modifications of the covered implementations. It is intended that the scope of the invention be defined by the scope of the claims appended hereto and their equivalents, with all claims to include their broadest reasonable scope unless otherwise stated. It will be appreciated that changes may be made to the particular embodiments by those skilled in the art without departing from the scope of the invention as defined by the scope of the claims hereinafter.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100043159A CN100476777C (en) | 2006-02-06 | 2006-02-06 | USB interface with host/device function and control method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2006100043159A CN100476777C (en) | 2006-02-06 | 2006-02-06 | USB interface with host/device function and control method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101017470A CN101017470A (en) | 2007-08-15 |
CN100476777C true CN100476777C (en) | 2009-04-08 |
Family
ID=38726490
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2006100043159A Active CN100476777C (en) | 2006-02-06 | 2006-02-06 | USB interface with host/device function and control method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100476777C (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9207697B2 (en) | 2014-05-05 | 2015-12-08 | Novoton Technology Corporation | Control chip and connection module utilizing the same |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118493A (en) * | 2010-11-26 | 2011-07-06 | 深圳市杰特电信控股有限公司 | Smart phone with master device and slave device and application method thereof |
CN102722360A (en) * | 2011-03-31 | 2012-10-10 | 比亚迪股份有限公司 | Mobile terminal and management method for externally inserted attachment |
CN102724351B (en) * | 2011-03-31 | 2015-05-13 | 比亚迪股份有限公司 | Mobile terminal and management method of mobile terminal to external interposer attachment |
CN102801057A (en) * | 2012-08-03 | 2012-11-28 | 昆山大百科实验室设备工程有限公司 | Improved USB power supply structure |
CN104778140B (en) * | 2014-01-15 | 2019-01-22 | 深圳市可橙科技有限公司 | System and method are connected in the USB automatic identification of starlike framework |
US9602648B2 (en) * | 2015-04-30 | 2017-03-21 | Keyssa Systems, Inc. | Adapter devices for enhancing the functionality of other devices |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1130643C (en) * | 1999-08-06 | 2003-12-10 | 株式会社Ntt都科摩 | Electronic device with USB interface |
US20040103223A1 (en) * | 2002-11-26 | 2004-05-27 | Motorola, Inc. | USB accessory adaptor |
US20040148451A1 (en) * | 2003-01-28 | 2004-07-29 | Ching-Chung Lai | USB controlling apparatus for data transfer between computers and method for the same |
US20040225836A1 (en) * | 2003-05-07 | 2004-11-11 | Sunplus Technology Co., Ltd. | Portable USB storage device capable of being set to device mode or host mode |
CN1188788C (en) * | 2003-04-15 | 2005-02-09 | 李季和 | Method for setting master-slave USB interface in MP3 player |
-
2006
- 2006-02-06 CN CNB2006100043159A patent/CN100476777C/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1130643C (en) * | 1999-08-06 | 2003-12-10 | 株式会社Ntt都科摩 | Electronic device with USB interface |
US20040103223A1 (en) * | 2002-11-26 | 2004-05-27 | Motorola, Inc. | USB accessory adaptor |
US20040148451A1 (en) * | 2003-01-28 | 2004-07-29 | Ching-Chung Lai | USB controlling apparatus for data transfer between computers and method for the same |
CN1188788C (en) * | 2003-04-15 | 2005-02-09 | 李季和 | Method for setting master-slave USB interface in MP3 player |
US20040225836A1 (en) * | 2003-05-07 | 2004-11-11 | Sunplus Technology Co., Ltd. | Portable USB storage device capable of being set to device mode or host mode |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9207697B2 (en) | 2014-05-05 | 2015-12-08 | Novoton Technology Corporation | Control chip and connection module utilizing the same |
Also Published As
Publication number | Publication date |
---|---|
CN101017470A (en) | 2007-08-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7895386B2 (en) | USB interface provided with host/device function and its control method | |
CN108885601B (en) | USB multi-host endpoint reflector hub | |
TWI393009B (en) | Data sharing and transfer systems and methods | |
US7214089B1 (en) | Universal serial bus On-The-Go apparatus | |
CN100476777C (en) | USB interface with host/device function and control method thereof | |
US8055919B2 (en) | Port power controller for USB hubs with legacy battery charge support | |
TW565797B (en) | Method and apparatus of controlling an operational mode of a USB device | |
US20110191503A1 (en) | Motherboard Compatible with Multiple Versions of Universal Serial Bus (USB) and Related Method | |
US20160004287A1 (en) | Portable electronic device and power management method thereof | |
CN102087624B (en) | Circuit structure and method for realizing USB interface functional verification test on the basis of FPGA module | |
CN107807892B (en) | A method of converting USB TYPE-C to USB3.0 and an adapter | |
CN105183679A (en) | Electronic device and information processing method | |
CN204576500U (en) | A kind of usb communication circuit of compatible I2C communication and system | |
US20120096286A1 (en) | Charging management method, charging control circuit and the host apparatus having the same | |
CN111948971A (en) | A smart card management device and data transfer method thereof | |
CN1316388C (en) | USB control circuit suitable for computer-to-computer transmission and its working method | |
CN111417034A (en) | Switch and hot plug method, device and system for switch board card thereof | |
CN101599050B (en) | Adaptable pci express controller core and method | |
CN101782879A (en) | Signal conversion device of all-in-one serial bus connector | |
CN104123257B (en) | Universal serial bus device, communication method and computer readable storage medium | |
TW202121183A (en) | Method and device of real time monitoring the connection status of i2c devices | |
US20090185559A1 (en) | Integration module for universal serial bus | |
CN207249662U (en) | Adaptive usb synchronizers | |
CN1322437C (en) | Multi-host access device for multi-host access to storage media | |
US20080147927A1 (en) | Storage Device Interface and Storage Device with the Same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |