descriptor_table_mini.py 777 B

12345678910111213141516171819202122232425
  1. from descriptor_generator import *
  2. device.set("bcdUSB", USB_BCD_11)
  3. device.set("bMaxPacketSize0", 16)
  4. device.set("bcdDevice", 0x0100)
  5. device.set("iProduct", u"CNC Remote Control BOOT")
  6. config0 = Configuration(device)
  7. config0.set("bmAttributes", USB_CONFIG_ATT_ONE)
  8. config0.set("bMaxPower", 400 // 2)
  9. interface0 = Interface(config0)
  10. interface0.set("bAlternateSetting", 0)
  11. interface0.set("bInterfaceClass", USB_CLASS_VENDOR_SPEC)
  12. ep2in = Endpoint(interface0)
  13. ep2in.set("bEndpointAddress", 2 | USB_ENDPOINT_IN)
  14. ep2in.set("bmAttributes", USB_ENDPOINT_XFER_BULK)
  15. ep2in.set("wMaxPacketSize", 64)
  16. ep2out = Endpoint(interface0)
  17. ep2out.set("bEndpointAddress", 2 | USB_ENDPOINT_OUT)
  18. ep2out.set("bmAttributes", USB_ENDPOINT_XFER_BULK)
  19. ep2out.set("wMaxPacketSize", 64)