USB Libraries Help > USB Device Libraries > USB Device Layer Library > Library Interface > g) Data Types and Constants > USB_DEVICE_INIT Structure
MPLAB Harmony USB Stack
USB_DEVICE_INIT Structure

USB Device Initialization Structure 

This data type defines the USB Device Initialization data structure. A data structure of this type should be initialized and provided to USB_DEVICE_Initialize.

C
typedef struct {
  SYS_MODULE_INIT moduleInit;
  unsigned int usbID;
  bool stopInIdle;
  bool suspendInSleep;
  INT_SOURCE interruptSource;
  INT_SOURCE interruptSourceUSBDma;
  void * endpointTable;
  uint16_t registeredFuncCount;
  USB_DEVICE_FUNCTION_REGISTRATION_TABLE * registeredFunctions;
  USB_DEVICE_MASTER_DESCRIPTOR * usbMasterDescriptor;
  USB_SPEED deviceSpeed;
  uint16_t queueSizeEndpointRead;
  uint16_t queueSizeEndpointWrite;
  SYS_MODULE_INDEX driverIndex;
  void * usbDriverInterface;
} USB_DEVICE_INIT;
Members
Members 
Description 
SYS_MODULE_INIT moduleInit; 
System module initialization 
unsigned int usbID; 
Identifies peripheral (PLIB-level) ID. The use of this parameter is

  • deprecated.

 

bool stopInIdle; 
If true, USB module will stop when CPU enters Idle Mode. The use of this

  • parameter is deprecated.

 

bool suspendInSleep; 
If true, USB module will suspend when the microcontroller enters sleep

  • mode. The use of this parameter is deprecated.

 

INT_SOURCE interruptSource; 
Interrupt Source for USB module. The use of this parameter is deprecated. 
INT_SOURCE interruptSourceUSBDma; 
Interrupt Source for USB DMA module. The use of this parameter is

  • deprecated.

 

void * endpointTable; 
Pointer to an byte array whose size is USB_DEVICE_ENDPOINT_TABLE_SIZE and who start address is aligned at a 512 bytes address boundary. The

  • use of this parameter is deprecated.

 

uint16_t registeredFuncCount; 
Number of function drivers registered to this instance of the USB device layer 
USB_DEVICE_FUNCTION_REGISTRATION_TABLE * registeredFunctions; 
Function driver table registered to this instance of the USB device layer 
USB_DEVICE_MASTER_DESCRIPTOR * usbMasterDescriptor; 
Pointer to USB Descriptor structure 
USB_SPEED deviceSpeed; 
Specify the speed at which this device will attempt to connect to the host. PIC32MX and PIC32WK devices support Full Speed only. PIC32MZ devices support Full Speed and High Speed. Selecting High Speed will allow the device to work at both Full Speed and High Speed. 
uint16_t queueSizeEndpointRead; 
Enter Endpoint Read queue size. Application can place this many Endpoint Read requests in the queue. Each Endpoint Read queue element would consume 36 Bytes of RAM. Value of this field should be at least 1. This is applicable only for applications using Endpoint Read/Write functions like USB Vendor Device. 
uint16_t queueSizeEndpointWrite; 
Enter Endpoint Write queue size. Application can place this many Endpoint Read requests in the queue. Each Endpoint Write queue element would consume 36 Bytes of RAM. Value of this field should be at least 1. This is applicable only for applications using Endpoint Read/Write functions like USB Vendor Device. 
SYS_MODULE_INDEX driverIndex; 
System Module Index of the driver that this device layer should open 
void * usbDriverInterface; 
Interface to the USB Driver that this Device Layer should use 
Remarks

This type is specific to implementation of the USB Device Stack API.