USB Libraries Help > USB Device Libraries > USB Device Layer Library > Introduction
MPLAB Harmony USB Stack
Introduction

The MPLAB Harmony 3 USB Device Layer Library (also referred to as the Device Layer) is part of the MPLAB Harmony 3 USB Device Stack. Within the USB Device Stack, the Device Layer implementation is independent of the USB Controller Hardware. It responds to enumeration requests from the Hosts. It receives control transfers from the Host and responds to these control transfers in case of standard device requests. It dispatches all other control transfers to function drivers and the application. It provides the application and function drivers with API routines that allow them to respond and complete a control transfer, with a facility to defer the responses to a control transfer. The Device Layer also provides the application with events and functions that allow the application to track the state of the device. 

The Device Layer plays the role of a system in the MPLAB Harmony USB Device Stack. It initializes USB device function drivers which contained in the active configuration. The state machines of these function drivers is maintained by the Device Layer i.e. the Device Layer invokes the function driver tasks routines from within its own task routine. The Device Layer thus treats the function drivers as sub modules. 

The device_layer features the following:

  • Supports both USB Full-Speed and Hi-Speed operation.
  • Based on a modular and event-driven architecture.
  • Hardware independent architecture. API does not change across microcontrollers.
  • Supports the SAME7x and SAMD2x families of microcontrollers.
  • Supports composite USB devices.
  • Supports CDC, HID, MSD, Printer, Audio v1.0. Audio v2.0 and Generic/Vendor Devices.
  • All functions are non-blocking.
  • Operates readily with a RTOS.
  • Designed to integrate readily with other MPLAB Harmony middleware.
  • Completely interrupt driven.
  • Requires minimal application intervention while maintaining the USB Device state.
  • Allows implementation of a multi-configuration USB device.
  • In case of multiple UBS controllers, allows itself to be instantiated more than once.