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

📄 common.h

📁 c编写的嵌入式程序源码
💻 H
字号:
/* ==========================================================================*/
/* - - - - - - - - - - -  C O M M O N . H  - - - - - - - - - - - - - - - - - */
/* ==========================================================================*/
/*	Created   06-14-2004   M. Wheatley                                       */
/*	Modified  06-14-2004   MW                                                */
/*.........................................................................  */
/* Include File of common project definitions                                */
/*.........................................................................  */
#ifndef _COMMON_INCLUDES_
#define _COMMON_INCLUDES_
/*>>>>>>>>>>>>>>>>>>>>>> External headers <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#include "p30f4013.h"
#include "dsp.h"
#include "math.h"

/***********************************************************************************************/
/***********************************************************************************************/

/*>>>>>>>>>>>>>>>>>>>>>> Global Defines <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
#define VEHICLENGTH    5		//the length of vehicle (m)
#define Check_Factor 30         //the factor which is used to detect the presence of vehicle
#define Adjust_Factor 98	//the factor which is used to adjust the scale
//#define ADC_Time 0x039A		//the time of ADC conversion 1ms
#define ADC_Time 0x00B8		//the time of ADC conversion 0.2ms

#define Delay_Time		60					//the time for delay
#define Steady_Factor   10            		//test if the magnetic field is steady
#define Study_Time    	60                  //the time of study
#define T_Befj        	400                 //the time befor adjust
#define T_Aftj 			10					//the time after adjust
#define T_Enaj 			120000              //the time enable the adjustment
#define Trans_Time      0xE0EA              //the time transport the data 2s
//#define Trans_Time      0x167D              //the time transport the data 0.2s

/***********************************************************************************************/
/***********************************************************************************************/
struct EnvStudy
{
	double Ever_Env;	   
};
/*
struct Adjust
{
	int Com_Flag;
	double K_Adjust_Z,K_Adjust_Y,K_Adjust_X,Comparation_Z, Comparation_Y, Comparation_X;
};
*/

struct Acquired
{
	unsigned int Read_ADCtimes,RPValue[48];	
	int Avalue[3],Array1[12],Array2[12],Array3[12];
    double Test_Aver,Test_Aver_Z, Test_Aver_Y, Test_Aver_X;
};
struct Flag
{
	int Send_Flag, Get_Flag, Time_Flag;
};
struct Data
{
	unsigned int flow, possession, posstime, time;
	unsigned int  speed[50], shape[50];
};
/*>>>>>>>>>>>>>>>>>>>>>> External functions <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
extern void On_Led1(void);
extern void On_Led2(void);
extern void Off_Led1(void);
extern void Off_Led2(void);
extern void delay();
extern void Init_Timer1(void);
extern void Init_Timer3(void);
extern void Init_ADC12(void);
//extern void rset(void);
//extern void On_Adjust(void);
//extern void Off_Adjust(void);
extern void Read_ADC(unsigned int ADtimes);
extern void Init_CAN(void);
extern void Get_Data(void);
extern void Process_Data(void);
extern void Study_Env(void);
void Check_Signal(void);
void rset(void);
/***********************************************************************************************/
/***********************************************************************************************/
extern void __attribute__((interrupt,no_auto_psv)) _C1Interrupt(void);
extern void __attribute__((__interrupt__,auto_psv)) _ADCInterrupt(void);

/***********************************************************************************************/
/***********************************************************************************************/
#endif // _COMMON_INCLUDES_

⌨️ 快捷键说明

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