www.pudn.com > multitaskRTC.rar > Ethernet.h, change:2006-03-27,size:2653b


#ifndef __INTERNET_ETHERNET_H__ 
#define __INTERNET_ETHERNET_H__ 
 
#include "..\inc\def.h" 
 
 
#define Ethernet_Reg00	(*(volatile unsigned short int*)0x0a000600) 
#define Ethernet_Reg01	(*(volatile unsigned short int*)0x0a000602) 
#define Ethernet_Reg02	(*(volatile unsigned short int*)0x0a000604) 
#define Ethernet_Reg03	(*(volatile unsigned short int*)0x0a000606) 
#define Ethernet_Reg04	(*(volatile unsigned short int*)0x0a000608) 
#define Ethernet_Reg05	(*(volatile unsigned short int*)0x0a00060a) 
#define Ethernet_Reg06	(*(volatile unsigned short int*)0x0a00060c) 
#define Ethernet_Reg07	(*(volatile unsigned short int*)0x0a00060e) 
#define Ethernet_Reg08	(*(volatile unsigned short int*)0x0a000610) 
#define Ethernet_Reg09	(*(volatile unsigned short int*)0x0a000612) 
#define Ethernet_Reg0a	(*(volatile unsigned short int*)0x0a000614) 
#define Ethernet_Reg0b	(*(volatile unsigned short int*)0x0a000616) 
#define Ethernet_Reg0c	(*(volatile unsigned short int*)0x0a000618) 
#define Ethernet_Reg0d	(*(volatile unsigned short int*)0x0a00061a) 
#define Ethernet_Reg0e	(*(volatile unsigned short int*)0x0a00061c) 
#define Ethernet_Reg0f	(*(volatile unsigned short int*)0x0a00061e) 
#define Ethernet_Reg10	(*(volatile unsigned short int*)0x0a000620) 
 
#define Ethernet_Reg00_01	(*(volatile unsigned *)0x0a000600) 
#define Ethernet_Reg02_03	(*(volatile unsigned *)0x0a000604) 
#define Ethernet_Reg04_05	(*(volatile unsigned *)0x0a000608) 
#define Ethernet_Reg06_07	(*(volatile unsigned *)0x0a00060c) 
#define Ethernet_Reg08_09	(*(volatile unsigned *)0x0a000610) 
#define Ethernet_Reg0a_0b	(*(volatile unsigned *)0x0a000614) 
#define Ethernet_Reg0c_0d	(*(volatile unsigned *)0x0a000618) 
#define Ethernet_Reg0e_0f	(*(volatile unsigned *)0x0a00061c) 
#define Ethernet_Reg10_11	(*(volatile unsigned *)0x0a000620) 
 
#define Ethernet_Reset_Reg	(*(volatile unsigned short*)0x0a00063c) 
 
////////////////////////////RTL8019AS///////////////// 
#define RTL8019_ISR_PRX		1	//收到一个有效包 
#define RTL8019_ISR_PTX		2	//成功发送一个包 
#define RTL8019_ISR_RXE		4 
#define RTL8019_ISR_TXE		8 
#define RTL8019_ISR_RST		0x80 //复位 
#define RTL8019_ISR_DMA	0x40 //复位 
 
#define MAX_MACPACKAGE_SIZE		1518 
 
 
/*数据链路层头部*/ 
typedef struct{ 
	U16* source; 
	U16* des; 
	U16 type; 
}MacHeader,*PMacHeader; 
 
/*数据包结构*/ 
typedef struct{ 
	U32* data; 
	int datalength; 
}PackageData, *PPackageData; 
 
void EtherNetISR(); 
void EtherSetRegPage(char pagenumber); 
void EtherGetMac(char mac[]); 
void EtherNetInit(); //网卡初始化 
void SendPackage(PMacHeader machd, PackageData PkData[],int nPkdata); 
int IsEtherNetRev(PackageData pPkdata[]); 
 
#endif