rusefi/firmware/config/boards/hellen/hellenMiataNA6/board_configuration.cpp

99 lines
2.9 KiB
C++
Raw Normal View History

2021-04-18 07:15:06 -07:00
/**
2021-04-18 19:03:43 -07:00
* @file boards/hellen/hellen64_miataNA6_94/board_configuration.cpp
2021-04-18 07:15:06 -07:00
*
*
2021-04-18 19:03:43 -07:00
* @brief Configuration defaults for the hellen64_miataNA6_94 board
2021-04-18 07:15:06 -07:00
*
2021-04-18 19:03:43 -07:00
* See https://rusefi.com/s/hellenNA6
2021-04-18 07:15:06 -07:00
*
* @author andreika <prometheus.pcb@gmail.com>
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "hellen_meta.h"
2021-04-18 07:15:06 -07:00
static void setInjectorPins() {
engineConfiguration->injectionPins[0] = H176_LS_1;
engineConfiguration->injectionPins[1] = Gpio::G8;
engineConfiguration->injectionPins[2] = Gpio::D11;
engineConfiguration->injectionPins[3] = Gpio::D10;
2021-04-18 07:15:06 -07:00
engineConfiguration->clutchDownPin = Gpio::C4; // Clutch switch input
2021-05-19 00:50:28 -07:00
engineConfiguration->clutchDownPinMode = PI_PULLDOWN;
engineConfiguration->launchActivationMode = CLUTCH_INPUT_LAUNCH;
engineConfiguration->malfunctionIndicatorPin = Gpio::G4; //1E - Check Engine Light
2021-04-18 07:15:06 -07:00
}
static void setIgnitionPins() {
engineConfiguration->ignitionPins[0] = Gpio::I8; // 3F - IGN_1 (1&4)
engineConfiguration->ignitionPins[1] = Gpio::Unassigned ; // Gpio::E4
engineConfiguration->ignitionPins[2] = Gpio::E5; // 3I - IGN_2 (2&3)
engineConfiguration->ignitionPins[3] = Gpio::Unassigned; // Gpio::E3
2021-04-18 07:15:06 -07:00
}
static void setupDefaultSensorInputs() {
2021-06-28 14:36:02 -07:00
// trigger inputs, hall
engineConfiguration->triggerInputPins[0] = Gpio::A6;
engineConfiguration->triggerInputPins[1] = Gpio::B1;
engineConfiguration->camInputs[0] = Gpio::Unassigned;
2021-04-18 07:15:06 -07:00
engineConfiguration->tps1_1AdcChannel = EFI_ADC_4;
engineConfiguration->mafAdcChannel = EFI_ADC_10;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_11;
engineConfiguration->afr.hwChannel = EFI_ADC_1;
engineConfiguration->clt.adcChannel = H144_IN_CLT;
2021-04-18 07:15:06 -07:00
engineConfiguration->iat.adcChannel = H144_IN_IAT;
2021-04-18 07:15:06 -07:00
}
2023-06-05 00:01:37 -07:00
#include "hellen_leds_176.cpp"
void setBoardConfigOverrides() {
2023-12-02 10:43:21 -08:00
setHellenVbatt();
2022-06-23 06:15:51 -07:00
2022-06-23 19:16:53 -07:00
setHellenSdCardSpi2();
2021-04-18 07:15:06 -07:00
2023-02-15 12:01:41 -08:00
setDefaultHellenAtPullUps();
2021-04-18 07:15:06 -07:00
2023-09-17 10:48:36 -07:00
setHellenCan();
2021-04-18 07:15:06 -07:00
}
/**
* @brief Board-specific configuration defaults.
*
* See also setDefaultEngineConfiguration
*
2023-12-16 19:36:23 -08:00
2021-04-18 07:15:06 -07:00
*/
void setBoardDefaultConfiguration() {
2021-04-18 07:15:06 -07:00
setInjectorPins();
setIgnitionPins();
engineConfiguration->enableSoftwareKnock = true;
2021-04-18 07:15:06 -07:00
// these stm32 pins do not match hellen_meta, is that because hellenNA6 is not using latest MCU version?
engineConfiguration->acRelayPin = Gpio::H15; // 1J - AC Relay
engineConfiguration->fuelPumpPin = Gpio::G2; // OUT_IO9
engineConfiguration->idle.solenoidPin = Gpio::D14; // OUT_PWM5
engineConfiguration->fanPin = Gpio::D12; // OUT_PWM8
engineConfiguration->mainRelayPin = Gpio::I2; // OUT_LOW3
engineConfiguration->tachOutputPin = Gpio::I0;
engineConfiguration->malfunctionIndicatorPin = Gpio::G9;
engineConfiguration->vehicleSpeedSensorInputPin = Gpio::H144_IN_VSS;
2021-04-18 07:15:06 -07:00
// "required" hardware is done - set some reasonable defaults
setupDefaultSensorInputs();
engineConfiguration->cylindersCount = 4;
engineConfiguration->firingOrder = FO_1_3_4_2;
2021-04-18 07:15:06 -07:00
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
2023-01-21 05:08:52 -08:00
2021-04-18 07:15:06 -07:00
}