2024-04-09 21:49:59 -07:00
// this section was generated automatically by rusEFI tool config_definition_base-all.jar based on (unknown script) controllers/algo/engine_state.txt Wed Apr 10 04:48:31 UTC 2024
2019-07-20 11:56:56 -07:00
// by class com.rusefi.output.CHeaderConsumer
2019-06-17 09:18:55 -07:00
// begin
2020-07-05 23:07:22 -07:00
# pragma once
2019-06-17 09:18:55 -07:00
# include "rusefi_types.h"
2022-06-29 20:34:00 -07:00
// start of LuaAdjustments
struct LuaAdjustments {
/**
2023-05-04 17:38:45 -07:00
* Lua : Fuel add
2024-01-03 12:32:11 -08:00
* units : g
2022-06-29 20:34:00 -07:00
* offset 0
*/
float fuelAdd = ( float ) 0 ;
/**
2023-05-04 17:38:45 -07:00
* Lua : Fuel mult
2022-06-30 10:53:57 -07:00
* offset 4
*/
float fuelMult = ( float ) 0 ;
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 0 */
bool clutchUpState : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 1 */
bool brakePedalState : 1 { } ;
2023-08-22 11:21:31 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 2 */
2022-07-07 21:45:52 -07:00
bool acRequestState : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 3 */
2022-11-15 06:34:13 -08:00
bool luaDisableEtb : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 4 */
2023-01-02 14:53:56 -08:00
bool luaIgnCut : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 5 */
bool unusedBit_7_5 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 6 */
bool unusedBit_7_6 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 7 */
bool unusedBit_7_7 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 8 */
bool unusedBit_7_8 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 9 */
bool unusedBit_7_9 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 10 */
bool unusedBit_7_10 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 11 */
bool unusedBit_7_11 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 12 */
bool unusedBit_7_12 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 13 */
bool unusedBit_7_13 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 14 */
bool unusedBit_7_14 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 15 */
bool unusedBit_7_15 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 16 */
bool unusedBit_7_16 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 17 */
bool unusedBit_7_17 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 18 */
bool unusedBit_7_18 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 19 */
bool unusedBit_7_19 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 20 */
bool unusedBit_7_20 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 21 */
bool unusedBit_7_21 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 22 */
bool unusedBit_7_22 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 23 */
bool unusedBit_7_23 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 24 */
bool unusedBit_7_24 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 25 */
bool unusedBit_7_25 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 26 */
bool unusedBit_7_26 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 27 */
bool unusedBit_7_27 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 28 */
bool unusedBit_7_28 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 29 */
bool unusedBit_7_29 : 1 { } ;
2022-06-29 20:34:00 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 30 */
bool unusedBit_7_30 : 1 { } ;
2023-08-22 11:21:31 -07:00
/**
2023-08-22 11:32:00 -07:00
offset 8 bit 31 */
bool unusedBit_7_31 : 1 { } ;
2022-06-29 20:34:00 -07:00
} ;
2023-08-22 11:32:00 -07:00
static_assert ( sizeof ( LuaAdjustments ) = = 12 ) ;
2022-06-29 20:34:00 -07:00
2019-06-19 19:34:11 -07:00
// start of speed_density_s
struct speed_density_s {
2019-06-17 09:18:55 -07:00
/**
2023-05-05 09:37:43 -07:00
* Air : Charge temperature estimate
2024-01-03 12:32:11 -08:00
* units : deg C
2022-09-03 04:44:24 -07:00
* offset 0
2019-06-17 09:18:55 -07:00
*/
2023-05-04 18:47:08 -07:00
scaled_channel < int16_t , 100 , 1 > tCharge = ( int16_t ) 0 ;
2019-06-17 09:18:55 -07:00
/**
2023-05-04 18:47:08 -07:00
* need 4 byte alignment
2024-01-03 12:32:11 -08:00
* units : units
2023-05-04 18:47:08 -07:00
* offset 2
2019-06-17 09:18:55 -07:00
*/
2023-05-04 18:47:08 -07:00
uint8_t alignmentFill_at_2 [ 2 ] ;
2019-06-17 09:18:55 -07:00
/**
2023-05-05 09:37:43 -07:00
* Air : Charge temperature estimate K
2023-05-04 18:47:08 -07:00
* offset 4
2019-06-17 09:18:55 -07:00
*/
2023-05-04 18:47:08 -07:00
float tChargeK = ( float ) 0 ;
2019-06-19 19:34:11 -07:00
} ;
2023-05-04 18:47:08 -07:00
static_assert ( sizeof ( speed_density_s ) = = 8 ) ;
2019-06-19 19:34:11 -07:00
2019-08-26 20:41:04 -07:00
// start of cranking_fuel_s
struct cranking_fuel_s {
/**
2023-05-05 10:57:39 -07:00
* Fuel : cranking CLT mult
2019-08-26 20:41:04 -07:00
* offset 0
*/
2023-05-05 10:57:39 -07:00
float coolantTemperatureCoefficient = ( float ) 0 ;
2019-08-26 20:41:04 -07:00
/**
2023-05-05 10:57:39 -07:00
* Fuel : cranking TPS mult
2019-08-26 20:41:04 -07:00
* offset 4
*/
2023-05-05 10:57:39 -07:00
float tpsCoefficient = ( float ) 0 ;
2019-08-26 20:41:04 -07:00
/**
2023-05-05 10:57:39 -07:00
* Fuel : cranking duration mult
2019-08-26 20:41:04 -07:00
* offset 8
*/
2023-05-05 10:57:39 -07:00
float durationCoefficient = ( float ) 0 ;
2019-08-26 20:41:04 -07:00
/**
2023-05-05 10:57:39 -07:00
* Fuel : Cranking cycle mass
2024-01-03 12:32:11 -08:00
* units : mg
2019-08-26 20:41:04 -07:00
* offset 12
*/
2023-05-05 10:57:39 -07:00
scaled_channel < uint16_t , 100 , 1 > fuel = ( uint16_t ) 0 ;
2019-08-26 20:41:04 -07:00
/**
2023-05-05 10:57:39 -07:00
* need 4 byte alignment
2024-01-03 12:32:11 -08:00
* units : units
2023-05-05 10:57:39 -07:00
* offset 14
2019-08-26 20:41:04 -07:00
*/
2023-05-05 10:57:39 -07:00
uint8_t alignmentFill_at_14 [ 2 ] ;
2019-08-26 20:41:04 -07:00
} ;
2023-05-05 10:57:39 -07:00
static_assert ( sizeof ( cranking_fuel_s ) = = 16 ) ;
2019-08-26 20:41:04 -07:00
2022-04-13 17:45:52 -07:00
// start of engine_state_s
struct engine_state_s {
2019-06-19 19:34:11 -07:00
/**
* offset 0
*/
2022-06-29 20:34:00 -07:00
LuaAdjustments lua ;
/**
2023-08-22 11:32:00 -07:00
* offset 12
2022-06-29 20:34:00 -07:00
*/
2019-06-19 19:34:11 -07:00
speed_density_s sd ;
2019-09-24 15:39:26 -07:00
/**
2023-08-22 11:32:00 -07:00
* offset 20
2019-09-24 15:39:26 -07:00
*/
2023-05-05 10:57:39 -07:00
cranking_fuel_s crankingFuel ;
2019-08-26 20:41:04 -07:00
/**
2023-05-05 10:57:39 -07:00
* @ @ GAUGE_NAME_FUEL_BARO_CORR @ @
2023-08-22 11:32:00 -07:00
* offset 36
2019-08-26 20:41:04 -07:00
*/
2023-05-05 10:57:39 -07:00
float baroCorrection = ( float ) 0 ;
2022-06-28 22:23:15 -07:00
/**
2022-06-29 15:16:13 -07:00
* Detected Board ID
2024-01-03 12:32:11 -08:00
* units : id
2023-08-22 11:32:00 -07:00
* offset 40
2022-06-28 22:23:15 -07:00
*/
2022-06-28 23:06:27 -07:00
int16_t hellenBoardId = ( int16_t ) 0 ;
2022-06-28 23:21:31 -07:00
/**
2022-06-29 00:27:51 -07:00
* @ @ INDICATOR_NAME_CLUTCH_UP @ @
2023-08-22 11:32:00 -07:00
* offset 42
*/
int8_t clutchUpState = ( int8_t ) 0 ;
2022-06-28 23:21:31 -07:00
/**
2022-06-29 00:27:51 -07:00
* @ @ INDICATOR_NAME_CLUTCH_DOWN @ @
2023-08-22 11:32:00 -07:00
* offset 43
*/
int8_t clutchDownState = ( int8_t ) 0 ;
2022-06-28 23:21:31 -07:00
/**
2022-06-29 00:27:51 -07:00
* @ @ INDICATOR_NAME_BRAKE_DOWN @ @
2023-08-22 11:32:00 -07:00
* offset 44
*/
int8_t brakePedalState = ( int8_t ) 0 ;
2022-06-28 23:21:31 -07:00
/**
2023-08-22 11:32:00 -07:00
* offset 45
*/
int8_t startStopState = ( int8_t ) 0 ;
2022-06-28 23:21:31 -07:00
/**
2023-08-22 11:32:00 -07:00
* offset 46
*/
2023-12-20 21:30:52 -08:00
int8_t smartChipState = ( int8_t ) 0 ;
/**
* offset 47
*/
int8_t smartChipRestartCounter = ( int8_t ) 0 ;
2022-08-22 08:19:58 -07:00
/**
2023-12-26 14:49:00 -08:00
* offset 48
*/
int8_t smartChipAliveCounter = ( int8_t ) 0 ;
/**
* need 4 byte alignment
2024-01-03 12:32:11 -08:00
* units : units
2023-12-26 14:49:00 -08:00
* offset 49
*/
uint8_t alignmentFill_at_49 [ 3 ] ;
/**
offset 52 bit 0 */
2023-09-25 11:13:59 -07:00
bool startStopPhysicalState : 1 { } ;
/**
2024-03-04 19:32:34 -08:00
* Harley ACR Active
2023-12-26 14:49:00 -08:00
offset 52 bit 1 */
2024-03-04 19:32:34 -08:00
bool acrActive : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 2 */
2024-03-04 19:32:34 -08:00
bool acrEngineMovedRecently : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 3 */
2024-03-04 19:32:34 -08:00
bool heaterControlEnabled : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 4 */
2024-03-04 19:32:34 -08:00
bool luaDigitalState0 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 5 */
2024-03-04 19:32:34 -08:00
bool luaDigitalState1 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 6 */
2024-03-04 19:32:34 -08:00
bool luaDigitalState2 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 7 */
2024-03-04 19:32:34 -08:00
bool luaDigitalState3 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 8 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_8 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 9 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_9 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 10 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_10 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 11 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_11 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 12 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_12 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 13 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_13 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 14 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_14 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 15 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_15 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 16 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_16 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 17 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_17 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 18 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_18 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 19 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_19 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 20 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_20 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 21 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_21 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 22 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_22 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 23 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_23 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 24 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_24 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 25 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_25 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 26 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_26 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 27 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_27 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 28 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_28 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 29 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_29 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 30 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_30 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
offset 52 bit 31 */
2024-03-04 19:32:34 -08:00
bool unusedBit_21_31 : 1 { } ;
2023-09-25 11:13:59 -07:00
/**
2023-12-26 14:49:00 -08:00
* offset 56
2022-08-22 08:19:58 -07:00
*/
2022-10-28 01:36:50 -07:00
uint32_t startStopStateToggleCounter = ( uint32_t ) 0 ;
2022-08-22 08:19:58 -07:00
/**
2023-12-26 14:49:00 -08:00
* offset 60
2022-08-22 08:19:58 -07:00
*/
2024-03-04 17:57:20 -08:00
float luaSoftSparkSkip = ( float ) 0 ;
/**
2024-03-11 13:57:36 -07:00
* offset 64
2024-03-04 17:57:20 -08:00
*/
float luaHardSparkSkip = ( float ) 0 ;
/**
2024-03-11 13:57:36 -07:00
* offset 68
2024-03-04 17:57:20 -08:00
*/
float tractionControlSparkSkip = ( float ) 0 ;
2022-08-22 15:32:47 -07:00
/**
* User - defined RPM hard limit
2024-01-03 12:32:11 -08:00
* units : rpm
2024-03-11 13:57:36 -07:00
* offset 72
2022-08-22 15:32:47 -07:00
*/
int16_t desiredRpmLimit = ( int16_t ) 0 ;
/**
* need 4 byte alignment
2024-01-03 12:32:11 -08:00
* units : units
2024-03-11 13:57:36 -07:00
* offset 74
2022-08-22 15:32:47 -07:00
*/
2024-03-11 13:57:36 -07:00
uint8_t alignmentFill_at_74 [ 2 ] ;
2022-08-25 15:51:12 -07:00
/**
2023-05-05 10:57:39 -07:00
* Fuel : Injection counter
2024-03-11 13:57:36 -07:00
* offset 76
2022-08-25 15:51:12 -07:00
*/
2022-10-28 01:36:50 -07:00
uint32_t fuelInjectionCounter = ( uint32_t ) 0 ;
2022-08-25 15:51:12 -07:00
/**
2023-05-05 10:57:39 -07:00
* Ign : Spark counter
2024-03-11 13:57:36 -07:00
* offset 80
2022-08-25 15:51:12 -07:00
*/
2024-02-28 21:29:48 -08:00
uint32_t globalSparkCounter = ( uint32_t ) 0 ;
2022-09-04 19:44:56 -07:00
/**
* @ @ GAUGE_NAME_FUEL_LOAD @ @
2024-03-11 13:57:36 -07:00
* offset 84
2022-09-04 19:44:56 -07:00
*/
float fuelingLoad = ( float ) 0 ;
/**
* @ @ GAUGE_NAME_IGNITION_LOAD @ @
2024-03-11 13:57:36 -07:00
* offset 88
2022-09-04 19:44:56 -07:00
*/
float ignitionLoad = ( float ) 0 ;
2022-11-05 17:28:03 -07:00
/**
2024-01-03 12:32:11 -08:00
* units : %
2024-03-11 13:57:36 -07:00
* offset 92
2022-11-05 17:28:03 -07:00
*/
scaled_channel < uint16_t , 100 , 1 > veTableYAxis = ( uint16_t ) 0 ;
/**
2024-03-11 13:57:36 -07:00
* offset 94
2022-11-05 17:28:03 -07:00
*/
2024-04-09 21:49:59 -07:00
uint8_t overDwellCounter = ( uint8_t ) 0 ;
/**
* offset 95
*/
uint8_t overDwellNotScheduledCounter = ( uint8_t ) 0 ;
2019-06-17 09:18:55 -07:00
} ;
2024-03-11 13:57:36 -07:00
static_assert ( sizeof ( engine_state_s ) = = 96 ) ;
2019-06-17 09:18:55 -07:00
// end
2024-04-09 21:49:59 -07:00
// this section was generated automatically by rusEFI tool config_definition_base-all.jar based on (unknown script) controllers/algo/engine_state.txt Wed Apr 10 04:48:31 UTC 2024