USB_Descriptors.#1
上传用户:gxz1972
上传日期:2019-09-13
资源大小:323k
文件大小:4k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. //-----------------------------------------------------------------------------
  2. // USB_Descriptors.c
  3. //-----------------------------------------------------------------------------
  4. // Copyright 2007 Vson Technology, Inc.
  5. // http://www.usbmcu.com
  6. //
  7. // Program Description:
  8. //
  9. //
  10. //
  11. //
  12. //
  13. // MCU:            C8051F347
  14. // Tool chain:     Keil C51 7.50 / Keil EVAL C51
  15. //                 Silicon Laboratories IDE version 2.6
  16. // Command Line:   
  17. // Project Name:   TR1000
  18. //
  19. //
  20. // Release 1.0
  21. //    -All changes by Brian Cai
  22. //    -24 JUL 2007
  23. //
  24. //
  25. //-----------------------------------------------------------------------------
  26. // Includes
  27. //-----------------------------------------------------------------------------
  28. #include "Include_H.h"
  29. //-----------------------------------------------------------------------------
  30. // Global Constants
  31. //-----------------------------------------------------------------------------
  32. // All descriptors are contained in the global structure <gDescriptorMap>.
  33. // This structure contains BYTE arrays for the standard device descriptor
  34. // and all configurations. The lengths of the configuration arrays are
  35. // defined by the number of interface and endpoint descriptors required
  36. // for the particular configuration (these constants are named
  37. // CFG1_IF_DSC and CFG1_EP_DSC for configuration1).
  38. //
  39. // The entire gDescriptorMap structure is initialized below in
  40. // codespace.
  41. DESCRIPTORS code gDescriptorMap = {
  42. //---------------------------
  43. // Begin Standard Device Descriptor (structure element stddevdsc)
  44. //---------------------------
  45.    18,                        // bLength
  46.    0x01,                      // bDescriptorType
  47.    0x00, 0x02,                // bcdUSB (lsb first)
  48.    0x00,                      // bDeviceClass
  49.    0x00,                      // bDeviceSubClass
  50.    0x00,                      // bDeviceProtocol
  51.    64,                        // bMaxPacketSize0
  52.    //0xC4, 0x10,                // idVendor (lsb first)
  53.    //0x03, 0x00,                // idProduct (lsb first)
  54.    0x38, 0x01,                // idVendor (lsb first)
  55.    0x38, 0x01,                // idProduct (lsb first)
  56.    0x00, 0x00,                // bcdDevice (lsb first)
  57.    0x00,                      // iManufacturer
  58.    0x00,                      // iProduct
  59.    0x00,                      // iSerialNumber
  60.    0x01,                      // bNumConfigurations
  61. //---------------------------
  62. // Begin Configuration 1 (structure element cfg1)
  63. //---------------------------
  64.    // Begin Descriptor: Configuration 1
  65.    0x09,                      // Length
  66.    0x02,                      // Type
  67.    0x20, 0x00,                // TotalLength (lsb first)
  68.    0x01,                      // NumInterfaces
  69.    0x01,                      // bConfigurationValue
  70.    0x00,                      // iConfiguration
  71.    0x80,                      // bmAttributes (no remote wakeup)
  72.    0x0F,                      // MaxPower (*2mA)
  73.    // Begin Descriptor: Interface0, Alternate0
  74.    0x09,                      // bLength
  75.    0x04,                      // bDescriptorType
  76.    0x00,                      // bInterfaceNumber
  77.    0x00,                      // bAlternateSetting
  78.    0x02,                      // bNumEndpoints
  79.    0x00,                      // bInterfaceClass
  80.    0x00,                      // bInterfaceSubClass
  81.    0x00,                      // bInterfaceProcotol
  82.    0x00,                      // iInterface
  83.    // Begin Descriptor: Endpoint1, Interface0, Alternate0
  84.    0x07,                      // bLength
  85.    0x05,                      // bDescriptorType
  86.    0x81,                      // bEndpointAddress (ep1, IN)
  87.    0x02,                      // bmAttributes (Bulk)
  88.    0x40, 0x00,                // wMaxPacketSize (lsb first)
  89.    0x05,                      // bInterval
  90.    // Begin Descriptor: Endpoint2, Interface0, Alternate0
  91.    0x07,                      // bLength
  92.    0x05,                      // bDescriptorType
  93.    0x02,                      // bEndpointAddress (ep2, OUT)
  94.    0x02,                      // bmAttributes (Bulk)
  95.    0x40, 0x00,                // wMaxPacketSize (lsb first)
  96.    0x05,                      // bInterval
  97. //---------------------------
  98. // End Configuration 1
  99. //---------------------------
  100. };
  101. //-----------------------------------------------------------------------------
  102. // End Of File
  103. //-----------------------------------------------------------------------------