Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ASF USB Device Vendor Example

Human interface on SAM4S-EK:

Introduction

This example shows how to implement a USB Device implementing Vendor Class on Atmel MCU with USB module.

Startup

The example uses a vendor class which implements a loopback on all endpoints types: control, interrupt, bulk and isochronous. After loading firmware, connect the board (EVKxx,Xplain,...) to the USB Host. A Host application developed on libusb library is provided with application note AVR4901.

Note
When the application is connected for the first time to the PC, the operating system will detect a new peripheral:
  • This will open a new hardware installation wizard on Windows operating systems.
  • Choose "No, not this time" to connect to Windows Update for this installation
  • click "Next"
  • When requested to search the INF file, browse the avr4901\ folder provided package of the AVR4901 http://ww1.microchip.com/downloads/en/appnotes/doc8481.pdf application note.
  • click "Next"
  • Led 0 (D2) blinks when USB host has checked and enabled vendor interface
  • Led 1 (D3) is on when loopback is running

About example

The example uses the following module groups:

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