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

📄 freedev_lan91c111_regs.h

📁 lan91c111网络接口的设计 包括功能设计文件和驱动程序文件
💻 H
📖 第 1 页 / 共 3 页
字号:

/* General Purpose Register */
#define IOADDR_FREEDEV_LAN91C111_GPR(base)          __IO_CALC_ADDRESS_NATIVE(base, 10)
#define IORD_FREEDEV_LAN91C111_GPR(base)            IORD_16DIRECT(base, (10*2))
#define IOWR_FREEDEV_LAN91C111_GPR(base,data)       IOWR_16DIRECT(base, (10*2), data)

/* Control Register */
#define IOADDR_FREEDEV_LAN91C111_CTR(base)          __IO_CALC_ADDRESS_NATIVE(base, 12)
#define IORD_FREEDEV_LAN91C111_CTR(base)            IORD_16DIRECT(base, (12*2))
#define IOWR_FREEDEV_LAN91C111_CTR(base,data)       IOWR_16DIRECT(base, (12*2), data)

#define FREEDEV_LAN91C111_CTR_STORE_MSK             0x1 
#define FREEDEV_LAN91C111_CTR_STORE_OFST            0 
#define FREEDEV_LAN91C111_CTR_RELOAD_MSK            0x2 
#define FREEDEV_LAN91C111_CTR_RELOAD_OFST           1 
#define FREEDEV_LAN91C111_CTR_EEPROM_SELECT_MSK     0x4 
#define FREEDEV_LAN91C111_CTR_EEPROM_SELECT_OFST    2 
#define FREEDEV_LAN91C111_CTR_TE_ENABLE_MSK         0x20 
#define FREEDEV_LAN91C111_CTR_TE_ENABLE_OFST        5 
#define FREEDEV_LAN91C111_CTR_CR_ENABLE_MSK         0x40 
#define FREEDEV_LAN91C111_CTR_CR_ENABLE_OFST        6 
#define FREEDEV_LAN91C111_CTR_LE_ENABLE_MSK         0x80 
#define FREEDEV_LAN91C111_CTR_LE_ENABLE_OFST        7 
#define FREEDEV_LAN91C111_CTR_AUTO_RELEASE_MSK      0x800 
#define FREEDEV_LAN91C111_CTR_AUTO_RELEASE_OFST     11 
#define FREEDEV_LAN91C111_CTR_RCV_BAD_MSK           0x4000 
#define FREEDEV_LAN91C111_CTR_RCV_BAD_OFST          14 

/* Bank 2 Registers */

/* MMU Command Register */
#define IOADDR_FREEDEV_LAN91C111_MMUCR(base)        __IO_CALC_ADDRESS_NATIVE(base, 0)
#define IORD_FREEDEV_LAN91C111_MMUCR(base)          IORD_16DIRECT(base, 0)
#define IOWR_FREEDEV_LAN91C111_MMUCR(base,data)     IOWR_16DIRECT(base, 0, data)

#define FREEDEV_LAN91C111_MMUCR_BUSY_MSK            0x1 
#define FREEDEV_LAN91C111_MMUCR_BUSY_OFST           0
#define FREEDEV_LAN91C111_MMUCR_CMD_OFST            5
#define FREEDEV_LAN91C111_MMUCR_NOP_MSK             (0<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_ALLOC_MSK           (1<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_RESET_MSK           (2<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_REMOVE_MSK          (3<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_REMOVE_RELEASE_MSK  (4<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_RELEASE_MSK         (5<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_ENQUEUE_MSK         (6<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  
#define FREEDEV_LAN91C111_MMUCR_RESET_TX_MSK        (7<<FREEDEV_LAN91C111_MMUCR_CMD_OFST)  

/* Packet Number Register */
#define IOADDR_FREEDEV_LAN91C111_PNR(base)          __IO_CALC_ADDRESS_NATIVE(base, 2)
#define IORD_FREEDEV_LAN91C111_PNR(base)            IORD_8DIRECT(base, (2*2))
#define IOWR_FREEDEV_LAN91C111_PNR(base,data)       IOWR_8DIRECT(base, (2*2), data)

