This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB custom (Vendor-Defined) HID device

Hi,

Is there a usb hidapi sample code for nrf52840 somewhere?

I know that there is a sample code of usbd_cdc_acm.
Using the HIDAPI library link below , It will be beneficial if the device is recognized as Vendor-Defined HID devices.
 It is no longer need a device driver.
 In addition, It is  not have to deal with changing port numbers.


http://www.signal11.us/oss/hidapi/

  • Hello,

    For  Vendor-Defined HID services, I believe you would still need a driver, if it is not one of the standard HID devices (mouse, keyboard, gaming controller, etc). What sort of device are you intending to make?

    Best regards,

    Edvin

  • Hi edvin,

    Thank you for your response.

    with my product already, it can be realized with a driver's unnecessary with a microcomputer manufactured by another vendor.

    The Host OS standard driver will be installed automatically.

    Although the explanation may not be sufficient, it can be realized by describing the descriptor.
    Interface descriptor->bInterfaceClass 0x03(HID)
    Interface descriptor->bInterfaceSubClass 0 (none)
    ReportDescriptor->Usage Page 0x06, 0x00, 0xff, (Vendor Defined)
    ReportDescriptor->Usage Page0x09, 0x01, (Vendor Defined)

    I am assuming an application that creates a host PC application and uses nrf 52840 as a gateway.
    The host PC application communicates with hidapi.dll simply using 1OUT endpoint and 1IN endpoint.


    Best regards,

    junichiro

  • Hello Junichiro,

    I think I understand. So if your question is whether there are any examples that can show the use of the HIDAPI examples. I assume that you mean HID over BLE, is that correct?

    In that case I would recommend you to check out the ble_app_hids_ examples, so one of the following:

    SDK15.2.0\examples\ble_peripheral\ble_app_hids_keyboard

    SDK15.2.0\examples\ble_peripheral\ble_app_hids_mouse

    And change the HID service to match your application in hids_init() in main.c.

    Best regards,

    Edvin

  • Hello Edvin,

    thanks,

    but , Your understanding is wrong, whether my explanation was missing.

    I'd like use USB-device Peripheral on nrf52840 as a Generic HID class, not over BLE.

    The one that is closest to what I want to achieve in the sample code that is currently published is the project below but it is not the correct answer.

    nRF5_SDK_15.2.0_9412b96\examples\peripheral\usbd_hid_generic

    Best regards,

    junichiro

  • junichiro okabe said:

    The one that is closest to what I want to achieve in the sample code that is currently published is the project below but it is not the correct answer.

    nRF5_SDK_15.2.0_9412b96\examples\peripheral\usbd_hid_generic

     

    "Not the correct answer"? Can you please specify what you mean?

    What exactly is it that you are going to make?

     BR,

    Edvin

Related