usb_desc.conf 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # -*- perl -*-
  2. #
  3. # Invoked from usbdescgen.pl
  4. #
  5. usb_languages('en_US', 'sv_SE');
  6. my $vendor_id = word(0x1d50);
  7. my $device_id = word(0x6149);
  8. my $version_id = word(0x0100);
  9. my $serial = usb_serial('Cereal');
  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('multi'), # Device with multiple interfaces
  17. byte(8), # Max packet size on endpoint 0
  18. $vendor_id, $device_id, $version_id,
  19. $manufacturer, $product, $serial,
  20. byte(usb_children) # Number of configurations
  21. ),
  22. usb_dset {
  23. usb_desc('configuration',
  24. word(usb_totallen), # Total length for this dset
  25. byte(usb_children), # Number of interfaces
  26. byte(usb_index,1), # This configuration index
  27. usb_string(), # Text description (empty)
  28. byte(0xc0), # Self or bus powered
  29. byte(500 >> 1)), # Up to 500 mA
  30. # Interface association descriptor
  31. usb_desc('interface_association',
  32. byte(\$mgmt_if), # First interface index
  33. byte(2), # Interface count
  34. # USB spec says to copy the first interface class
  35. usb_class('cdc','acm','v25ter'),
  36. usb_string()),
  37. # Management interface
  38. usb_dset {
  39. usb_desc('interface',
  40. byte($mgmt_if = usb_index),
  41. byte(0), # No alternate settings
  42. byte(1), # Endpoint count
  43. usb_class('cdc','acm','v25ter'),
  44. usb_string()),
  45. usb_desc('cs_interface.header',
  46. word(0x120)), # CDC spec version 1.20
  47. usb_desc('cs_interface.call_management',
  48. byte(0x03), # AT commands over setup or data
  49. byte(\$data_if)), # Which data interface
  50. usb_desc('cs_interface.acm',
  51. byte(0x04)), # Supports SEND_BREAK
  52. usb_desc('cs_interface.union',
  53. byte(\$mgmt_if), # Controlling interface
  54. byte(\$data_if)), # Data interface
  55. # EP 3, input: notification
  56. usb_desc('endpoint',
  57. ep_i(3), # Endpoint 3 input
  58. byte(3), # Interrupt, data
  59. word(64), # Max packet size
  60. byte(2)), # Interval
  61. },
  62. # Data interface
  63. usb_dset {
  64. usb_desc('interface',
  65. byte($data_if = usb_index),
  66. byte(0), # No alternate settings
  67. byte(2), # Endpoint count
  68. usb_class('cdc_data'),
  69. usb_string()),
  70. # EP 2, input: upstream data
  71. usb_desc('endpoint',
  72. ep_i(2),
  73. byte(2), # Bulk, data
  74. word(64), # Max packet size
  75. byte(0)), # Interval
  76. # EP 2, output: downstream data
  77. usb_desc('endpoint',
  78. ep_o(2),
  79. byte(2), # Bulk, data
  80. word(64), # Max packet size
  81. byte(0)) # Interval
  82. }
  83. },
  84. };
  85. usb_additional_data {
  86. # Line state structure
  87. dword(115200), # Baud rate
  88. byte(0), # 1 stop bit
  89. byte(0), # No parity
  90. byte(8) # 8 data bits
  91. };