rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
custom_engine.cpp File Reference

Detailed Description

set engine_type 49 FRANKENSO_QA_ENGINE See also DEFAULT_ENGINE_TYPE Frankenso QA 12 cylinder engine

Date
Jan 18, 2015
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file custom_engine.cpp.

Functions

void setDiscoveryPdm ()
 
void setDiscovery33810Test ()
 
void setFrankensoConfiguration ()
 
void setEtbTestConfiguration ()
 
void setEepromTestConfiguration ()
 
void setL9779TestConfiguration ()
 
void proteusDcWastegateTest ()
 
void proteusBoardTest ()
 
static void setBasicNotECUmode ()
 
void setBodyControlUnit ()
 
void mreSecondaryCan ()
 
void mreBCM ()
 
void mreBoardNewTest ()
 
void setBoschHDEV_5_injectors ()
 
void setRotary ()
 
void setTest33816EngineConfiguration ()
 
void proteusLuaDemo ()
 
void detectBoardType ()
 
void fuelBenchMode ()
 
void proteusStimQc ()
 
void testEngine6451 ()
 

Variables

static uint8_t write_buf [EE_PAGE_SIZE+10]
 
static const I2CEepromFileConfig i2cee
 
EepromDevice eepdev_24xx
 
static I2CEepromFileStream ifile
 
static const float hardCodedHpfpLobeProfileQuantityBins [16]
 
static const float hardCodedHpfpLobeProfileAngle [16]
 

Function Documentation

◆ detectBoardType()

void detectBoardType ( )

Definition at line 807 of file custom_engine.cpp.

807 {
808#if HW_HELLEN && EFI_PROD_CODE
810#endif //HW_HELLEN EFI_PROD_CODE
811 // todo: add board ID detection?
812 // see hellen128 which has/had alternative i2c board id?
813}
void detectHellenBoardType()

Referenced by runRusEfi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fuelBenchMode()

void fuelBenchMode ( )

Definition at line 815 of file custom_engine.cpp.

815 {
817#if EFI_ENGINE_CONTROL
819#endif // EFI_ENGINE_CONTROL
824}
static void setBasicNotECUmode()
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
void setFlatInjectorLag(float value)
float crankingCycleFuelCoef[CRANKING_CYCLE_CLT_SIZE][CRANKING_CURVE_SIZE]
float postCrankingFactor[CRANKING_ENRICH_COUNT][CRANKING_ENRICH_COUNT]
constexpr void setTable(TElement(&dest)[N][M], const VElement value)
void setArrayValues(TValue(&array)[TSize], float value)

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mreBCM()

void mreBCM ( )

Definition at line 452 of file custom_engine.cpp.

452 {
454 // maybe time to kill this feature is pretty soon?
456}
void mreSecondaryCan()

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mreBoardNewTest()

void mreBoardNewTest ( )

MRE_BOARD_NEW_TEST set engine_type 31

Definition at line 462 of file custom_engine.cpp.

462 {
463#if (BOARD_TLE8888_COUNT > 0)
464 engineConfiguration->debugMode = DBG_TLE8888;
465
467 // set cranking_rpm 500
469 // set cranking_dwell 200
471 // set cranking_fuel 300
473 engineConfiguration->injectionMode = IM_SEQUENTIAL;
475
476 // EFI_ADC_1: "23 - AN temp 2"
477 // test harness: Red/Green, 2K PD. expected 2.0v
478 // iat in microrusefi/board_configuration.cpp
479
480 // EFI_ADC_2: "24 - AN temp 3"
481 // test harness: Blue/White, 2K PD. expected 2.0v
482
483
484 // EFI_ADC_10: "27 - AN volt 1"
485 // test harness: Blue/Red, 3.84K PD / 5.3 PU. expected 1.6v
487
488 // EFI_ADC_14: "32 - AN volt 6"
489 // test harness: Red/White 3.6K PD / 5.2 PU. expected 1.6v
491
492 // EFI_ADC_4: "28 - AN volt 10"
493 // test harness: Red/Yellow
494 engineConfiguration->afr.hwChannel = EFI_ADC_4;
495
496 // EFI_ADC_7: "31 - AN volt 3"
497 // test harness: White/Red
499
503
504
505#endif /* BOARD_TLE8888_COUNT */
506
508 engineConfiguration->firingOrder = FO_1_2_3_4_5_6_7_8_9_10_11_12;
509 engineConfiguration->injector.flow = 5; // longer blink
510
511
512#if (BOARD_TLE8888_COUNT > 0)
519
522
523 // LED #8
524 // TLE8888 half bridges (pushpull, lowside, or high-low) IN12
525 // Gpio::TLE8888_PIN_21: "35 - GP Out 1"
527
528 // LED #1
529 // Gpio::TLE8888_PIN_22: "34 - GP Out 2"
531
532 // LED #2
533 // Gpio::TLE8888_PIN_23: "33 - GP Out 3"
534 engineConfiguration->ignitionPins[11 - 1] = MRE_GPOUT_3;
535
536 // LED #7
537 // Gpio::TLE8888_PIN_24: "43 - GP Out 4"
539
540 engineConfiguration->afr.hwChannel = EFI_ADC_6;
542
543 // TLE8888 high current low side: IN10
544 // Gpio::TLE8888_PIN_6: "7 - Lowside 1"
546
547 // TLE8888 high current low side: VVT2 IN9 / OUT5
548 // Gpio::TLE8888_PIN_5: "3 - Lowside 2"
550
551 // Gpio::TLE8888_PIN_4: INJ#4
553 // Gpio::TLE8888_PIN_3: INJ#3
555 // Gpio::TLE8888_PIN_2: INJ#2
557 // Gpio::TLE8888_PIN_1: LED #3 - INJ#1
559
560
565
567
569#endif /* BOARD_TLE8888_COUNT */
570
571}
@ TLE8888_PIN_12
@ Unassigned
@ TLE8888_PIN_22
@ TLE8888_PIN_1
@ TLE8888_PIN_11
@ TLE8888_PIN_2
@ TLE8888_PIN_5
@ TLE8888_PIN_6
@ TLE8888_PIN_24
@ TLE8888_PIN_4
@ TLE8888_PIN_21
@ TLE8888_PIN_3
@ TLE8888_PIN_13
@ TLE8888_PIN_10

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ mreSecondaryCan()

void mreSecondaryCan ( )

Definition at line 415 of file custom_engine.cpp.

415 {
417
418 engineConfiguration->auxAnalogInputs[0] = MRE_IN_TPS;
419 engineConfiguration->auxAnalogInputs[1] = MRE_IN_MAP;
420 engineConfiguration->auxAnalogInputs[2] = MRE_IN_CLT;
421 engineConfiguration->auxAnalogInputs[3] = MRE_IN_IAT;
422 // engineConfiguration->auxAnalogInputs[0] =
423
424
425 // EFI_ADC_14: "32 - AN volt 6"
426// engineConfiguration->afr.hwChannel = EFI_ADC_14;
427
428
429 strncpy(config->luaScript, R"(
430txPayload = {}
431function onTick()
432 auxV = getAuxAnalog(0)
433 print('Hello analog ' .. auxV )
434 -- first byte: integer part, would be autoboxed to int
435 txPayload[1] = auxV
436 -- second byte: fractional part, would be autoboxed to int, overflow would be ignored
437 txPayload[2] = auxV * 256;
438 auxV = getAuxAnalog(1)
439 print('Hello analog ' .. auxV )
440 txPayload[3] = auxV
441 txPayload[4] = auxV * 256;
442 auxV = getAuxAnalog(2)
443 print('Hello analog ' .. auxV )
444 txPayload[5] = auxV
445 txPayload[6] = auxV * 256;
446 txCan(1, 0x600, 1, txPayload)
447end
448)", efi::size(config->luaScript));
449
450}
void setBodyControlUnit()

Referenced by applyEngineType(), and mreBCM().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proteusBoardTest()

void proteusBoardTest ( )

