at91sam7x的最新版Ucos-II内核源码.
源代码在线查看: usb-device-hid-keyboard-project.html
Atmel Corporation - USB Device HID Keyboard 1.4
USB Device HID Keyboard Project 1.4
Main >
USB Framework >
HID Keyboard
Purpose
This application creates an USB HID (Human-Interface Device) keyboard on a host
computer. Pressing any of the buttons on the board outputs characters or special
keys on the host side.
Hardware Requirements
This package can be used with the following Atmel evaluation boards:
AT91SAM7S-EK (except AT91SAM7S32)
AT91SAM7X-EK
AT91SAM7SE-EK
AT91SAM7A3-EK
AT91SAM9260-EK
AT91SAM9261-EK
AT91SAM9263-EK
AT91SAM9RL-EK
AT91SAM9XE-EK
AT91SAM9G20-EK
Description
This examples enumerates as an HID keyboard device to the host computer. Most
operating systems have a default implementation of this class, so they will
recognize the keyboard transparently.
Once the device is fully configured by the OS, pressing the buttons on the
board will cause one of the following QWERTY keys to be sent: 'A', '9',
'Num. Lock' and 'Right Shift' (on evaluation kits with less than four buttons, it
is not possible to output the extra keys).
In addition, the third LED on the board will report the num. lock state of the
keyboard. This means that when pressing the num. lock button on the EK or the num.
lock button on the keyboard, the LED should turn on & off to reflect the change.
WARNING: on the SAM7X/XC evaluation kit, the project only works in internal flash.
Usage
Build the application.
Optionally, connect the DBGU port of the evaluation board to the computer
and open it in a terminal. Debug information generated by the application
will be visibled that way.
Settings: 115200 bauds, 8 bits, 1 stop bit, no parity, no flow control.
Download and run the program inside the evaluation board. Please refer
to the SAM-BA User Guide,
the GNU-Based Software Development
application note or to the IAR EWARM User Guide,
depending on your chosen solution.
In the terminal window, the following text should appear:
-- USB Device HID Keyboard Project 1.4 --
Connect the USB cable to the board. Traces should start to
appear on the terminal. If this is the first time the device is connected to
the PC, the operating system may take some time to install it.
Once the device is connected and configured, pressing any of the board
buttons should send characters to the host PC. Pressing num. lock should
also make the third LED toggle its state (on/off).
Atmel Corporation ©2008