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

📄 cp220x_reg.h

📁 c8051f020_uip1.0.rar
💻 H
📖 第 1 页 / 共 2 页
字号:
extern volatile unsigned char pdata      PHYSTA      ;   // Physical Layer Status            
extern volatile unsigned char pdata      TXPWR       ;   // Transmitter Power Register 

//-----------------------------------------------------------------------------
// Bit Definitions
//-----------------------------------------------------------------------------
           
// TLB0INFOH Bit Definitions
#define  RXVALID        0x80
#define  RXVLAN         0x40
#define  RXUNSUP        0x20
#define  RXPCF          0x10
#define  RXCF           0x08
#define  RXADATA        0x04
#define  BCAST          0x02
#define  MCAST          0x01

// TLB0INFOL Bit Definitions
#define  RXOK           0x80
#define  LENGTH         0x40
#define  LENERR         0x20
#define  CRCERR         0x10
#define  RXVLT          0x08
#define  RXLEN          0x02
#define  RXDROP         0x01

// INT0 Bit Definitions
#define  EEOPINT         0x80
#define  ERXEINT         0x40
#define  ESELFINT        0x20
#define  EOSCINT         0x10
#define  EFLWEINT        0x08
#define  ETXINT          0x04
#define  ERXFINT         0x02
#define  ERXINT          0x01

// INT0EN Bit Definitions
#define  EOPINT         0x80
#define  RXEINT         0x40
#define  SELFINT        0x20
#define  OSCINT         0x10
#define  FLWEINT        0x08
#define  TXINT          0x04
#define  RXFINT         0x02
#define  RXINT          0x01

// INT1 Bit Definitions
#define  WAKEINT        0x20
#define  LINKINT        0x10
#define  JABINT         0x08
#define  ANFINT         0x04
#define  RFINT          0x02
#define  ANCINT         0x01

// INT1EN Bit Definitions
#define  EWAKEINT        0x20
#define  ELINKINT        0x10
#define  EJABINT         0x08
#define  EANFINT         0x04
#define  ERFINT          0x02
#define  EANCINT         0x01

// RXCN Bit Definitions
#define  RXINH          0x08
#define  RXCLRV         0x04
#define  RXSKIP         0x02
#define  RXCLEAR        0x01

// TXCN Bit Definitions
#define  OVRRIDE        0x80
#define  CRCENOV        0x20
#define  PADENOV        0x10
#define  TXPPKT         0x08
#define  BCKPRES        0x04
#define  FDPLXOV        0x02
#define  TXGO           0x01

// PHYCN Bit Definitions
#define  PHYEN          0x80
#define  TXEN           0x40
#define  RXEN           0x20
#define  DPLXMD         0x10
#define  LBMD           0x08
#define  LPRFAULT       0x04
#define  POLREV         0x02
#define  LINKSTA        0x01

// PHYCF Bit Definitions
#define  SMSQ           0x80
#define  LINKINTG       0x40
#define  JABBER         0x20
#define  AUTONEG        0x10
#define  ADRFAULT       0x08
#define  ADPAUSE        0x04
#define  AUTOPOL        0x02
#define  REVPOL         0x01

// MACCN Bit Definitions
#define  RANDRST        0x4000
#define  LOOPBCK        0x0010
#define  TXPAUSE        0x0008
#define  RXPAUSE        0x0004
#define  PASSALL        0x0002
#define  RCVEN          0x0001

// MACCF Bit Definitions
#define  ABORTD         0x4000
#define  EBBPD          0x2000
#define  EBD            0x1000
#define  RLPRE          0x0200
#define  PUREPRE        0x0100
#define  PADMD1         0x0080
#define  PADMD0         0x0040
#define  PADEN          0x0020
#define  CRCEN          0x0010
#define  PHEADER        0x0008
#define  LENCHK         0x0002
#define  FLLDPLX        0x0001

#ifndef	MACADDRESS
typedef union MACADDRESS {
   unsigned int Int[3];
   unsigned char Char[6];
} MACADDRESS;
#endif

#ifndef UINT1
typedef union UINT1 {
   unsigned int Int;
   unsigned char Char[2];
} UINT1;
#endif

void CP220x_RST_Low(void);
void CP220x_RST_High(void);
u8_t PHY_Init();
void MAC_Init(void);
void MAC_Write(u8_t mac_reg_offset, u16_t mac_reg_data);
void MAC_SetAddress(MACADDRESS* pMAC);
void CP220x_Send(void);
u16_t rcve_frame(void);

void  etherdev_send(void);
u16_t etherdev_read(void);
void etherdev_init(void);
#endif
//-----------------------------------------------------------------------------
// End Of File
//-----------------------------------------------------------------------------

⌨️ 快捷键说明

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