rusefi/firmware/config/engines/gm_sbc.cpp

59 lines
2.0 KiB
C++
Raw Normal View History

2023-03-26 08:35:32 -07:00
#include "pch.h"
#include "gm_sbc.h"
#include "defaults.h"
#if HW_HELLEN
#include "hellen_meta.h"
#endif // HW_HELLEN
2023-04-29 16:28:11 -07:00
#include "proteus_meta.h"
void setStepperHw() {
engineConfiguration->useStepperIdle = true;
engineConfiguration->useHbridgesToDriveIdleStepper = true;
engineConfiguration->stepper_dc_use_two_wires = false;
engineConfiguration->stepperDcInvertedPins = false; // or true?
#if HW_HELLEN
engineConfiguration->stepperDcInvertedPins = true; // todo: fix test harness not today
setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
// using 8chan pinout for DC1: A26 (OUT_DC1+) and A27 (OUT_DC1-)
engineConfiguration->stepperDcIo[0].controlPin = H144_GP4; // DC1_PWM
engineConfiguration->stepperDcIo[0].directionPin1 = H144_GP3; // DC1_DIR
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[0].disablePin = H144_GP5; // ETB_DIS
// using 8chan pinout for DC2: A28 (OUT_DC2+) and A29 (OUT_DC2-)
engineConfiguration->stepperDcIo[1].controlPin = H144_UART1_TX; // DC2_PWM
engineConfiguration->stepperDcIo[1].directionPin1 = H_SPI3_CS; // DC2_DIR
engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
2023-03-27 07:15:48 -07:00
// open question if we need custom logic to handle shared disable pin? engineConfiguration->stepperDcIo[1].disablePin = H144_GP5; // ETB_DIS
#endif // HW_HELLEN
}
void setSbc() {
2023-04-28 18:01:08 -07:00
engineConfiguration->cylindersCount = 8;
engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2;
engineConfiguration->displacement = 5.2;
2023-03-26 08:26:38 -07:00
engineConfiguration->etbFunctions[0] = DC_None;
engineConfiguration->etbFunctions[1] = DC_None;
2023-03-27 07:33:49 -07:00
strcpy(engineConfiguration->engineMake, ENGINE_MAKE_GM);
strcpy(engineConfiguration->engineCode, "SBC");
setStepperHw();
2023-03-26 08:26:38 -07:00
// 8 cylinders one coil HEI trigger
2023-04-29 16:28:11 -07:00
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 8;
engineConfiguration->trigger.customSkippedToothCount = 0;
}
void set8chanSbc() {
setSbc();
2023-03-26 08:26:38 -07:00
}
void setProteusSbc() {
setSbc();
}