Subversion Repositories DashDisplay

Rev

Rev 42 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
// this file defines various constants
2
 
20 mjames 3
#if !defined __INC_PLX_H
4
#define      __INC_PLX_H
2 mjames 5
 
6
typedef enum {
7
        PLX_Start = 0x80,
8
    PLX_Stop  = 0x40,
9
} PLX_Header;
10
 
11
 
12
 
39 mjames 13
static const char * PLX_Obs_Names []= {
14
  "AFR","EGT","FluidTemp","Vac","Boost","AIT","RPM","Speed","TPS",
15
        "Load","FluidPressure","Timing","MAP","MAF","ShortFuel",
16
        "LongFuel","NBO2", "Fuel","Volts","Knock","Duty","CHT"
17
} ;
18
 
19
enum PLX_Observations
20
{
44 mjames 21
  PLX_AFR =   0,      //Wideband Air/Fuel
2 mjames 22
  PLX_EGT =   1,      //EGT
23
  PLX_FluidTemp =2, //Fluid Temp
24
  PLX_Vac =   3,      //Vac
25
  PLX_Boost = 4,   //Boost
26
  PLX_AIT =   5, //AIT
27
  PLX_RPM =   6,
28
  PLX_Speed = 7, //Speed
29
  PLX_TPS =   8, //TPS
30
  PLX_Load =  9 , //Engine Load
31
  PLX_FluidPressure = 10, //Fluid Pressure
32
  PLX_Timing = 11, //Engine timing
33
  PLX_MAP =   12, //MAP
34
  PLX_MAF =   13, //MAF
35
  PLX_ShortFuel = 14, //Short term fuel trim
36
  PLX_LongFuel =15, //Long term fuel trim
37
  PLX_NBO2 =  16, //Narrowband O2 sensor@@@@@@@
15 mjames 38
  PLX_Fuel =  17, //Fuel level
39
  PLX_Volts = 18, //Volts
2 mjames 40
  PLX_Knock = 19, //Knock
41
  PLX_Duty  = 20, //Duty cycle
15 mjames 42
  PLX_X_CHT = 21, // Extended observations for aircooled engine 
44 mjames 43
  PLX_MAX_OBS
39 mjames 44
};
2 mjames 45
 
39 mjames 46
 
40 mjames 47
enum PLX_AFR_Units
39 mjames 48
{
49
                        AFR_Lambda,
44 mjames 50
                    AFR_Gasoline,
39 mjames 51
                        AFR_Diesel,
52
                        AFR_Methanol,
53
                        AFR_Ethanol,
54
                        AFR_LPG,
55
                        AFR_CNG
56
 
40 mjames 57
};
39 mjames 58
 
40 mjames 59
enum PLX_TEMP_Units
39 mjames 60
{
44 mjames 61
         TEMP_Celsius,
39 mjames 62
     TEMP_Fahrenheit
40 mjames 63
};
39 mjames 64
 
40 mjames 65
enum PLX_PRESSURE_Units
66
{
67
        PRESSURE_PSI_Fuel,
68
        PRESSURE_KGCM2_Fuel,
69
        PRESSURE_Bar_Fuel,
70
        PRESSURE_PSI_Oil,
71
        PRESSURE_KGCM2_Oil,
72
        PRESSURE_Bar_Oil
73
};
39 mjames 74
 
42 mjames 75
enum PLX_MAP_Units
76
{
77
        PRESSURE_kPa,
78
        PRESSURE_InHg
79
};
39 mjames 80
 
2 mjames 81
extern double ConveriMFDRaw2Data(int sensor, int units, int raw);
4 mjames 82
 
83
#pragma pack(push,1)
40 mjames 84
typedef struct
4 mjames 85
{
7 mjames 86
        char AddrH;
87
        char AddrL;
88
        char Instance;
4 mjames 89
        char ReadingH;
90
        char ReadingL;
91
} PLX_SensorInfo;
92
#pragma pack(pop)
93
 
94
 
95
static inline int ConvPLX(char H, char L)
96
{
97
        return ((H & 0x3F)<<6) | (L & 0x3F);
98
}
99
 
100
 
20 mjames 101
#endif