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.

Using Tivaware USB Library to implement a USB Custom HID host

A 3rd party developer/contractor has written a API for communicating with a custom USB HID device for desktop applications. The sources were written in C. I could generalize this API as Business Logic + Communication. In this post Business Logic is abbreviated as BL and Communication Interface as COMM to avoid repetition and simplicity

The developer implemented the COMM part of the API using HIDAPI. Now I have a task to implement this whole API for TM4C Microcontroller using the IoT Evaluation Board.

Because the BL is way too complex and pointless to rewrite from scratch. Therefore, I thought it would be beneficial to just reuse the BL and get away by implementing the correct COMM/communication interface. The COMM endpoints of the API boils down to the following function calls

xx_usb_api_open()
xx_usb_api_close()
xx_usb_api_read()
xx_usb_api_write()

HIDAPI functions like hid_open(), hid_write() are called respectively in the above functions. Could anyone point me in the right direction as to how I can replace HIDAPI in the above functions with Tivaware USB Library ? How I configure USB Library for this scenario (like modes, callbacks) ?

Currently, I have no other option but to RT*M which seems to be way too complicated for my skill set. (Tivaware USB Library)

The example projects are also not easy to understand and do not relate well for my scenario. For example there are projects where a keyboard or mouse can be connected to the dev board and see the output on LCD screen (Seems unidirectional). However, in my application the communication is bidirectional.

Any help or pointers to the right direction would be appreciated :)

  • As of now, I started reading the Tivaware USB Driver Guide and understood that I should be using usbhhid. Instantiate a driver tHIDInstance with tHIDSubClassProtocol = eUSBHHIDClassVendor. Am I in the right direction ?

    I really wish there was an example for custom vendor / product id based HID devices ? If there is one, could anyone link it in this thread ?

  • Hello Raja,

    Let us first get the facts: The HID examples in TivaWare are based out of easy to acquire devices or which does not require something that may incur setup requirements on every user trying to emulate them.

    Now the library that you have is not visible to us at all (and even if it is then it is out of the USBLIB format). Having access to it to understand how each of the API is working is an intense and time consuming task. I would suggest checking with the 3rd party developer.

    Regards
    Amit