📄 globldef.h
字号:
#ifndef GlobDef_h
#define GlobDef_h
typedef unsigned char byte;
typedef unsigned int word;
//定义rtl控制端口
#define RTL_RESET_PIN P3_4
//控制量
#define DELAY_AFTER_HARDWARE_RESET 0x8333 //100ms 100000/12=8333
#define MIN_PACKET_SIZE 46
#define MAX_PACKET_SIZE 1500 //以太网帧必须为46-1500字节。
#define SEND_START_PAGE0 0x4000
#define SEND_START_PAGE1 0x4bff// 前12页为发送缓存
#define RECEIVE_START_PAGE 0x4c00//后52页为接收缓存
#define RECEIVE_STOP_PAGE 0x7fff//page式管理,一页256b。
#define MemAllocation
#define PAGE_NOT_FOUND
#define StartPos
//rtl 寄存器
#define CR 0x8000 //或者80?
#define CR_PAGE0 0x00 //Set cr=00 000000
#define CR_ABORT_COMPLETE_DMA 0x20 //Set cr=00 1xx 000
#define CR_TXP 0x04 //选择cr bit 2
#define CR_REMOTE_WRITE 0x10 //使cr=00 010 000
#define CR_START_COMMAND 0x02 //选择cr bit 1
#define CR_STOP_COMMAND 0x01 //选择cr bit 0
#define PSTART_WPAGE0 0x8001
#define PSTOP_WPAGE0 0x8002
#define BNRY_WPAGE0 0x8003
#define TPSR_WPAGE0 0x8004
#define RCR_WPAGE0 0x800c
#define TCR_WPAGE0 0x800d
#define DCR_WPAGE0 0x800e
#define IMR_WPAGE0 0x800f
#define ISR_WPAGE0 0x8007
#define CURR_WPAGE 0x8007//In page1
#define RSARH_WPAGE0 0x8008
#define RSARL_WPAGE0 0x8009
#define RBCRH_WPAGE0 0x800a
#define RBCRL_WPAGE0 0x800b
#define REMOTE_DMA_PORT 0x8010//10-17中随便一个
#define RESET_PPORT 0x8018//18-1f中随便一个
#define PrePage
#define CURR_RPAGE1 0x8007
//设置物理地址
//0 页叫 Prom 页,只有 32 字节,地址为 0x0000 --0x001f,用于存储以太网物理地址。
#define PRA0_WPAGE1 0x0000
#define PRA1_WPAGE1 0x0001
#define PRA2_WPAGE1 0x0002
#define PRA3_WPAGE1 0x0003
#define PRA4_WPAGE1 0x0004
#define PRA5_WPAGE1 0x0005
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -