Skip to main content
SNorm.1
Associate III
Sep 8, 2021 9:38 AM UTC
Solved

Difference between the two USB HID device classes in STM32CubeMX?

I want to use the STM32CubeMX code generation tool to generate the USB HID device class driver code, I found that in the USB DEVICE drop-down list box options, there are two HID device class options to choose from, are Custom Human Interface Device Class and Human Interface Device Class, I checked the USB official web list of USB device classes, found that only the Human Interface Device Class, a standard HID class devices. So, what type of HID device is the Custom Human Interface Device Class in the tool? Is it a user-defined HID class device and what are the similarities and differences between it and a standard HID class device? Is there any information available on this?

0693W00000DmWB4QAN.png

This topic has been closed for replies.
Pavel A.
Pavel A.Best answer
Sep 9, 2021 12:33 AM UTC

The "Custom HID" class is a limited example of a HID compatible device which is not a keyboard or mouse.

The other "HID class" is example of a joystick/mouse device.

https://github.com/STMicroelectronics/stm32_mw_usb_device/blob/5af065de854f4573511e023aa76c3462c60a0a21/Class/HID/Src/usbd_hid.c#L18

Feel free to extend and modify these examples for your needs.

For more functionality and more standard classes, consider USB libraries from various software vendors or google for projects on github.

--pa

2 replies

Pavel A.
Pavel A.Best answer
Sep 9, 2021 12:33 AM UTC

The "Custom HID" class is a limited example of a HID compatible device which is not a keyboard or mouse.

The other "HID class" is example of a joystick/mouse device.

https://github.com/STMicroelectronics/stm32_mw_usb_device/blob/5af065de854f4573511e023aa76c3462c60a0a21/Class/HID/Src/usbd_hid.c#L18

Feel free to extend and modify these examples for your needs.

For more functionality and more standard classes, consider USB libraries from various software vendors or google for projects on github.

--pa

SNorm.1
SNorm.1Author
Associate III
Sep 13, 2021 9:27 AM UTC

Thank you very much for your reply! I get it now.