PROTEUS_QC_TEST_BOARD set engine_type 42

Definition at line 317 of file custom_engine.cpp.

317 {
319 engineConfiguration->firingOrder = FO_1_2_3_4_5_6_7_8_9_10_11_12;
321 engineConfiguration->injector.flow = 4.6; // longer blink
322
324 engineConfiguration->injectionMode = IM_SEQUENTIAL;
326
330
331#if EFI_PROD_CODE
332 engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_1;
333 engineConfiguration->injectionPins[1] = Gpio::PROTEUS_LS_2;
334 engineConfiguration->injectionPins[2] = Gpio::PROTEUS_LS_3;
335 engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_4;
336 engineConfiguration->injectionPins[4] = Gpio::PROTEUS_LS_5;
337 engineConfiguration->injectionPins[5] = Gpio::PROTEUS_LS_6;
338 engineConfiguration->injectionPins[6] = Gpio::PROTEUS_LS_9;
339 engineConfiguration->injectionPins[7] = Gpio::PROTEUS_LS_8;
340 engineConfiguration->injectionPins[8] = Gpio::PROTEUS_LS_11;
341 engineConfiguration->injectionPins[9] = Gpio::PROTEUS_LS_10;
342 engineConfiguration->injectionPins[10] = Gpio::PROTEUS_LS_12;
343 engineConfiguration->injectionPins[11] = Gpio::PROTEUS_LS_13;
344
345
346 engineConfiguration->luaOutputPins[0] = Gpio::PROTEUS_LS_7;
347 engineConfiguration->luaOutputPins[1] = Gpio::PROTEUS_LS_14;
348 engineConfiguration->luaOutputPins[2] = Gpio::PROTEUS_LS_15;
349 engineConfiguration->luaOutputPins[3] = Gpio::PROTEUS_LS_16;
350 engineConfiguration->luaOutputPins[4] = Gpio::PROTEUS_HS_2;
351 engineConfiguration->luaOutputPins[5] = Gpio::PROTEUS_HS_4;
352
353 engineConfiguration->ignitionPins[0] = Gpio::PROTEUS_IGN_1;
354 engineConfiguration->ignitionPins[1] = Gpio::PROTEUS_IGN_2;
355 engineConfiguration->ignitionPins[2] = Gpio::PROTEUS_IGN_4;
356 engineConfiguration->ignitionPins[3] = Gpio::PROTEUS_IGN_5;
357 engineConfiguration->ignitionPins[4] = Gpio::PROTEUS_IGN_6;
358 engineConfiguration->ignitionPins[5] = Gpio::PROTEUS_IGN_7;
359
360 engineConfiguration->ignitionPins[6] = Gpio::PROTEUS_HS_3;
361 engineConfiguration->ignitionPins[7] = Gpio::PROTEUS_IGN_3;
362 engineConfiguration->ignitionPins[8] = Gpio::PROTEUS_IGN_9;
363 engineConfiguration->ignitionPins[9] = Gpio::PROTEUS_IGN_8;
364 engineConfiguration->ignitionPins[10] = Gpio::PROTEUS_HS_1;
365 engineConfiguration->ignitionPins[11] = Gpio::PROTEUS_IGN_12;
366
367 strncpy(config->luaScript, R"(
368 startPwm(0, 10, 0.5)
369 startPwm(1, 11, 0.5)
370 startPwm(2, 12, 0.5)
371 startPwm(3, 13, 0.5)
372 startPwm(4, 14, 0.5)
373 startPwm(5, 15, 0.5)
374 startPwm(6, 16, 0.5)
375 startPwm(7, 17, 0.5)
376
377 function onTick()
378 end
379 )", efi::size(config->luaScript));
380
381#endif // EFI_PROD_CODE
382
383#if EFI_ELECTRONIC_THROTTLE_BODY
385#endif // EFI_ELECTRONIC_THROTTLE_BODY
386}
void setProteusHitachiEtbDefaults()

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proteusDcWastegateTest()

void proteusDcWastegateTest ( )

Definition at line 286 of file custom_engine.cpp.

