This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TM4C1294KCPDT: USBDHIDGamepad

Part Number: TM4C1294KCPDT

Tool/software: TI C/C++ Compiler

Hi, my name is Humberto.

I am using a TM4C1294 to implement a HID gamepad device.
My gamepad has 20 buttons and 20 LEDs that I need to control according to some external software instructions.

Is it possible to use USBDHIDPacketRead() to receive a packet via USB in this case? Is there any other option?

Thanks,

Regards,

  • Hello Humberto,

    It may be? I am not sure what your host would require. That would define if it's possible. That's a very application specific question.

    As for other ideas, another option could be to use the USBDHIDGamepad API's available as part of the USB Lib.

    You should reference our Gamepad example located at [Install Path]\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c129x\usb_dev_gamepad for some other idea about to be implement your HID gamepad device which includes using the aforementioned USBDHIDGamepad API's.
  • Thanks  Jacobi

    I am using the Gamepad example, and I modified it according to the USBHIDGamepad API's ( USB lib ).
    However, this example only shows how to send the buttons status, and the USBDHIDGamepad API does't have any function that receives a report from the host.

    The gamepad will be connected to a windows tablet. 

    Is there a way to change my handler to acchieve it ?

  • Hello Humberto,

    You will need to add that functionality in yourself then. Again as mentioned before, this is an application specific concern.

    It looks like the HIDGamepadRxHandler has hooks in place in the form of case statements which are not used that you may be able to leverage as a starting point.

    We have a lot of documentation on HID Report's within our USB Library User's Guide, you should read that in detail: http://www.ti.com/lit/ug/spmu297d/spmu297d.pdf - that would be a very good starting point for you in terms of understanding what needs to be done.

    Section 2.19.2 Defining a Custom HID Gamepad Report should be of particular interest!