📄 c6455_common.h
字号:
/*
* Copyright 2007 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
* @(#) TCP/IP_Network_Developers_Kit 1.92.00.22 01-10-2007 (ndk-b22)
*/
#ifndef _C6455_COMMON_H_
#define _C6455_COMMON_H_
#include "cslr.h"
#include "cslr_ectl.h"
#include "cslr_mdio.h"
#include "cslr_emac.h"
#include "cslr_dev.h"
//
// Peripheral register structures
//
//EMAC and EMAC Control Module registers
#define ECTL_REGS ((CSL_EctlRegs *) 0x02C81000u)
#define MDIO_REGS ((CSL_MdioRegs *) 0x02C81800u)
#define EMAC_REGS ((CSL_EmacRegs *) 0x02C80000u)
// Chip Level registers
#define DEV_REGS ((CSL_DevRegs *) 0x02A80000u)
//
// EMAC Descriptor section
//
#define _EMAC_DSC_BASE_ADDR 0x02c82000u
#define _EMAC_DSC_BASE_ADDR_L2 0x00900800u
// EMAC Descriptor Size and Element Count
#define _EMAC_DSC_SIZE 8192
#define _EMAC_DSC_ENTRY_SIZE 16
#define _EDMA_DSC_ENTRY_COUNT (_EMAC_DSC_SIZE/_EMAC_DSC_ENTRY_SIZE)
//
// EMAC Descriptor
//
// The following is the format of a single buffer descriptor
// on the EMAC.
//
typedef struct _EMAC_Desc {
struct _EMAC_Desc *pNext; /* Pointer to next descriptor in chain */
Uint8 *pBuffer; /* Pointer to data buffer */
Uint32 BufOffLen; /* Buffer Offset(MSW) and Length(LSW) */
Uint32 PktFlgLen; /* Packet Flags(MSW) and Length(LSW) */
} EMAC_Desc;
//
// DESCRIPTOR ACCESS MACROS
//
// Packet Flags for TX and RX
#define EMAC_DSC_FLAG_SOP 0x80000000u
#define EMAC_DSC_FLAG_EOP 0x40000000u
#define EMAC_DSC_FLAG_OWNER 0x20000000u
#define EMAC_DSC_FLAG_EOQ 0x10000000u
#define EMAC_DSC_FLAG_TDOWNCMPLT 0x08000000u
#define EMAC_DSC_FLAG_PASSCRC 0x04000000u
// The following flags are RX only
#define EMAC_DSC_FLAG_JABBER 0x02000000u
#define EMAC_DSC_FLAG_OVERSIZE 0x01000000u
#define EMAC_DSC_FLAG_FRAGMENT 0x00800000u
#define EMAC_DSC_FLAG_UNDERSIZED 0x00400000u
#define EMAC_DSC_FLAG_CONTROL 0x00200000u
#define EMAC_DSC_FLAG_OVERRUN 0x00100000u
#define EMAC_DSC_FLAG_CODEERROR 0x00080000u
#define EMAC_DSC_FLAG_ALIGNERROR 0x00040000u
#define EMAC_DSC_FLAG_CRCERROR 0x00020000u
#define EMAC_DSC_FLAG_NOMATCH 0x00010000u
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -