USB1.1协议学习经验之2
先了解一下USB设备的连接过程: 当 USB 设备接上或从 USB 设备移开的时候,主机启动一个被称作总线标识 (bus enumeration) 的进程,来标识并管理设备状态的改变,当 USB 设备接上一个加电端口时,系统当采取以下操作: 1.USB 设备所连的集线器通过其通向主机
先了解一下USB设备的连接过程:
当USB设备接上或从USB设备移开的时候,主机启动一个被称作总线标识(bus enumeration)的进程,来标识并管理设备状态的改变,当USB设备接上一个加电端口时,系统当采取以下操作:
1.USB设备所连的集线器通过其通向主机的状态改变通道向主机,汇报本USB设备已连接上。此时,USB设备处于加电状态,它所连接的端口是无效的。
2.主机通过寻问集线器决定此次状态改变的确切含义。
3.主机一旦得知新设备已连上以后,它至少等待100ms以使得插入操作的完成以及设备电源稳定工作。然后主机发出端口使能及复位命令给那个端口。
4.集线器将发向端口的复位信号持续10ms。当复位信号撤消后,端口已经有效了。这时USB设备处于缺省状态,并且可从VBUS汲取小于100mA的电能,所有设备寄存器及状态已经被复位,设备可对缺省地址产生响应。
5.主机给设备分配一个唯一的地址,设备转向编址状态。(Address state)。
6.在USB设备接受设备地址之前,它的缺省控制通道(Default Control Pipe)在缺省地址处自然是可寻址的,主机通过读取设备描述表,判决设备缺省通道的实际净数据负载。
7.主机从设备读取配置信息要从配置0读到配置n-1,其中n为配置个数,此操作须花费几个毫秒。
8.基于从设备取来的配置信息及设备如何被使用的信息,主机给设备一个配置值,此刻,设备就处于配置状态(Configured state)并此配置有关的所有端节点,都按照配置各就各位,USB设备现在可以从VBUS得到描述中所要求的电量了。从设备的角度来讲,它已经准备就绪了。
当UBS设备被取走时,集线器同样会通知主机,断开一个设备连接会使得设备所连接的端口无效,一收到断开通知后,主机就会更新的拓扑信息。
地址分配
当USB设备连接以后,由主机负责给此设备分配一个唯一的地址,这个操作是在设备复位及端口使能操作以后。
配置
USB设备在正常被使用以前,必须被配置,由主机负责配置设备。主机一般会从USB设备获取配置信息后再准定此设备有哪些功能。
作为配置操作的一部分,主机会设置设备的配置值,并且,如果必要的话会选择合适的接口的备选设置。
只须一个简单配置,一个设备可能支持多重接口。一个接口是一组端结点集合,它们代表了设备向主机提供的单一的功能或特性,用来与这组相关端结点通信的协议以及接口内各端结点的目的可以作为一个设备类的一部分或者由厂商制定具体定义。
另外,一个配置中的结口可能有备选设置。这些备选设置会重定义相关端结点的数目或特性。如果是这样的话,设备必须支持GetInterface(接口请求)与Set Interface(接口设置)请求,来汇报及选择指定的接口的设备选设置。
在每个设备配置下,每个接口描述表可能包括用来标识接口的及备选设置的域,接口被从0~N-1编号。n为配置所支持的能同时使用的接口数目,类似的设置的编号也从0开始。当设备初始化配置后,缺省设置是备选设置0。
为了支持通用的设备驱动程序管理一组相关的BUS设备,设备与接口描述表中包含了类(Class),子类(Sub class),及协议(Protocol)域。这些域用来标识一个设备的功能及用于通信的协议。
一个类值被分配给一组按照特性划分成USB类说明一部分的设备。一个类的设备可进一步划分成子类,并且在一个类或子类中,一个协议代值可定义主机软件是怎样与设备通信的。
数据传送
数据可能以四种方式(控制,批量,中断,同步)在USB设备端结点与主机之间传送。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

If you're having issues with your USB to HDMI adapter not working properly on Windows, it could be because of an outdated graphics card driver or a problem with the adapter itself. The following content will help you resolve this dilemma. Fix USB to HDMI adapter not working on Windows 11/10 Use the following solutions to fix USB to HDMI adapter not working on Windows 10/11: Update Display Adapter Driver Rollback Graphics Driver Unplug and Plug USB to HDMI Adapter Updated BIOS Let's get started. 1] Update Display Adapter Driver Issues may be caused by outdated or corrupted display adapter drivers. You can try downloading from the official website of the manufacturer

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

1. On the computer desktop, right-click [This PC]. 2. On the pop-up menu, click [Properties]. 3. After entering the [System] page, click [Device Manager] on the left. 4. In the [Device Manager] list box, find [Universal Serial Bus Controller] and double-click (or click [>] on the left). 5. After expanding the [Universal Serial Bus Controller] list, right-click the item labeled [Hub] or [Hub]. 6. In the pop-up menu, click [Properties]. 7. On the [USBRootHub Properties] page, click the [Power Management] tab. 8. After opening the [Power Management] page, click the box or [Allow the computer to turn off this device to save power (A)] to uncheck the box. 9. [Allow the computer to turn off this device

We will show you how to fix media transfer error when connecting your phone to PC via USB cable. When you try to import photos and videos from your phone to your computer, you may encounter a "Please update your device's settings to accept media transfers" error message displayed by the Photos app. Please update your device settings to accept media transfers Update your device settings to allow media transfers to resolve the error message. Restart your two devices Use different USB cables Check your Android phone settings Install the MTP USB device driver Use other methods to transfer your photos and videos Let’s get started. 1] Restart both devices It is recommended that you first try to restart your devices, including computers and phones, when you encounter a temporary failure. Heavy

What does 0x0000011b mean when connecting to a printer? Users often encounter various error codes when using computers, laptops or other devices. Among them, 0x0000011b is a common printer connection error code. So, what does connecting printer 0x0000011b mean? First, we need to understand the basic principles of printer connection. When we need to print files from the computer, we usually need to connect the printer to the computer for data transfer between the two. This connection can be made via

With the development of the digital era, shared printers have become an indispensable part of the modern office environment. However, sometimes we may encounter the problem that the shared printer cannot be connected to the printer, which will not only affect work efficiency, but also cause a series of troubles. This article aims to explore the reasons and solutions for why a shared printer cannot connect to the printer. There are many reasons why a shared printer cannot connect to the printer, the most common of which is network issues. If the network connection between the shared printer and the printer is unstable or interrupted, normal operation will not be possible.

Solutions to Restricted Network Connections in Win10 With the rapid development of technology, the Internet has become an indispensable part of people's lives. However, sometimes we may encounter some problems when connecting to the Internet on computers using the Windows 10 operating system, one of which is restricted connections. In this case, we cannot access web pages, download files, or use network functions normally. So, is there any way to solve this problem? This article will introduce you to several common solutions. 1. Check the network connection settings. First, I

1. Place the earphones in the earphone box and keep the lid open. Press and hold the button on the box to enter the pairing state of the earphones. 2. Turn on the watch music function and select Bluetooth headphones, or select Bluetooth headphones in the watch settings function. 3. Select the headset on the watch to pair successfully.
