Skip to main content
Graduate
March 23, 2023
Solved

Is normal CDC like communication possible when using HID?

  • March 23, 2023
  • 3 replies
  • 1487 views

Hey all,

I would like to make a HID device which would have output options configured by computer, I thought I would use same USB to feed the config to STM, But I cant seem to find a clear answer if it is even possible to send data to USB HID, like you do with CDC.

If anyone has clear answer or can point me towards documentation/example for that, I'd appreciate it.

    This topic has been closed for replies.
    Best answer by Lubos KOUDELKA

    Here seems to be the easiest option composite device - first class will be your HID keyboard, second class would serve for switching keyboard modes from host device, could be custom HID as well.

    3 replies

    ST Employee
    March 23, 2023

    Hi,

    you may check following guidance

    https://www.youtube.com/watch?v=3JGRt3BFYrM&list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&index=16

    But honestly right now I don't see any significant advantage compared to CDC. Could you please share why you want to prefer HID over CDC?

    Super User
    March 23, 2023

    HID devices are easier to recognize (vs. multiple COM ports) by software.

    The modern Windows has .net API to help with this.

    Graduate
    March 23, 2023

    Hey Lubos, Thanks for your answer, I want to use HID because I want my device to act as a keyboard when connected to pc. As far as I know, HID is the only way to do it (?).

    ST Employee
    March 24, 2023

    Here seems to be the easiest option composite device - first class will be your HID keyboard, second class would serve for switching keyboard modes from host device, could be custom HID as well.