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.

[参考译文] USB 驱动程序 USB 控制器

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/677309/usb-driver-usb-controller

大家好

我遇到了一些问题。 我使用 TMS320F2837xD 和 v190版本的固件。  我需要在大容量器件上创建6个或更多端点。 指示 USB 库和 USB 控制器 支持多达16个端点的输入和相同的输出 。  但是    文件 usb.c 中的函数_USBIndexWrite 或_USBIndexRead 包含"assert" 、允许 我们 仅创建 4个端点。 我高亮显示它。

 \\param ui32Endpoint 是此写入的目标端点索引。

_USBIndexWrite (uint32_t ui32Base、uint32_t ui32Endpoint、
              uint32_t ui32IndexedReg、uint32_t ui32Value、uint32_t ui32Size)

   uint32_t ui32Index;

   //
   //检查参数。
   //
   断言(ui32Base == USB0_BASE);
   Assert ((ui32Endpoint == 0)||(ui32Endpoint == 1)||(ui32Endpoint == 2)||
          (ui32Endpoint == 3));
   assert ((ui32Size = 1)||(ui32Size = 2));

   //
   //保存旧索引以防它被使用。
   //
   ui32Index = HWREGB (ui32Base + USB_O_EPIDX);

   //
   //设置索引。
   //
   HWREGB (ui32Base + USB_O_EPIDX)= ui32Endpoint;

有人能评论一下吗? 那么、我是否删除了该限制? 或者是否 需要考虑一下?

谢谢你。

Andrii

大家好
我已经对文件 usb.c 进行了更多的调查、并发现了其他端点数量限制
限值为7个一般点 、在上一个示例中为4个点。 因此、我 不知道哪个点数是有效的。

USBEndpointStatus (uint32_t ui32Base、uint32_t ui32Endpoint)

   uint32_t ui32Status;

   //
   //检查参数。
   //
   断言(ui32Base == USB0_BASE);
   Assert ((ui32Endpoint == USB_EP_0)||(ui32Endpoint ==USB_EP_1)||
          (ui32Endpoint =USB_EP_2)||(ui32Endpoint =USB_EP_3)||
          (ui32Endpoint =USB_EP_4)||(ui32Endpoint =USB_EP_5)||
          (ui32Endpoint =USB_EP_6)||(ui32Endpoint =USB_EP_7));


USBHostEndpointStatusClear (uint32_t ui32Base、uint32_t ui32Endpoint、
                          uint32_t ui32Flags)

   //
   //检查参数。
   //
   断言(ui32Base == USB0_BASE);
   Assert ((ui32Endpoint == USB_EP_0)||(ui32Endpoint ==USB_EP_1)||
          (ui32Endpoint =USB_EP_2)||(ui32Endpoint =USB_EP_3)||
          (ui32Endpoint =USB_EP_4)||(ui32Endpoint =USB_EP_5)||
          (ui32Endpoint =USB_EP_6)||(ui32Endpoint =USB_EP_7));


USBHostEndpointDataToggle (uint32_t ui32Base、uint32_t ui32Endpoint、
                         bool bDataToggle、uint32_t ui32Flags)

   uint32_t ui32DataToggle;

   //
   //检查参数。
   //
   断言(ui32Base == USB0_BASE);
   Assert ((ui32Endpoint == USB_EP_0)||(ui32Endpoint ==USB_EP_1)||
          (ui32Endpoint =USB_EP_2)||(ui32Endpoint =USB_EP_3)||
          (ui32Endpoint =USB_EP_4)||(ui32Endpoint =USB_EP_5)||
          (ui32Endpoint =USB_EP_6)||(ui32Endpoint =USB_EP_7));

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

    让我来看看这个。 我不确定该器件上有多少个端点可用。

    我同意我们的文档和代码目前不一致。 我们将解决这个问题。

    我很快会回来的。

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

    F2837x 有32个端点。 16输入和16输出。 这与 TRM 一致。 您可以修改源代码以删除限制可配置的端点的断言。

    我们的 F2806x 器件只有6个端点。

    希望这对您有所帮助。

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