📄 net_bsp.h
字号:
/*
*********************************************************************************************************
* uC/TCP-IP
* The Embedded TCP/IP Suite
*
* (c) Copyright 2003-2006; Micrium, Inc.; Weston, FL
*
* All rights reserved. Protected by international copyright laws.
*
* uC/TCP-IP is provided in source form for FREE evaluation, for educational
* use or peaceful research. If you plan on using uC/TCP-IP in a commercial
* product you need to contact Micrium to properly license its use in your
* product. We provide ALL the source code for your convenience and to help
* you experience uC/TCP-IP. The fact that the source code is provided does
* NOT mean that you can use it without paying a licensing fee.
*
* Knowledge of the source code may NOT be used to develop a similar product.
*
* Please help us continue to provide the Embedded community with the finest
* software available. Your honesty is greatly appreciated.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
*
* NETWORK BOARD SUPPORT PACKAGE (BSP) FUNCTIONS
*
* TEMPLATE
*
* Filename : net_bsp.h
* Version : V1.88
* Programmer(s) : ITJ
* Jean-Denis Hatier
*********************************************************************************************************
* Note(s) : (1) To provide the required Board Support Package functionality, insert the appropriate
* board-dependent code to perform the stated actions wherever '$$$$' comments are found.
*
* #### This note MAY be entirely removed for specific board support packages.
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* EXTERNS
*********************************************************************************************************
*/
#ifdef NET_BSP_MODULE
#define NET_BSP_EXT
#else
#define NET_BSP_EXT extern
#endif
/*$PAGE*/
/*
*********************************************************************************************************
* DEFINES
*********************************************************************************************************
*/
#define AT91RM9200_EMAC_REG_ADDR_BASE 0xFFFBC000
#define AT91RM9200_EMAC_RX_NUM_BUFS 8 /* Number of RX buffers. MUST be => 2. */
#define AT91RM9200_EMAC_RX_BUF_HDRS_ADDR 0x00200200 /* Length: AT91RM9200_EMAC_RX_NUM_BUFS * sizeof(AT91RM9200_EMAC_RX_BUF_HDR) */
#define AT91RM9200_EMAC_RX_BUF_ADDR 0x00200400 /* Length: AT91RM9200_EMAC_RX_NUM_BUFS * AT91RM9200_EMAC_RX_BUF_SIZE */
#define AT91RM9200_EMAC_TX_BUF_ADDR 0x00203400 /* Length: AT91RM9200_EMAC_TX_NUM_BUFS * AT91RM9200_EMAC_TX_BUF_SIZE */
/*
*********************************************************************************************************
* MACRO'S
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* NIC READ/WRITE MACRO'S
*
* Description : Read/Write data values to & from NIC.
*
* Argument(s) : Various.
*
* Return(s) : Various.
*
* Caller(s) : Specific NIC Read/Write function(s).
*
* These macro's are network protocol suite to network interface controller (NIC) macro's
* & SHOULD be called only by appropriate network interface controller function(s).
*
* Note(s) : (1) When NET_NIC_CFG_RD_WR_SEL configured to NET_NIC_RD_WR_SEL_MACRO, implement NIC read/write
* functionality with macro's.
*
* (a) The developer MUST implement the NIC read/write macro functions with the correct number
* & type of arguments necessary to implement the NIC's read/write functionality.
*
* (b) The developer SHOULD appropriately name the NIC read/write macro functions by appending
* the number of bits that the macro functions read/write to the end of the macro function
* name :
* NetNIC_Rd_xx()
* NetNIC_Wr_xx()
*
* For example, 16-bit read/write macro functions should be named :
* NetNIC_Rd_16()
* NetNIC_Wr_16()
*
* See also 'net_bsp.c NetNIC_Rd_xx() Note #1'
* & 'net_bsp.c NetNIC_Wr_xx() Note #1'.
*********************************************************************************************************
*/
#if (NET_NIC_CFG_RD_WR_SEL != NET_NIC_RD_WR_SEL_FNCT)
#define AT91RM9200_EMAC_RegRd(reg_offset) (*((volatile CPU_INT32U *)(AT91RM9200_EMAC_REG_ADDR_BASE + reg_offset)))
#define AT91RM9200_EMAC_RegWr(reg_offset, val) (*((volatile CPU_INT32U *)(AT91RM9200_EMAC_REG_ADDR_BASE + reg_offset)) = val)
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -