USB Component
Version 6.17.0
MDK Middleware for USB Device and Host Communication
|
The Custom Class for USB Host has two use cases:
Supporting Custom or Standard Class Devices requires the USB Host to be aware of the specific Class. On a PC, it is easy to add Class support by simply installing the required driver. However, in an embedded system this is not possible.
The Custom Class are a starting point for adding support for any USB Device Class. Furthermore, all Class Specific Requests need to be handled by the application running on the USB Host system. For more information on these requests, please consult the USB-IF Device Class Documents. The user code template file USBH_User_CustomClass.c contains all the functions that require adaptation.
The number of concurrent Custom Class Devices in a system can be configured using the USBH_Config_CustomClass.h configuration file.
The Custom Class for USB Device has two use cases:
The Custom Class gives full control of the USB handling. It is designed to react on any kind of event on any of the assigned endpoints and to handle any control message that may reach the system. The application has the full capability of dealing with control messages for whatever USB Device class. Message handling control can be taken over from the USB Device Core. The user code template file USBD_User_Device.c contains all functions used for Device level Control Endpoint 0 (STANDARD, CLASS and VENDOR requests) message interception and handling, whereas file USBD_User_CustomClass.c contains all the functions used for Custom Class Control Endpoint 0 CLASS requests and Custom Class endpoint events handling.
To create the Custom Class the configuration file providing up to four interfaces with up to 8 endpoints has been provided.
Every USB Device requires certain descriptors. The following list is not complete but gives an impression about the various descriptors that may be required:
The necessary descriptors are automatically generated by the USB Middleware Component from the Class, Subclass, and Protocol Codes and the Interface String specified in the USBD_Config_CustomClass_n.h file. The page USB Descriptors provides more information on the topic.