usb_desc.conf 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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('cdc'), # Communications device class
  17. byte(8), # Max packet size on endpoint 0
  18. $vendor_id, $device_id, $version_id,
  19. $manufacturer, $product, $serial,
  20. byte(usb_children)
  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. # Management interface
  31. usb_dset {
  32. usb_desc('interface',
  33. byte($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(0x03), # AT commands over setup or data
  42. byte(\$data_if)), # Which data interface
  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. byte($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 2, input: upstream data
  64. usb_desc('endpoint',
  65. ep_i(2),
  66. byte(2), # Bulk, data
  67. word(64), # Max packet size
  68. byte(0)), # Interval
  69. # EP 1, output: downstream data
  70. usb_desc('endpoint',
  71. ep_o(1),
  72. byte(2), # Bulk, data
  73. word(64), # Max packet size
  74. byte(0)) # Interval
  75. }
  76. },
  77. };
  78. usb_additional_data {
  79. # Line state structure
  80. dword(115200), # Baud rate
  81. byte(0), # 1 stop bit
  82. byte(0), # No parity
  83. byte(8) # 8 data bits
  84. };