AT90USB162 USB device HID generic demonstration
Use of this program is subject to Atmel's End User License Agreement.
Please read file lic_page for copyright notice.
This embedded application code illustrates how to implement a USB application with the AT90USBxxx controller using the generic HID class implementation.
A pc side applications allow to communicate with the embedded firmware (see USB HID Generic PC demos).
The sample code is delivered for STK526.
This source code is usable with the following compilers:
- IAR Embedded Workbench (5.11A and higher)
- AVRGCC (WinAVR 20080411 and higher).
Support for other compilers may required modifications or attention for:
- compiler.h file
- special registers declaration file
- interrupt subroutines declarations
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 usb 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. Once this task has detected that the usb connection is fully operationnal, it updates different status flags that can be check within the high level application tasks.
- The hid task performs the high level device application operation. Once the device is fully enumerated (DEVICE SETUP_SET_CONFIGURATION request received), the task checks for received data on its OUT endpoint and transmit data on its IN endpoint.
Generated on Fri Sep 11 14:27:17 2009 for ATMEL by
1.5.3