2014-08-29 07:52:33 -07:00
|
|
|
/**
|
|
|
|
* @file mazda_miata_nb.cpp
|
|
|
|
*
|
|
|
|
* MAZDA_MIATA_NB = 9
|
|
|
|
*
|
|
|
|
* @date Feb 18, 2014
|
2015-01-12 15:04:10 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2015
|
2014-08-29 07:52:33 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mazda_miata_nb.h"
|
|
|
|
#include "thermistors.h"
|
|
|
|
|
2015-02-07 08:05:28 -08:00
|
|
|
void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfiguration) {
|
|
|
|
board_configuration_s *boardConfiguration = &engineConfiguration->bc;
|
2014-08-29 07:52:33 -07:00
|
|
|
// set_rpm_hard_limit 3000
|
|
|
|
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now
|
|
|
|
|
2015-01-23 09:04:28 -08:00
|
|
|
engineConfiguration->trigger.type = TT_MAZDA_MIATA_NB;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
engineConfiguration->globalTriggerAngleOffset = 276;
|
|
|
|
|
|
|
|
// set_cranking_injection_mode 0
|
|
|
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
|
|
|
// set_injection_mode 1
|
|
|
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
|
|
|
// set_ignition_mode 2
|
|
|
|
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
|
|
|
|
// set_firing_order 2
|
2015-02-09 08:07:00 -08:00
|
|
|
engineConfiguration->specs.firingOrder = FO_1_THEN_3_THEN_4_THEN2;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
2015-01-22 18:04:47 -08:00
|
|
|
setThermistorConfiguration(&engineConfiguration->clt, 0, 32500, 30, 7550, 100, 700);
|
|
|
|
engineConfiguration->clt.bias_resistor = 2700;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
2015-01-22 18:04:47 -08:00
|
|
|
setThermistorConfiguration(&engineConfiguration->iat, -10, 160310, 60, 7700, 120.00, 1180);
|
|
|
|
engineConfiguration->iat.bias_resistor = 2700;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
engineConfiguration->tpsAdcChannel = EFI_ADC_3; // 15 is the old value
|
2014-09-06 13:02:45 -07:00
|
|
|
engineConfiguration->vbattAdcChannel = EFI_ADC_0; // 1 is the old value
|
2014-08-29 07:52:33 -07:00
|
|
|
// engineConfiguration->map.channel = 1;
|
|
|
|
engineConfiguration->mafAdcChannel = EFI_ADC_1;
|
|
|
|
engineConfiguration->cltAdcChannel = EFI_ADC_11;
|
|
|
|
engineConfiguration->iatAdcChannel = EFI_ADC_13;
|
2015-01-28 17:06:25 -08:00
|
|
|
engineConfiguration->afr.hwChannel = EFI_ADC_2;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
boardConfiguration->idleValvePin = GPIOE_0;
|
|
|
|
boardConfiguration->idleValvePinMode = OM_DEFAULT;
|
|
|
|
|
2014-11-12 19:03:34 -08:00
|
|
|
boardConfiguration->fuelPumpPin = GPIOC_14; // Frankenstein: low side - out #4
|
2014-08-29 07:52:33 -07:00
|
|
|
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
|
|
|
|
2014-11-12 19:03:34 -08:00
|
|
|
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - out #12
|
|
|
|
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - out #11
|
|
|
|
boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - out #8
|
|
|
|
boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - out #6
|
2014-11-10 07:03:20 -08:00
|
|
|
boardConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
|
|
|
|
boardConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
|
2014-08-29 07:52:33 -07:00
|
|
|
boardConfiguration->injectionPinMode = OM_DEFAULT;
|
|
|
|
|
|
|
|
boardConfiguration->ignitionPins[0] = GPIOE_10; // Frankenstein: high side #1
|
2014-11-10 07:03:20 -08:00
|
|
|
boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED;
|
2014-08-29 07:52:33 -07:00
|
|
|
boardConfiguration->ignitionPins[2] = GPIOC_9; // // Frankenstein: high side #2
|
2014-11-10 07:03:20 -08:00
|
|
|
boardConfiguration->ignitionPins[3] = GPIO_UNASSIGNED;
|
2014-08-29 07:52:33 -07:00
|
|
|
boardConfiguration->ignitionPinMode = OM_INVERTED;
|
|
|
|
|
|
|
|
boardConfiguration->malfunctionIndicatorPin = GPIOE_1;
|
|
|
|
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
|
|
|
|
|
|
|
|
boardConfiguration->fanPin = GPIOE_6;
|
|
|
|
boardConfiguration->fanPinMode = OM_DEFAULT;
|
|
|
|
|
2014-11-10 07:03:20 -08:00
|
|
|
boardConfiguration->electronicThrottlePin1 = GPIO_UNASSIGNED;
|
2015-01-03 20:07:07 -08:00
|
|
|
boardConfiguration->clutchDownPin = GPIO_UNASSIGNED;
|
2014-08-29 07:52:33 -07:00
|
|
|
|
|
|
|
// set_whole_fuel_map 3
|
|
|
|
setWholeFuelMap(engineConfiguration, 3);
|
|
|
|
|
|
|
|
|
|
|
|
// 10 deg before TDC is default timing
|
|
|
|
}
|