cancel
Showing results for 
Search instead for 
Did you mean: 

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

Coconop
Associate II

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...

1 ACCEPTED SOLUTION

Accepted Solutions
Ben K
Senior III

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.

View solution in original post

5 REPLIES 5
Ben K
Senior III

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
Associate II

Hi Ben,

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

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 Accept as Solution on the reply which solved your issue or answered your question.

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.

Welcome on-board, and we look forward to see more contributions from your side.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.