Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ASF USB Device HID Multi-touch

Human interface on SAM4S-EK:

Introduction

This example shows how to implement a USB Device HID Multi-touch on Atmel MCU with USB module.

Startup

The example uses the buttons or sensors available on the board to simulate a standard multi-touch. After loading firmware, connect the board (EVKxx,Xplain,...) to the USB Host. When connected to a USB host system this application provides a HID multi-touch with two points application in the Windows 7 operating systems. This example uses the native HID driver for these operating systems.

  • Led 0 (D2) blinks when USB host has checked and enabled HID generic interface
  • Push button 0 (SW0) is used to draw line in paint application on Windows O.S
    • Run the application and connect usb to he PC first.
    • Open paint and push button 0 continuously, then two lines painted.

About example

The example uses the following module groups:

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