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.

[参考译文] MSP432E401Y:USB HID Gamepad 无法发送数据

Guru**** 2387830 points
Other Parts Discussed in Thread: MSP432E401Y
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1520506/msp432e401y-usb-hid-gamepad-not-sending-data

器件型号:MSP432E401Y

工具/软件:

尊敬的 E2E:

我们正在尝试使用创建 USB gamepad 设备 MSP432E401Y LaunchPad

虽然 SDK 中没有专用的游戏示例、但我们usbdhidgamepad.c/h在中找到了 MSP432E4 SimpleLink SDK 并且正在尝试使用它们。 我们对usb_hid_sensor_device_MSP_EXP432E401Y_tirtos_ccs示例进行了如下修改:

  • 已将传感器驱动程序文件替换为 usbdhidgamepad.c/h

  • initsendReport将传感器和功能更换为 Gamepad 驱动程序的传感器和功能

  • 进行了修改sensorTaskFxn以填充tGamePadReport结构、包括 X/Y/Z 轴和按钮的虚拟/递增值

  • 更新.syscfg为:

    • 使用 gamepad HID 报告描述符() g_pui8GameReportDescriptor

    • 将描述符大小设置为 46

将工程刷写到 LaunchPad 后、 WebHID Explorer 将器件识别 为具有以下描述符的游戏手柄:

productName: Gamepad Example
vendorId:    0x2047 (8263) Texas Instruments Incorporated (MSP430 Group) 
productId:   0x0100 (256)
opened:      true
collections[0]
  Usage: 0001:0005 (Generic Desktop > Gamepad)
  Input reports: 0x01
Input report 0x01
  8 bits (bits 0 to 7)
    Data,Var,Abs
    Usage: 0001:0030 (Generic Desktop > X)
    Logical bounds: -127 to 127
  8 bits (bits 8 to 15)
    Data,Var,Abs
    Usage: 0001:0031 (Generic Desktop > Y)
    Logical bounds: -127 to 127
  8 bits (bits 16 to 23)
    Data,Var,Abs
    Usage: 0001:0032 (Generic Desktop > Z)
    Logical bounds: -127 to 127
  8 bits (bits 24 to 31)
    Data,Var,Abs
    Usage: 0009:0001 (Button Button 1)
    Logical bounds: 0 to 1

不过、 似乎没有发送输入数据 发送到主机。 游戏手柄是可见的、但值保持为0、并且看不到更新、这与传感器示例不同、传感器示例在刷写后立即开始发送 HID 报告。

请团队成员查看项目(随附)并告诉我们:

  • 要获取默认的游戏加载驱动程序以发送 HID 输入报告、还需要做什么?

  • 是否需要通过 USB 触发/报告与传感器示例不同的数据?

我们希望得到任何指导或建议来帮助您实现这一目标、以便我们可以继续构建我们的自定义游戏模板逻辑。

提前感谢!

e2e.ti.com/.../usb_5F00_hid_5F00_sensor_5F00_device_5F00_MSP_5F00_EXP432E401Y_5F00_tirtos_5F00_ccs.zip

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    有一个适用于 TM4C129的 USB 游戏手柄示例。 请从 https://www.ti.com/tool/SW-TM4C 下载用于 TM4C 的 TivaWare SDK。 下载后、您可以在 C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\dk-tm4c129x\usb_dev_gamepad 处找到 gamepad 示例。 您可以参考示例。 TM4C129和 MSP432E 是相同的芯片、共享同一个 USB 库。