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.

TM4C129ENCPDT: Emulating USB HID Mouse on Tiva Board and Sending HID Reports through USB Hub Upstream

Part Number: TM4C129ENCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hi,

I'm currently working on a project where I aim to interface a mouse with a Tiva board through a USB hub. The mouse is connected to the downstream port of the hub, while the Tiva board is connected to the upstream port.

After configuring my Tiva board as a host using the usbhhidmouse.h & usbhhub.h libraries, I've successfully managed to receive mouse coordinates from the connected mouse. However, I'm now looking to take it a step further.

My goal is to emulate a USB HID mouse on the Tiva board and send HID reports over the same upstream connection of the hub. This way, the data can be transmitted to the downstream port, which is connected to a PC. Ultimately, I aim for my device to be recognized as an HID mouse by the PC.

Additionally, considering that the Tiva board is configured as a host for the mouse and hub to receive mouse coordinates, I'm curious if it's feasible to reconfigure the Tiva board as a device and send HID reports through the upstream of the hub.

I would appreciate any insights, tips, sample code or guidance on how to achieve this emulation and data transmission effectively through the hub.

Thank you in advance for your help!

  • Hi,

      We don't have an example for USB HID mouse device. But there is USB HID keyboard device example at C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\usb_dev_keyboard. Since both mouse and keyboard use the HID class, You can reference the keyboard example as a starting point and make needed modification for the mouse device. 

  • Hi charles, 

    Thank you for your response. 

    I've successfully managed to emulate a USB HID mouse on the Tiva board, so that aspect is covered. However, my current challenge revolves around connecting the mouse emulated Tiva board to the PC through a USB hub. The upstream of the hub is connected to the Tiva board, while one of the downstream ports is connected to the PC. Since I'm programming the USB stack of the Tiva board as a device, I'm seeking guidance on how to send the HID reports over the upstream connection of the USB hub. Any insights or assistance on this specific aspect would be greatly appreciated.

    Thank you for your support!

  • Hi,

      I'm not a USB expert. But my understanding is that  upstream USB port receives power (and data) and a downstream USB port provides power (and data) to devices connected to it. If the Tiva board enumerates as a USB HID device then you should connect it to the hub's downstream port while connecting the hub's upstream port to the PC because the PC is the host, isn't?