/* Allocation Result Register */
#define IOADDR_FREEDEV_LAN91C111_ARR(base)          __IO_CALC_ADDRESS_NATIVE(base, 3)
#define IORD_FREEDEV_LAN91C111_ARR(base)            IORD_8DIRECT(base, (3*2))
#define IOWR_FREEDEV_LAN91C111_ARR(base,data)       IOWR_8DIRECT(base, (3*2), data)

#define FREEDEV_LAN91C111_ARR_FAILED_MSK            0x80    
#define FREEDEV_LAN91C111_ARR_FAILED_OFST           7    

/* Receive FIFO Ports Register */
#define IOADDR_FREEDEV_LAN91C111_RX_FIFO(base)      __IO_CALC_ADDRESS_NATIVE(base, 4)
#define IORD_FREEDEV_LAN91C111_RX_FIFO(base)        IORD_16DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_RX_FIFO(base,data)   IOWR_16DIRECT(base, (4*2), data)

#define FREEDEV_LAN91C111_RX_FIFO_REMPTY_MSK        0x8000  
#define FREEDEV_LAN91C111_RX_FIFO_REMPTY_OFST       15  

/* Transmit FIFO Ports Register */
#define IOADDR_FREEDEV_LAN91C111_TX_FIFO(base)      __IO_CALC_ADDRESS_NATIVE(base, 4)
#define IORD_FREEDEV_LAN91C111_TX_FIFO(base)        IORD_16DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_TX_FIFO(base,data)   IOWR_16DIRECT(base, (4*2), data)

#define FREEDEV_LAN91C111_TX_FIFO_TEMPTY_MSK        0x80    
#define FREEDEV_LAN91C111_TX_FIFO_TEMPTY_OFST       7    

/* Pointer Register */
#define IOADDR_FREEDEV_LAN91C111_PTR(base)          __IO_CALC_ADDRESS_NATIVE(base, 6)
#define IORD_FREEDEV_LAN91C111_PTR(base)            IORD_16DIRECT(base, (6*2))
#define IOWR_FREEDEV_LAN91C111_PTR(base,data)       IOWR_16DIRECT(base, (6*2), data)

#define FREEDEV_LAN91C111_PTR_LOW_MSK               0xFF 
#define FREEDEV_LAN91C111_PTR_LOW_OFST              0 
#define FREEDEV_LAN91C111_PTR_HIGH_MSK              0x700 
#define FREEDEV_LAN91C111_PTR_HIGH_OFST             8 
#define FREEDEV_LAN91C111_PTR_NOT_EMPTY_MSK         0x800 
#define FREEDEV_LAN91C111_PTR_NOT_EMPTY_OFST        11 
#define FREEDEV_LAN91C111_PTR_ETEN_MSK              0x1000
#define FREEDEV_LAN91C111_PTR_ETEN_OFST             12
#define FREEDEV_LAN91C111_PTR_READ_MSK              0x2000 
#define FREEDEV_LAN91C111_PTR_READ_OFST             13 
#define FREEDEV_LAN91C111_PTR_AUTO_INCR_MSK         0x4000 
#define FREEDEV_LAN91C111_PTR_AUTO_INCR_OFST        14 
#define FREEDEV_LAN91C111_PTR_RCV_MSK               0x8000 
#define FREEDEV_LAN91C111_PTR_RCV_OFST              15 

/* Data Register */
#define IOADDR_FREEDEV_LAN91C111_DATA(base)         __IO_CALC_ADDRESS_NATIVE(base, 8)
#define IORD_FREEDEV_LAN91C111_DATA_BYTE(base)      IORD_8DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_DATA_BYTE(base,data) IOWR_8DIRECT(base, (8*2), data)
#define IORD_FREEDEV_LAN91C111_DATA_HW(base)        IORD_16DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_DATA_HW(base,data)   IOWR_16DIRECT(base, (8*2), data)

#define IORD_FREEDEV_LAN91C111_DATA_WORD(base)      ((IORD_32DIRECT(base, (8*2)))|((IORD_32DIRECT(base,(10*2)))<<16))
#define IOWR_FREEDEV_LAN91C111_DATA_WORD(base,data) IOWR_32DIRECT(base, (8*2), ((data)&0xffff));  \
                                                    IOWR_32DIRECT(base, (10*2), (((data)&0xffff0000)>>16));
                                                    
   
