Skip to main content
Coconop
Associate
November 23, 2018
Solved

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

  • November 23, 2018
  • 2 replies
  • 1800 views

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.
Best answer by Ben K

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.

2 replies

Ben K
Ben KBest answer
Senior III
November 23, 2018

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
November 23, 2018

Hi Ben,

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

Amel NASRI
Technical Moderator
November 23, 2018

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
November 23, 2018

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.