1

我正在尝试通过 LPC1769 微控制器中的批量传输来实现 USB 供应商特定的类。我有一个 USB 生物识别模块,提取了它的设备信息。因此,我配置了以下描述符。

const uint8_t USB_DeviceDescriptor[]={};
const uint8_t USB_ConfigDescriptor[]={};
const uint8_t USB_StringDescriptor[]={};

现在我的 USB 生物识别设备和我的 LPC1769 设备具有相似类型的设备信息(我已经在我的 Ubuntu PC 上使用此命令“lsusb -v”看到它)但是,当我将它插入 Windows 时,它应该属于 USB 类(Trident符号列表)在设备管理器中。USB 生物识别设备列在“通用串行总线控制器”下。

我找不到任何文档、流程图 谁能指导我如何在供应商特定类别中建立通信。

USB 生物识别设备信息

Bus 003 Device 023: ID 16d1:0407  
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x16d1 
  idProduct          0x0407 
  bcdDevice            0.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              300mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

我的 LPC1769 USB 设备信息

Bus 003 Device 018: ID 1fc9:2002 NXP Semiconductors 
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1fc9 NXP Semiconductors
  idProduct          0x2002 
  bcdDevice            1.00
  iManufacturer           1 
  iProduct                2 
  iSerial                 1 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              3 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1

提前谢谢你。

4

2 回答 2

1
 bEndpointAddress     0x01  EP 1 OUT
    bmAttributes            2
      Transfer Type            Bulk
      Synch Type               None
      Usage Type               Data
    wMaxPacketSize     0x0200  1x 512 bytes

LPC1769 仅支持 USB 全速,因此 Bulk EPwMaxPacketSize最大为 64 字节。只有高速设备支持 512 字节的 Bulk EP。

要操作“供应商特定”类 USB 设备,您可以使用特定内核驱动程序或LibUSB /WinUSB 作为驱动程序以及用户模式应用程序。

于 2015-08-06T18:45:25.533 回答
0

每当没有为特定 USB 设备(VID 和 PID)安装驱动程序时,它会在设备管理器中显示“?其他设备”。但是,就我而言,它列在“通信设备类”下,尽管我已将 USB 类协议更改为“供应商特定类”。为什么?驱动程序实例正在尝试使用相同的 VID 和 PID 进行映射。我已经改变了我与 USB 生物识别设备的相同之处。它显示在“通用串行总线控制器列表”中。

现在,您可以将其与您的 Android 选项卡与“Android Studio 平台”集成,有一个名为“UsbManager”的 API http://developer.android.com/reference/android/hardware/usb/UsbManager.html

感谢您的参与。

于 2015-08-11T13:19:04.707 回答