© 2006-2008 FreeRange Technologies, Inc. All rights reserved.
The Controller Layer

The controller layer is comprised of hardware specific drivers that handle communication between supported USB controllers and the stack's higher layers. Each unique controller driver utilizes the same software interface (i.e.
the Controller API) to communicate with the USB protocol layer.

USBConnex-Peripheral supports various USB peripheral controllers on the market. If developers require support for other hardware, they can write their own controller drivers using the stack's simple, straightforward Controller API.

The Protocol Layer

The Protocol Layer is the core element of the USBConnex-Peripheral software stack and consists of three components: the class driver API, USB protocol driver and USB controller API. Each component is described below.

The Class Driver API sits above the USB Protocol Driver and abstracts the particulars of both the USB protocol and underlying hardware from the class drivers and the higher layer application software. By providing a common interface between the class drivers and USB Protocol Driver, this API provides a simple mechanism for users to develop their own class drivers to support specific functions, such as printing or storage.

The USB Protocol Driver handles all USB protocol specific operations. It routes data between device
endpoints and the bus interface, interfaces to the peripheral controller's major pipes (input/output endpoints) and assists with device enumeration. It also manages bandwidth and other resources associated with the bus.

The USB Controller API sits below the USB Protocol Driver and abstracts the details of the USB peripheral controller from the upper layer software. As such, it presents a consistent interface to whatever USB hardware the product developer selects. By utilizing this API, users can support different USB peripheral controllers, separately or at the same time, without having to modify the stack's higher layers. They can also use this API to write their own controller drivers to support their hardware of choice.

The Class Driver Layer

All USB devices use a specific protocol to communicate with software that sits above the USB stack and implement the device's USB behavior. For example, USB hard drives follow the Mass Storage Class protocol, which defines how the drive uses encapsulated SCSI commands to communicate with the OS file system. Similarly, devices such as keyboards and mice implement the HID (human interface device) protocol.

The USB-IF has defined a number of standard classes that support devices exhibiting similar functions. Examples of standard classes include: the printer class, mass storage class, HID class, HUB class, communication class, audio class, and digital still image class.

While many USB peripherals on the market today follow one of the standard classes, others follow manufacturer proprietary protocols. Devices that sometimes do not take the standards based approach include MP3 players, smartphones and networking devices. USBConnex-Peripheral can support both standard and proprietary protocols, all of which communicate with the lower layers of the stack via the
Class Driver API.

Abstraction Interfaces

Hardware Abstraction Interface

The hardware abstraction interface abstracts the details of the stack from the hardware platform upon which it runs. This interface makes the stack highly portable and enables users to integrate the software with a wide variety of platforms and CPUs quickly and easily. All hardware specific function calls, such as register accesses, hardware initialization and interrupt handling utilize the hardware abstraction interface. 

OS Abstraction Interface

The stack also includes an operating system (OS) abstraction layer, which provides a layer of abstraction between the USBConnex-Peripheral stack and the operating system. This abstraction makes the stack highly portable and allows developers to easily port it to any operating system and C libraries. All function specific calls that are OS specific, such as interrupt hooking, task initialization and memory allocation utilize the OS abstraction interface.
Stack Architecture
 
 
 
 
 
 
 
 
Simplifying Device Connectivity
Products
USBConnex-Peripheral was architected in a modular fashion so that developers need only license those components they require for their project. Users can configure the stack to support a variety of embedded systems that include big or little endian processors, DMA or non-DMA device controllers, simple to complex operating systems or no operating system at all. 

The diagram found below illustrates the stack's overall architecture, followed by a description of each layer and/or component.