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

📄 global.h

📁 采用MPS430控制的项目
💻 H
字号:
#ifdef    _Global_
#define   Global
#else  
#define   Global   extern      
#endif
/*****************************************************************
协议数据定义
******************************************************************/
Global unsigned char STR0_Rec[600];		//发送--接收智能设备数据指针
Global unsigned char STR1_Rec[600]; 	//发送--接收计算机数据指针

Global unsigned int  STR0_len;			
Global unsigned char STR0_Re_flag;
Global unsigned char Com0_flag;
Global unsigned char Com0Busy;

Global unsigned int  STR1_len;			//接收数据的长度
Global unsigned char STR1_Re_flag;		//接收完数据,须处理标志
Global unsigned char Com1_flag;			//接收数据标志
//Global unsigned char Com1Busy;

Global unsigned char LastBuf;			//用于区分来自门禁还是智能设备
Global unsigned char DATAFLAG;			//通讯--标志位
/******************************************************************
系统变量--任务标志
******************************************************************/
Global Uint16  Time_interval;				//定时上传时间间隔

Global Uint16  Task;						//任务队列
#define Read_OutDoor    (0x0001)
#define Read_InDoor     (0x0002)
#define CaiJi_Data      (0x0004)
#define UpSend_Data     (0x0008)
#define Save_Data	    (0x0010)
//#define DoorAlarm       (0x0020)
#define Read_Key		(0x0040)
#define Com1OrderToCom0 (0x0080)
#define Com0DataToCom1  (0x0100)
#define DoorSpeak		(0x0200)
#define SendDoorCardNo	(0x0400)

Global Uint16  Time_Count;
/**************************************************************
门禁系统变量
**************************************************************/
#define MaxCard  10//最大的卡号数 最多22
Global unsigned char HaveDoorRight;			//是否具有开门权限1:有 0:无
Global unsigned char DoorOK;				//指示基站是否封网0:封网 1:解网
Global unsigned char DoorDir;				//进出门方向0:进 1;出
Global unsigned char DoorAlarm;
Global unsigned char DoorAlarm_ID;			//告警代码
Global unsigned char OpenDoorDelay;			//开门延时,遥控开门后,延时时间后未打开,开门失败
Global unsigned char CloseDoorDelay;		//关门延时,遥控关门后,长时间未关闭,关门失败
Global unsigned char CardNo[MaxCard][5];	//卡号-0:权限 1-4:卡号
/**************************************************************
智能设备
**************************************************************/
#define MaxAdr   16
Global unsigned char Adr_sum;				//智能设备总数
Global unsigned char Adr[MaxAdr][2];		//智能CID1和ADR
/**************************************************************
菜单设置变量
***************************************************************/    
Global Uint8   key_data;  					//按键键值                   
Global uchar   Menu_ID;						//菜单号
Global Uint8   Set_array[20];				//输入的密码值 6位
Global uchar   Set_array_count;				//输入密码的次数
Global Uint16  Set_temp;					//设置临时存储区

Global uchar   MIMA[6];						//用户密码

Global Uint16 Yuan_dk;						//远端端口
Global Uint16 Bendi_dk;						//本地端口
Global Uint32 Yuan_IP;						//远端IP
Global Uint32 Bendi_IP;						//本地IP
/************************************************************** 
实时采集变量定义  
**************************************************************/ 
Global Uint16 ADAlarm_para[3][16];			//上下限,零点
Global Uint16 ADSam_Value[16];				//16模拟输入的采集值
Global Uint8  ADSam_Alarm[16];				//16路模拟输入是否告警
Global Uint8  ADSam_Code[16];				//16路模拟输入对应的代码值
Global Uint16 ADMax[16];
Global Uint16 ADMin[16];
Global Uint16 ADAver[16];

Global Uint8  DISam_Value[16];
Global Uint8  DISam_Alarm[16];				//16路开关输入是否告警
Global Uint8  DISam_Code[16];				//16路开关输入对应的代码值

Global Uint8  DOSam_Code[8];				//8路开关输出对应的代码值

Global Uint16 OutStates;					//当前输出状态
/************************************************************** 
告警状态变量定义
**************************************************************/ 
Global Uint8  Alarm_Sum;					//告警条总数
Global Uint8  Alarm_Now;
Global Uint16 OldData_Sum;					//历史数据的总条数
Global Uint16 OldData_Now;
/************************************************************** 
当前时间 
**************************************************************/ 
Global Uint8  Time_now[6];					//当前时间 年 月 日 时 分 秒 
Global Uint8  LastSaveDataTime[3];
Global struct TIME
{
	Uint8 Year;
	Uint8 Months;
	Uint8 Date;
	Uint8 Hours;
	Uint8 Minutes;
	Uint8 Seconds;
}Time8583; 
/**************************************************************
LCD 变量定义单元
***************************************************************/                         
Global  uchar   const  *p,*head;  
Global  uchar   KS0108B_DAT,KS0108B_COM,KS0108B_c;
Global  uint    KS0108B_i;
Global  uchar   num_word;           
/**************************************************************/                         
#undef    Global
/*****************************__END___*************************/

⌨️ 快捷键说明

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