286 {
288 engineConfiguration->etbFunctions[0] = DC_Wastegate;
289 engineConfiguration->etbFunctions[1] = DC_None;
290 engineConfiguration->map.sensor.hwChannel = EFI_ADC_NONE;
291
293 setTPS1Calibration(98, 926, 891, 69);
294
298
299 strncpy(config->luaScript, R"(
300
301mapSensor = Sensor.new("map")
302mapSensor : setTimeout(3000)
303
304function onTick()
305 local tps = getSensor("TPS1")
306 tps = (tps == nil and 0 or tps)
307 mapSensor : set(tps)
308end
309
310 )", efi::size(config->luaScript));
311}
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proteusLuaDemo()

void proteusLuaDemo ( )

for this demo I use ETB just a sample object to control with PID. No reasonable person should consider actually using Lua for actual intake ETB control while driving around the racing track - hard-coded ETB control is way smarter!

controlIndex = 0 directionIndex = 1

print('pid output ' .. output) print('')

local duty = (bias + output) / 100

– isPositive = duty > 0; – pwmValue = isPositive and duty or -duty – setPwmDuty(controlIndex, pwmValue)

– dirValue = isPositive and 1 or 0; – setPwmDuty(directionIndex, dirValue)

– print('pwm ' .. pwmValue .. ' dir ' .. dirValue)

Definition at line 684 of file custom_engine.cpp.

684 {
685#if HW_PROTEUS
688
691
692 strcpy(engineConfiguration->scriptCurveName[2 - 1], "rateofchange");
693
694 strcpy(engineConfiguration->scriptCurveName[3 - 1], "bias");
695
696 /**
697 * for this demo I use ETB just a sample object to control with PID. No reasonable person should consider actually using
698 * Lua for actual intake ETB control while driving around the racing track - hard-coded ETB control is way smarter!
699 */
700 static const float defaultBiasBins[] = {
701 0, 1, 2, 4, 7, 98, 99, 100
702 };
703 static const float defaultBiasValues[] = {
704 -20, -18, -17, 0, 20, 21, 22, 25
705 };
706
710
713
716
717 engineConfiguration->auxAnalogInputs[0] = PROTEUS_IN_ANALOG_VOLT_10;
718 engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
719
720
721 // ETB direction #1 PD10
723 // ETB control PD12
725 // ETB disable PD11
727
728/**
729controlIndex = 0
730directionIndex = 1
731
732 print('pid output ' .. output)
733 print('')
734
735
736
737 local duty = (bias + output) / 100
738
739-- isPositive = duty > 0;
740-- pwmValue = isPositive and duty or -duty
741-- setPwmDuty(controlIndex, pwmValue)
742
743-- dirValue = isPositive and 1 or 0;
744-- setPwmDuty(directionIndex, dirValue)
745
746-- print('pwm ' .. pwmValue .. ' dir ' .. dirValue)
747
748 *
749 */
750
751 auto script = R"(
752
753startPwm(0, 800, 0.1)
754-- direction
755startPwm(1, 80, 1.0)
756-- disable
757startPwm(2, 80, 0.0)
758
759pid = Pid.new(2, 0, 0, -100, 100)
760
761biasCurveIndex = findCurveIndex("bias")
762
763voltageFromCan = nil
764canRxAdd(0x600)
765
766function onCanRx(bus, id, dlc, data)
767 print('got CAN id=' .. id .. ' dlc=' .. dlc)
768 voltageFromCan = data[2] / 256.0 + data[1]
769end
770
771function onTick()
772 local targetVoltage = getAuxAnalog(0)
773
774-- local target = interpolate(1, 0, 3.5, 100, targetVoltage)
775 local target = interpolate(1, 0, 3.5, 100, voltageFromCan)
776-- clamp 0 to 100
777 target = math.max(0, target)
778 target = math.min(100, target)
779
780 print('Decoded target: ' .. target)
781
782 local tps = getSensor("TPS1")
783 tps = (tps == nil and 'invalid TPS' or tps)
784 print('Tps ' .. tps)
785
786 local output = pid:get(target, tps)
787
788 local bias = curve(biasCurveIndex, target)
789 print('bias ' .. bias)
790
791 local duty = (bias + output) / 100
792 isPositive = duty > 0;
793 pwmValue = isPositive and duty or -duty
794 setPwmDuty(0, pwmValue)
795
796 dirValue = isPositive and 1 or 0;
797 setPwmDuty(1, dirValue)
798
799 print('pwm ' .. pwmValue .. ' dir ' .. dirValue)
800 print('')
801end
802 )";
803 strncpy(config->luaScript, script, efi::size(config->luaScript));
804#endif
805}
static const float defaultBiasValues[]
static const float defaultBiasBins[]
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ proteusStimQc()

