📄 c5509evm_device.c
字号:
/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) DDK 1.11.00.00 11-04-03 (ddk-b13)" */
/*
* ======== c5509evm_device.c ========
* This file defines example USB device descriptor information for
* the C5509 EVM.
*/
#include <std.h>
#include <csl.h>
#include <c5509_usb.h>
/*
* Control Endpoint 0 IN and OUT USB event mask.
*/
#define EP0EVENTMASK (USB_EVENT_RESET | USB_EVENT_SETUP | USB_EVENT_SUSPEND | \
USB_EVENT_RESUME | USB_EVENT_EOT)
/*
* Device Descriptor
*/
static Uint16 deviceDescriptor[] = {
0x0000, /* field for xfer_byte_cnt - used by the data */
/* transfer API, not an integral part of descriptor */
(C5509_USB_DESCRIPTOR_DEVICE<<8) | 18, /* bLength, bDescriptorType */
0x0101, /* bcdUSB */
0x0000, /* bDeviceClass, bDeviceSubClass */
0x4000, /* bDeviceProtocol, bMaxPacketSize0 = 64 */
0x0451, /* idVendor = Texas Instruments */
0x9001, /* idProduct = catalog DSP product */
0x0000, /* bcdDevice ID = prototype */
0x0201, /* iManufacturer, iProductName */
0x0100 /* iSerialNumber, bNumConfigurations */
};
/*
* String Descriptors Language Id
*/
static Uint16 stringDescriptorLangId[] = {
0x0000, /* field for xfer_byte_cnt - used by the data */
/* transfer API, not an integral part of descriptor */
(C5509_USB_DESCRIPTOR_STRING<<8) | 4, /* bLength, bDescriptorType */
0x0409, /* LANGID (English) */
0x0000
};
/*
* String Descriptor
*/
static String stringDescriptor[] = {
(char *)&stringDescriptorLangId[0], /* LANGID */
" Texas Instruments, Inc.", /* iManufacturer */
" TMX320VC5509", /* iProductName */
" USB Demo Device", /* iConfiguration */
" Vendor Specific", /* iInterface - Vendor Specific */
NULL /* end of string descriptor */
};
/*
* Override default non-setup event handler
*/
#ifdef OVERRIDEHANDLERS
static Void myEvtCb( Uint16 event, C5509_USB_UsbEventHandler handler) {
if (event == USB_EVENT_RESET) {
/*
* application can extend functionality here.
*/
handler(); /* call the default reset event handler */
}
else if (event == USB_EVENT_SUSPEND) {
/*
* application can extend functionality here
*/
handler(); /* call the default suspend event handler */
}
}
/*
* Override default setup event handler
*/
static C5509_USB_UsbReqRet mySetupEvtCb( Uint16 requestId,
C5509_USB_UsbReqHandler handler, USB_SetupStruct *setupPacket) {
/*
* application can extend functionality here.
*/
return handler(); /* call the default setup event handler */
}
#endif
/*
* USB device configuration.
*/
C5509_USB_DeviceConfig myDeviceConfig = {
&deviceDescriptor[0],
&stringDescriptorLangId[0],
&stringDescriptor[0],
#ifdef OVERRIDEHANDLERS
myEvtCb,
mySetupEvtCb
#else
NULL, /* set to NULL to default event handler */
NULL /* set to NULL to default setup event handler */
#endif
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -