2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file rusefi_enums.h
|
|
|
|
* @brief Fundamental rusEfi enumerable types live here
|
|
|
|
*
|
|
|
|
* @note this file should probably not include any other files
|
|
|
|
*
|
|
|
|
* @date Jan 14, 2014
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-11-14 21:00:13 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#include "efifeatures.h"
|
2019-04-19 10:57:40 -07:00
|
|
|
#include "obd_error_codes.h"
|
2021-10-14 15:36:47 -07:00
|
|
|
#include "live_data_ids.h"
|
2021-10-23 18:46:42 -07:00
|
|
|
#include "engine_types.h"
|
2019-06-04 09:46:55 -07:00
|
|
|
// we do not want to start the search for header from current folder so we use brackets here
|
|
|
|
// https://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename
|
|
|
|
#include <rusefi_hw_enums.h>
|
2018-09-29 07:31:19 -07:00
|
|
|
|
2018-01-23 18:59:50 -08:00
|
|
|
#define PERCENT_MULT 100.0f
|
2019-05-27 08:17:28 -07:00
|
|
|
#define PERCENT_DIV 0.01f
|
2016-02-14 10:02:00 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
ADC_OFF = 0,
|
|
|
|
ADC_SLOW = 1,
|
|
|
|
ADC_FAST = 2,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_adc_channel_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} adc_channel_mode_e;
|
|
|
|
|
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
TV_FALL = 0,
|
|
|
|
TV_RISE = 1
|
2015-07-10 06:01:56 -07:00
|
|
|
} trigger_value_e;
|
|
|
|
|
2020-01-27 20:45:46 -08:00
|
|
|
// see also PWM_PHASE_MAX_WAVE_PER_PWM
|
2015-07-10 06:01:56 -07:00
|
|
|
// todo: better names?
|
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
T_PRIMARY = 0,
|
|
|
|
T_SECONDARY = 1,
|
2015-07-10 06:01:56 -07:00
|
|
|
// todo: I really do not want to call this 'tertiary'. maybe we should rename all of these?
|
2017-02-13 20:03:19 -08:00
|
|
|
T_CHANNEL_3 = 2,
|
|
|
|
T_NONE = 15
|
2015-07-10 06:01:56 -07:00
|
|
|
} trigger_wheel_e;
|
|
|
|
|
2020-01-27 20:45:46 -08:00
|
|
|
// see also 'HW_EVENT_TYPES'
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
2016-02-27 20:03:34 -08:00
|
|
|
SHAFT_PRIMARY_FALLING = 0,
|
|
|
|
SHAFT_PRIMARY_RISING = 1,
|
|
|
|
SHAFT_SECONDARY_FALLING = 2,
|
|
|
|
SHAFT_SECONDARY_RISING = 3,
|
|
|
|
SHAFT_3RD_FALLING = 4,
|
|
|
|
SHAFT_3RD_RISING = 5,
|
2015-07-10 06:01:56 -07:00
|
|
|
} trigger_event_e;
|
|
|
|
|
2021-02-08 12:09:12 -08:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2020-05-09 23:36:01 -07:00
|
|
|
/**
|
2020-05-14 20:13:32 -07:00
|
|
|
* This mode is useful for troubleshooting and research - events are logged but no effects on phase synchronization
|
2020-05-09 23:36:01 -07:00
|
|
|
*/
|
2021-10-24 14:06:59 -07:00
|
|
|
VVT_INACTIVE = 0,
|
2020-05-14 20:13:32 -07:00
|
|
|
|
2020-05-09 23:36:01 -07:00
|
|
|
/**
|
|
|
|
* Single-tooth cam sensor mode where TDC and cam signal happen in opposite 360 degree of 720 degree engine cycle
|
|
|
|
*/
|
2016-08-22 20:04:55 -07:00
|
|
|
VVT_SECOND_HALF = 1,
|
2020-05-09 23:36:01 -07:00
|
|
|
/**
|
|
|
|
* Toyota 2JZ has three cam tooth. We pick one of these three tooth to synchronize based on the expected angle position of the event
|
|
|
|
*/
|
|
|
|
VVT_2JZ = 2,
|
|
|
|
/**
|
|
|
|
* Mazda NB2 has three cam tooth. We synchronize based on gap ratio.
|
2020-08-29 14:46:01 -07:00
|
|
|
* @see TT_VVT_MIATA_NB2
|
2020-05-09 23:36:01 -07:00
|
|
|
*/
|
2021-02-08 15:20:53 -08:00
|
|
|
VVT_MIATA_NB2 = 3,
|
2020-05-14 20:13:32 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Single-tooth cam sensor mode where TDC and cam signal happen in the same 360 degree of 720 degree engine cycle
|
|
|
|
*/
|
|
|
|
VVT_FIRST_HALF = 4,
|
2020-08-29 14:46:01 -07:00
|
|
|
/**
|
|
|
|
* @see TT_VVT_BOSCH_QUICK_START
|
|
|
|
*/
|
2020-08-26 21:43:23 -07:00
|
|
|
VVT_BOSCH_QUICK_START = 5,
|
|
|
|
|
2020-10-03 07:39:43 -07:00
|
|
|
/**
|
|
|
|
* 1.8l Toyota 1ZZ-FE https://rusefi.com/forum/viewtopic.php?f=3&t=1735
|
2021-10-28 12:57:23 -07:00
|
|
|
* 4 minus one
|
|
|
|
* looks abandoned and unfinished?
|
2020-10-03 07:39:43 -07:00
|
|
|
*/
|
2021-10-28 12:57:23 -07:00
|
|
|
VVT_TOYOTA_4_1 = 6,
|
2020-10-03 07:39:43 -07:00
|
|
|
|
2020-12-03 20:54:08 -08:00
|
|
|
VVT_FORD_ST170 = 7,
|
2021-03-22 04:48:29 -07:00
|
|
|
|
|
|
|
VVT_BARRA_3_PLUS_1 = 8,
|
2021-07-01 14:02:18 -07:00
|
|
|
|
|
|
|
VVT_NISSAN_VQ = 9,
|
2021-10-28 07:36:41 -07:00
|
|
|
|
2021-10-28 12:57:23 -07:00
|
|
|
/**
|
|
|
|
* 4 plus one
|
|
|
|
*/
|
2021-10-28 07:36:41 -07:00
|
|
|
VVT_HONDA_K = 10,
|
2021-11-05 12:33:22 -07:00
|
|
|
|
|
|
|
VVT_NISSAN_MR = 11,
|
2021-11-14 18:43:56 -08:00
|
|
|
|
2021-12-16 18:13:55 -08:00
|
|
|
VVT_12 = 12,
|
2021-12-07 05:57:23 -08:00
|
|
|
|
|
|
|
VVT_MAP_V_TWIN_ANOTHER = 13,
|
|
|
|
|
2016-08-22 20:04:55 -07:00
|
|
|
} vvt_mode_e;
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* This enum is used to select your desired Engine Load calculation algorithm
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
/**
|
|
|
|
* Speed Density algorithm - Engine Load is a function of MAP, VE and target AFR
|
|
|
|
* http://articles.sae.org/8539/
|
|
|
|
*/
|
|
|
|
LM_SPEED_DENSITY = 3,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MAF with a known kg/hour function
|
|
|
|
*/
|
|
|
|
LM_REAL_MAF = 4,
|
|
|
|
|
2020-11-27 12:44:31 -08:00
|
|
|
LM_ALPHA_N = 5,
|
2020-07-25 01:14:35 -07:00
|
|
|
|
2021-07-15 21:49:14 -07:00
|
|
|
LM_LUA = 6,
|
|
|
|
|
2020-07-26 20:33:18 -07:00
|
|
|
// This mode is for unit testing only, so that tests don't have to rely on a particular real airmass mode
|
|
|
|
LM_MOCK = 100,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_engine_load_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} engine_load_mode_e;
|
|
|
|
|
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
DM_NONE = 0,
|
|
|
|
DM_HD44780 = 1,
|
|
|
|
DM_HD44780_OVER_PCF8574 = 2,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_display_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
} display_mode_e;
|
|
|
|
|
2021-02-08 12:09:12 -08:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2020-04-23 16:39:59 -07:00
|
|
|
TL_AUTO = 0,
|
|
|
|
TL_SEMI_AUTO = 1,
|
|
|
|
TL_MANUAL = 2,
|
|
|
|
TL_HALL = 3,
|
2020-04-23 13:57:37 -07:00
|
|
|
|
|
|
|
} tle8888_mode_e;
|
|
|
|
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
|
|
|
LF_NATIVE = 0,
|
|
|
|
/**
|
|
|
|
* http://www.efianalytics.com/MegaLogViewer/
|
|
|
|
* log example: http://svn.code.sf.net/p/rusefi/code/trunk/misc/ms_logs/
|
|
|
|
*/
|
|
|
|
LM_MLV = 1,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_log_format = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} log_format_e;
|
|
|
|
|
|
|
|
typedef enum {
|
2015-11-09 16:03:32 -08:00
|
|
|
/**
|
|
|
|
* In auto mode we currently have some pid-like-but-not really PID logic which is trying
|
|
|
|
* to get idle RPM to desired value by dynamically adjusting idle valve position.
|
|
|
|
* TODO: convert to PID
|
|
|
|
*/
|
|
|
|
IM_AUTO = 0,
|
|
|
|
/**
|
|
|
|
* Manual idle control is extremely simple: user just specifies desired idle valve position
|
|
|
|
* which could be adjusted according to current CLT
|
|
|
|
*/
|
|
|
|
IM_MANUAL = 1,
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_idle_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} idle_mode_e;
|
|
|
|
|
2019-02-28 16:42:15 -08:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* GND for logical OFF, VCC for logical ON
|
|
|
|
*/
|
|
|
|
OM_DEFAULT = 0,
|
|
|
|
/**
|
|
|
|
* GND for logical ON, VCC for logical OFF
|
|
|
|
*/
|
|
|
|
OM_INVERTED = 1,
|
|
|
|
/**
|
|
|
|
* logical OFF is floating, logical ON is GND
|
|
|
|
*/
|
2018-01-26 08:34:01 -08:00
|
|
|
OM_OPENDRAIN = 2,
|
2019-02-22 19:10:41 -08:00
|
|
|
OM_OPENDRAIN_INVERTED = 3
|
2015-07-10 06:01:56 -07:00
|
|
|
} pin_output_mode_e;
|
|
|
|
|
2019-02-28 16:48:38 -08:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2018-01-26 08:34:01 -08:00
|
|
|
PI_DEFAULT = 0,
|
|
|
|
PI_PULLUP = 1,
|
2019-02-22 19:10:41 -08:00
|
|
|
PI_PULLDOWN = 2
|
2015-07-10 06:01:56 -07:00
|
|
|
} pin_input_mode_e;
|
|
|
|
|
2018-02-28 04:57:04 -08:00
|
|
|
#define CRANK_MODE_MULTIPLIER 2.0f
|
|
|
|
|
2020-08-08 14:00:14 -07:00
|
|
|
/**
|
|
|
|
* @see getCycleDuration
|
|
|
|
* @see getEngineCycle
|
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
// todo: better enum name
|
|
|
|
typedef enum {
|
|
|
|
OM_NONE = 0,
|
2016-07-14 19:01:48 -07:00
|
|
|
/**
|
2018-02-28 04:57:04 -08:00
|
|
|
* 720 degree engine cycle but trigger is defined using a 360 cycle which is when repeated.
|
|
|
|
* For historical reasons we have a pretty weird approach where one crank trigger revolution is
|
|
|
|
* defined as if it's stretched to 720 degress. See CRANK_MODE_MULTIPLIER
|
2016-07-14 19:01:48 -07:00
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
FOUR_STROKE_CRANK_SENSOR = 1,
|
2016-07-14 19:01:48 -07:00
|
|
|
/**
|
|
|
|
* 720 degree engine and trigger cycle
|
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
FOUR_STROKE_CAM_SENSOR = 2,
|
2016-07-14 19:01:48 -07:00
|
|
|
/**
|
|
|
|
* 360 degree cycle
|
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
TWO_STROKE = 3,
|
|
|
|
|
2016-11-13 20:02:33 -08:00
|
|
|
/**
|
|
|
|
* 720 degree engine cycle but trigger is defined using a 180 cycle which is when repeated three more times
|
2020-08-08 14:00:14 -07:00
|
|
|
* In other words, same pattern is repeated on the crank wheel twice.
|
2016-11-13 20:02:33 -08:00
|
|
|
*/
|
|
|
|
FOUR_STROKE_SYMMETRICAL_CRANK_SENSOR = 4,
|
|
|
|
|
2020-04-19 06:59:55 -07:00
|
|
|
/**
|
|
|
|
* Same pattern repeated three times on crank wheel. Crazy, I know!
|
|
|
|
*/
|
|
|
|
FOUR_STROKE_THREE_TIMES_CRANK_SENSOR = 5,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_operation_mode_e = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} operation_mode_e;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Ignition Mode
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
/**
|
|
|
|
* in this mode only SPARKOUT_1_OUTPUT is used
|
|
|
|
*/
|
|
|
|
IM_ONE_COIL = 0,
|
|
|
|
/**
|
|
|
|
* in this mode we use as many coils as we have cylinders
|
|
|
|
*/
|
2018-01-26 08:34:01 -08:00
|
|
|
IM_INDIVIDUAL_COILS = 1,
|
2021-10-23 17:24:21 -07:00
|
|
|
IM_WASTED_SPARK = 2,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-02-15 00:44:09 -08:00
|
|
|
/**
|
|
|
|
* some v12 engines line BMW M70 and M73 run two distributors, one for each bank of cylinders
|
|
|
|
*/
|
|
|
|
IM_TWO_COILS = 3,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_ignition_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} ignition_mode_e;
|
|
|
|
|
2017-11-06 07:25:06 -08:00
|
|
|
/**
|
|
|
|
* @see getNumberOfInjections
|
|
|
|
*/
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
2017-11-06 16:00:30 -08:00
|
|
|
/**
|
|
|
|
* each cylinder has it's own injector but they all works in parallel
|
|
|
|
*/
|
2017-11-06 07:25:06 -08:00
|
|
|
IM_SIMULTANEOUS = 0,
|
|
|
|
/**
|
|
|
|
* each cylinder has it's own injector, each injector is wired separately
|
|
|
|
*/
|
|
|
|
IM_SEQUENTIAL = 1,
|
|
|
|
/**
|
|
|
|
* each cylinder has it's own injector but these injectors work in pairs. Injectors could be wired in pairs or separately.
|
2020-03-11 21:20:05 -07:00
|
|
|
* Each pair is fired once per engine cycle
|
|
|
|
* todo: we might want to implement one additional mode where each pair of injectors is floating twice per engine cycle.
|
|
|
|
* todo: this could reduce phase offset from injection to stroke but would not work great for large injectors
|
2017-11-06 07:25:06 -08:00
|
|
|
*/
|
2021-10-23 18:46:42 -07:00
|
|
|
IM_BATCH = 2,
|
2017-11-06 16:00:30 -08:00
|
|
|
/**
|
|
|
|
* only one injector located in throttle body
|
|
|
|
*/
|
2021-10-23 18:46:42 -07:00
|
|
|
IM_SINGLE_POINT = 3,
|
2017-11-06 16:00:30 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_injection_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} injection_mode_e;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Ignition Mode while cranking
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
CIM_DEFAULT = 0,
|
|
|
|
CIM_FIXED_ANGLE = 1,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-03-25 12:08:32 -07:00
|
|
|
// todo: make this a one byte enum
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_cranking_ignition_mode = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} cranking_ignition_mode_e;
|
|
|
|
|
2019-04-14 15:12:15 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2016-10-13 12:02:07 -07:00
|
|
|
UART_NONE = 0,
|
|
|
|
UART_DEVICE_1 = 1,
|
|
|
|
UART_DEVICE_2 = 2,
|
|
|
|
UART_DEVICE_3 = 3,
|
|
|
|
UART_DEVICE_4 = 4,
|
|
|
|
} uart_device_e;
|
|
|
|
|
2019-03-25 19:41:31 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
_5MHz,
|
2019-03-26 07:35:33 -07:00
|
|
|
_2_5MHz,
|
|
|
|
_1_25MHz,
|
2019-03-25 19:41:31 -07:00
|
|
|
_150KHz
|
|
|
|
} spi_speed_e;
|
2016-10-13 12:02:07 -07:00
|
|
|
|
2020-05-13 20:26:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See spi3mosiPin
|
|
|
|
* See spi2MisoMode
|
|
|
|
*/
|
2019-04-14 15:12:15 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2015-07-10 06:01:56 -07:00
|
|
|
SPI_NONE = 0,
|
|
|
|
SPI_DEVICE_1 = 1,
|
|
|
|
SPI_DEVICE_2 = 2,
|
|
|
|
SPI_DEVICE_3 = 3,
|
|
|
|
SPI_DEVICE_4 = 4,
|
|
|
|
} spi_device_e;
|
|
|
|
|
2020-04-19 15:45:40 -07:00
|
|
|
typedef enum {
|
2020-04-21 17:48:37 -07:00
|
|
|
BMW_e46 = 0,
|
|
|
|
W202 = 1,
|
2020-04-19 15:58:22 -07:00
|
|
|
Force_4_bytes_size_can_vss_nbc_e = ENUM_32_BITS,
|
2020-04-19 15:45:40 -07:00
|
|
|
} can_vss_nbc_e;
|
|
|
|
|
2021-10-05 21:19:33 -07:00
|
|
|
/**
|
|
|
|
* inertia measurement unit, yawn accelerometer
|
|
|
|
* By the way both kinds of BOSCH use Housing : TE 1-967640-1, pins 144969-1 seal 967056-1 plug 967067-2
|
|
|
|
*/
|
2021-09-30 12:18:40 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
IMU_NONE = 0,
|
|
|
|
IMU_VAG = 1,
|
2021-10-05 13:10:29 -07:00
|
|
|
/**
|
|
|
|
* f037000002
|
|
|
|
* https://github.com/rusefi/rusefi_documentation/blob/master/OEM-Docs/Bosch/Data%20Sheet_68903691_Acceleration_Sensor_MM5.10.pdf
|
|
|
|
*/
|
|
|
|
IMU_MM5_10 = 2,
|
2021-09-30 12:18:40 -07:00
|
|
|
IMU_TYPE_3 = 3,
|
|
|
|
IMU_TYPE_4 = 4,
|
2021-09-30 12:25:02 -07:00
|
|
|
} imu_type_e;
|
2021-09-30 12:18:40 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
|
|
|
ES_BPSX_D1 = 0,
|
|
|
|
/**
|
|
|
|
* same as innovate LC2
|
2015-12-20 14:01:42 -08:00
|
|
|
* 0v->7.35afr, 5v->22.39
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
2017-04-24 17:00:14 -07:00
|
|
|
ES_Innovate_MTX_L = 1,
|
|
|
|
/**
|
|
|
|
* Same as AEM
|
|
|
|
* 0v->10.0afr
|
|
|
|
* 5v->20.0afr
|
|
|
|
*/
|
|
|
|
ES_14Point7_Free = 2,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
ES_NarrowBand = 3,
|
|
|
|
|
|
|
|
ES_PLX = 4,
|
|
|
|
|
2017-10-29 17:29:02 -07:00
|
|
|
ES_Custom = 5,
|
|
|
|
|
2019-03-21 19:21:30 -07:00
|
|
|
ES_AEM = 6,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_ego_sensor = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} ego_sensor_e;
|
|
|
|
|
2019-05-29 21:18:41 -07:00
|
|
|
typedef brain_pin_e output_pin_e;
|
2019-04-13 07:58:52 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
2018-01-26 08:34:01 -08:00
|
|
|
MT_CUSTOM = 0,
|
|
|
|
MT_DENSO183 = 1,
|
2015-08-16 20:01:33 -07:00
|
|
|
/**
|
|
|
|
* 20 to 250 kPa (2.9 to 36.3 psi) 0.2 to 4.9 V OUTPUT
|
|
|
|
*/
|
2018-01-26 08:34:01 -08:00
|
|
|
MT_MPX4250 = 2,
|
|
|
|
MT_HONDA3BAR = 3,
|
|
|
|
MT_DODGE_NEON_2003 = 4,
|
2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* 22012AA090
|
|
|
|
*/
|
|
|
|
MT_SUBY_DENSO = 5,
|
|
|
|
/**
|
|
|
|
* 16040749
|
|
|
|
*/
|
|
|
|
MT_GM_3_BAR = 6,
|
|
|
|
|
2015-08-16 20:01:33 -07:00
|
|
|
/**
|
|
|
|
* 20 to 105 kPa (2.9 to 15.2 psi) 0.3 to 4.9 V Output
|
|
|
|
*/
|
|
|
|
MT_MPX4100 = 7,
|
|
|
|
|
2016-06-12 08:03:43 -07:00
|
|
|
/**
|
|
|
|
* http://rusefi.com/forum/viewtopic.php?f=3&t=906&p=18976#p18976
|
|
|
|
* Toyota 89420-02010
|
|
|
|
*/
|
|
|
|
MT_TOYOTA_89420_02010 = 8,
|
|
|
|
|
2018-01-26 07:50:12 -08:00
|
|
|
/**
|
|
|
|
* 20 to 250 kPa (2.9 to 36.3 psi) 0.25 to 4.875 OUTPUT
|
|
|
|
* More precise calibration data for new NXP sensor revisions MPX4250A and MPXA4250A.
|
|
|
|
* For an old Freescale MPX4250D use "MT_MPX4250".
|
|
|
|
* See https://www.nxp.com/docs/en/data-sheet/MPX4250A.pdf
|
|
|
|
*/
|
|
|
|
MT_MPX4250A = 9,
|
|
|
|
|
2020-05-04 16:08:36 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Bosch 2.5 Bar TMap Map Sensor with IAT
|
|
|
|
* 20 kPa at 0.40V, 250 kPa at 4.65V
|
2020-10-22 21:39:22 -07:00
|
|
|
* 4 pin:
|
|
|
|
* Pin 1 : Sensor Ground
|
|
|
|
* Pin 2 : Temp Signal
|
|
|
|
* Pin 3 : 5v
|
|
|
|
* Pin 4 : Map Signal
|
|
|
|
* Volkswagen Passat B6
|
2020-05-04 16:08:36 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
MT_BOSCH_2_5 = 10,
|
|
|
|
|
2020-05-17 22:39:41 -07:00
|
|
|
MT_MAZDA_1_BAR = 11,
|
|
|
|
|
2021-02-02 06:15:28 -08:00
|
|
|
MT_GM_2_BAR = 12,
|
|
|
|
|
|
|
|
MT_GM_1_BAR = 13,
|
|
|
|
|
2021-09-30 18:34:23 -07:00
|
|
|
MT_MPXH6400 = 14,
|
|
|
|
|
2018-09-29 07:10:30 -07:00
|
|
|
Force_4_bytes_size_cranking_map_type = ENUM_32_BITS,
|
2015-07-10 06:01:56 -07:00
|
|
|
} air_pressure_sensor_type_e;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SC_OFF = 0,
|
|
|
|
/**
|
|
|
|
* You would use this value if you want to see a detailed graph of your trigger events
|
|
|
|
*/
|
2018-01-26 08:34:01 -08:00
|
|
|
SC_TRIGGER = 1,
|
2021-11-24 19:03:17 -08:00
|
|
|
// unused 2
|
2015-09-12 15:01:13 -07:00
|
|
|
SC_RPM_ACCEL = 3,
|
2015-09-13 14:02:44 -07:00
|
|
|
SC_DETAILED_RPM = 4,
|
2019-12-02 14:49:01 -08:00
|
|
|
SC_AUX_FAST1 = 5,
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
Internal_ForceMyEnumIntSize_sensor_chart = ENUM_32_BITS,
|
|
|
|
} sensor_chart_e;
|
|
|
|
|
2017-08-03 19:30:47 -07:00
|
|
|
typedef enum {
|
2020-05-19 22:05:15 -07:00
|
|
|
REVERSE = -1,
|
2017-08-03 19:30:47 -07:00
|
|
|
NEUTRAL = 0,
|
|
|
|
GEAR_1 = 1,
|
|
|
|
GEAR_2 = 2,
|
|
|
|
GEAR_3 = 3,
|
|
|
|
GEAR_4 = 4,
|
|
|
|
|
|
|
|
} gear_e;
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
typedef enum {
|
|
|
|
CUSTOM = 0,
|
|
|
|
Bosch0280218037 = 1,
|
|
|
|
Bosch0280218004 = 2,
|
|
|
|
DensoTODO = 3,
|
|
|
|
Internal_ForceMyEnumIntSize_maf_sensor = ENUM_32_BITS,
|
|
|
|
} maf_sensor_type_e;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/**
|
|
|
|
* This is the default mode in which ECU controls timing dynamically
|
|
|
|
*/
|
|
|
|
TM_DYNAMIC = 0,
|
|
|
|
/**
|
|
|
|
* Fixed timing is useful while you are playing with a timing gun - you need to have fixed
|
|
|
|
* timing if you want to install your distributor at some specific angle
|
|
|
|
*/
|
|
|
|
TM_FIXED = 1,
|
|
|
|
|
|
|
|
Internal_ForceMyEnumIntSize_timing_mode = ENUM_32_BITS,
|
|
|
|
} timing_mode_e;
|
|
|
|
|
2015-12-24 11:02:03 -08:00
|
|
|
typedef enum {
|
|
|
|
CS_OPEN = 0,
|
|
|
|
CS_CLOSED = 1,
|
|
|
|
CS_SWIRL_TUMBLE = 2,
|
|
|
|
|
|
|
|
Internal_ForceMyEnumIntSize_chamber_stype = ENUM_32_BITS,
|
|
|
|
} chamber_style_e;
|
|
|
|
|
2016-01-20 20:03:03 -08:00
|
|
|
/**
|
|
|
|
* Net Body Computer types
|
|
|
|
*/
|
|
|
|
typedef enum {
|
2020-03-31 17:08:30 -07:00
|
|
|
CAN_BUS_NBC_NONE = 0,
|
2016-01-20 20:03:03 -08:00
|
|
|
CAN_BUS_NBC_FIAT = 1,
|
|
|
|
CAN_BUS_NBC_VAG = 2,
|
|
|
|
CAN_BUS_MAZDA_RX8 = 3,
|
2020-03-31 17:08:30 -07:00
|
|
|
CAN_BUS_NBC_BMW = 4,
|
2020-04-13 05:11:06 -07:00
|
|
|
CAN_BUS_W202_C180 = 5,
|
2020-06-14 13:59:43 -07:00
|
|
|
CAN_BUS_BMW_E90 = 6,
|
2020-12-31 09:22:01 -08:00
|
|
|
CAN_BUS_Haltech = 7,
|
2021-03-14 14:27:26 -07:00
|
|
|
CAN_BUS_MQB = 8,
|
2021-07-05 14:47:59 -07:00
|
|
|
CAN_BUS_NISSAN_VQ = 9,
|
2021-07-28 11:51:29 -07:00
|
|
|
CAN_BUS_GENESIS_COUPE = 10,
|
2021-08-02 10:30:51 -07:00
|
|
|
CAN_BUS_HONDA_K = 11,
|
2021-12-08 04:04:59 -08:00
|
|
|
CAN_AIM_DASH = 12,
|
2021-03-14 14:27:26 -07:00
|
|
|
|
2016-01-20 20:03:03 -08:00
|
|
|
Internal_ForceMyEnumIntSize_can_nbc = ENUM_32_BITS,
|
|
|
|
} can_nbc_e;
|
2015-12-24 11:02:03 -08:00
|
|
|
|
2018-09-29 09:16:36 -07:00
|
|
|
typedef enum {
|
|
|
|
TCHARGE_MODE_RPM_TPS = 0,
|
|
|
|
TCHARGE_MODE_AIR_INTERP = 1,
|
|
|
|
Force_4bytes_size_tChargeMode_e = ENUM_32_BITS,
|
|
|
|
} tChargeMode_e;
|
|
|
|
|
2018-11-22 15:56:51 -08:00
|
|
|
// peak type
|
|
|
|
typedef enum {
|
|
|
|
MINIMUM = -1,
|
|
|
|
NOT_A_PEAK = 0,
|
|
|
|
MAXIMUM = 1
|
|
|
|
} PidAutoTune_Peak;
|
|
|
|
|
|
|
|
// auto tuner state
|
|
|
|
typedef enum {
|
|
|
|
AUTOTUNER_OFF = 0,
|
|
|
|
STEADY_STATE_AT_BASELINE = 1,
|
|
|
|
STEADY_STATE_AFTER_STEP_UP = 2,
|
|
|
|
RELAY_STEP_UP = 4,
|
|
|
|
RELAY_STEP_DOWN = 8,
|
|
|
|
CONVERGED = 16,
|
|
|
|
FAILED = 128
|
|
|
|
} PidAutoTune_AutoTunerState;
|
|
|
|
|
2019-05-11 07:41:04 -07:00
|
|
|
typedef enum {
|
|
|
|
INIT = 0,
|
|
|
|
TPS_THRESHOLD = 1,
|
|
|
|
RPM_DEAD_ZONE = 2,
|
2019-07-21 11:06:51 -07:00
|
|
|
PID_VALUE = 4,
|
|
|
|
PID_UPPER = 16,
|
|
|
|
BLIP = 64,
|
2019-07-21 15:34:37 -07:00
|
|
|
/**
|
|
|
|
* Live Docs reads 4 byte value so we want 4 byte enum
|
|
|
|
*/
|
|
|
|
Force_4bytes_size_idle_state_e = ENUM_32_BITS,
|
2019-05-11 07:41:04 -07:00
|
|
|
} idle_state_e;
|
2020-02-01 14:55:58 -08:00
|
|
|
|
2020-01-31 11:23:15 -08:00
|
|
|
typedef enum {
|
|
|
|
OPEN_LOOP = 0,
|
|
|
|
CLOSED_LOOP = 1,
|
|
|
|
Force_4bytes_size_boostType_e = ENUM_32_BITS,
|
2020-02-01 14:55:58 -08:00
|
|
|
} boostType_e;
|
2020-02-02 07:44:31 -08:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SWITCH_INPUT_LAUNCH = 0,
|
|
|
|
CLUTCH_INPUT_LAUNCH = 1,
|
|
|
|
ALWAYS_ACTIVE_LAUNCH = 2,
|
|
|
|
Force_4bytes_size_launchActivationMode_e = ENUM_32_BITS,
|
|
|
|
} launchActivationMode_e;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
SWITCH_INPUT_ANTILAG = 0,
|
|
|
|
ALWAYS_ON_ANTILAG = 1,
|
|
|
|
Force_4bytes_size_antiLagActivationMode_e = ENUM_32_BITS,
|
|
|
|
} antiLagActivationMode_e;
|
2020-04-25 15:26:29 -07:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
GPPWM_Tps = 0,
|
|
|
|
GPPWM_Map = 1,
|
|
|
|
GPPWM_Clt = 2,
|
|
|
|
GPPWM_Iat = 3,
|
2020-07-23 02:51:08 -07:00
|
|
|
GPPWM_FuelLoad = 4,
|
|
|
|
GPPWM_IgnLoad = 5,
|
2021-03-29 05:57:37 -07:00
|
|
|
GPPWM_AuxTemp1 = 6,
|
|
|
|
GPPWM_AuxTemp2 = 7,
|
2021-04-14 22:08:34 -07:00
|
|
|
GPPWM_Zero = 8,
|
2021-05-28 00:38:45 -07:00
|
|
|
GPPWM_AccelPedal = 9,
|
2021-07-31 18:20:19 -07:00
|
|
|
GPPWM_Vbatt = 10,
|
2020-04-25 15:26:29 -07:00
|
|
|
} gppwm_channel_e;
|
|
|
|
|
2020-06-14 15:06:33 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
B100KBPS = 0, // 100kbps
|
|
|
|
B250KBPS = 1, // 250kbps
|
|
|
|
B500KBPS = 2, // 500kbps
|
|
|
|
B1MBPS = 3, // 1Mbps
|
|
|
|
} can_baudrate_e;
|
|
|
|
|
2020-04-25 15:26:29 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
GPPWM_GreaterThan = 0,
|
|
|
|
GPPWM_LessThan = 1,
|
|
|
|
} gppwm_compare_mode_e;
|
2020-09-07 07:15:42 -07:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
VE_None = 0,
|
|
|
|
VE_MAP = 1,
|
|
|
|
VE_TPS = 2,
|
|
|
|
} ve_override_e;
|
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
AFR_None = 0,
|
|
|
|
AFR_MAP = 1,
|
|
|
|
AFR_Tps = 2,
|
|
|
|
AFR_AccPedal = 3,
|
|
|
|
AFR_CylFilling = 4,
|
2021-12-26 11:53:27 -08:00
|
|
|
} load_override_e;
|
2020-09-28 13:33:07 -07:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
2021-09-26 20:08:37 -07:00
|
|
|
// todo: rename to HB_None?
|
2021-10-23 18:46:42 -07:00
|
|
|
ETB_None = 0,
|
2020-09-28 13:33:07 -07:00
|
|
|
ETB_Throttle1 = 1,
|
|
|
|
ETB_Throttle2 = 2,
|
2021-10-23 18:46:42 -07:00
|
|
|
ETB_IdleValve = 3,
|
2020-09-28 13:33:07 -07:00
|
|
|
ETB_Wastegate = 4,
|
2021-09-26 20:08:37 -07:00
|
|
|
// todo: rename to dc_function_e? rename to hbrg_function_e?
|
2020-09-28 13:33:07 -07:00
|
|
|
} etb_function_e;
|
2020-10-23 12:46:16 -07:00
|
|
|
|
2021-10-06 10:57:04 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
STEPPER_FULL = 0,
|
|
|
|
STEPPER_HALF = 2,
|
|
|
|
STEPPER_FOURTH = 4,
|
|
|
|
STEPPER_EIGHTH = 8,
|
|
|
|
} stepper_num_micro_steps_e;
|
|
|
|
|
2020-10-23 12:46:16 -07:00
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
IPT_Low = 0,
|
|
|
|
IPT_High = 1,
|
|
|
|
} injector_pressure_type_e;
|
2020-11-10 20:11:22 -08:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
ICM_None = 0,
|
|
|
|
ICM_FixedRailPressure = 1,
|
|
|
|
ICM_SensedRailPressure = 2,
|
|
|
|
} injector_compensation_mode_e;
|
2021-07-07 20:46:44 -07:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
INJ_None = 0,
|
|
|
|
INJ_PolynomialAdder = 1,
|
|
|
|
} InjectorNonlinearMode;
|
2021-11-05 20:15:35 -07:00
|
|
|
|
|
|
|
typedef enum __attribute__ ((__packed__)) {
|
|
|
|
HPFP_CAM_NONE = 0,
|
|
|
|
HPFP_CAM_IN1 = 1,
|
|
|
|
HPFP_CAM_EX1 = 2,
|
|
|
|
HPFP_CAM_IN2 = 3,
|
|
|
|
HPFP_CAM_EX2 = 4,
|
|
|
|
} hpfp_cam_e;
|