2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file rover_v8.cpp
|
|
|
|
*
|
|
|
|
* V8, firing order 18436572
|
|
|
|
*
|
|
|
|
* This config overrides some values of the default configuration which is set by setDefaultConfiguration() method
|
|
|
|
*
|
2017-01-06 07:04:41 -08:00
|
|
|
* set engine_type 10
|
2015-07-10 06:01:56 -07:00
|
|
|
*
|
|
|
|
* ROVER_V8 = 10
|
|
|
|
*
|
|
|
|
* @date Jun 27, 2014
|
2017-01-03 03:05:22 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2017
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "main.h"
|
|
|
|
#include "rover_v8.h"
|
2016-12-31 12:02:44 -08:00
|
|
|
#include "engine_math.h"
|
2017-01-05 09:02:46 -08:00
|
|
|
#include "allsensors.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
void setFrankenstein_01_LCD(board_configuration_s *boardConfiguration) {
|
|
|
|
boardConfiguration->HD44780_rs = GPIOE_9;
|
|
|
|
boardConfiguration->HD44780_e = GPIOE_11;
|
|
|
|
boardConfiguration->HD44780_db4 = GPIOE_13;
|
|
|
|
boardConfiguration->HD44780_db5 = GPIOE_15;
|
|
|
|
boardConfiguration->HD44780_db6 = GPIOB_11;
|
|
|
|
boardConfiguration->HD44780_db7 = GPIOB_13;
|
|
|
|
}
|
|
|
|
|
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
|
|
|
void setRoverv8(DECLARE_ENGINE_PARAMETER_F) {
|
|
|
|
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
|
2017-05-05 09:11:18 -07:00
|
|
|
// set trigger_type 9
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;
|
|
|
|
|
2017-05-02 15:40:49 -07:00
|
|
|
boardConfiguration->is_enabled_spi_2 = false;
|
|
|
|
boardConfiguration->isHip9011Enabled = false;
|
2017-01-28 12:05:25 -08:00
|
|
|
setFrankenstein_01_LCD(boardConfiguration);
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->specs.displacement = 3.528;
|
|
|
|
engineConfiguration->specs.cylindersCount = 8;
|
|
|
|
engineConfiguration->specs.firingOrder = FO_1_8_4_3_6_5_7_2;
|
|
|
|
|
|
|
|
// set_rpm_hard_limit 4000
|
|
|
|
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
|
2017-01-05 09:02:46 -08:00
|
|
|
// set_cranking_rpm 350
|
|
|
|
engineConfiguration->cranking.rpm = 350;
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
// set_whole_fuel_map 3
|
|
|
|
setWholeFuelMap(3 PASS_ENGINE_PARAMETER);
|
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set cranking_injection_mode 0
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
2017-01-06 06:03:33 -08:00
|
|
|
// set injection_mode 1
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
|
2017-01-06 06:03:33 -08:00
|
|
|
// set ignition_mode 2
|
2015-07-10 06:01:56 -07:00
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
|
2017-01-05 09:02:46 -08:00
|
|
|
// set_ignition_channels
|
|
|
|
boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: low side - out #8
|
|
|
|
boardConfiguration->ignitionPins[1] = GPIOE_10; // Frankenstein: low side - out #8
|
|
|
|
boardConfiguration->ignitionPins[2] = GPIOE_12; // Frankenstein: low side - out #8
|
|
|
|
boardConfiguration->ignitionPins[3] = GPIOE_14; // Frankenstein: low side - out #8
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
// Frankenstein: low side - out #1: PC14
|
|
|
|
// Frankenstein: low side - out #2: PC15
|
|
|
|
// Frankenstein: low side - out #3: PE6
|
|
|
|
// Frankenstein: low side - out #4: PC13
|
|
|
|
// Frankenstein: low side - out #5: PE4
|
|
|
|
// Frankenstein: low side - out #6: PE5
|
|
|
|
// Frankenstein: low side - out #7: PE2
|
|
|
|
// Frankenstein: low side - out #8: PE3
|
|
|
|
// Frankenstein: low side - out #9: PE0
|
|
|
|
// Frankenstein: low side - out #10: PE1
|
|
|
|
// Frankenstein: low side - out #11: PB8
|
|
|
|
// Frankenstein: low side - out #12: PB9
|
|
|
|
|
2017-01-05 09:02:46 -08:00
|
|
|
boardConfiguration->injectionPins[0] = GPIOC_14; // Frankenstein: low side - out #1
|
|
|
|
boardConfiguration->injectionPins[1] = GPIOC_15; // Frankenstein: low side - out #2
|
|
|
|
boardConfiguration->injectionPins[2] = GPIOE_6; // Frankenstein: low side - out #3
|
|
|
|
boardConfiguration->injectionPins[3] = GPIOC_13; // Frankenstein: low side - out #4
|
|
|
|
boardConfiguration->injectionPins[4] = GPIOE_4; // Frankenstein: low side - out #5
|
|
|
|
boardConfiguration->injectionPins[5] = GPIOE_5; // Frankenstein: low side - out #6
|
|
|
|
boardConfiguration->injectionPins[6] = GPIOE_2; // Frankenstein: low side - out #7
|
|
|
|
boardConfiguration->injectionPins[7] = GPIOE_3; // Frankenstein: low side - out #8
|
|
|
|
|
2017-01-05 10:01:54 -08:00
|
|
|
boardConfiguration->fuelPumpPin = GPIOE_0; // Frankenstein: low side - out #9
|
2017-01-05 09:02:46 -08:00
|
|
|
boardConfiguration->malfunctionIndicatorPin = GPIOE_1; // Frankenstein: low side - out #10
|
2015-07-10 06:01:56 -07:00
|
|
|
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
|
|
|
|
2017-01-05 09:02:46 -08:00
|
|
|
boardConfiguration->triggerInputPins[0] = GPIOC_6; // 2G YEL/BLU
|
|
|
|
boardConfiguration->triggerInputPins[1] = GPIOA_5; // 2E White CKP
|
|
|
|
|
|
|
|
setCommonNTCSensor(&engineConfiguration->clt);
|
|
|
|
engineConfiguration->clt.config.bias_resistor = 2700;
|
|
|
|
setCommonNTCSensor(&engineConfiguration->iat);
|
|
|
|
engineConfiguration->iat.config.bias_resistor = 2700;
|
|
|
|
|
|
|
|
engineConfiguration->tpsAdcChannel = EFI_ADC_3; //Frankenstein: inp2
|
|
|
|
engineConfiguration->vbattAdcChannel = EFI_ADC_0; //Frankenstein: inp5
|
|
|
|
engineConfiguration->clt.adcChannel = EFI_ADC_11;
|
|
|
|
engineConfiguration->iat.adcChannel = EFI_ADC_13;
|
|
|
|
|
|
|
|
setCommonNTCSensor(&engineConfiguration->clt);
|
|
|
|
engineConfiguration->clt.config.bias_resistor = 2700;
|
|
|
|
setCommonNTCSensor(&engineConfiguration->iat);
|
|
|
|
engineConfiguration->iat.config.bias_resistor = 2700;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TPS 0% 0.9v
|
|
|
|
* TPS 100% 2.34v
|
|
|
|
*/
|
|
|
|
engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
|
|
|
|
engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
|
|
|
|
|
|
|
|
/* Stepper logic:
|
|
|
|
boardConfiguration->idle.stepperDirectionPin = GPIOE_10;
|
2017-05-02 15:40:49 -07:00
|
|
|
boardConfiguration->idle.stepperStepPin = GPIOE_12; // todo: set pin which would not conflict with coils
|
|
|
|
engineConfiguration->stepperEnablePin = GPIOE_14; // todo: set pin which would not conflict with coils
|
2017-01-05 09:02:46 -08:00
|
|
|
engineConfiguration->idleStepperReactionTime = 10;
|
|
|
|
engineConfiguration->idleStepperTotalSteps = 150;
|
|
|
|
*/
|
2017-05-02 15:40:49 -07:00
|
|
|
boardConfiguration->useStepperIdle = false;
|
2017-01-05 09:02:46 -08:00
|
|
|
|
2017-01-06 07:04:41 -08:00
|
|
|
// set injection_pin_mode 0
|
2015-07-10 06:01:56 -07:00
|
|
|
boardConfiguration->injectionPinMode = OM_DEFAULT;
|
|
|
|
|
|
|
|
boardConfiguration->canTxPin = GPIOB_6;
|
|
|
|
boardConfiguration->canRxPin = GPIOB_12;
|
|
|
|
engineConfiguration->canWriteEnabled = true;
|
|
|
|
engineConfiguration->canReadEnabled = false;
|
|
|
|
engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8;
|
2016-12-31 12:02:44 -08:00
|
|
|
|
|
|
|
|
2017-01-05 09:02:46 -08:00
|
|
|
setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER);
|
2016-12-31 12:02:44 -08:00
|
|
|
|
2017-01-05 09:02:46 -08:00
|
|
|
// todo: make this official Frankenstein joystick?
|
|
|
|
boardConfiguration->joystickCenterPin = GPIOD_8;
|
|
|
|
boardConfiguration->joystickAPin = GPIOD_10;
|
|
|
|
boardConfiguration->joystickBPin = GPIO_UNASSIGNED;
|
|
|
|
boardConfiguration->joystickCPin = GPIO_UNASSIGNED;
|
|
|
|
boardConfiguration->joystickDPin = GPIOD_11;
|
2016-12-31 12:02:44 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
}
|