📄 main.c
字号:
#define MAIN //定义主函数
#include "reg51.h"
#include "intrins.h"
#include "absacc.h"
#include "io.h"//AT89C2051的IO定义
#include "spi.h"//将SPI子函数定义为外部函数
#include "sub.h"//激活子函数定义为外部函数
#include "ch.h"//通道子函数定义为外部函数
/*******主函数*********/
void main(void)
{
//OSCin 2.048M
SCPEN=1;
_nop_();
SCPEN=0;
_nop_();
reset();//WRITE NR0软件复位
_nop_();
delayms(100);
//mc145572的激活
//区分NT与LT模式
NT_activation();
_nop_();
_nop_();
initial_reg();//write各控制寄存器
_nop_();
_nop_();
_nop_();
read_statusReg();//需要读出的寄存器状态
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -