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

📄 freedev_lan91c111_regs.h

📁 lan91c111网络接口的设计 包括功能设计文件和驱动程序文件
💻 H
📖 第 1 页 / 共 3 页
字号:
/*
* Register definitions for the LAN91C111 ethernet chip used on the Nios II
* FreeDev2.1 development 16bit net boards
* Create by Free-electron
* author:liu-jun-sheng
* address:MoGanShan road HangZhou ZheJiang China 
* tel:0571-88846603
* www.Free-Electron.com.cn
* date:2005/12/02
*/

/*
* Register definitions for the Lan 91C111 ethernet chip used on the Nios 
* development boards
*/

#include <io.h>

#ifndef __FREEDEV_LAN91C111_REGS_H_
#define __FREEDEV_LAN91C111_REGS_H_

#define FREEDEV_LAN91C111_CHIP_ID                   0x3390
#define FREEDEV_LAN91C111_CHIP_REV                  0x1

/*
* There are four banks of registers, each paged in or out depending upon the
* value written to the Bank Select Register
*/

#define IOADDR_FREEDEV_LAN91C111_BSR(base)          __IO_CALC_ADDRESS_NATIVE(base, 14)      
#define IORD_FREEDEV_LAN91C111_BSR(base)            IORD_16DIRECT(base, (14*2))
#define IOWR_FREEDEV_LAN91C111_BSR(base,data)       IOWR_16DIRECT(base, (14*2), data)

/*
* Bank 0 registers
*/ 

/* Transmit Control Register */
#define IOADDR_FREEDEV_LAN91C111_TCR(base)          __IO_CALC_ADDRESS_NATIVE(base, 0)
#define IORD_FREEDEV_LAN91C111_TCR(base)            IORD_16DIRECT(base, 0)
#define IOWR_FREEDEV_LAN91C111_TCR(base,data)       IOWR_16DIRECT(base, 0, data)

#define FREEDEV_LAN91C111_TCR_TXENA_MSK             0x1        
#define FREEDEV_LAN91C111_TCR_TXENA_OFST            0
#define FREEDEV_LAN91C111_TCR_LOOP_MSK              0x2        
#define FREEDEV_LAN91C111_TCR_LOOP_OFST             1        
#define FREEDEV_LAN91C111_TCR_FORCOL_MSK            0x4        
#define FREEDEV_LAN91C111_TCR_FORCOL_OFST           2        
#define FREEDEV_LAN91C111_TCR_PAD_EN_MSK            0x80        
#define FREEDEV_LAN91C111_TCR_PAD_EN_OFST           7        
#define FREEDEV_LAN91C111_TCR_NOCRC_MSK             0x100        
#define FREEDEV_LAN91C111_TCR_NOCRC_OFST            8        
#define FREEDEV_LAN91C111_TCR_MON_CSN_MSK           0x400        
#define FREEDEV_LAN91C111_TCR_MON_CSN_OFST          10        
#define FREEDEV_LAN91C111_TCR_FDUPLX_MSK            0x800  
#define FREEDEV_LAN91C111_TCR_FDUPLX_OFST           11  
#define FREEDEV_LAN91C111_TCR_STP_SQET_MSK          0x1000        
#define FREEDEV_LAN91C111_TCR_STP_SQET_OFST         12        
#define FREEDEV_LAN91C111_TCR_EPH_LOOP_MSK          0x2000        
#define FREEDEV_LAN91C111_TCR_EPH_LOOP_OFST         13        
#define FREEDEV_LAN91C111_TCR_SWFDUP_MSK            0x8000        
#define FREEDEV_LAN91C111_TCR_SWFDUP_OFST           15        

/* EPH Status Register */
#define IOADDR_FREEDEV_LAN91C111_EPHSR(base)        __IO_CALC_ADDRESS_NATIVE(base, 2)
#define IORD_FREEDEV_LAN91C111_EPHSR(base)          IORD_16DIRECT(base, (2*2))
#define IOWR_FREEDEV_LAN91C111_EPHSR(base,data)     IOWR_16DIRECT(base, (2*2), data)

