Skip to main content
Coconop
Associate
Nov 23, 2018 9:33 AM UTC
Solved

Does anyone have an example of USB-HID implementation with both IN and OUT endpoints ?

The USB-HID ST library comes with an example of Mouse device that I have adapted successfully.

However it only has a single Input endpoint to send reports to the Host.

I am mainly interested in OUT endpoint for communication Host to device.

Does anyone have already coded something similar ?

For example a mouse/Keyboard with LEDs feedback or Joystick with vibration feedback.

I cannot find any concrete example on the web...

This topic has been closed for replies.
Ben K
Ben KBest answer
Senior III
Nov 23, 2018 10:26 AM UTC

This library has proper HID class implementation:

https://github.com/IntergatedCircuits/USBDevice

Set the USBD_HID_OUT_SUPPORT to 1 in usbd_config.h to enable OUT endpoint support. When implementing the interface, you have to call USBD_HID_ReportOut() every time you want to receive data from the host. The SetReport callback will provide the received data.

5 replies

Ben K
Ben KBest answer
Senior III
Nov 23, 2018 10:26 AM UTC

This library has proper HID class implementation:

https://github.com/IntergatedCircuits/USBDevice

Set the USBD_HID_OUT_SUPPORT to 1 in usbd_config.h to enable OUT endpoint support. When implementing the interface, you have to call USBD_HID_ReportOut() every time you want to receive data from the host. The SetReport callback will provide the received data.

Coconop
CoconopAuthor
Associate
Nov 23, 2018 10:35 AM UTC

Hi Ben,

Thank you for this link, it seems to fit my needs indeed.

Amel NASRI
ST Technical Moderator
Nov 23, 2018 1:54 PM UTC

So, why don't you select @Ben K​ 's answer as the best one? :)

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Coconop
CoconopAuthor
Associate
Nov 23, 2018 2:10 PM UTC

I planned to do so, I was just waiting to check in details the code and also some potential other answers.

Sorry it is my 1st "contribution" to this community.