2.2.3 Configuring the Library

The USB Device Layer initializes and configures the USB Controller Driver ( the driver that manages the USB peripheral when operating as device) and maintains its task routine. For completeness, the following table lists the configuration macros that are needed by the USB Controller Driver. These macros should be defined in system_config.h file along with the Device Layer Configuration macros.

Macros
Name Description
USB_DEVICE_INSTANCES_NUMBERNumber of Device Layer instances to provisioned in the application.
USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINEDSpecifies the combined endpoint queue depth in case of a vendor USB device implementation.
USB_DEVICE_SET_DESCRIPTOR_EVENT_ENABLEEnables the Device Layer Set Descriptor Event.
USB_DEVICE_SOF_EVENT_ENABLEEnables the Device Layer SOF event.
USB_DEVICE_SYNCH_FRAME_EVENT_ENABLEEnables the Device Layer Synch Frame Event.
USB_DEVICE_BOS_DESCRIPTOR_SUPPORT_ENABLESpecifies if the Device Layer should process a Host request for a BOS descriptor.
USB_DEVICE_DRIVER_INITIALIZE_EXPLICITSpecifies if the USB Controller Driver must be initialized explicitly as opposed to being initialized by the Device Layer.
USB_DEVICE_EP0_BUFFER_SIZEBuffer Size in Bytes for Endpoint 0.
USB_DEVICE_STRING_DESCRIPTOR_TABLE_ADVANCED_ENABLESpecifying this macro enables the Advanced String Descriptor Table Entry Format.
USB_DEVICE_TRANSFER_HANDLE_INVALIDConstant that defines the value of an Invalid Device Endpoint Data Transfer Handle.
Configuration on MCCThis section describes the symbols available in the MCC that can be configured.