Subversion Repositories DashDisplay

Rev

Rev 40 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. // this file defines various constants
  2.  
  3. #if !defined __INC_PLX_H
  4. #define      __INC_PLX_H
  5.  
  6. typedef enum {
  7.         PLX_Start = 0x80,
  8.     PLX_Stop  = 0x40,
  9. } PLX_Header;
  10.  
  11.  
  12.  
  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
  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@@@@@@@
  38.   PLX_Fuel =  17, //Fuel level
  39.   PLX_Volts = 18, //Volts
  40.   PLX_Knock = 19, //Knock
  41.   PLX_Duty  = 20, //Duty cycle
  42.   PLX_X_CHT = 21, // Extended observations for aircooled engine
  43.  
  44. };
  45.  
  46.  
  47. enum PLX_AFR_Units
  48. {
  49.                         AFR_Lambda,
  50.                   AFR_Gasoline,
  51.                         AFR_Diesel,
  52.                         AFR_Methanol,
  53.                         AFR_Ethanol,
  54.                         AFR_LPG,
  55.                         AFR_CNG
  56.  
  57. };
  58.  
  59. enum PLX_TEMP_Units
  60. {
  61.                  TEMP_Celsius,
  62.      TEMP_Fahrenheit
  63. };
  64.  
  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. };
  74.  
  75. enum PLX_MAP_Units
  76. {
  77.         PRESSURE_kPa,
  78.         PRESSURE_InHg
  79. };
  80.  
  81. extern double ConveriMFDRaw2Data(int sensor, int units, int raw);
  82.  
  83. #pragma pack(push,1)
  84. typedef struct
  85. {
  86.         char AddrH;
  87.         char AddrL;
  88.         char Instance;
  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.  
  101. #endif
  102.