USB Libraries Help > USB Device Libraries > USB Device Layer Library > Files > usb_device.h
MPLAB Harmony USB Stack
usb_device.h

Microchip Technology Inc.

File Name

usb_device.h

Description

USB Device Layer Interface Definition 

This header file contains the function prototypes and definitions of the data types and constants that make up the interface to the USB device layer. This application should include this file if it needs to use the USB Device Layer API.

Enumerations
 
Name 
Description 
 
Enumerated data type that identifies the USB Device Layer Client Status. 
 
USB Device Layer Control Transfer Status Stage flags. 
 
Enumerated data type identifying results of a control transfer. 
 
USB Device Layer Events. 
 
Enumerated data type that identifies if the device is self powered or bus powered . 
 
Enumerated data type that identifies if the remote wakeup status of the device. 
 
USB Device Layer Results Enumeration 
 
Enumerated data type that identifies the USB Device Layer Transfer Flags. 
Functions
 
Name 
Description 
 
Informs the client of the current USB device configuration set by the USB host. 
 
Informs the client of the current operation speed of the USB bus. 
 
This function will attach the device to the USB. 
 
Returns the client specific status. 
 
Closes an opened handle to an instance of the USB device layer. 
 
Receives data stage of the control transfer from host to device. 
 
Sends data stage of the control transfer from device to host. 
 
Initiates status stage of the control transfer. 
 
De-initializes the specified instance of the USB device layer. 
 
This function will detach the device from the USB. 
 
Disables a device endpoint. 
 
Enables a device endpoint. 
 
Returns true if the endpoint is enabled. 
 
This function returns the stall status of the specified endpoint and direction. 
 
Reads data received from host on the requested endpoint. 
 
This function stalls an endpoint in the specified direction. 
 
This function clears the stall on an endpoint in the specified direction. 
 
This function cancels a transfer scheduled on an endpoint. 
 
This function requests a data write to a USB Device Endpoint. 
 
USB Device Layer Event Handler Callback Function set function. 
 
Creates and initializes an instance of the USB device layer. 
 
Returns true if the device is in a suspended state. 
 
Opens the specified USB device layer instance and returns a handle to it. 
 
Sets power state of the device. 
 
This function will start the resume signaling. 
 
This function will start a self timed Remote Wake-up. 
 
Gets the "Remote wake-up" status of the device. 
 
This function will stop the resume signaling. 
 
Returns the current state of the USB device. 
 
Provides the current status of the USB device layer 
 
USB Device layer calls all other function driver tasks in this function. It also generates and forwards events to its clients. 
Macros
 
Name 
Description 
 
This is macro _USB_DEVICE_H. 
 
Device Layer Event Handler Function Response Type. 
 
Constant that defines the value of an Invalid Device Handle. 
 
USB device layer index definitions. 
 
This is macro USB_DEVICE_INDEX_1. 
 
This is macro USB_DEVICE_INDEX_2. 
 
This is macro USB_DEVICE_INDEX_3. 
 
This is macro USB_DEVICE_INDEX_4. 
 
This is macro USB_DEVICE_INDEX_5. 
 
Constant that defines the value of an Invalid Device Endpoint Data Transfer Handle. 
Structures
 
Name 
Description 
 
USB Device Set Configuration Event Data type. 
 
USB Device Layer Endpoint Read and Write Complete Event Data type. 
 
USB Device Layer Endpoint Read and Write Complete Event Data type. 
 
USB Device Start Of Frame Event Data Type 
 
USB Device Synch Frame Event Data type. 
 
USB Device Function Registration Structure 
 
USB Device Initialization Structure 
 
USB Device Master Descriptor Structure. 
Types
 
Name 
Description 
 
Pointer to an array that contains pointer to configuration descriptors. 
 
USB Device Layer Event Handler Function Pointer Type 
 
Device Layer Event Handler function return type. 
 
Data type for USB device handle. 
 
Pointer to an array that contains pointer to string descriptors. 
 
Data type for USB Device Endpoint Data Transfer Handle.