rusefi/firmware/controllers/algo/rusefi_enums.h

737 lines
15 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file rusefi_enums.h
* @brief Fundamental rusEFI enumerable types live here
*
* This and few over headers are part of integration API between C/C++ and code generator for memory meta and java code.
* TODO: move enums which should not be visible outside of the firmware out of 'integration API' headers like this one
2015-07-10 06:01:56 -07:00
*
* @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
2023-10-31 06:30:58 -07:00
#include <rusefi/true_false.h>
2015-07-10 06:01:56 -07:00
#include "efifeatures.h"
#include "obd_error_codes.h"
#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>
#include "rusefi_hw_pin_mode.h"
2018-09-29 07:31:19 -07: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
/* diagnostic for brain pins
* can be combination of few bits
* defined as bit mask
* PIN_UNKNOWN is reported for pins with no diagnostic support, like on-chip gpio
*/
typedef enum __attribute__ ((__packed__))
{
PIN_OK = 0,
PIN_OPEN = 0x01,
PIN_SHORT_TO_GND = 0x02,
PIN_SHORT_TO_BAT = 0x04,
PIN_OVERLOAD = 0x08,
PIN_DRIVER_OVERTEMP = 0x10,
PIN_DRIVER_OFF = 0x20,
PIN_UNKNOWN = 0x80
} brain_pin_diag_e;
// see also PWM_PHASE_MAX_WAVE_PER_PWM
// todo: better names?
enum class TriggerWheel : uint8_t {
T_PRIMARY = 0,
T_SECONDARY = 1,
};
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
*/
VVT_INACTIVE = 0,
2020-05-14 20:13:32 -07:00
2020-05-09 23:36:01 -07:00
/**
* Single tooth on the camshaft anywhere in the 720 degree cycle
2020-05-09 23:36:01 -07:00
*/
VVT_SINGLE_TOOTH = 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
*/
2023-09-14 13:53:16 -07:00
VVT_TOYOTA_3_TOOTH = 2,
2020-05-09 23:36:01 -07:00
/**
* Mazda NB2 has three cam tooth. We synchronize based on gap ratio.
2022-01-31 15:20:43 -08:00
* @see TT_VVT_MIATA_NB
2020-05-09 23:36:01 -07:00
*/
2022-01-31 15:20:43 -08:00
VVT_MIATA_NB = 3,
2020-05-14 20:13:32 -07:00
2023-08-24 22:10:03 -07:00
VVT_MITSUBISHI_4G69 = 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
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
VVT_FORD_ST170 = 7,
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
/**
2022-09-24 20:43:00 -07:00
* 4 equally spaced no way to sync
2021-10-28 12:57:23 -07:00
*/
2022-09-24 20:25:36 -07:00
VVT_HONDA_K_INTAKE = 10,
VVT_NISSAN_MR = 11,
2021-11-14 18:43:56 -08:00
VVT_MITSUBISHI_3A92 = 12,
2021-12-07 05:57:23 -08:00
2022-08-31 21:18:06 -07:00
VVT_MAP_V_TWIN = 13,
2021-12-07 05:57:23 -08:00
VVT_MITSUBISHI_6G75 = 14,
VVT_MAZDA_SKYACTIV = 15,
2022-08-28 19:57:44 -07:00
2022-09-24 20:43:00 -07:00
/**
* 4 plus one
*/
VVT_HONDA_K_EXHAUST = 16,
VVT_MITSUBISHI_4G9x = 17,
VVT_MITSUBISHI_4G63 = 18,
VVT_FORD_COYOTE = 19,
VVT_MITSUBISHI_6G72 = 20,
VVT_HONDA_CBR_600 = 21,
2023-11-08 11:51:12 -08:00
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
*/
2022-05-01 10:51:36 -07:00
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
/**
* Speed Density algorithm - Engine Load is a function of MAP, VE and target AFR
* http://articles.sae.org/8539/
*/
LM_SPEED_DENSITY = 0,
2015-07-10 06:01:56 -07:00
/**
* MAF with a known kg/hour function
*/
LM_REAL_MAF = 1,
2015-07-10 06:01:56 -07:00
LM_ALPHA_N = 2,
2020-07-25 01:14:35 -07:00
LM_LUA = 3,
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,
2015-07-10 06:01:56 -07:00
} engine_load_mode_e;
2022-05-01 10:51:36 -07:00
typedef enum __attribute__ ((__packed__)) {
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
} 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;
typedef enum __attribute__ ((__packed__)) {
DWELL_2MS = 0,
DWELL_4MS = 1,
DWELL_8MS = 2,
DWELL_16MS = 3,
DWELL_32MS = 4,
DWELL_64MS = 5,
} mc33810maxDwellTimer_e;
typedef enum __attribute__ ((__packed__)) {
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,
2015-07-10 06:01:56 -07:00
} idle_mode_e;
2023-02-14 10:20:18 -08:00
enum class SentEtbType : uint8_t {
2023-02-20 08:50:59 -08:00
NONE = 0,
GM_TYPE_1 = 1,
FORD_TYPE_1 = 2,
2023-03-01 13:09:23 -08:00
CUSTOM = 3,
2023-02-14 10:20:18 -08:00
};
2023-03-04 16:02:20 -08:00
enum class CanGpioType : uint8_t {
NONE = 0,
DRT = 1,
MS = 2,
};
enum class UiMode : uint8_t {
FULL = 0,
INSTALLATION = 1,
TUNING = 2,
};
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,
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,
PI_PULLDOWN = 2
2015-07-10 06:01:56 -07:00
} pin_input_mode_e;
/**
* @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
2023-05-13 11:52:50 -07:00
* defined as if it's stretched to 720 degrees. 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
* 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,
// Same pattern TWELVE TIMES on the crank wheel!
// This usually means Honda, which often has a 12 tooth crank wheel or 24 tooth cam wheel
// without a missing tooth, plus a single tooth cam channel to resolve the engine phase.
FOUR_STROKE_TWELVE_TIMES_CRANK_SENSOR = 6,
/**
* Same pattern repeated six times on crank wheel like 1995 Lamborghini Diablo
*/
FOUR_STROKE_SIX_TIMES_CRANK_SENSOR = 7,
2015-07-10 06:01:56 -07:00
} operation_mode_e;
/**
* @brief Ignition Mode
*/
2022-05-01 10:51:36 -07:00
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
/**
* 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,
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,
2015-07-10 06:01:56 -07:00
} ignition_mode_e;
2017-11-06 07:25:06 -08:00
/**
* @see getNumberOfInjections
*/
2022-05-01 10:51:36 -07:00
typedef enum __attribute__ ((__packed__)) {
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
*/
IM_BATCH = 2,
2017-11-06 16:00:30 -08:00
/**
* only one injector located in throttle body
*/
IM_SINGLE_POINT = 3,
2017-11-06 16:00:30 -08:00
2015-07-10 06:01:56 -07:00
} injection_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,
_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,
2024-02-26 09:28:14 -08:00
SPI_DEVICE_5 = 5,
2024-02-26 10:17:07 -08:00
SPI_DEVICE_6 = 6,
2015-07-10 06:01:56 -07:00
} spi_device_e;
2024-02-26 11:30:08 -08:00
#define SPI_TOTAL_COUNT 6
2022-05-01 20:07:12 -07:00
typedef enum __attribute__ ((__packed__)) {
BMW_e46 = 0,
W202 = 1,
BMW_e90 = 2,
2023-12-12 14:47:40 -08:00
NISSAN_350 = 3,
HYUNDAI_PB = 4,
HONDA_CIVIC9 = 5,
2020-04-19 15:45:40 -07:00
} can_vss_nbc_e;
/**
* 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
*/
2022-05-01 20:07:12 -07:00
typedef enum __attribute__ ((__packed__)) {
IMU_NONE = 0,
IMU_VAG = 1,
/**
* f037000002
* https://github.com/rusefi/rusefi_documentation/blob/master/OEM-Docs/Bosch/Data%20Sheet_68903691_Acceleration_Sensor_MM5.10.pdf
*/
IMU_MM5_10 = 2,
IMU_TYPE_3 = 3,
IMU_TYPE_4 = 4,
/**
* Mercedes pn: A 006 542 26 18
* Almost the same as BOSCH above, but XY only and different CAN IDs
*/
IMU_TYPE_MB_A0065422618 = 5,
} imu_type_e;
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
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_PLX = 4,
2017-10-29 17:29:02 -07:00
ES_Custom = 5,
2019-03-21 19:21:30 -07:00
ES_AEM = 6,
2015-07-10 06:01:56 -07:00
} ego_sensor_e;
typedef enum __attribute__ ((__packed__)) {
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,
/**
* 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,
MT_GM_2_BAR = 12,
MT_GM_1_BAR = 13,
2022-01-17 16:58:55 -08:00
/**
* 4 bar
*/
2021-09-30 18:34:23 -07:00
MT_MPXH6400 = 14,
2023-08-02 15:16:33 -07:00
/**
* 3 bar
*/
MT_MPXH6300 = 15,
2015-07-10 06:01:56 -07:00
} air_pressure_sensor_type_e;
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
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
} sensor_chart_e;
2017-08-03 19:30:47 -07:00
typedef enum {
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;
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
CUSTOM = 0,
Bosch0280218037 = 1,
Bosch0280218004 = 2,
DensoTODO = 3,
2015-07-10 06:01:56 -07:00
} maf_sensor_type_e;
typedef enum __attribute__ ((__packed__)) {
2015-07-10 06:01:56 -07:00
/**
* 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,
} timing_mode_e;
2016-01-20 20:03:03 -08:00
/**
* Net Body Computer types
*/
typedef enum __attribute__ ((__packed__)) {
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,
2023-06-03 17:28:33 -07:00
CAN_BUS_BMW_E46 = 4,
CAN_BUS_W202_C180 = 5,
CAN_BUS_BMW_E90 = 6,
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,
CAN_BUS_MS_SIMPLE_BROADCAST = 13,
2021-03-14 14:27:26 -07:00
2016-01-20 20:03:03 -08:00
} can_nbc_e;
2015-12-24 11:02:03 -08:00
typedef enum __attribute__ ((__packed__)) {
TCHARGE_MODE_RPM_TPS = 0,
TCHARGE_MODE_AIR_INTERP = 1,
TCHARGE_MODE_AIR_INTERP_TABLE = 2,
} tChargeMode_e;
2022-05-01 20:07:12 -07:00
typedef enum __attribute__ ((__packed__)) {
2019-05-11 07:41:04 -07:00
INIT = 0,
TPS_THRESHOLD = 1,
RPM_DEAD_ZONE = 2,
PID_VALUE = 4,
PID_UPPER = 16,
BLIP = 64,
2022-05-01 20:07:12 -07:00
2019-05-11 07:41:04 -07:00
} idle_state_e;
2020-02-01 14:55:58 -08:00
// todo: should this be just a boolean?
2022-05-01 20:07:12 -07:00
typedef enum __attribute__ ((__packed__)) {
2020-01-31 11:23:15 -08:00
OPEN_LOOP = 0,
CLOSED_LOOP = 1,
2022-05-01 20:07:12 -07:00
2020-02-01 14:55:58 -08:00
} boostType_e;
2022-05-01 20:07:12 -07:00
typedef enum __attribute__ ((__packed__)) {
SWITCH_INPUT_LAUNCH = 0,
CLUTCH_INPUT_LAUNCH = 1,
ALWAYS_ACTIVE_LAUNCH = 2,
STOP_INPUT_LAUNCH = 3,
} launchActivationMode_e;
2022-05-01 10:51:36 -07:00
typedef enum __attribute__ ((__packed__)) {
SWITCH_INPUT_ANTILAG = 0,
ALWAYS_ON_ANTILAG = 1,
} antiLagActivationMode_e;
2020-04-25 15:26:29 -07:00
typedef enum __attribute__ ((__packed__)) {
GPPWM_Zero = 0,
GPPWM_Tps = 1,
GPPWM_Map = 2,
GPPWM_Clt = 3,
GPPWM_Iat = 4,
GPPWM_FuelLoad = 5,
GPPWM_IgnLoad = 6,
GPPWM_AuxTemp1 = 7,
GPPWM_AuxTemp2 = 8,
GPPWM_AccelPedal = 9,
2021-07-31 18:20:19 -07:00
GPPWM_Vbatt = 10,
GPPWM_VVT_1I = 11,
GPPWM_VVT_1E = 12,
GPPWM_VVT_2I = 13,
GPPWM_VVT_2E = 14,
GPPWM_EthanolPercent = 15,
GPPWM_AuxLinear1 = 16,
GPPWM_AuxLinear2 = 17,
GPPWM_GppwmOutput1 = 18,
GPPWM_GppwmOutput2 = 19,
GPPWM_GppwmOutput3 = 20,
GPPWM_GppwmOutput4 = 21,
2022-10-17 18:21:23 -07:00
GPPWM_LuaGauge1 = 22,
GPPWM_LuaGauge2 = 23,
GPPWM_Rpm = 24,
GPPWM_DetectedGear = 25,
2024-01-17 02:46:04 -08:00
GPPWM_BaroPressure = 26,
2020-04-25 15:26:29 -07:00
} gppwm_channel_e;
2020-06-14 15:06:33 -07:00
typedef enum __attribute__ ((__packed__)) {
B50KBPS = 0, // 50kbps
B83KBPS = 1, // 83.33kbps
B100KBPS = 2, // 100kbps
B125KBPS = 3, // 125kbps
B250KBPS = 4, // 250kbps
B500KBPS = 5, // 500kbps
B1MBPS = 6, // 1Mbps
2020-06-14 15:06:33 -07:00
} 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;
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;
typedef enum __attribute__ ((__packed__)) {
2023-02-18 19:39:45 -08:00
DC_None = 0,
DC_Throttle1 = 1,
DC_Throttle2 = 2,
// this is about SINGLE DC-motor idle valve like 90s volkswagen/earlier M111 engines
// NOT to be used in dual H-bridge stepper control
2023-02-18 19:39:45 -08:00
DC_IdleValve = 3,
DC_Wastegate = 4,
} dc_function_e;
typedef enum __attribute__ ((__packed__)) {
STEPPER_FULL = 0,
STEPPER_HALF = 2,
STEPPER_FOURTH = 4,
STEPPER_EIGHTH = 8,
} stepper_num_micro_steps_e;
typedef enum __attribute__ ((__packed__)) {
IPT_Low = 0,
IPT_High = 1,
} injector_pressure_type_e;
typedef enum __attribute__ ((__packed__)) {
ICM_None = 0,
ICM_FixedRailPressure = 1,
ICM_SensedRailPressure = 2,
} injector_compensation_mode_e;
typedef enum __attribute__ ((__packed__)) {
FPM_Absolute = 0,
FPM_Gauge = 1,
FPM_Differential = 2,
} fuel_pressure_sensor_mode_e;
typedef enum __attribute__ ((__packed__)) {
INJ_None = 0,
INJ_PolynomialAdder = 1,
INJ_FordModel = 2,
} InjectorNonlinearMode;
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;
2022-01-27 14:39:24 -08:00
#if __cplusplus
#include <cstdint>
2022-01-27 14:39:24 -08:00
enum class TsCalMode : uint8_t {
None = 0,
Tps1Max = 1,
Tps1Min = 2,
EtbKp = 3,
EtbKi = 4,
EtbKd = 5,
Tps1SecondaryMax = 6,
Tps1SecondaryMin = 7,
Tps2Max = 8,
Tps2Min = 9,
Tps2SecondaryMax = 10,
Tps2SecondaryMin = 11,
PedalMin = 12,
PedalMax = 13,
2022-01-27 14:39:24 -08:00
};
enum class GearControllerMode : uint8_t {
None = 0,
ButtonShift = 1,
2024-04-02 19:02:39 -07:00
Automatic = 2,
Generic = 3,
};
enum class TransmissionControllerMode : uint8_t {
None = 0,
SimpleTransmissionController = 1,
2024-04-03 20:02:51 -07:00
Generic4 = 2,
Gm4l6x = 3,
};
enum class InjectionTimingMode : uint8_t {
End = 0,
Start = 1,
Center = 2,
};
2022-06-26 16:40:54 -07:00
enum class SelectedGear : uint8_t {
Invalid = 0,
ManualPlus = 1,
ManualMinus = 2,
Park = 3,
Reverse = 4,
Neutral = 5,
Drive = 6,
Manual = 7,
Manual3 = 8,
Manual2 = 9,
Manual1 = 10,
Low = 11,
};
2023-01-21 05:56:21 -08:00
#define SC_Exhaust_First 1
2022-01-27 14:39:24 -08:00
#endif // __cplusplus