void proteusStimQc ( )

Definition at line 829 of file custom_engine.cpp.

829 {
831 engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH;
832 engineConfiguration->vvtMode[1] = VVT_SINGLE_TOOTH;
833
834 engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_1;
835 engineConfiguration->triggerInputPins[1] = PROTEUS_DIGITAL_2;
836 engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_3;
837 engineConfiguration->camInputs[1] = PROTEUS_DIGITAL_4;
839 engineConfiguration->brakePedalPin = PROTEUS_DIGITAL_6;
840
842 // EFI_ADC_13: "Analog Volt 4"
843 engineConfiguration->tps2_1AdcChannel = PROTEUS_IN_TPS2_1;
844 // EFI_ADC_0: "Analog Volt 5"
845 engineConfiguration->tps2_2AdcChannel = PROTEUS_IN_ANALOG_VOLT_5;
846 engineConfiguration->oilPressure.hwChannel = PROTEUS_IN_ANALOG_VOLT_6;
847 // pps2 volt 7
848
849 // pps1 volt 9
850 // afr volt 10
851 engineConfiguration->oilTempSensor.adcChannel = PROTEUS_IN_ANALOG_VOLT_11;
853
854
855 engineConfiguration->auxLinear1.hwChannel = PROTEUS_IN_ANALOG_TEMP_1;
856 engineConfiguration->auxLinear2.hwChannel = PROTEUS_IN_ANALOG_TEMP_4;
857
858// engineConfiguration->fan2Pin = Gpio::PROTEUS_LS_9;
859// engineConfiguration->malfunctionIndicatorPin = Gpio::PROTEUS_LS_13;
860// engineConfiguration->tachOutputPin = Gpio::PROTEUS_LS_14;
861//
862// engineConfiguration->vvtPins[0] = Gpio::PROTEUS_LS_15;
863// engineConfiguration->vvtPins[1] = Gpio::PROTEUS_LS_16;
864}
void setProteusEtbIO()
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
void setCommonNTCSensor(ThermistorConf *thermistorConf, float pullup)

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBasicNotECUmode()

static void setBasicNotECUmode ( )
static

◆ setBodyControlUnit()

void setBodyControlUnit ( )

Definition at line 407 of file custom_engine.cpp.

407 {
408 for (int i = 0; i < MAX_CYLINDER_COUNT;i++) {
411 }
413}

Referenced by mreSecondaryCan(), and setHondaCivicBcm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBoschHDEV_5_injectors()

void setBoschHDEV_5_injectors ( )

Definition at line 584 of file custom_engine.cpp.

584 {
588
591 setTable(config->hpfpTarget, 5000);
592
594 setLinearCurve(config->hpfpCompensationLoadBins, 0.005, 0.120, 0.001);
595
596 // This is the configuration for bosch HDEV 5 injectors
597 // all times in microseconds/us
609
610 engineConfiguration->mc33_hpfp_i_peak = 5; // A not mA like above
613 engineConfiguration->mc33_hpfp_max_hold = 10; // this value in ms not us
614}
static const float hardCodedHpfpLobeProfileQuantityBins[16]
static const float hardCodedHpfpLobeProfileAngle[16]
scaled_channel< uint8_t, 2, 1 > hpfpLobeProfileQuantityBins[HPFP_LOBE_PROFILE_SIZE]
scaled_channel< uint16_t, 1000, 1 > hpfpCompensationLoadBins[HPFP_COMPENSATION_SIZE]
scaled_channel< uint8_t, 1, 50 > hpfpTargetRpmBins[HPFP_TARGET_SIZE]
uint16_t hpfpTarget[HPFP_TARGET_SIZE][HPFP_TARGET_SIZE]
scaled_channel< uint8_t, 1, 50 > hpfpCompensationRpmBins[HPFP_COMPENSATION_SIZE]
scaled_channel< uint16_t, 10, 1 > hpfpTargetLoadBins[HPFP_TARGET_SIZE]
scaled_channel< uint8_t, 2, 1 > hpfpLobeProfileAngle[HPFP_LOBE_PROFILE_SIZE]
void setRpmTableBin(TValue(&array)[TSize])

Referenced by setDefaultEngineConfiguration(), and setTest33816EngineConfiguration().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDiscovery33810Test()

void setDiscovery33810Test ( )

set engine_type 59

Definition at line 43 of file custom_engine.cpp.

43 {
44// spi3mosiPin = Gpio::B5 grey
45// spi3misoPin = Gpio::B4; vio
46// spi3sckPin = Gpio::B3; blue
47// CS PC5 white
48// EN PA6 yellow
49
51 engineConfiguration->clt.adcChannel = EFI_ADC_NONE;
54
56
61
66
69}
@ MC33810_0_GD_3
@ MC33810_0_OUT_0
@ MC33810_0_GD_2
@ MC33810_0_OUT_1
@ MC33810_0_GD_1
@ MC33810_0_GD_0

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ setDiscoveryPdm()

void setDiscoveryPdm ( )

Definition at line 35 of file custom_engine.cpp.

35 {
36}

◆ setEepromTestConfiguration()

void setEepromTestConfiguration ( )

set engine_type 61

Definition at line 234 of file custom_engine.cpp.

234 {
237 // dirty hack
239 efiSetPadMode("I2C", Gpio::A8, PAL_MODE_ALTERNATE(4));
240 efiSetPadMode("I2C", Gpio::C9, PAL_MODE_ALTERNATE(4));
241
242
243 addConsoleActionI("ee_read",
244 [](int value) {
245 if (ifile.vmt != eepdev_24xx.efsvmt) {
246 EepromFileOpen((EepromFileStream *)&ifile, (EepromFileConfig *)&i2cee, &eepdev_24xx);
247 }
248
249 ifile.vmt->setposition(&ifile, 0);
250// chFileStreamSeek(&ifile, 0);
251 int v2;
252 streamRead(&ifile, (uint8_t *)&v2, 4);
253 efiPrintf("EE has %d", v2);
254
255 v2 += 3;
256 ifile.vmt->setposition(&ifile, 0);
257 streamWrite(&ifile, (uint8_t *)&v2, 4);
258
259
260 });
261}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
void addConsoleActionI(const char *token, VoidInt callback)
Register a console command with one Integer parameter.
EepromDevice eepdev_24xx
static I2CEepromFileStream ifile
void brain_pin_markUnused(brain_pin_e brainPin)

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEtbTestConfiguration()

void setEtbTestConfiguration ( )

remember that some H-bridges require 5v control lines, not just 3v logic outputs we have on stm32

Definition at line 160 of file custom_engine.cpp.

160 {
161 // VAG test ETB
163 // by the way this ETB has default position of ADC=74 which is about 4%
165
166 // yes, 30K - that's a test configuration
168
171
172
177 /**
178 * remember that some H-bridges require 5v control lines, not just 3v logic outputs we have on stm32
179 */
180 engineConfiguration->etbIo[0].directionPin1 = Gpio::C7; // Frankenso high-side in order to get 5v control
183
184#if EFI_ELECTRONIC_THROTTLE_BODY
186#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
187
188 engineConfiguration->tps1_1AdcChannel = EFI_ADC_2; // PA2
190
191 // turning off other PWMs to simplify debugging
197
198 // no analog dividers - all sensors with 3v supply, naked discovery bench setup
200
201 // see also setDefaultEtbBiasCurve
202}
void setBoschVNH2SP30Curve()
void setCrankOperationMode()

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFrankensoConfiguration()

void setFrankensoConfiguration ( )

Frankenso analog #1 PC2 ADC12 CLT Frankenso analog #2 PC1 ADC11 IAT Frankenso analog #3 PA0 ADC0 MAP Frankenso analog #4 PC3 ADC13 WBO / O2 Frankenso analog #5 PA2 ADC2 TPS Frankenso analog #6 PA1 ADC1 Frankenso analog #7 PA4 ADC4 Frankenso analog #8 PA3 ADC3 Frankenso analog #9 PA7 ADC7 Frankenso analog #10 PA6 ADC6 Frankenso analog #11 PC5 ADC15 Frankenso analog #12 PC4 ADC14 VBatt

http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board

Definition at line 73 of file custom_engine.cpp.

73 {
74#ifdef HW_FRANKENSO
76
78
79 /**
80 * Frankenso analog #1 PC2 ADC12 CLT
81 * Frankenso analog #2 PC1 ADC11 IAT
82 * Frankenso analog #3 PA0 ADC0 MAP
83 * Frankenso analog #4 PC3 ADC13 WBO / O2
84 * Frankenso analog #5 PA2 ADC2 TPS
85 * Frankenso analog #6 PA1 ADC1
86 * Frankenso analog #7 PA4 ADC4
87 * Frankenso analog #8 PA3 ADC3
88 * Frankenso analog #9 PA7 ADC7
89 * Frankenso analog #10 PA6 ADC6
90 * Frankenso analog #11 PC5 ADC15
91 * Frankenso analog #12 PC4 ADC14 VBatt
92 */
93 engineConfiguration->tps1_1AdcChannel = EFI_ADC_2; // PA2
94
96
99 engineConfiguration->afr.hwChannel = EFI_ADC_13;
100
103
104
105 /**
106 * http://rusefi.com/wiki/index.php?title=Manual:Hardware_Frankenso_board
107 */
108 // Frankenso low out #1: PE6
109 // Frankenso low out #2: PE5
110 // Frankenso low out #3: PD7 Main Relay
111 // Frankenso low out #4: PC13 Idle valve solenoid
112 // Frankenso low out #5: PE3
113 // Frankenso low out #6: PE4 fuel pump relay
114 // Frankenso low out #7: PE1 (do not use with discovery!)
115 // Frankenso low out #8: PE2 injector #2
116 // Frankenso low out #9: PB9 injector #1
117 // Frankenso low out #10: PE0 (do not use with discovery!)
118 // Frankenso low out #11: PB8 injector #3
119 // Frankenso low out #12: PB7 injector #4
120
124
126
130#ifndef EFI_INJECTOR_PIN3
132#else /* EFI_INJECTOR_PIN3 */
133 engineConfiguration->injectionPins[3] = EFI_INJECTOR_PIN3; // #4
134#endif /* EFI_INJECTOR_PIN3 */
135
136 setAlgorithm(LM_SPEED_DENSITY);
137
146
150 // set_ignition_pin 4 PE10
152
153 // todo: 8.2 or 10k?
154 engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;
155#endif // HW_FRANKENSO
156}
void commonFrankensoAnalogInputs()
void setAlgorithm(engine_load_mode_e algo)

Referenced by applyEngineType(), setDodgeRam1996(), setEngineTemplateConfiguration(), setMiataNA6_MAP_Frankenso(), setVwAba(), and testEngine6451().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setL9779TestConfiguration()

void setL9779TestConfiguration ( )

◆ setRotary()

void setRotary ( )

set engine_type 107

Definition at line 619 of file custom_engine.cpp.

619 {
622
625
626 strcpy(engineConfiguration->engineMake, ENGINE_MAKE_MAZDA);
627 strcpy(engineConfiguration->engineCode, "13B");
628 strcpy(engineConfiguration->vehicleName, "test");
629
630 engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
631 engineConfiguration->injectionPins[2] = Gpio::Unassigned; // injector in default pinout
633
637}

