Introduction, Name, Usb concepts – Comtrol eCos User Manual

Page 679

Advertising
background image

Introduction

Name

Introduction

— eCos support for USB slave devices

Introduction

The eCos USB slave support allows developers to produce USB peripherals. It consists of a number of different
eCos packages:

1. Device drivers for specific implementations of USB slave hardware, for example the on-chip USB Device

Controller provided by the Intel SA1110 processor. A typical USB peripheral will only provide one USB slave
port and therefore only one such device driver package will be needed. Usually the device driver package
will be loaded automatically when you create an eCos configuration for target hardware that has a USB slave
device. If you select a target which does have a USB slave device but no USB device driver is loaded, this
implies that no such device driver is currently available.

2. The common USB slave package. This serves two purposes. It defines the API that specific device drivers

should implement. It also provides various utilities that will be needed by most USB device drivers and appli-
cations, such as handlers for standard control messages. Usually this package will be loaded automatically at
the same time as the USB device driver.

3. The common USB package. This merely provides some information common to both the host and slave sides

of USB, such as details of the control protocol. It is also used to place the other USB-related packages ap-
propriately in the overall configuration hierarchy. Usually this package will be loaded at the same time as the
USB device driver.

4. Class-specific USB support packages. These make it easier to develop specific classes of USB peripheral,

such as a USB-ethernet device. If no suitable package is available for a given class of peripheral then the
USB device driver can instead be accessed directly from application code. Such packages will never be loaded
automatically since the configuration system has no way of knowing what class of USB peripheral is being
developed. Instead developers have to add the appropriate package or packages explicitly.

These packages only provide support for developing USB peripherals, not USB hosts.

USB Concepts

Information about USB can be obtained from a number of sources including the USB Implementers Forum web
site (http://www.usb.org/). Only a brief summary is provided here.

A USB network is asymmetrical: it consists of a single host, one or more slave devices, and possibly some number
of intermediate hubs. The host side is significantly more complicated than the slave side. Essentially, all operations
are initiated by the host. For example, if the host needs to receive some data from a particular USB peripheral then
it will send an IN token to that peripheral; the latter should respond with either a NAK or with appropriate data.
Similarly, when the host wants to transmit data to a peripheral it will send an OUT token followed by the data;
the peripheral will return a NAK if it is currently unable to receive more data or if there was corruption, otherwise
it will return an ACK. All transfers are check-summed and there is a clearly-defined error recovery process. USB
peripherals can only interact with the host, not with each other.

575

Advertising