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

📄 rtl8019.h

📁 RT-Thread是发展中的下一代微内核嵌入式实时操作系统
💻 H
字号:
/*+------------------------------------------------------------------------------| File        : rtl8019.h+------------------------------------------------------------------------------| Description :	RealTek 8019 ethnet interface driver+------------------------------------------------------------------------------| History     : 2004-12-2, Bernard Xiong,	The init version+------------------------------------------------------------------------------*/#ifndef __RTL8019_H__#define __RTL8019_H__#define RLT8019_BASE	0x60000000#define NE_CR			(*(volatile unsigned char *)(RLT8019_BASE+0))	/* Control Register */#define	NE_DMA			(*(volatile unsigned char *)(RLT8019_BASE+16))	/* DMA Register */#define	NE_RESET		(*(volatile unsigned char *)(RLT8019_BASE+32))	/* Reset Register */#define NE_PSTART		(*(volatile unsigned char *)(RLT8019_BASE+1))	/* Page Start Register */#define NE_PSTOP		(*(volatile unsigned char *)(RLT8019_BASE+2))	/* Page Stop Register */#define NE_BNRY			(*(volatile unsigned char *)(RLT8019_BASE+3))	/* Boundary Register */#define NE_TPSR			(*(volatile unsigned char *)(RLT8019_BASE+4))	/* Transmit Page Start Register */#define NE_TBCR0		(*(volatile unsigned char *)(RLT8019_BASE+5))	/* Transmit Byte Count Register 0 */#define NE_TBCR1		(*(volatile unsigned char *)(RLT8019_BASE+6))	/* Transmit Byte Count Register 1 */#define NE_ISR			(*(volatile unsigned char *)(RLT8019_BASE+7))	/* Interrupt Status Register */#define NE_RSAR0		(*(volatile unsigned char *)(RLT8019_BASE+8))	/* Remote Start Address Register 0 */#define NE_RSAR1		(*(volatile unsigned char *)(RLT8019_BASE+9))	/* Remote Start Address Register 1 */#define NE_RBCR0		(*(volatile unsigned char *)(RLT8019_BASE+10))	/* Remote Byte Count Register 0 */#define NE_RBCR1		(*(volatile unsigned char *)(RLT8019_BASE+11))	/* Remote Byte Count Register 1 */#define NE_RCR			(*(volatile unsigned char *)(RLT8019_BASE+12))	/* Receive Configuration Register */#define NE_TCR			(*(volatile unsigned char *)(RLT8019_BASE+13))	/* Transmit Configuration Register */#define NE_DCR			(*(volatile unsigned char *)(RLT8019_BASE+14))	/* Data Configuration Register */#define NE_IMR			(*(volatile unsigned char *)(RLT8019_BASE+15))	/* Interrupt Mask Register */#define NE_PAR0			(*(volatile unsigned char *)(RLT8019_BASE+1))	/* Physical Address Register 0 */#define NE_PAR1			(*(volatile unsigned char *)(RLT8019_BASE+2))	/* Physical Address Register 1 */#define NE_PAR2			(*(volatile unsigned char *)(RLT8019_BASE+3))	/* Physical Address Register 2 */#define NE_PAR3			(*(volatile unsigned char *)(RLT8019_BASE+4))	/* Physical Address Register 3 */#define NE_PAR4			(*(volatile unsigned char *)(RLT8019_BASE+5))	/* Physical Address Register 4 */#define NE_PAR5			(*(volatile unsigned char *)(RLT8019_BASE+6))	/* Physical Address Register 5 */#define NE_CURR			(*(volatile unsigned char *)(RLT8019_BASE+7))	/* Current Page Register */#define NE_MAR0			(*(volatile unsigned char *)(RLT8019_BASE+8))	/* Multicast Address Register 0 */#define NE_MAR1			(*(volatile unsigned char *)(RLT8019_BASE+9))	/* Multicast Address Register 1 */#define NE_MAR2			(*(volatile unsigned char *)(RLT8019_BASE+10))	/* Multicast Address Register 2 */#define NE_MAR3			(*(volatile unsigned char *)(RLT8019_BASE+11))	/* Multicast Address Register 3 */#define NE_MAR4			(*(volatile unsigned char *)(RLT8019_BASE+12))	/* Multicast Address Register 4 */#define NE_MAR5			(*(volatile unsigned char *)(RLT8019_BASE+13))	/* Multicast Address Register 5 */#define NE_MAR6			(*(volatile unsigned char *)(RLT8019_BASE+14))	/* Multicast Address Register 6 */#define NE_MAR7			(*(volatile unsigned char *)(RLT8019_BASE+15))	/* Multicast Address Register 7 *//* commands for CR register */#define	CMD_STOP	0x01		/* stop */#define	CMD_RUN		0x02		/* run */#define	CMD_XMIT	0x04		/* xmit, transmit data to network  */#define	CMD_READ	0x08		/* read */#define	CMD_WRITE	0x10		/* write */#define	CMD_SEND	0x18		/* send */#define	CMD_NODMA	0x20		/* no DMA */#define	CMD_PAGE0	0x00		/* select 0 page */#define	CMD_PAGE1	0x40		/* select 1 page */#define	CMD_PAGE2	0x80		/* select 2 page */#define	XMIT_START	16*1024		/* the start address of transmit buffer */#define	RECV_START	16*1024		/* the start address of receive buffer */#define	RECV_STOP	48*1024		/* the end address of receive buffer *//* the status of interrupt status register */#define	ISR_PRX		0x01		/* ISR of packet receive */#define	ISR_PTX		0x02		/* ISR of packet transmit */#define	ISR_RXE		0x04		/* ISR of receive error */#define	ISR_TXE		0x08		/* ISR of transmit error */#define	ISR_OVW		0x10		/* ISR of buffer overflow */#define	ISR_CNT		0x20		/* ISR of count error */#define	ISR_RDC		0x40		/* ISR of end of DMA */#define	ISR_RST		0x80		/* ISR of reset *//* value of Data Control Register */#define	DCR_WTS		0x01#define	DCR_BOS		0x02#define	DCR_LAS		0x04#define	DCR_LS		0x08#define	DCR_ARM		0x10#define	DCR_FIFO2	0x00#define	DCR_FIFO4	0x20#define	DCR_FIFO8	0x40#define	DCR_FIFO12	0x60/* value of Transmit Control Register */#define	TCR_CRC			0x01#define	TCR_LOOP_NONE	0x00#define	TCR_LOOP_INT	0x02#define	TCR_LOOP_EXT	0x06#define	TCR_ATD			0x08#define	TCR_OFST		0x10/* value of Receive Control Register */#define	RCR_SEP		0x01#define	RCR_AR		0x02#define	RCR_AB		0x04#define	RCR_AM		0x08#define	RCR_PRO		0x10#define	RCR_MON		0x20#define INT_NE		0x18#define FLG_POLL	0x01int rtl8019_device_register(char* name);#endif

⌨️ 快捷键说明

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