API Interface of the USB Device Component.
More...
|
| Core |
| Initialize and manage the USB Device Core statically and at run-time.
|
|
| Device Class |
| Implement application specific behavior of USB Device classes.
|
|
| Data Types |
| Public Data Types used by USB Device component.
|
|
| Debug Events |
| Event Recorder functions.
|
|
API Interface of the USB Device Component.
Refer to USB Device for more information of the USB Device Component.
USB Device Threads and Function Calls
Each USB Device instance has a separate configuration file USBD_Config_n.h whereby
- class is the short name of the device class (ADC, CDC, HID, MSC).
- n refers to the instance number of the USB Device Class.
For example, you might have 2 mass storage device instances as a part of the device. The configuration files will have the names USBD_Config_MSC_0.h and USBD_Config_MSC_1.h. The user code will be placed in the files USBD_User_MSC_0.c and USBD_User_MSC_1.c.
- Note
- Within template files, the place-holder for a device instance is marked %Instance%. Please replace %Instance% with the corresponding device class instance number.
A configuration file defines:
- The assignment of the USB Device to a certain USB Driver, which interfaces to an USB Controller in the microcontroller.
- The USB Transfer Rate (Low-/Full- or High-speed) of the USB Device.
- Device Settings configure:
- Maximum Endpoint 0 Packet Size
- Vendor ID: sets the vendor identification number and is required for any end product. The Vendor ID gets assigned by the USB-IF.
- Attention
- It is not permitted to use the pre-defined Vendor ID (0xC251) for final products.
- Product ID: every device variant needs an unique Product ID so that the USB Host can handle drivers for the device.
- Device Release Number: is typically shown in the USB Host computer as "Firmware Revision". The number is interpreted as "binary coded decimal", meaning that 0x0101 will be shown as firmware revision 1.01.
- Configuration Settings define:
- Power: specifies whether an USB Device is bus-powered or not.
- Remote Wakeup: specifies whether an USB Device is capable of sending wake-up signal to the USB Host.
- Maximum Power Consumption: if the USB Device is bus-powered, then the maximum power consumption must be specified. The USB Host uses this information to stay within the power limits of the USB bus.
- String Settings specify:
- Language ID: sets the language.
- Manufacturer String: defines the manufacturer of the USB Device
- Product String: defines the name of the USB Device
- Serial Number String: specifies if USB device will contain serial number string
- Default value: specifies the default serial number of an USB device (can be empty)
- Maximum Length (in characters): specifies the maximum number of serial number string characters that can be set during run-time
These settings are used to create Device Descriptor, Configuration Descriptor, and Interface Descriptor.