mac_52.h

来自「收集到的一些常用功能模块」· C头文件 代码 · 共 36 行

H
36
字号
#ifndef MAC_52_H
#define MAC_52_H

#include<reg52.h>
#include <intrins.h>  //_nop_()

#define NOP()  _nop()

#define MAC_SEI()  EA = 1;
#define MAC_CLI()  EA = 0;
#define MAC_SEEX0Int()  EX0 = 1;  //允许外部中断0
#define MAC_CLEX0Int()  EX0 = 0;  //禁止外部中断0
#define MAC_SEEX1Int()  EX1 = 1;  
#define MAC_CLEX1Int()  EX1 = 0;
#define MAX_SET0Int()   ET0 = 1;
#define MAC_CLT0Int()   ET0 = 0;
#define MAX_SET1Int()   ET1 = 1;
#define MAC_CLT1Int()   ET1 = 0;
#define MAX_SET2Int()   ET2 = 1;
#define MAC_CLT2Int()   ET2 = 0;
#define MAC_SEUARTInt() ES = 1;
#define MAC_CLUARTInt() ES = 0;

#define MAC_SetUseT0()  TR0 = 1    //启动定时器0
#define MAC_DisUseT0()  TR0 = 0;   //关闭定时器0
#define MAC_SetUseT1()  TR1 = 1;
#define MAC_DisUseT1()  TR1 = 0;

#define VECT_EX0  0
#define VECT_T0   1
#define VECT_EX1  2
#define VECT_T1   3
#define VECT_UART 4
#define VEVT_T2   5

#endif

⌨️ 快捷键说明

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