rusEFI
The most advanced open source ECU
init_can_sensors.cpp
Go to the documentation of this file.
1 /**
2  * @file init_can_sensors.cpp
3  * body control unit use-case: inject many sensors from external ECU via ODB-II request/response
4  * this is totally different from Lua "set" sensor method
5  *
6  * @date March 31, 2020
7  * @author Matthew Kennedy, (c) 2020
8  */
9 
10 #include "pch.h"
11 
12 #if EFI_PROD_CODE && EFI_CAN_SUPPORT
13 #include "can_sensor.h"
14 #include "can.h"
15 
17  CAN_DEFAULT_BASE + CAN_PEDAL_TPS_OFFSET, /*offset =*/ 0,
18  SensorType::AcceleratorPedal, CAN_TIMEOUT
19 );
20 
22  PID_RPM, ODB_RPM_MULT,
24 );
25 
27  PID_COOLANT_TEMP, 1,
29 );
30 
32  PID_INTAKE_TEMP, 1,
34 );
35 
37  PID_INTAKE_TEMP, ODB_TPS_BYTE_PERCENT,
39 );
40 
41 //ObdCanSensor<1, ODB_TPS_BYTE_PERCENT> obdTpsSensor(
42 // PID_ENGINE_LOAD,
43 // SensorType::Tps, TIMEOUT
44 //);
45 
48 // registerCanSensor(canPedalSensor);
53  }
54 }
55 #endif // EFI_PROD_CODE && EFI_CAN_SUPPORT
void registerCanSensor(CanSensorBase &sensor)
Definition: can_rx.cpp:97
ObdCanSensor< 1, 0 > obdTpsSensor(PID_INTAKE_TEMP, ODB_TPS_BYTE_PERCENT, SensorType::Tps1)
ObdCanSensor< 1, ODB_TEMP_EXTRA > obdCltSensor(PID_COOLANT_TEMP, 1, SensorType::Clt)
CanSensor< int16_t, PACK_MULT_PERCENT > canPedalSensor(CAN_DEFAULT_BASE+CAN_PEDAL_TPS_OFFSET, 0, SensorType::AcceleratorPedal, CAN_TIMEOUT)
ObdCanSensor< 1, ODB_TEMP_EXTRA > obdIatSensor(PID_INTAKE_TEMP, 1, SensorType::Iat)
void initCanSensors()
ObdCanSensor< 2, 0 > obdRpmSensor(PID_RPM, ODB_RPM_MULT, SensorType::Rpm)
engine_configuration_s * engineConfiguration