Jump to main content

##

# 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_NUMBER | Number of Device Layer instances to provisioned in the application.
USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED | Specifies the combined endpoint queue depth in case of a vendor USB device implementation.
USB_DEVICE_SET_DESCRIPTOR_EVENT_ENABLE | Enables the Device Layer Set Descriptor Event.
USB_DEVICE_SOF_EVENT_ENABLE | Enables the Device Layer SOF event.
USB_DEVICE_SYNCH_FRAME_EVENT_ENABLE | Enables the Device Layer Synch Frame Event.
USB_DEVICE_BOS_DESCRIPTOR_SUPPORT_ENABLE | Specifies if the Device Layer should process a Host request for a BOS descriptor.
USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT | Specifies if the USB Controller Driver must be initialized explicitly as opposed to being initialized by the Device Layer.
USB_DEVICE_EP0_BUFFER_SIZE | Buffer Size in Bytes for Endpoint 0.
USB_DEVICE_STRING_DESCRIPTOR_TABLE_ADVANCED_ENABLE | Specifying this macro enables the Advanced String Descriptor Table Entry Format.
USB_DEVICE_TRANSFER_HANDLE_INVALID | Constant that defines the value of an Invalid Device Endpoint Data Transfer Handle.
Configuration on MCC | This section describes the symbols available in the MCC that can be configured.