#define FREEDEV_LAN91C111_EPHSR_TX_SUC_MSK          0x1       
#define FREEDEV_LAN91C111_EPHSR_TX_SUC_OFST         0       
#define FREEDEV_LAN91C111_EPHSR_COL_MSK             0x2       
#define FREEDEV_LAN91C111_EPHSR_COL_OFST            1       
#define FREEDEV_LAN91C111_EPHSR_MUL_COL_MSK         0x4       
#define FREEDEV_LAN91C111_EPHSR_MUL_COL_OFST        2       
#define FREEDEV_LAN91C111_EPHSRLTX_MULT_MSK         0x8       
#define FREEDEV_LAN91C111_EPHSRLTX_MULT_OFST        3       
#define FREEDEV_LAN91C111_EPHSR_16COL_MSK           0x10       
#define FREEDEV_LAN91C111_EPHSR_16COL_OFST          4       
#define FREEDEV_LAN91C111_EPHSR_SQET_MSK            0x20       
#define FREEDEV_LAN91C111_EPHSR_SQET_OFST           5       
#define FREEDEV_LAN91C111_EPHSR_LTXBRD_MSK          0x40       
#define FREEDEV_LAN91C111_EPHSR_LTXBRD_OFST         6       
#define FREEDEV_LAN91C111_EPHSR_TXDEFR_MSK          0x80       
#define FREEDEV_LAN91C111_EPHSR_TXDEFR_OFST         7       
#define FREEDEV_LAN91C111_EPHSR_LATCOL_MSK          0x200       
#define FREEDEV_LAN91C111_EPHSR_LATCOL_OFST         9       
#define FREEDEV_LAN91C111_EPHSR_LOSTCARR_MSK        0x400       
#define FREEDEV_LAN91C111_EPHSR_LOSTCARR_OFST       10       
#define FREEDEV_LAN91C111_EPHSR_EXC_DEF_MSK         0x800       
#define FREEDEV_LAN91C111_EPHSR_EXC_DEF_OFST        11       
#define FREEDEV_LAN91C111_EPHSR_CTR_ROL_MSK         0x1000       
#define FREEDEV_LAN91C111_EPHSR_CTR_ROL_OFST        12
#define FREEDEV_LAN91C111_EPHSR_LINK_OK_MSK         0x4000       
#define FREEDEV_LAN91C111_EPHSR_LINK_OK_OFST        14       
#define FREEDEV_LAN91C111_EPHSR_TXUNRN_MSK          0x8000       
#define FREEDEV_LAN91C111_EPHSR_TXUNRN_OFST         15       

/* Receive Control Register */  
#define IOADDR_FREEDEV_LAN91C111_RCR(base)          __IO_CALC_ADDRESS_NATIVE(base, 4)
#define IORD_FREEDEV_LAN91C111_RCR(base)            IORD_16DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_RCR(base,data)       IOWR_16DIRECT(base, (4*2), data)

#define FREEDEV_LAN91C111_RCR_RX_ABORT_MSK          0x1  
#define FREEDEV_LAN91C111_RCR_RX_ABORT_OFST         0  
#define FREEDEV_LAN91C111_RCR_PRMS_MSK              0x2  
#define FREEDEV_LAN91C111_RCR_PRMS_OFST             1  
#define FREEDEV_LAN91C111_RCR_ALMUL_MSK             0x4  
#define FREEDEV_LAN91C111_RCR_ALMUL_OFST            2  
#define FREEDEV_LAN91C111_RCR_RXEN_MSK              0x100  
#define FREEDEV_LAN91C111_RCR_RXEN_OFST             8
#define FREEDEV_LAN91C111_RCR_STRIP_CRC_MSK         0x200  
#define FREEDEV_LAN91C111_RCR_STRIP_CRC_OFST        9  
#define FREEDEV_LAN91C111_RCR_ABORT_ENB_MSK         0x2000  
#define FREEDEV_LAN91C111_RCR_ABORT_ENB_OFST        13  
#define FREEDEV_LAN91C111_RCR_FILT_CAR_MSK          0x4000  
#define FREEDEV_LAN91C111_RCR_FILT_CAR_OFST         14  
#define FREEDEV_LAN91C111_RCR_SOFTRST_MSK           0x8000  
#define FREEDEV_LAN91C111_RCR_SOFTRST_OFST          15  


