Advertisement
EdizonTN

Untitled

Aug 7th, 2020
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. USB_Descriptor_Configuration_t ConfigurationDescriptor __SECTION_RODATA =
  2. {
  3. .Config =
  4. {
  5. .Header = {.Size = sizeof(USB_Descriptor_Configuration_Header_t), .Type = DTYPE_Configuration},
  6.  
  7. .TotalConfigurationSize = sizeof(USB_Descriptor_Configuration_t)-1,
  8. .TotalInterfaces = 2,
  9. .ConfigurationNumber = 1,
  10. .ConfigurationStrIndex = NO_DESCRIPTOR,
  11. .ConfigAttributes = (USB_CONFIG_ATTR_BUSPOWERED | USB_CONFIG_ATTR_SELFPOWERED),
  12. .MaxPowerConsumption = USB_CONFIG_POWER_MA(CONF_CORE_CURRENT_NOM / 8) // in 8mA units
  13. },
  14.  
  15. .CDC_CCI_Interface =
  16. {
  17. .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
  18.  
  19. .InterfaceNumber = 0,
  20. .AlternateSetting = 0,
  21. .TotalEndpoints = 1,
  22. .Class = CDC_CSCP_CDCClass,
  23. .SubClass = CDC_CSCP_ACMSubclass,
  24. .Protocol = CDC_CSCP_ATCommandProtocol,
  25. .InterfaceStrIndex = NO_DESCRIPTOR
  26. },
  27.  
  28. .CDC_Functional_Header =
  29. {
  30. .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalHeader_t), .Type = DTYPE_CSInterface},
  31.  
  32. .Subtype = CDC_DSUBTYPE_CSInterface_Header,
  33. .CDCSpecification = VERSION_BCD(01.10),
  34. },
  35.  
  36. .CDC_Functional_ACM =
  37. {
  38. .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalACM_t), .Type = DTYPE_CSInterface},
  39.  
  40. .Subtype = CDC_DSUBTYPE_CSInterface_ACM,
  41. .Capabilities = 0x04, // see PSTN120.pdf
  42. },
  43.  
  44. .CDC_Functional_Union =
  45. {
  46. .Header = {.Size = sizeof(USB_CDC_Descriptor_FunctionalUnion_t), .Type = DTYPE_CSInterface},
  47.  
  48. .Subtype = CDC_DSUBTYPE_CSInterface_Union,
  49. .MasterInterfaceNumber = 0,
  50. .SlaveInterfaceNumber = 1,
  51. },
  52.  
  53. .CDC_NotificationEndpoint =
  54. {
  55. .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
  56.  
  57. .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM),
  58. .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
  59. .EndpointSize = CDC_NOTIFICATION_EPSIZE,
  60. .PollingIntervalMS = 0xFF
  61. },
  62.  
  63. .CDC_DCI_Interface =
  64. {
  65. .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},
  66.  
  67. .InterfaceNumber = 1,
  68. .AlternateSetting = 0,
  69. .TotalEndpoints = 2,
  70. .Class = CDC_CSCP_CDCDataClass,
  71. .SubClass = CDC_CSCP_NoDataSubclass,
  72. .Protocol = CDC_CSCP_NoDataProtocol,
  73. .InterfaceStrIndex = NO_DESCRIPTOR
  74. },
  75.  
  76. .CDC_DataOutEndpoint =
  77. {
  78. .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
  79.  
  80. .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM),
  81. .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
  82. .EndpointSize = CDC_TXRX_EPSIZE,
  83. .PollingIntervalMS = 0x02
  84. },
  85.  
  86. .CDC_DataInEndpoint =
  87. {
  88. .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
  89.  
  90. .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM),
  91. .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
  92. .EndpointSize = CDC_TXRX_EPSIZE,
  93. .PollingIntervalMS = 0x02
  94. },
  95. // Required by IP3511
  96. .CDC_Termination = 0x00
  97. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement