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

📄 usb_bf535cfg.h

📁 基于ADSP-BF535 USB驱动代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#ifndef _USB_BF535CFG
#define _USB_BF535CFG


#define VENDOR_ID 	1110		// Analog Devices, Inc.
#define PRODUCT_ID 	21535 		// 21535 for DDK driver, 535 for NuMega driver
#define NUM_ENDPOINTS 7
#define EP_DMA_BUFL_SIZE 64

section("usb_io") UCHAR EpDmaBuf[EP_DMA_BUFL_SIZE];

section("usb_io") USB_DEVICE_DESCRIPTOR DeviceDesc =
{
	sizeof(USB_DEVICE_DESCRIPTOR),	// bLength;
	USB_DEVICE_DESCRIPTOR_TYPE,		// bDescriptorType;
	0x0110,							// bcdUSB (USB 1.1)
	USB_DEVICE_CLASS_RESERVED,		// bDeviceClass;
	0x00,							// bDeviceSubClass; 
	0x00,							// bDeviceProtocol;
	0x08,							// bMaxPacketSize0;
	VENDOR_ID,						// idVendor;
	PRODUCT_ID, 					// idProduct;
	0x0000,							// bcdDevice;
	0x00,							// iManufacturer;
	0x00,							// iProduct;
	0x00,							// iSerialNumber;
	0x01							// bNumConfigurations;
};

											
section("usb_io") USB_DEVICE_REQUEST_DESCRIPTOR DeviceRequestDesc =
{
	0xFF,	// bmRequestType;
	0xFF,	// bRequest;
	0xFFFF,	// wValue;
	0xFFFF,	// wIndex;
	0xFFFF	// wLenght; 
};

section("usb_io") USB_DEVICE_REQUEST_DESCRIPTOR DeviceRequestDescDummy =
{
	0xFF,	// bmRequestType;
	0xFF,	// bRequest;
	0xFFFF,	// wValue;
	0xFFFF,	// wIndex;
	0xFFFF	// wLenght; 
};
																																						
typedef struct _USB_CONFIGURATION_PAYLOAD
{																			
    USB_CONFIGURATION_DESCRIPTOR cfgPayload;
    USB_INTERFACE_DESCRIPTOR IntPayload;
    USB_ENDPOINT_DESCRIPTOR EpPayload[NUM_ENDPOINTS];
} USB_CONFIGURATION_PAYLOAD, *PUSB_CONFIGURATION_PAYLOAD;

section("usb_io") USB_CONFIGURATION_PAYLOAD ConfigDesc =
{
	
//-------------------------------------------------------------------------------
//	Configuration Descriptor
//-------------------------------------------------------------------------------
	{sizeof(USB_CONFIGURATION_DESCRIPTOR),	// bLength;		
	USB_CONFIGURATION_DESCRIPTOR_TYPE,		// bDescriptorType;
	sizeof(USB_CONFIGURATION_PAYLOAD),		// wTotalLength;				
	0x01,									// bNumInterfaces;		
	0x00,									// bConfigurationValue;	
	//0x01,									// bConfigurationValue;	
	0x00,									// iConfiguration;	
	0x40,									// bmAttributes; Self Powered
	0x00},  								// MaxPower;
	
//-------------------------------------------------------------------------------
// Interface Descriptor: Interface 0, Alternate 0
//-------------------------------------------------------------------------------								
	{sizeof(USB_INTERFACE_DESCRIPTOR),		
	USB_INTERFACE_DESCRIPTOR_TYPE,		// bDescriptorType;
	0x00,								// bInterfaceNumber;
	0x00,								// bAlternateSetting;
	NUM_ENDPOINTS,						// bNumEndpoints;
	0x00,								// bInterfaceClass;
	0x00,								// bInterfaceSubClass;
	0x00,								// bInterfaceProtocol;
	0x00},								// iInterface;
	
	{
	
//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 1 (OUT)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x01 | USB_ENDPOINT_DIRECTION_OUT,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;

//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 2 (OUT)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x02 | USB_ENDPOINT_DIRECTION_OUT,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;

//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 3 (OUT)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x03 | USB_ENDPOINT_DIRECTION_OUT,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;										

//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 4 (OUT)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x04| USB_ENDPOINT_DIRECTION_OUT,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;
		
//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 5 (IN)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x05 |USB_ENDPOINT_DIRECTION_IN,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;

//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 6 (IN)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x06 |USB_ENDPOINT_DIRECTION_IN,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;

//-------------------------------------------------------------------------------
// EndPoint Descriptor: Interface 0, Alternate 0, Endpoint 7 (IN)
//-------------------------------------------------------------------------------
		{sizeof(USB_ENDPOINT_DESCRIPTOR),	// bLength;		
		USB_ENDPOINT_DESCRIPTOR_TYPE,		// bDescriptorType;
		0x07 |USB_ENDPOINT_DIRECTION_IN,	// bEndpointAddress;
		USB_ENDPOINT_TYPE_BULK,				// bmAttributes;
		0x0040,								// wMaxPacketSize;
		0x00},								// bInterval;
	}
};


EP_BUF EpBuf[MAX_EP_BUF] =
{
	// [0] ----------------- End Point 0 --------------------
	{
		LOG_EP0,	// buffer address
		0,			// user bit
		8,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		EP_CTL,		// control pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 0
		EP0			// pipe 0
	},
	//=============================================================
	// Configuration 0, Interface 0, Alternate 0
	//=============================================================
	// [1] ----------------- End Point 1 (OUT) --------------------
	{
		LOG_EP1,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_OUT,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP1			// EP register 1
	},
	// [2] ----------------- End Point 2 (OUT) --------------------
	{
		LOG_EP2,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_OUT,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1	
		EP2		// EP Register 1
	},
	// [3] ----------------- End Point 3 (OUT)  --------------------
	{
		LOG_EP3,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_OUT,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP3			// EP Register 2
	},
	// [4] ----------------- End Point 4 (OUT) --------------------
	{
		LOG_EP4,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_OUT,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP4			// EP Register 2
	},
	// [5] ----------------- End Point 5 (IN) --------------------
	{
		LOG_EP5,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_IN,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP5			// EP Register 3
	},
	// [6] ----------------- End Point 6 (IN) --------------------
	{
		LOG_EP6,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_IN,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP6			// EP Register 3
	},
	// [7] ----------------- End Point 7 (IN) --------------------
	{
		LOG_EP7,	// buffer address
		0,			// user bit
		64,			// maximum packet size
		EP_IN,		// Out pipe
		EP_BULK,	// Bulk pipe
		EP_ALT0,	// Alternate setting
		EP_IFACE0,	// interface 0
		EP_CONFIG0,	// config 1
		EP7			// EP Register 4
	},
	//=============================================================
	// 21535 Only supports 1 configuration, 2 interfaces and 2
	// Alternates, we just patch up with 0 to the End Point 63
	//=============================================================
	// [8] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [9] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [10] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [11] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [12] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [13] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [14] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [15] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [16] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [17] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [18] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [19] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [20] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [21] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [22] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [23] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [24] ----------------- End Point ??? --------------------
	{
		0,			// buffer address
		0,			// user bit
		0,			// maximum packet size
		0,			// ignore pipe direction for control pipe
		0,			// control pipe
		0,			// Alternate setting
		0,			// interface 0
		0,			// config 0
		0			// pipe 0
	},
	// [25] ----------------- End Point ??? --------------------
	{
		0,			// buffer address

⌨️ 快捷键说明

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