⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_dscr.c

📁 在CCS开发环境下的DSP 5509A的固件程序
💻 C
📖 第 1 页 / 共 2 页
字号:
const Uint16 usb_demo_ifc0_alt1_intrpt_in_endpoint_descriptor[] =
{
  0x0000,                               // field for xfer_byte_cnt - used by the data
                                        // transfer API, not an integral part of descriptor
  (USB_DESCRIPTOR_ENDPT<<8) | 7,        // bLength, bDescriptorType
  0x0383,                               // bEndpointAddress = 3 IN , bmAttributes = intrpt
  0x0040,                               // wMaxPacketSize
  0x01                                  // bInterval = once per mSec
};
  
// bulk endpoint descriptor - endpt4 OUT (for host dma mode )
const Uint16 usb_demo_ifc0_alt1_hostdma_out_endpoint_descriptor[] =
{
  0x0000,                               // field for xfer_byte_cnt - used by the data
                                        // transfer API, not an integral part of descriptor
  (USB_DESCRIPTOR_ENDPT<<8) | 7,        // bLength, bDescriptorType
  0x0204,                               // bEndpointAddress = 4 OUT, bmAttributes = bulk
  0x0040,                               // wMaxPacketSize
  0x00                                  // bInterval
};

// bulk endpoint descriptor - endpt4 IN (for host dma mode )
const Uint16 usb_demo_ifc0_alt1_hostdma_in_endpoint_descriptor[] =
{
  0x0000,                               // field for xfer_byte_cnt - used by the data
                                        // transfer API, not an integral part of descriptor
  (USB_DESCRIPTOR_ENDPT<<8) | 7,        // bLength, bDescriptorType */
  0x0284,                               // bEndpointAddress = 4 IN , bmAttributes
  0x0040,                               // wMaxPacketSize
  0x00                                  // bInterval
};

// iso endpoint descriptor - endpt5 IN
const Uint16 usb_demo_ifc0_alt1_iso_in_endpoint_descriptor[] =
{
  0x0000,                               // field for xfer_byte_cnt - used by the data
                                        // transfer API, not an integral part of descriptor
  (USB_DESCRIPTOR_ENDPT<<8) | 7,        // bLength, bDescriptorType
  0x0185,                               // bEndpointAddress = 5 IN , bmAttributes = iso
  0x0010,                               // wMaxPacketSize
  0x01                                  // bInterval = once per mSec
};
  
/******************************************************************************/
/*                                                                            */
/*                       Descriptor Linked List                               */
/*                                                                            */
/******************************************************************************/

// Create a linked list of all the descriptors (except for device and string descr)
// The framework expects the configuration and the interface descriptor as a linked
// list 

USB_DataStruct usb_demo_ifc0_alt1_iso_in_endpoint_descriptor_link =
{
  7,                                                           // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_iso_in_endpoint_descriptor[0], // pointer to this descriptor
  NULL                                                         // end of descriptor link
};

USB_DataStruct usb_demo_ifc0_alt1_hostdma_in_endpoint_descriptor_link =
{
  7,                                                     // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_hostdma_in_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt1_iso_in_endpoint_descriptor_link              // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt1_hostdma_out_endpoint_descriptor_link =
{
  7,                                                      // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_hostdma_out_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt1_hostdma_in_endpoint_descriptor_link           // pointer to next descriptor link
};


USB_DataStruct usb_demo_ifc0_alt1_intrpt_in_endpoint_descriptor_link =
{
  7,                                                    // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_intrpt_in_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt1_hostdma_out_endpoint_descriptor_link        // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt1_bulk_in_endpoint_descriptor_link =
{
  7,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_bulk_in_endpoint_descriptor[0],  // pointer to this descriptor
  &usb_demo_ifc0_alt1_intrpt_in_endpoint_descriptor_link         // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt1_bulk_out_endpoint_descriptor_link =
{
  7,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_bulk_out_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt1_bulk_in_endpoint_descriptor_link           // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt1_descriptor_link =
{
  9,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt1_descriptor[0],         // pointer to this descriptor
  &usb_demo_ifc0_alt1_bulk_out_endpoint_descriptor_link          // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt0_hostdma_in_endpoint_descriptor_link =
{
  7,                                                     // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_hostdma_in_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt1_descriptor_link                    // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt0_hostdma_out_endpoint_descriptor_link =
{
  7,                                                      // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_hostdma_out_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt0_hostdma_in_endpoint_descriptor_link           // pointer to next descriptor link
};


USB_DataStruct usb_demo_ifc0_alt0_intrpt_in_endpoint_descriptor_link =
{
  7,                                                    // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_intrpt_in_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt0_hostdma_out_endpoint_descriptor_link        // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt0_bulk_in_endpoint_descriptor_link =
{
  7,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_bulk_in_endpoint_descriptor[0],  // pointer to this descriptor
  &usb_demo_ifc0_alt0_intrpt_in_endpoint_descriptor_link         // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt0_bulk_out_endpoint_descriptor_link =
{
  7,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_bulk_out_endpoint_descriptor[0], // pointer to this descriptor
  &usb_demo_ifc0_alt0_bulk_in_endpoint_descriptor_link           // pointer to next descriptor link
};

USB_DataStruct usb_demo_ifc0_alt0_descriptor_link =
{
  9,                                                   // length in bytes
  (Uint16 *)&usb_demo_ifc0_alt0_descriptor[0],         // pointer to this descriptor
  &usb_demo_ifc0_alt0_bulk_out_endpoint_descriptor_link          // pointer to next descriptor link
};

USB_DataStruct configuration_descriptor_link =
{
  9,                                                   // length in bytes
  (Uint16 *)&configuration_descriptor[0],              // pointer to this descriptor
  &usb_demo_ifc0_alt0_descriptor_link                  // pointer to next descriptor link
};

/******************************************************************************/
/*                                                                            */
/*                       String Descriptors                                   */
/*                                                                            */
/******************************************************************************/

Uint16 string_descriptor_langid[] =
{
  0x0000,                               // field for xfer_byte_cnt - used by the data
                                        // transfer API, not an integral part of descriptor
  (USB_DESCRIPTOR_STRING<<8) | 4,  // bLength, bDescriptorType 
  0x0409,                               // LANGID (English)
  0x0000
};


// C55xx chars are 16-bit
// calculate and add the length to the beginning of the strings
// at runtime before sending the string descriptors
 
char *string_descriptor[] =
{
  (char *)&string_descriptor_langid[0],  // LANGID
  "  Texas Instruments, Inc.",           // iManufacturer
  "  TMX320VC5509",                      // iProductName
  "  USB Demo Device",                   // iConfiguration
  "  Vendor Specific",                   // iInterface - Vendor Specific
  NULL                                   // end of string descriptor
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -