Human interface on UC3C_EK :
Introduction
This example shows how to implement a USB dual mode (device and host) HID Mouse on Atmel MCU with USB module.
Startup
In device mode, the example uses the buttons or sensors available on the board to simulate a standard mouse. After loading firmware, connect the board to the USB Host. When connected to a USB host system this application provides a mouse application in the Unix/Mac/Windows operating systems. This example uses the native HID driver for these operating systems.
In host mode, after loading firmware, connect the board to a USB device mouse.
- PWR led is on when power present
- Led 0 is on in host mode (when USB OTG cable is pluged)
- device mode:
- Led 1 is on when USB line is in IDLE mode, and off in SUSPEND mode
- Led 2 blinks when USB host has checked and enabled HID mouse interface
- Mouse buttons are not linked.
- The PB0 and PB1 are used to move mouse on the axe X.
- host mode:
- Led is on when Vbus is present
- Led 1 is continuously on when a device is connected
- Led 1 blinks when the device is enumerated and USB in idle mode
- Led 2 is on when a HID mouse button is pressed
- Led 3 is on when the mouse move
- Switch PB0 allows to enter the device in suspend mode with remote wakeup feature authorized
- Only PB1 button can be used to wakeup USB device in suspend mode
About example
The example uses the following module groups:
- Basic modules: Startup, board, clock, interrupt, power management
- USB device and host stack and HID modules:
services/usb/
services/usb/udc/
services/usb/uhc/
services/usb/class/hid/
services/usb/class/hid/device/mouse/
services/usb/class/hid/host/mouse/
- Specific implementation:
- main.c,
initializes clock
initializes interrupt
manages UI
- specific implementation for each target "./examples/product_board/":
- conf_foo.h configuration of each module
- ui.c implement of user's interface (buttons, leds)