Subversion Repositories DashDisplay

Rev

Rev 28 | Rev 40 | Go to most recent revision | 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
{
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 
39 mjames 43
 
44
};
2 mjames 45
 
39 mjames 46
 
47
typedef enum
48
{
49
                        AFR_Lambda,
50
                  AFR_Gasoline,
51
                        AFR_Diesel,
52
                        AFR_Methanol,
53
                        AFR_Ethanol,
54
                        AFR_LPG,
55
                        AFR_CNG
56
 
57
} PLX_AFR_Units;
58
 
59
typedef enum
60
{
61
                 TEMP_Celsius,
62
     TEMP_Fahrenheit
63
} PLX_TEMP_Units;
64
 
65
 
66
 
2 mjames 67
extern double ConveriMFDRaw2Data(int sensor, int units, int raw);
4 mjames 68
 
69
#pragma pack(push,1)
70
typedef struct
71
{
7 mjames 72
        char AddrH;
73
        char AddrL;
74
        char Instance;
4 mjames 75
        char ReadingH;
76
        char ReadingL;
77
} PLX_SensorInfo;
78
#pragma pack(pop)
79
 
80
 
81
static inline int ConvPLX(char H, char L)
82
{
83
        return ((H & 0x3F)<<6) | (L & 0x3F);
84
}
85
 
86
 
20 mjames 87
#endif