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

📄 gaojin.h

📁 移植UCOS于增强型51单片机上
💻 H
字号:
#ifndef GAOJIN_H
#define GAOJIN_H
#include "ADC12.H"
#if SAMPLENUM==128
	#define SERCHRANGE 20	//往两边搜寻过零点的范围(采样点数)
	#define GJsameValNum	5	//定义多少个采样值一样算是削顶了
#endif
#if SAMPLENUM==64
	#define SERCHRANGE 10	//往两边搜寻过零点的范围(采样点数)
	#define GJsameValNum	2	//定义多少个采样值一样算是削顶了
#endif

#define GJOFREQCHGNUM 	30	//达到告警上限的频率改变次数
#define FREQCHECKPERIOD	(100/OS_SW_PERIOD)//检测的时间ms

//#define POUTMAX			16	//定义功放最大输出值大于这个值必然过载
#define POWERVOLT	54.0			//定义电源电压值,取60V和48伏的中间一个值兼容两种功放电源
#define POWERDROPVAL 15				//电源差异的数值
#define POWERLIMIT      12500
#define sameValRange	2	//认为值一样的范围
#define GJINTERVAl		10	//两个告警输出之间的间隔时间ms
#define GJNUM			7	//告警个数
#define GJOUTPORT		P4OUT
/*
#define UAOVERLOAD		(0xff&(~BIT3))	//ua过载			1
#define UBOVERLOAD		(0xff&(~BIT2))	//ub过载			10	
#define UCOVERLOAD		(0xff&(~(BIT3|BIT2)))	//ua过载	11
#define IAOVERLOAD		(0xff&(~BIT1))	//ub过载			100
#define IBOVERLOAD		(0xff&(~(BIT1|BIT3)))	//ub过载	101
#define ICOVERLOAD		(0xff&(~(BIT1|BIT2)))	//ub过载		110
#define PWROVERLOAD	(0xff&(~(BIT1|BIT2|BIT3)))//ub过载	111

#define UAOVERLOAD		(0xff&~0x08)	//ua过载			1
#define UBOVERLOAD		(0xff&~0x04)	//ub过载			10	
#define UCOVERLOAD		(0xff&~0x0C)	//ua过载	11
#define IAOVERLOAD		(0xff&~0x02)	//ia过载			100
#define IBOVERLOAD		(0xff&~0x0a)	//ib过载	101
#define ICOVERLOAD		(0xff&~0x06)	//ic过载		110
#define PWROVERLOAD		(0xff&~0x0e)	//ub过载	111
*/

#define UAOVERLOAD		0xf7	//ua过载			1
#define UBOVERLOAD		0xfb	//ub过载			10	
#define UCOVERLOAD		0xf3	//uc过载	11
#define IAOVERLOAD		0xfd	//ia过载			100
#define IBOVERLOAD		0xf5	//ib过载	101
#define ICOVERLOAD		0xf9	//ic过载		110
#define PWROVERLOAD		0xf1	//pwr过载	111
#define FREQ1OVERLOAD   0xfe	//频率通道1过载
#define FREQ2OVERLOAD	0xF6	//频率通道2过载
#define URGENCYLOAD		0xfa	//紧急告警
//告警位段,节省ram
typedef struct GJSTA
{
	union
	{
		unsigned int gj;
		struct
		{
			unsigned ua: 1;		//ua过载
			unsigned ub: 1;		//ub过载
			unsigned uc: 1;		//uc过载
			unsigned ia: 1;		//ia过载
			unsigned ib: 1;		//ib过载
			unsigned ic: 1;		//ic过载
			unsigned pwr: 1;		//电源跌落
			unsigned freq1: 1;		//频率通道1不稳
			unsigned freq2: 1;		//频率通道2不稳
			unsigned urgency:1;	//紧急情况可能是短路等严重过载情况
		};
	};
}gjsta;
extern gjsta GJSta;
extern gjsta GJFiltered;	//滤波后的

void GJCheck(char Channel);
void GJCheckNew(char Channel);
void GJCheckExtra(char Channel);
void GJOut(void);	//告警输出
void InitGjSta(void);
void GJTask(void *pdata);
void CheckFreq(void);		//监测频率是否正常
#endif

⌨️ 快捷键说明

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