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

📄 usbmodule.h

📁 dsp5509a USB 驱动 pc端程序 下面还有 dsp端程序
💻 H
字号:
/*USB Module Registers define*/
#define USB_BASEADDRESS 0x5800

#define 	USBCLKMOD	 *(volatile ioport unsigned int*)0x1E00
#define 	USBGCTL		 *(volatile ioport unsigned int*)0x6791
#define 	USBINTSRC 	 *(volatile ioport unsigned int*)0x6792
#define 	USBIEPIF 	 *(volatile ioport unsigned int*)0x6793
#define 	USBOEPIF 	 *(volatile ioport unsigned int*)0x6794
#define 	USBIEPIE 	 *(volatile ioport unsigned int*)0x679B
#define 	USBOEPIE 	 *(volatile ioport unsigned int*)0x679C
#define 	USBICNF0 	 *(volatile ioport unsigned int*)0x6780
#define 	USBICT0 	 *(volatile ioport unsigned int*)0x6781
#define 	USBOCNF0 	 *(volatile ioport unsigned int*)0x6782
#define 	USBOCT0 	 *(volatile ioport unsigned int*)0x6783
#define 	USBCTL 		 *(volatile ioport unsigned int*)0x67FC
#define 	USBIE 		 *(volatile ioport unsigned int*)0x67FD
#define 	USBIF 		 *(volatile ioport unsigned int*)0x67FE
#define 	USBADDR 	 *(volatile ioport unsigned int*)0x67FF
#define 	OUT0BUF		 *(volatile ioport unsigned int*)0x6680
#define 	HOSTCTL     *(volatile ioport unsigned int*)0x67a0   /*Host DMA control register*/
#define 	FUNADR      *(volatile ioport unsigned int*)0x67ff   /*Function address register*/
/*USB Idle control and status register*/
#define USBIDLECTL  *(volatile ioport unsigned int*)0x7000   /*USB IDLE control register*/
#define USBIDLSTAT  *(volatile ioport unsigned int*)0x7001   /*USB IDLE status register*/

/*endpoint descriptor blocks*/
#define OEDB_base      	0x6700
#define IEDB_base	   	0x6740
#define CNF			   	0x00
#define X_BBASE			0x01
#define XCT				0x02
#define XOCT			0x03
#define BSIZE			0x04
#define Y_BBASE			0x05
#define YCT				0x06
#define YOCT			0x07

typedef struct _SetupPkg
{
	int bmReqestType;
	int bRequest;
	int wValue;
	int wIndex;
	int wLength;
}SETUPPKG;
extern SETUPPKG SetupPkg;

typedef struct _StandardReg
{
	int Get_Status		:	1;
	int Clear_Feature	:	1;
	int Revd1			:	1;
	int Set_Feature		:	1;
	int Revd2			:	1;
	int	Set_Address		:	1;
	int	Get_Descriptor	:	1;
	int Set_Descriptor	:	1;
	int Get_Configuration:	1;
	int Set_Configuration:	1;
	int Get_Interface	:	1;
	int Set_Interface	:	1;
	int Synch_Frame		:	1;
}STANDARDREQ;
extern STANDARDREQ StandardReq;

extern int DeviceDescr[];
extern int ConfigDescr[];
extern int InterfaceDescr[];
extern int EP1_TXDescr[];
extern int EP1_RXDescr[];

extern int UsbCfgOver;
extern int StdReqFlg;

extern void (*StandardRequest[])(void);
void LoadUsbModle();
interrupt void USBISR();
void Setup_Packet_rx();

void Get_Status();
void Clear_Feature();
void Set_Feature();
void Set_Address();
void Get_Descriptor();
void Set_Descriptor();
void Get_Configuration();
void Set_Configuration();
void Get_Interface();
void Set_Interface();
void GetCommand();
void reserved();
void Stall_Ep0();

void Bus_Reset();
void control_transfer(int*buffer,int Length);
void ConfigEndPoint(unsigned int Ep);
void Ep1_Rx();
void Ep1_Tx();


⌨️ 快捷键说明

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