/* Counter Register */
#define IOADDR_FREEDEV_LAN91C111_ECR(base)          __IO_CALC_ADDRESS_NATIVE(base, 6)
#define IORD_FREEDEV_LAN91C111_ECR(base)            IORD_16DIRECT(base, (6*2))
#define IOWR_FREEDEV_LAN91C111_ECR(base,data)       IOWR_16DIRECT(base, (6*2), data)

/* Memory Information Register */
#define IOADDR_FREEDEV_LAN91C111_MIR(base)          __IO_CALC_ADDRESS_NATIVE(base, 8)
#define IORD_FREEDEV_LAN91C111_MIR(base)            IORD_16DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_MIR(base,data)       IOWR_16DIRECT(base, (8*2), data)

/* Receive/Phy Control Register */
#define IOADDR_FREEDEV_LAN91C111_RPCR(base)         __IO_CALC_ADDRESS_NATIVE(base, 10)
#define IORD_FREEDEV_LAN91C111_RPCR(base)           IORD_16DIRECT(base, (10*2))
#define IOWR_FREEDEV_LAN91C111_RPCR(base,data)      IOWR_16DIRECT(base, (10*2), data)

#define FREEDEV_LAN91C111_RPCR_LS0B_MSK             0x4
#define FREEDEV_LAN91C111_RPCR_LS0B_OFST            2
#define FREEDEV_LAN91C111_RPCR_LS1B_MSK             0x8
#define FREEDEV_LAN91C111_RPCR_LS1B_OFST            3
#define FREEDEV_LAN91C111_RPCR_LS2B_MSK             0x10
#define FREEDEV_LAN91C111_RPCR_LS2B_OFST            4
#define FREEDEV_LAN91C111_RPCR_LS0A_MSK             0x20
#define FREEDEV_LAN91C111_RPCR_LS0A_OFST            5
#define FREEDEV_LAN91C111_RPCR_LS1A_MSK             0x40
#define FREEDEV_LAN91C111_RPCR_LS1A_OFST            6
#define FREEDEV_LAN91C111_RPCR_LS2A_MSK             0x80
#define FREEDEV_LAN91C111_RPCR_LS2A_OFST            7
#define FREEDEV_LAN91C111_RPCR_ANEG_MSK             0x800
#define FREEDEV_LAN91C111_RPCR_ANEG_OFST            11
#define FREEDEV_LAN91C111_RPCR_DPLX_MSK             0x1000  
#define FREEDEV_LAN91C111_RPCR_DPLX_OFST            12  
#define FREEDEV_LAN91C111_RPCR_SPEED_MSK            0x2000  
#define FREEDEV_LAN91C111_RPCR_SPEED_OFST           13  

/* Bank 1 Registers */

/* Configuration Reg */
#define IOADDR_FREEDEV_LAN91C111_CR(base)           __IO_CALC_ADDRESS_NATIVE(base, 0)
#define IORD_FREEDEV_LAN91C111_CR(base)             IORD_16DIRECT(base, 0)
#define IOWR_FREEDEV_LAN91C111_CR(base,data)        IOWR_16DIRECT(base, 0, data)