/* 
* Interrupt Status Registers
*/

/* Interrupt Status Register */
#define IOADDR_FREEDEV_LAN91C111_IST(base)          __IO_CALC_ADDRESS_NATIVE(base, 12)
#define IORD_FREEDEV_LAN91C111_IST(base)            IORD_8DIRECT(base, (12*2))

/* Interrupt ACK Register */
#define IOWR_FREEDEV_LAN91C111_ACK(base, data)      IOWR_8DIRECT(base, (12*2), data)

/* Interrupt Mask Register */
#define IOADDR_FREEDEV_LAN91C111_MSK(base)          __IO_CALC_ADDRESS_NATIVE(base, 13)
#define IORD_FREEDEV_LAN91C111_MSK(base)            IORD_8DIRECT(base, (12*2+1))
#define IOWR_FREEDEV_LAN91C111_MSK(base, data)      IOWR_8DIRECT(base, (12*2+1), data)

/* The bit definitions are the same for all three registers */
#define FREEDEV_LAN91C111_INT_RCV_INT_MSK           0x1 
#define FREEDEV_LAN91C111_INT_RCV_INT_OFST          0 
#define FREEDEV_LAN91C111_INT_TX_INT_MSK            0x2 
#define FREEDEV_LAN91C111_INT_TX_INT_OFST           1
#define FREEDEV_LAN91C111_INT_TX_EMPTY_INT_MSK      0x4 
#define FREEDEV_LAN91C111_INT_TX_EMPTY_INT_OFST     2 
#define FREEDEV_LAN91C111_INT_ALLOC_INT_MSK         0x8
#define FREEDEV_LAN91C111_INT_ALLOC_INT_OFST        3
#define FREEDEV_LAN91C111_INT_RX_OVRN_INT_MSK       0x10
#define FREEDEV_LAN91C111_INT_RX_OVRN_INT_OFST      4
#define FREEDEV_LAN91C111_INT_EPH_INT_MSK           0x20
#define FREEDEV_LAN91C111_INT_EPH_INT_OFST          5
#define FREEDEV_LAN91C111_INT_ERCV_INT_MSK          0x40
#define FREEDEV_LAN91C111_INT_ERCV_INT_OFST         6
#define FREEDEV_LAN91C111_INT_MDINT_MSK             0x80
#define FREEDEV_LAN91C111_INT_MDINT_OFST            7

/* Bank 3 Registers */

