AT90USBxxx USB Host CDC Sample applicaton
Use of this program is subject to Atmel's End User License Agreement.
Please read file lic_page for copyright notice.
This embedded application source code illustrates how to implement a simple USB host application with CDC support.
To use the application, the SK525 should be configured to be self powered (see STK525 hardware manual).
- Note:
- The application can also be used with the USBKey in host mode (powered with an external battery)
The application uses host operating mode of the STK525. In host mode, the USB can be connected (with a mini A connector attached to the mini AB STK525 receptacle) to a standard CDC device (or another STK525 running device CDC application). In this mode the AT90USBxxx controller will initialize and enumerate a device CDC application.
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 application is based on two different tasks:
- The usb_task (usb_task.c associated source file), is the task performing the USB low level enumeration process in device mode or host mode.
- The host_cdc_task is active allows to initialize a connected CDC device and manage communications (data, events) : 1. UART-USB bridge configuration : in this mode, data received on UART is sent to the CDC device connected, and data received from the CDC device is sent back through the UART. This is the default mode of this demonstration package, and is enabled by defining CDC_USE_UART label in "config.h" file 2. User can also delete CDC_USE_UART define, and is free to build its own data manager from the host_cdc_task function that exchange data streams with the CDC device through arrays (that replace the UART data registers) -> see "host_cdc_task.c" file content for more information about adaptation of this library to your own software
Generated on Wed Sep 23 09:41:07 2009 for ATMEL by
1.5.3