Configuration of the USB Device HID Class.
Configuration of the USB Device HID Class.
This configuration file defines:
- The assignment of the HID class to the USB Device instance.
- USB Endpoint assignments for the HID class with parameters for Full/Low-speed and High-speed communication.
- Class Settings for the Interface Descriptor.
These settings are used to create the Interface Descriptor and Endpoint Descriptor of the related USB Device Class. It is important that the settings match the application specific behavior in the related C source file USBD_User_HID_n.c.
HID Class Configuration File
The USB Device HID Class configuration file USBD_Config_HID_n.h contains the following settings:
- Assign Device Class to USB Device # selects USB Device that is used for this Device Class instance.
- Interrupt Endpoint Settings
- Interrupt IN Endpoint Settings
- Interrupt IN Endpoint Number sets the number of the endpoint to be used. Conflicting settings are flagged by compile-time error messages.
- Endpoint Settings
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange. This setting is available for low-/full- and high-speed endpoints.
- Additional transactions per microframe specifies additional transactions per microframe. This setting is available only for high-speed endpoints.
- Endpoint polling Interval (in xxx) specifies the frequency of requests initiated by USB Host for getting data. This setting is available for low-/full- and high-speed endpoints.
- Interrupt OUT Endpoint Settings
- Interrupt OUT Endpoint Number sets the number of the endpoint to be used. Conflicting settings are flagged by compile-time error messages.
- Endpoint Settings
- Maximum Endpoint Packet Size (in bytes) specifies the physical packet size used for information exchange. This setting is available for low-/full- and high-speed endpoints.
- Additional transactions per microframe specifies additional transactions per microframe. This setting is available only for high-speed endpoints.
- Endpoint polling Interval (in xxx) specifies the frequency of requests sent by USB Host for setting data. This setting is available for low-/full- and high-speed endpoints.
- Human Interface Device Class Settings
- HID Interface String is used to create USB Descriptors.
- Number of Input Reports is used for memory allocation in the USB component.
- Number of Output Reports is used for memory allocation in the USB component.
- Maximum Input Report Size (in bytes) is used for memory allocation in the USB component.
- Maximum Output Report Size (in bytes) is used for memory allocation in the USB component.
- Maximum Feature Report Size (in bytes) is used for memory allocation in the USB component.
- Use User Provided HID Report Descriptor: if checked, you need to provide HID Report Descriptor in an array: const uint8_t usbd_hid0_report_descriptor[]
- User Provided HID Report Descriptor Size (in bytes) : is used for memory allocation in the USB component.
- OS Resources Settings
- Human Interface Device Class Thread Stack Size is used for memory allocation in the USB component.
- The default Human Interface Device Class Thread priority is osPriorityAboveNormal. This priority can be changed by changing USBD_HIDn_THREAD_PRIORITY define in this configuration file. This priority needs to be high enough so that USB Stack can react to USB events in a timely manner. Due to this requirement it is recommended to keep this setting at default.