Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ASF USB host HID mouse

Human interface on EVK1100 :

Introduction

This example shows how to implement a USB host HID mouse on Atmel MCU with USB module. The application note AVR4953 provides information about this implementation.

Startup

After loading firmware, connect the board (EVKxx,Xplain,...) to a USB device mouse.

  • PWR led is on when power present
  • Led 0 is on when USB OTG cable is plugged
  • Led 1 is on when Vbus is present
  • Led 2 is on when a device is connected
  • Led 3 blinks when the device is enumerated and USB in idle mode
  • Led 4 is on when the mouse left button is down
  • Led 5 is on when the mouse right button is down
  • Led 6 is on when the mouse move
  • Led 7 is on when a bad Vbus level has been detected
  • Switch PB0 allows to enter the device in suspend mode
  • Switch PB1 allows to enter the device in suspend mode with remote wakeup feature authorized
  • Only Push joystick button can be used to wakeup USB device in suspend mode

Note: On board the LED labels are incremented of one. E.g. Led0 in software corresponding at Led1 label on board.

About example

The example uses the following module groups:

  • Basic modules: Startup, board, clock, interrupt, power management
  • USB host stack and HID modules:
    services/usb/
    services/usb/uhc/
    services/usb/class/hid/
    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)