Microchip® Advanced Software Framework

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

Human interface on SAML21-XPlain:

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"
  • LED0 blinks when USB host has checked and enabled Vendor interface
  • LED0 is on when
    • USB is in IDLE mode and Vendor interface is not enabled by Host
    • 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)