cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration of an HID (standard Joystick) via PC-Software

Gregster
Associate

Hello ST community,

I have a question regarding the HID functionality of an STM32 controller.

I have realised a (driverless!) joystick with an STM32 controller. So far everything works fine.
However, I would like to write additional PC software that can set some properties of my joystick from the PC side. For example, I would like to trigger a calibration of my axes or set the axis sensitivity or define the LED lighting (static!) of my joystick.

Do you have any tips on the best way to do this?

My thoughts:

- Custom HID class ?
Should I create a custom HID class with my own commands?
I had already found a good tutorial here on the ST site, but a type of communication for microcontroller-side calibration or communication with the controller for exchanging settings & data seems to be different?. This method would not make sense for a standard joystick?  [As far as I understand it]

- Serial USB connection ? (USB-CDC?)
Since the microcontroller can also be used for serial communication via USB:
Is it possible or useful to implement a serial communication in addition to the HID joystick functionality?

- another method?
Is there a better method than these two to realise this?
I would be grateful for any food for thought here. :)

Best regards

Greg

2 REPLIES 2
Pavel A.
Evangelist III

Implement so called "feature reports" to send commands from host to your HID device.

For Windows: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/hidsdi/nf-hidsdi-hidd_setfeature

(though docum refers to drivers, HidD_SetFeature() is usermode API. Here's a small simple example).

Thanks for the advice.
I will take a look at this. :)