📄 smi.h
字号:
#ifndef _SMI_H_
#define _SMI_H_
#include "ctype.h"
#include "reg52.h"
typedef union
{
struct
{
BYTE high8;
BYTE low8;
}bit8;
WORD union16;
}SMIDATA;
sbit MDC = P1^2;
sbit MDIO = P1^3;
#define setMDIO {MDC=0;MDIO=1;MDC=1;}
#define clearMDIO {MDC=0;MDIO=0;MDC=1;}
#define MAXPREAMBLELENGTH 33
#define SMIPHYADDRESSLENGTH 5
#define SMIPHYADDRESSBIT 3
void smiBitSend( BYTE length, BYTE value );
BYTE smiBitGet( void );
void smiPreambleSend( void );
void smiStartWrite( void );
void smiStartRead( void );
void smiPhyRegisterSend( BYTE phyRegAddr, BYTE phyAddr );
void smiWriteValue( SMIDATA *smiData );
void smiReadValue( SMIDATA *smiData );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -