2015-07-10 06:01:56 -07:00
|
|
|
/*
|
|
|
|
* @file obd2.h
|
|
|
|
*
|
|
|
|
* @date Jun 9, 2015
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-01-26 10:58:47 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
#define OBD_TEST_REQUEST 0x7DF
|
|
|
|
|
|
|
|
#define OBD_TEST_RESPONSE 0x7E8
|
|
|
|
|
|
|
|
#define OBD_CURRENT_DATA 1
|
2020-08-31 19:00:03 -07:00
|
|
|
#define _OBD_2 2
|
2015-07-10 06:01:56 -07:00
|
|
|
#define OBD_STORED_DIAGNOSTIC_TROUBLE_CODES 3
|
|
|
|
#define OBD_PENDING_DIAGNOSTIC_TROUBLE_CODES 7
|
|
|
|
|
2017-12-17 18:10:02 -08:00
|
|
|
#define PID_SUPPORTED_PIDS_REQUEST_01_20 0x00
|
|
|
|
#define PID_MONITOR_STATUS 0x01
|
|
|
|
#define PID_FUEL_SYSTEM_STATUS 0x03
|
2015-07-10 06:01:56 -07:00
|
|
|
#define PID_ENGINE_LOAD 0x04
|
|
|
|
#define PID_COOLANT_TEMP 0x05
|
2020-07-29 12:15:01 -07:00
|
|
|
#define PID_STFT_BANK1 0x06
|
2021-01-04 04:35:21 -08:00
|
|
|
#define PID_STFT_BANK2 0x08
|
2015-07-10 06:01:56 -07:00
|
|
|
#define PID_FUEL_PRESSURE 0x0A
|
|
|
|
#define PID_INTAKE_MAP 0x0B
|
|
|
|
#define PID_RPM 0x0C
|
|
|
|
#define PID_SPEED 0x0D
|
|
|
|
#define PID_TIMING_ADVANCE 0x0E
|
|
|
|
#define PID_INTAKE_TEMP 0x0F
|
2017-12-17 18:10:02 -08:00
|
|
|
#define PID_INTAKE_MAF 0x10
|
2015-07-10 06:01:56 -07:00
|
|
|
#define PID_THROTTLE 0x11
|
|
|
|
|
2017-12-17 18:10:02 -08:00
|
|
|
#define PID_SUPPORTED_PIDS_REQUEST_21_40 0x20
|
2020-07-29 02:54:47 -07:00
|
|
|
#define PID_FUEL_AIR_RATIO_1 0x24
|
2017-12-17 18:10:02 -08:00
|
|
|
|
|
|
|
#define PID_SUPPORTED_PIDS_REQUEST_41_60 0x40
|
|
|
|
#define PID_FUEL_RATE 0x5E
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-04-12 19:07:03 -07:00
|
|
|
#if HAL_USE_CAN
|
2020-03-19 05:43:37 -07:00
|
|
|
void obdOnCanPacketRx(const CANRxFrame& rx);
|
2018-11-16 04:40:06 -08:00
|
|
|
#endif /* HAL_USE_CAN */
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-08-31 19:47:33 -07:00
|
|
|
#define ODB_RPM_MULT 4
|
2020-09-03 20:27:53 -07:00
|
|
|
#define ODB_TEMP_EXTRA 40
|
2020-09-06 20:39:25 -07:00
|
|
|
#define ODB_TPS_BYTE_PERCENT 2.55f
|