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

📄 typedefine.h

📁 基于16位单片机的符合osek标准的操作系统
💻 H
字号:
/******************************************************************************
													Copyright (c) Jiangkui 2005
File Name		 	:	typedefine.h		
	
Engineer		 	:	

Location		 	:	GasolineEngine Dep.

Date Created	 	:	02/07/2005

Current Revision 	:	Revision: 1.0 

Notes				:	

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

#include "com_typedefine.h"

typedef struct{
	unsigned int  array[200];
	unsigned long  accum;
	unsigned int  average;
	unsigned int  index;
	unsigned int  max;
	} GROUP_ACCUM;

typedef struct{
	UINT16 kp;
	UINT16 ki;
	INT32  goal;
	UINT16 value;
	INT32  error0;
	INT32  derror;
	UINT16 outmax;
	UINT16 outmin;
	INT32  out0;
	} GROUP_PID;



typedef struct	
{
	char * base_pointer;
	int Buffer_size;
	int Current_index;
} REC_BUF_TYPE;

struct Arraylp
{
	unsigned char pointer;
	unsigned int array[7];
};

union event_tag {
    unsigned int p;
    struct {
        unsigned int offset:15;
        unsigned int pin:1;
    } b;
};
union Data_tag {
    unsigned int p;
    struct {
        unsigned char high:8;
        unsigned char low:8;
    } b;
};
	

typedef union {
  char Byte;
  struct {
    char BIT0    :1;           
    char BIT1    :1;           
    char BIT2    :1;           
    char BIT3    :1;           
    char BIT4    :1;           
    char BIT5    :1;          
    char BIT6    :1;           
    char BIT7    :1;          
  } Bits;
} BIT_Union; 
		

typedef union {
  char Byte;
  struct {
    char BIT0    :1;           
    char BIT1    :1;           
    char BIT2    :1;           
    char BIT3    :1;           
    char BIT4    :1;           
    char BIT5    :1;          
    char BIT6    :1;           
    char BIT7    :1;          
  } Bits;
} BIT_Union8; 
		


typedef union {
  unsigned int Word;
  struct {
    unsigned char BIT0    :1;           
    unsigned char BIT1    :1;           
    unsigned char BIT2    :1;           
    unsigned char BIT3    :1;           
    unsigned char BIT4    :1;           
    unsigned char BIT5    :1;          
    unsigned char BIT6    :1;           
    unsigned char BIT7    :1;          
    unsigned char BIT8    :1;           
    unsigned char BIT9    :1;           
    unsigned char BIT10    :1;           
    unsigned char BIT11    :1;           
    unsigned char BIT12    :1;           
    unsigned char BIT13    :1;          
    unsigned char BIT14    :1;           
    unsigned char BIT15    :1;          
  } Bits;
  struct {
    unsigned int BIT     :16;
  } MergedBits;
} bit_union16; 


typedef union {
  unsigned long Long;
  struct {
    long BIT0    :1;           
    long BIT1    :1;           
    long BIT2    :1;           
    long BIT3    :1;           
    long BIT4    :1;           
    long BIT5    :1;          
    long BIT6    :1;           
    long BIT7    :1;          
    long BIT8    :1;           
    long BIT9    :1;           
    long BIT10    :1;           
    long BIT11    :1;           
    long BIT12    :1;           
    long BIT13    :1;          
    long BIT14    :1;           
    long BIT15    :1;          
    long BIT16    :1;           
    long BIT17    :1;           
    long BIT18    :1;           
    long BIT19    :1;           
    long BIT20    :1;           
    long BIT21    :1;          
    long BIT22    :1;           
    long BIT23    :1;          
    long BIT24    :1;           
    long BIT25    :1;           
    long BIT26    :1;           
    long BIT27    :1;           
    long BIT28    :1;           
    long BIT29    :1;          
    long BIT30    :1;           
    long BIT31    :1;          
  } Bits;
  struct {
    unsigned long BIT     :32;
  } MergedBits;
} bit_union32; 

typedef union {
 unsigned int Byte;
  struct {
    unsigned int FaultOccur   			:3; //故障确诊过程中,故障发生次数          
    unsigned int FaultDrivingCycle    	:2; //B类故障在连续三个运转循环里都存在,则确诊并存储         
    unsigned int NOFaultDrivingCycle    :2; //故障确诊并存储后,无故障运转循环计数,用于熄灭MIL
    unsigned int HotDrivingCycle        :6; //故障确诊并存储后,无故障发生的暖机循环计数,满40时擦除已存储的故障信息
               
  } Bits;
} DTCCounter_Union;

typedef struct 
{
	unsigned int DrivingCycleCounter;  //Driving Cycle Counter
	unsigned int HotCycleCounter;      //Hot Driving Cycle Counter
	unsigned int DrivingDistance;      //Accumulative Driving Distance
	unsigned int DrivingTime;	   	   //Accumulative Driving Time 	   	
} StatusOfDriving;

typedef struct 
{
	unsigned int code;   //Diagnosis Test Code
	unsigned int vess;   //Engine rotate speed
	unsigned int ess;    //vehicle speed
	unsigned char load;	//Calculated Load
	unsigned char mapvalue;
	unsigned char cwtvalue;
	unsigned char state;
	//unsigned int distance;
	
} FreezeFrame;



typedef union {
  unsigned int Byte;
  struct {
    unsigned int PendingFaultPresent     :1; //indicates that the fault indicated by this DTC is currently present in ECU.          
    unsigned int PendingFaultState    	 :1; //indicates that the pending fault indicated by this DTC has been present (bit 0 has been set) at least once during the current driving cycle.          
    unsigned int TestRunning    		 :1; //indicates whether the diagnostic trouble code test conditions are met at the time of request.          
    unsigned int TestInhibit    		 :1; //'1' = test is inhibited by other DTC          
    unsigned int TestReadiness    		 :1; //indicates that the diagnostic trouble code test has not yet been completed during the current driving cycle.          
    unsigned int DTCStorageState    	 :1; //indicates that the fault indicated by this DTC has been validated (bit 6 has been set) at least once and stored in non volatile memory         
    unsigned int ValidatedFaultPresent   :1; //indicates that the fault indicated by this DTC is currently validated in the ECU.          
    unsigned int ValidatedFaultState     :1; //indicates that the fault indicated by this DTC has been validated (bit 6 has been set) at least once during the current driving cycle
    unsigned int InterFaultOccur         :8; //间歇故障计数     
  } Bits;
} StatusOfDTC_Union; 

⌨️ 快捷键说明

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