/* Multicast Table Registers */
#define IOADDR_FREEDEV_LAN91C111_MT0(base)          __IO_CALC_ADDRESS_NATIVE(base, 0)
#define IORD_FREEDEV_LAN91C111_MT0(base)            IORD_8DIRECT(base, 0)
#define IOWR_FREEDEV_LAN91C111_MT0(base, data)      IOWR_8DIRECT(base, 0, data)
#define IOADDR_FREEDEV_LAN91C111_MT1(base)          __IO_CALC_ADDRESS_NATIVE(base, 1)
#define IORD_FREEDEV_LAN91C111_MT1(base)            IORD_8DIRECT(base, (1*2))
#define IOWR_FREEDEV_LAN91C111_MT1(base, data)      IOWR_8DIRECT(base, (1*2), data)
#define IOADDR_FREEDEV_LAN91C111_MT2(base)          __IO_CALC_ADDRESS_NATIVE(base, 2)
#define IORD_FREEDEV_LAN91C111_MT2(base)            IORD_8DIRECT(base, (2*2))
#define IOWR_FREEDEV_LAN91C111_MT2(base, data)      IOWR_8DIRECT(base, (2*2), data)
#define IOADDR_FREEDEV_LAN91C111_MT3(base)          __IO_CALC_ADDRESS_NATIVE(base, 3)
#define IORD_FREEDEV_LAN91C111_MT3(base)            IORD_8DIRECT(base, (2*2+1))
#define IOWR_FREEDEV_LAN91C111_MT3(base, data)      IOWR_8DIRECT(base, (2*2+1), data)
#define IOADDR_FREEDEV_LAN91C111_MT4(base)          __IO_CALC_ADDRESS_NATIVE(base, 4)
#define IORD_FREEDEV_LAN91C111_MT4(base)            IORD_8DIRECT(base, (4*2))
#define IOWR_FREEDEV_LAN91C111_MT4(base, data)      IOWR_8DIRECT(base, (4*2), data)
#define IOADDR_FREEDEV_LAN91C111_MT5(base)          __IO_CALC_ADDRESS_NATIVE(base, 5)
#define IORD_FREEDEV_LAN91C111_MT5(base)            IORD_8DIRECT(base, (4*2+1))
#define IOWR_FREEDEV_LAN91C111_MT5(base, data)      IOWR_8DIRECT(base, (4*2+1), data)
#define IOADDR_FREEDEV_LAN91C111_MT6(base)          __IO_CALC_ADDRESS_NATIVE(base, 6)
#define IORD_FREEDEV_LAN91C111_MT6(base)            IORD_8DIRECT(base, (6*2))
#define IOWR_FREEDEV_LAN91C111_MT6(base, data)      IOWR_8DIRECT(base, (6*2), data)
#define IOADDR_FREEDEV_LAN91C111_MT7(base)          __IO_CALC_ADDRESS_NATIVE(base, 7)
#define IORD_FREEDEV_LAN91C111_MT7(base)            IORD_8DIRECT(base, (6*2+1))
#define IOWR_FREEDEV_LAN91C111_MT7(base, data)      IOWR_8DIRECT(base, (6*2+1), data)

/* Management Interface Register */
#define IOADDR_FREEDEV_LAN91C111_MGMT(base)         __IO_CALC_ADDRESS_NATIVE(base, 8)
#define IORD_FREEDEV_LAN91C111_MGMT(base)           IORD_16DIRECT(base, (8*2))
#define IOWR_FREEDEV_LAN91C111_MGMT(base, data)     IOWR_16DIRECT(base, (8*2), data)

#define FREEDEV_LAN91C111_MGMT_MDO_MSK              0x1 
#define FREEDEV_LAN91C111_MGMT_MDO_OFST             0 
#define FREEDEV_LAN91C111_MGMT_MDI_MSK              0x2 
#define FREEDEV_LAN91C111_MGMT_MDI_OFST             1 
#define FREEDEV_LAN91C111_MGMT_MCLK_MSK             0x4 
#define FREEDEV_LAN91C111_MGMT_MCLK_OFST            2 
#define FREEDEV_LAN91C111_MGMT_MDOE_MSK             0x8 
#define FREEDEV_LAN91C111_MGMT_MDOE_OFST            3 
#define FREEDEV_LAN91C111_MGMT_MSK_CRS100_MSK       0x4000 
#define FREEDEV_LAN91C111_MGMT_MSK_CRS100_OFST      14 

/* Revision Register */
#define IOADDR_FREEDEV_LAN91C111_REV(base)          __IO_CALC_ADDRESS_NATIVE(base, 10)
#define IORD_FREEDEV_LAN91C111_REV(base)            IORD_16DIRECT(base, (10*2))
#define IOWR_FREEDEV_LAN91C111_REV(base, data)      IOWR_16DIRECT(base, (10*2), data)

/* Early RCV Register */
#define IOADDR_FREEDEV_LAN91C111_ERCV(base)         __IO_CALC_ADDRESS_NATIVE(base, 12)
#define IORD_FREEDEV_LAN91C111_ERCV(base)           IORD_16DIRECT(base, (12*2))
#define IOWR_FREEDEV_LAN91C111_ERCV(base, data)     IOWR_16DIRECT(base, (12*2), data)

#define FREEDEV_LAN91C111_ERCV_RCV_THRSHLD_MSK      0x1F 
#define FREEDEV_LAN91C111_ERCV_RCV_THRSHLD_OFST     0 
#define FREEDEV_LAN91C111_ERCV_RCV_DISCRD_MSK       0x80 
#define FREEDEV_LAN91C111_ERCV_RCV_DISCRD_OFST      7 

⌨️ 快捷键说明

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