Referenced by applyEngineType().

Here is the caller graph for this function:

◆ setTest33816EngineConfiguration()

void setTest33816EngineConfiguration ( )

set engine_type 103

Definition at line 642 of file custom_engine.cpp.

642 {
643
644 // grey
645 // default spi3mosiPin PB5
646 // white
647 // default spi3misoPin PB4
648 // violet
649 // default spi3sckPin PB3
650
651
654
659
660
661 // blue
663 // green
666 // yellow
668
670
671 // enable_spi 3
673 // Wire up spi3
677
679
682}
void setBoschHDEV_5_injectors()

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testEngine6451()

void testEngine6451 ( )

Definition at line 868 of file custom_engine.cpp.

868 {
869#ifdef HW_FRANKENSO
871#endif
873
877 engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
878 engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
880}
void setFrankensoConfiguration()
void setWholeTimingTable(angle_t value)
scaled_channel< int8_t, 10, 1 > ignitionIatCorrTable[IAT_IGN_CORR_COUNT][IAT_IGN_CORR_COUNT]

Referenced by applyEngineType().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ eepdev_24xx

EepromDevice eepdev_24xx
extern

◆ hardCodedHpfpLobeProfileAngle

const float hardCodedHpfpLobeProfileAngle[16]
static
Initial value:
= {0.0, 7.5, 16.5, 24.0,
32.0 , 40.0, 48.0, 56.0,
64.0 , 72.0, 80.0, 88.0,
96.0 , 103.5, 112.5, 120.0
}

Definition at line 578 of file custom_engine.cpp.

578 {0.0, 7.5, 16.5, 24.0,
57932.0 , 40.0, 48.0, 56.0,
58064.0 , 72.0, 80.0, 88.0,
58196.0 , 103.5, 112.5, 120.0
582};

Referenced by setBoschHDEV_5_injectors().

◆ hardCodedHpfpLobeProfileQuantityBins

const float hardCodedHpfpLobeProfileQuantityBins[16]
static
Initial value:
= {0.0, 1.0, 4.5, 9.5,
16.5, 25.0, 34.5, 45.0 ,
55.0, 65.5, 75.0, 83.5,
90.5, 95.5, 99.0, 100.0}

Definition at line 573 of file custom_engine.cpp.

573 {0.0, 1.0, 4.5, 9.5,
57416.5, 25.0, 34.5, 45.0 ,
57555.0, 65.5, 75.0, 83.5,
57690.5, 95.5, 99.0, 100.0};

Referenced by setBoschHDEV_5_injectors().

◆ i2cee

const I2CEepromFileConfig i2cee
static
Initial value:
= {
.barrier_low = 0,
.barrier_hi = EE_SIZE - 1,
.size = EE_SIZE,
.pagesize = EE_PAGE_SIZE,
.write_time = TIME_MS2I(EEPROM_WRITE_TIME_MS),
.i2cp = &EE_U2CD,
.addr = 0x50,
.write_buf = write_buf
}
static uint8_t write_buf[EE_PAGE_SIZE+10]

https://www.onsemi.com/pdf/datasheet/cat24c32-d.pdf CAT24C32

Definition at line 217 of file custom_engine.cpp.

217 {
218 .barrier_low = 0,
219 .barrier_hi = EE_SIZE - 1,
220 .size = EE_SIZE,
221 .pagesize = EE_PAGE_SIZE,
222 .write_time = TIME_MS2I(EEPROM_WRITE_TIME_MS),
223 .i2cp = &EE_U2CD,
224 .addr = 0x50,
225 .write_buf = write_buf
226};

◆ ifile

I2CEepromFileStream ifile
static

Definition at line 229 of file custom_engine.cpp.

Referenced by setEepromTestConfiguration().

◆ write_buf

uint8_t write_buf[EE_PAGE_SIZE+10]
static

Definition at line 208 of file custom_engine.cpp.

Go to the source code of this file.