#define FREEDEV_LAN91C111_CR_EXT_PHY_MSK            0x200  
#define FREEDEV_LAN91C111_CR_EXT_PHY_OFST           9  
#define FREEDEV_LAN91C111_CR_GPCNTRL_MSK            0x400  
#define FREEDEV_LAN91C111_CR_GPCNTRL_OFST           10  
#define FREEDEV_LAN91C111_CR_NO_WAIT_MSK            0x1000  
#define FREEDEV_LAN91C111_CR_NO_WAIT_OFST           12  
#define FREEDEV_LAN91C111_CR_EPH_POWER_EN_MSK       0x8000 
#define FREEDEV_LAN91C111_CR_EPH_POWER_EN_OFST      15 

/* Base Address Register */
#define IOADDR_FREEDEV_LAN91C111_BAR(base)          __IO_CALC_ADDRESS_NATIVE(base, 2)
#define IORD_FREEDEV_LAN91C111_BAR(base)            IORD_16DIRECT(base, (2*2))
#define IOWR_FREEDEV_LAN91C111_BAR(base,data)       IOWR_16DIRECT(base, (2*2), data)

/* Individual Address Registers */
#define IOADDR_FREEDEV_LAN91C111_IAR0(base)         __IO_CALC_ADDRESS_NATIVE(base, 4)
#define IORD_FREEDEV_LAN91C111_IAR0(base)           IORD_8DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_IAR0(base,data)      IOWR_8DIRECT(base, (4*2), data)
#define IOADDR_FREEDEV_LAN91C111_IAR1(base)         __IO_CALC_ADDRESS_NATIVE(base, 5)
#define IORD_FREEDEV_LAN91C111_IAR1(base)           IORD_8DIRECT(base, (4*2+1))
#define IOWR_FREEDEV_LAN91C111_IAR1(base,data)      IOWR_8DIRECT(base, (4*2+1), data)
#define IOADDR_FREEDEV_LAN91C111_IAR2(base)         __IO_CALC_ADDRESS_NATIVE(base, 6)
#define IORD_FREEDEV_LAN91C111_IAR2(base)           IORD_8DIRECT(base, (6*2))
#define IOWR_FREEDEV_LAN91C111_IAR2(base,data)      IOWR_8DIRECT(base, (6*2), data)
#define IOADDR_FREEDEV_LAN91C111_IAR3(base)         __IO_CALC_ADDRESS_NATIVE(base, 7)
#define IORD_FREEDEV_LAN91C111_IAR3(base)           IORD_8DIRECT(base, (6*2+1))
#define IOWR_FREEDEV_LAN91C111_IAR3(base,data)      IOWR_8DIRECT(base, (6*2+1), data)
#define IOADDR_FREEDEV_LAN91C111_IAR4(base)         __IO_CALC_ADDRESS_NATIVE(base, 8)
#define IORD_FREEDEV_LAN91C111_IAR4(base)           IORD_8DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_IAR4(base,data)      IOWR_8DIRECT(base, (8*2), data)
#define IOADDR_FREEDEV_LAN91C111_IAR5(base)         __IO_CALC_ADDRESS_NATIVE(base, 9)
#define IORD_FREEDEV_LAN91C111_IAR5(base)           IORD_8DIRECT(base, (8*2+1))
#define IOWR_FREEDEV_LAN91C111_IAR5(base,data)      IOWR_8DIRECT(base, (8*2+1), data)
#define IORD_FREEDEV_LAN91C111_IAR0_1(base)         IORD_16DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_IAR0_1(base,data)    IOWR_16DIRECT(base, (4*2), data)
#define IORD_FREEDEV_LAN91C111_IAR2_3(base)         IORD_16DIRECT(base, (6*2))
#define IOWR_FREEDEV_LAN91C111_IAR2_3(base,data)    IOWR_16DIRECT(base, (6*2), data)
#define IORD_FREEDEV_LAN91C111_IAR4_5(base)         IORD_16DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_IAR4_5(base,data)    IOWR_16DIRECT(base, (8*2), data)

⌨️ 快捷键说明

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