usb_desc.conf 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # -*- perl -*-
  2. #
  3. # Invoked from usbdescgen.pl
  4. #
  5. usb_languages('en_US', 'sv_SE');
  6. my $vendor_id = 0x1d50;
  7. my $device_id = 0x6149;
  8. my $version_id = 0x0100;
  9. my $serial = usb_serial('?' x 16);
  10. my $manufacturer = usb_string('' => 'Peter & Per');
  11. my $product = usb_string('' => 'MAX80 I/O card for ABC');
  12. my $mgmt_if, $data_if;
  13. usb_device {
  14. usb_desc('device',
  15. word(0x101), # USB version
  16. usb_class('cdc'), # Communications device class
  17. byte(8), # Max packet size on endpoint 0
  18. word($vendor_id), word($device_id), word($version_id),
  19. $manufacturer, $product, $serial,
  20. usb_children # Configuration count
  21. ),
  22. usb_dset {
  23. usb_desc('configuration',
  24. usb_totallen, # Total length for this dset
  25. usb_children, # Number of interfaces
  26. usb_index, # Configuration index
  27. usb_string(), # Text description (empty)
  28. byte(0xc0), # Self or bus powered
  29. byte(500 >> 1)), # Up to 500 mA
  30. # Management interface
  31. usb_dset {
  32. usb_desc('interface',
  33. $mgmt_if = usb_index,
  34. byte(0), # No alternate settings
  35. byte(1), # Endpoint count
  36. usb_class('cdc','acm','v25ter'),
  37. usb_string()),
  38. usb_desc('cs_interface.header',
  39. word(0x120)), # CDC spec version 1.20
  40. usb_desc('cs_interface.call_management',
  41. byte(0x01), # No AT commands over data
  42. byte(0)), # No interface applicable
  43. usb_desc('cs_interface.acm',
  44. byte(0x04)), # Supports SEND_BREAK
  45. usb_desc('cs_interface.union',
  46. byte(\$mgmt_if), # Controlling interface
  47. byte(\$data_if)), # Data interface
  48. # EP 3, input: notification
  49. usb_desc('endpoint',
  50. ep_i(3), # Endpoint 3 input
  51. byte(3), # Interrupt, data
  52. word(64), # Max packet size
  53. byte(2)), # Interval
  54. },
  55. # Data interface
  56. usb_dset {
  57. usb_desc('interface',
  58. $data_if = usb_index,
  59. byte(0), # No alternate settings
  60. byte(2), # Endpoint count
  61. usb_class('cdc_data'),
  62. usb_string()),
  63. # EP 1, output: downstream data
  64. usb_desc('endpoint',
  65. ep_o(1),
  66. byte(2), # Bulk, data
  67. word(64), # Max packet size
  68. byte(0)), # Interval
  69. # EP 2, input: upstream data
  70. usb_desc('endpoint',
  71. ep_i(2),
  72. byte(3), # Bulk, data
  73. word(64), # Max packet size
  74. byte(0)) # Interval
  75. }
  76. }
  77. };