8#include <rusefi/arrays.h>
42 setPPSInputs(PROTEUS_IN_ANALOG_VOLT_2, PROTEUS_IN_ANALOG_VOLT_11);
43 setTPS1Inputs(PROTEUS_IN_ANALOG_VOLT_4, PROTEUS_IN_ANALOG_VOLT_3);
48#if defined(HW_HELLEN_8CHAN)
66#ifdef HW_HELLEN_UAEFI121
81#ifdef HW_HELLEN_SUPER_UAEFI
101#ifdef HW_HELLEN_UAEFI
152function getBitRange(data, bitIndex, bitWidth)
153 byteIndex = bitIndex >> 3
154 shift = bitIndex - byteIndex * 8
155 value = data[1 + byteIndex]
156 if (shift + bitWidth > 8) then
157 value = value + data[2 + byteIndex] * 256
159 mask = (1 << bitWidth) - 1
160 return (value >> shift) & mask
163hexstr = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "A", "B", "C", "D", "E", "F" }
165function toHexString(num)
173 result = hexstr[n + 1] ..result
174 num = math.floor(num / 16)
179function arrayToString(arr)
182 while arr[index] ~= nil do
183 str = str.." "..toHexString(arr[index])
189STARTER_OUTPUT_INDEX = 0
190startPwm(STARTER_OUTPUT_INDEX, 100, 0)
193ECMEngineStatus = 0xC9
202function canIgnStatus(bus, id, dlc, data)
203 crankingBits = getBitRange(data, 2, 2)
204 isCranking = (crankingBits == 2)
205-- need special considerations to append boolean print('crankingBits ' .. crankingBits .. ', isCranking ' .. isCranking)
206 print('crankingBits ' .. crankingBits)
209function printAny(bus, id, dlc, data)
210 print('packet ' .. id)
213canRxAdd(IGN_STATUS, canIgnStatus)
214-- canRxAddMask(0, 0xFFFFFFF, printAny)
216-- todo: take VIN from configuration? encode VIN?
217canVin1 = { 0x47, 0x4E, 0x4C, 0x43, 0x32, 0x45, 0x30, 0x34 }
218canVin2 = { 0x42, 0x52, 0x32, 0x31, 0x36, 0x33, 0x36, 0x36 }
219dataECMEngineStatus = { 0x84, 0x09, 0x99, 0x0A, 0x00, 0x40, 0x08, 0x00 }
221-- todo: smarter loop code :)
241 txCan(1, VIN_Part1, 0, canVin1)
242 txCan(1, VIN_Part2, 0, canVin2)
244 -- good enough for fuel module!
245 txCan(1, ECMEngineStatus, 0, dataECMEngineStatus)
248 setPwmDuty(STARTER_OUTPUT_INDEX, 1)
250 setPwmDuty(STARTER_OUTPUT_INDEX, 0)
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
void setPPSCalibration(float primaryUp, float primaryDown, float secondaryUp, float secondaryDown)
void setLeftRightBanksNeedBetterName()
static constexpr engine_configuration_s * engineConfiguration
void setLuaScript(const char *luaScript)
This file is about configuring engine via the human-readable protocol.
air_pressure_sensor_config_s sensor
air_pressure_sensor_type_e type
vehicle_info_t engineMake
angle_t globalTriggerAngleOffset
float fuelReferencePressure
float tChargeAirIncrLimit
float tpsDecelEnleanmentThreshold
float tpsAccelFractionDivisor
ignition_mode_e ignitionMode
dc_function_e etbFunctions[ETB_COUNT]
cranking_parameters_s cranking
output_pin_e vvtPins[CAM_INPUTS_COUNT]
vvt_mode_e vvtMode[CAMS_PER_BANK]
output_pin_e injectionPins[MAX_CYLINDER_COUNT]
bool invertPrimaryTriggerSignal
injection_mode_e crankingInjectionMode
float tChargeAirDecrLimit
float etbIdleThrottleRange
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
injector_compensation_mode_e injectorCompensationMode
firing_order_e firingOrder
float tpsAccelEnrichmentThreshold
injection_mode_e injectionMode
vehicle_info_t engineCode
brain_input_pin_e camInputs[CAM_INPUTS_COUNT]
output_pin_e ignitionPins[MAX_CYLINDER_COUNT]
scaled_channel< uint8_t, 20, 1 > tpsAccelLookback
int16_t tpsAccelFractionPeriod
void setGmCltSensor(ThermistorConf *thermistorConf)