Advertisement
Guest User

cyfxbulklpdscr.c

a guest
May 10th, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.29 KB | None | 0 0
  1. /*
  2. ## Cypress USB 3.0 Platform source file (cyfxbulklpdscr.c)
  3. ## ===========================
  4. ##
  5. ## Copyright Cypress Semiconductor Corporation, 2010-2011,
  6. ## All Rights Reserved
  7. ## UNPUBLISHED, LICENSED SOFTWARE.
  8. ##
  9. ## CONFIDENTIAL AND PROPRIETARY INFORMATION
  10. ## WHICH IS THE PROPERTY OF CYPRESS.
  11. ##
  12. ## Use of this file is governed
  13. ## by the license agreement included in the file
  14. ##
  15. ## <install>/license/license.txt
  16. ##
  17. ## where <install> is the Cypress software
  18. ## installation root directory path.
  19. ##
  20. ## ===========================
  21. */
  22.  
  23. /* This file contains the USB enumeration descriptors for the bulk loop application example.
  24. * The descriptor arrays must be 32 byte aligned and multiple of 32 bytes if the D-cache is
  25. * turned on. If the linker used is not capable of supporting the aligned feature for this,
  26. * either the descriptors must be placed in a different section and the section should be
  27. * 32 byte aligned and 32 byte multiple; or dynamically allocated buffer allocated using
  28. * CyU3PDmaBufferAlloc must be used, and the descriptor must be loaded into it. The example
  29. * assumes that the aligned attribute for 32 bytes is supported by the linker. Do not add
  30. * any other variables to this file other than USB descriptors. This is not the only
  31. * pre-requisite to enabling the D-cache. Refer to the documentation for
  32. * CyU3PDeviceCacheControl for more information.
  33. */
  34.  
  35.  
  36. #include "cyfxbulklpautomanytoone.h"
  37. #include "cyfxusbdebug.h"
  38.  
  39. /* Standard device descriptor for USB 3.0 */
  40. const uint8_t CyFxUSB30DeviceDscr[] __attribute__ ((aligned (32))) =
  41. {
  42. 0x12, /* Descriptor size */
  43. CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
  44. 0x00,0x03, /* USB 3.0 */
  45. 0x00, /* Device class */
  46. 0x00, /* Device sub-class */
  47. 0x00, /* Device protocol */
  48. 0x09, /* Maxpacket size for EP0 : 2^9 */
  49. 0xB4,0x04, /* Vendor ID */
  50. 0xF0,0x00, /* Product ID */
  51. 0x00,0x00, /* Device release number */
  52. 0x01, /* Manufacture string index */
  53. 0x02, /* Product string index */
  54. 0x00, /* Serial number string index */
  55. 0x01 /* Number of configurations */
  56. };
  57.  
  58. /* Standard device descriptor for USB 2.0 */
  59. const uint8_t CyFxUSB20DeviceDscr[] __attribute__ ((aligned (32))) =
  60. {
  61. 0x12, /* Descriptor size */
  62. CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
  63. 0x10,0x02, /* USB 2.10 */
  64. 0x00, /* Device class */
  65. 0x00, /* Device sub-class */
  66. 0x00, /* Device protocol */
  67. 0x40, /* Maxpacket size for EP0 : 64 bytes */
  68. 0xB4,0x04, /* Vendor ID */
  69. 0xF0,0x00, /* Product ID */
  70. 0x00,0x00, /* Device release number */
  71. 0x01, /* Manufacture string index */
  72. 0x02, /* Product string index */
  73. 0x00, /* Serial number string index */
  74. 0x01 /* Number of configurations */
  75. };
  76.  
  77. /* Binary device object store descriptor */
  78. const uint8_t CyFxUSBBOSDscr[] __attribute__ ((aligned (32))) =
  79. {
  80. 0x05, /* Descriptor size */
  81. CY_U3P_BOS_DESCR, /* Device descriptor type */
  82. 0x16,0x00, /* Length of this descriptor and all sub descriptors */
  83. 0x02, /* Number of device capability descriptors */
  84.  
  85. /* USB 2.0 extension */
  86. 0x07, /* Descriptor size */
  87. CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
  88. CY_U3P_USB2_EXTN_CAPB_TYPE, /* USB 2.0 extension capability type */
  89. 0x02,0x00,0x00,0x00, /* Supported device level features: LPM support */
  90.  
  91. /* SuperSpeed device capability */
  92. 0x0A, /* Descriptor size */
  93. CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
  94. CY_U3P_SS_USB_CAPB_TYPE, /* SuperSpeed device capability type */
  95. 0x00, /* Supported device level features */
  96. 0x0E,0x00, /* Speeds supported by the device : SS, HS and FS */
  97. 0x03, /* Functionality support */
  98. 0x00, /* U1 Device Exit latency */
  99. 0x00,0x00 /* U2 Device Exit latency */
  100. };
  101.  
  102. /* Standard device qualifier descriptor */
  103. const uint8_t CyFxUSBDeviceQualDscr[] __attribute__ ((aligned (32))) =
  104. {
  105. 0x0A, /* Descriptor size */
  106. CY_U3P_USB_DEVQUAL_DESCR, /* Device qualifier descriptor type */
  107. 0x00,0x02, /* USB 2.0 */
  108. 0x00, /* Device class */
  109. 0x00, /* Device sub-class */
  110. 0x00, /* Device protocol */
  111. 0x40, /* Maxpacket size for EP0 : 64 bytes */
  112. 0x01, /* Number of configurations */
  113. 0x00 /* Reserved */
  114. };
  115.  
  116. /* Standard super speed configuration descriptor */
  117. const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) =
  118. {
  119. /* Configuration descriptor */
  120. 0x09, /* Descriptor size */
  121. CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
  122. 0x39,0x00, /* Length of this descriptor and all sub descriptors */
  123. 0x01, /* Number of interfaces */
  124. 0x01, /* Configuration number */
  125. 0x00, /* COnfiguration string index */
  126. 0x80, /* Config characteristics - Bus powered */
  127. 0x32, /* Max power consumption of device (in 8mA unit) : 400mA */
  128.  
  129. /* Interface descriptor */
  130. 0x09, /* Descriptor size */
  131. CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
  132. 0x00, /* Interface number */
  133. 0x00, /* Alternate setting number */
  134. 0x03, /* Number of end points */
  135. 0xFF, /* Interface class */
  136. 0x00, /* Interface sub class */
  137. 0x00, /* Interface protocol code */
  138. 0x00, /* Interface descriptor string index */
  139.  
  140. /* Endpoint descriptor for producer 1 EP */
  141. 0x07, /* Descriptor size */
  142. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  143. CY_FX_EP_PRODUCER_1, /* Endpoint address and description */
  144. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  145. 0x00,0x04, /* Max packet size = 1024 bytes */
  146. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  147.  
  148. /* Super speed endpoint companion descriptor for producer 1 EP */
  149. 0x06, /* Descriptor size */
  150. CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
  151. 0x00, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
  152. 0x00, /* Max streams for bulk EP = 0 (No streams) */
  153. 0x00,0x00, /* Service interval for the EP : 0 for bulk */
  154.  
  155. /* Endpoint descriptor for producer 2 EP */
  156. 0x07, /* Descriptor size */
  157. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  158. CY_FX_EP_PRODUCER_2, /* Endpoint address and description */
  159. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  160. 0x00,0x04, /* Max packet size = 1024 bytes */
  161. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  162.  
  163. /* Super speed endpoint companion descriptor for producer 2 EP */
  164. 0x06, /* Descriptor size */
  165. CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
  166. 0x00, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
  167. 0x00, /* Max streams for bulk EP = 0 (No streams) */
  168. 0x00,0x00, /* Service interval for the EP : 0 for bulk */
  169.  
  170. /* Endpoint descriptor for consumer EP */
  171. 0x07, /* Descriptor size */
  172. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  173. CY_FX_EP_CONSUMER, /* Endpoint address and description */
  174. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  175. 0x00,0x04, /* Max packet size = 1024 bytes */
  176. 0x00, /* Servicing interval for data transfers : 0 for Bulk */
  177.  
  178. /* Super speed endpoint companion descriptor for consumer EP */
  179. 0x06, /* Descriptor size */
  180. CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
  181. 0x00, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
  182. 0x00, /* Max streams for bulk EP = 0 (No streams) */
  183. 0x00,0x00 /* Service interval for the EP : 0 for bulk */
  184. };
  185.  
  186. /* Standard high speed configuration descriptor */
  187. const uint8_t CyFxUSBHSConfigDscr[] __attribute__ ((aligned (32))) =
  188. {
  189. /* Configuration descriptor */
  190. 0x09, /* Descriptor size */
  191. CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
  192. 0x35,0x00, /* Length of this descriptor and all sub descriptors */
  193. 0x01, /* Number of interfaces */
  194. 0x01, /* Configuration number */
  195. 0x00, /* COnfiguration string index */
  196. 0x80, /* Config characteristics - bus powered */
  197. 0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
  198.  
  199. /* Interface descriptor */
  200. 0x09, /* Descriptor size */
  201. CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
  202. 0x00, /* Interface number */
  203. 0x00, /* Alternate setting number */
  204. 0x05, /* Number of endpoints */
  205. 0xFF, /* Interface class */
  206. 0x00, /* Interface sub class */
  207. 0x00, /* Interface protocol code */
  208. 0x00, /* Interface descriptor string index */
  209.  
  210. /* Endpoint descriptor for producer 1 EP */
  211. 0x07, /* Descriptor size */
  212. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  213. CY_FX_EP_PRODUCER_1, /* Endpoint address and description */
  214. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  215. 0x00,0x02, /* Max packet size = 512 bytes */
  216. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  217.  
  218. /* Endpoint descriptor for producer 2 EP */
  219. 0x07, /* Descriptor size */
  220. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  221. CY_FX_EP_PRODUCER_2, /* Endpoint address and description */
  222. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  223. 0x00,0x02, /* Max packet size = 512 bytes */
  224. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  225.  
  226. /* Endpoint descriptor for producer 3 EP */
  227. 0x07, /* Descriptor size */
  228. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  229. CY_FX_EP_PRODUCER_3, /* Endpoint address and description */
  230. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  231. 0x40,0x00, /* Max packet size = 64 bytes */
  232. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  233.  
  234. /* Endpoint descriptor for consumer EP */
  235. 0x07, /* Descriptor size */
  236. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  237. CY_FX_EP_CONSUMER, /* Endpoint address and description */
  238. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  239. 0x00,0x02, /* Max packet size = 512 bytes */
  240. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  241.  
  242. /* Endpoint descriptor for consumer EP */
  243. 0x07, /* Descriptor size */
  244. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  245. CY_FX_EP_DEBUG, /* Endpoint address and description */
  246. CY_U3P_USB_EP_INTR, /* Interrupt endpoint type */
  247. 0x80,0x00, /* Max packet size = 128 bytes */
  248. 0x01 /* Servicing interval for data transfers : every micro-frame. */
  249.  
  250.  
  251. };
  252.  
  253. /* Standard full speed configuration descriptor */
  254. const uint8_t CyFxUSBFSConfigDscr[] __attribute__ ((aligned (32))) =
  255. {
  256. /* Configuration descriptor */
  257. 0x09, /* Descriptor size */
  258. CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
  259. 0x35,0x00, /* Length of this descriptor and all sub descriptors */
  260. 0x01, /* Number of interfaces */
  261. 0x01, /* Configuration number */
  262. 0x00, /* COnfiguration string index */
  263. 0x80, /* Config characteristics - bus powered */
  264. 0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
  265.  
  266. /* Interface descriptor */
  267. 0x09, /* Descriptor size */
  268. CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
  269. 0x00, /* Interface number */
  270. 0x00, /* Alternate setting number */
  271. 0x05, /* Number of endpoints */
  272. 0xFF, /* Interface class */
  273. 0x00, /* Interface sub class */
  274. 0x00, /* Interface protocol code */
  275. 0x00, /* Interface descriptor string index */
  276.  
  277. /* Endpoint descriptor for producer 1 EP */
  278. 0x07, /* Descriptor size */
  279. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  280. CY_FX_EP_PRODUCER_1, /* Endpoint address and description */
  281. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  282. 0x40,0x00, /* Max packet size = 64 bytes */
  283. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  284.  
  285. /* Endpoint descriptor for producer 2 EP */
  286. 0x07, /* Descriptor size */
  287. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  288. CY_FX_EP_PRODUCER_2, /* Endpoint address and description */
  289. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  290. 0x40,0x00, /* Max packet size = 64 bytes */
  291. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  292.  
  293. /* Endpoint descriptor for producer 3 EP */
  294. 0x07, /* Descriptor size */
  295. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  296. CY_FX_EP_PRODUCER_3, /* Endpoint address and description */
  297. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  298. 0x40,0x00, /* Max packet size = 64 bytes */
  299. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  300.  
  301. /* Endpoint descriptor for consumer EP */
  302. 0x07, /* Descriptor size */
  303. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  304. CY_FX_EP_CONSUMER, /* Endpoint address and description */
  305. CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
  306. 0x40,0x00, /* Max packet size = 64 bytes */
  307. 0x00, /* Servicing interval for data transfers : 0 for bulk */
  308.  
  309. /* Endpoint descriptor for consumer EP */
  310. 0x07, /* Descriptor size */
  311. CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
  312. CY_FX_EP_DEBUG, /* Endpoint address and description */
  313. CY_U3P_USB_EP_INTR, /* Interrupt endpoint type */
  314. 0x80,0x00, /* Max packet size = 128 bytes */
  315. 0x01 /* Servicing interval for data transfers : every micro-frame. */
  316. };
  317.  
  318. /* Standard language ID string descriptor */
  319. const uint8_t CyFxUSBStringLangIDDscr[] __attribute__ ((aligned (32))) =
  320. {
  321. 0x04, /* Descriptor size */
  322. CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
  323. 0x09,0x04 /* Language ID supported */
  324. };
  325.  
  326. /* Standard manufacturer string descriptor */
  327. const uint8_t CyFxUSBManufactureDscr[] __attribute__ ((aligned (32))) =
  328. {
  329. 0x10, /* Descriptor size */
  330. CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
  331. 'C',0x00,
  332. 'y',0x00,
  333. 'p',0x00,
  334. 'r',0x00,
  335. 'e',0x00,
  336. 's',0x00,
  337. 's',0x00
  338. };
  339.  
  340. /* Standard product string descriptor */
  341. const uint8_t CyFxUSBProductDscr[] __attribute__ ((aligned (32))) =
  342. {
  343. 0x08, /* Descriptor size */
  344. CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
  345. 'F',0x00,
  346. 'X',0x00,
  347. '3',0x00
  348. };
  349.  
  350. /* Place this buffer as the last buffer so that no other variable / code shares
  351. * the same cache line. Do not add any other variables / arrays in this file.
  352. * This will lead to variables sharing the same cache line. */
  353. const uint8_t CyFxUsbDscrAlignBuffer[32] __attribute__ ((aligned (32)));
  354.  
  355. /* [ ] */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement