Series2 USB software library for USB device mode

License

Use of this program is subject to Atmel's End User License Agreement.

Please read file lic_page for copyright notice.

Description

This embedded application source code illustrates how to implement a USB interfaced application over the series 4 USB controller.

As the series 4 implements a device/host usb controller, the embedded application can operates in one of the following usb operating modes:

To optimize embedded code/ram size and reduce the number of source modules, the application can be configured to use one and only one of these operating modes.

This sample application can be configured for both STK600 or EVK527 hardware, see TARGET_BOARD define value in config.h file.

About the source code

This source code is usable with the following compilers:

Support for other compilers may required modifications or attention for:

About the sample application

By default the sample code is delivered with a simple preconfigured dual role USB application. It means that the code generated allows to operate as a device or a host depending on the USB ID pin:

appli.gif
Thus two instances of this application can be connected together with a miniA-miniB cable.

Architecture

As illustrated in the figure bellow, the application entry point is located is the main.c file. The main function first performs the initialization of a scheduler module and then runs it in an infinite loop. The scheduler is a simple infinite loop calling all its tasks defined in the conf_scheduler.h file. No real time schedule is performed, when a task ends, the scheduler calls the next task defined in the configuration file (conf_scheduler.h).

The sample dual role application is based on three different tasks:

arch_full.gif

Configuration

The sample application is configured to implements both host and device functionnalities. Of course it can also be configured to be used in device or reduced host only mode (See conf_usb.h file). Depending on the USB operating mode selected, the USB task will call either the usb_host_task (usb_host_task.c), either the usb device task (usb_device_task.c) to manage chapter 9 requests. In such case, the corresponding template_device_task or template_host_task can be removed from the scheduled tasks (see conf_scheduler.h).
Note:
The B device descriptors used for this sample application are not directly usable for enumeration with a standard Pc host system. Please refers to ATMEL website for real devices applications examples (HID mouse, HID keyboard, MassStorage, CDC ... )
Todo:
Implements the required mechanism for On the Go (OTG) compliance: SRP, HNP and role exchange detection/requests.

Generated on Fri Sep 11 14:23:53 2009 for ATMEL by  doxygen 1.5.3