Книга: Advanced PIC Microcontroller Projects in C

8.3.3 Enumeration

8.3.3 Enumeration

When a device is plugged into a USB bus, it becomes known to the host through a process called enumeration. The steps of enumeration are:

• When a device is plugged in, the host becomes aware of it because one of the data lines (D+ or D–) becomes logic high.

• The host sends a USB reset signal to the device to place the device in a known state. The reset device responds to address 0.

• The host sends a request on address 0 to the device to find out its maximum packet size using a Get Descriptor command.

• The device responds by sending a small portion of the device descriptor.

• The host sends a USB reset again.

• The host assigns a unique address to the device and sends a Set Address request to the device. After the request is completed, the device assumes the new address. At this point the host is free to reset any other newly plugged-in devices on the bus.

• The host sends a Get Device Descriptor request to retrieve the complete device descriptor, gathering information such as manufacturer, type of device, and maximum control packet size.

• The host sends a Get Configuration Descriptors request to receive the device’s configuration data, such as power requirements and the types and number of interfaces supported.

• The host may request any additional descriptors from the device.

The initial communication between the host and the device is carried out using the control transfer type of data flow.

Initially, the device is addressed, but it is in an unconfigured state. After the host gathers enough information about the device, it loads a suitable device driver which configures the device by sending it a Set Configuration request. At this point the device has been configured, and it is ready to respond to device-specific requests (i.e., it can receive data from and send data to the host).

Оглавление книги

Оглавление статьи/книги

Генерация: 1.263. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз