2023-12-04 06:47:45 -08:00
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
Gpio getCommsLedPin() {
|
2024-04-28 07:03:56 -07:00
|
|
|
// TODO: https://github.com/rusefi/fw-custom-mega/issues/1
|
2023-12-04 06:47:45 -08:00
|
|
|
return Gpio::Unassigned;
|
|
|
|
}
|
|
|
|
|
|
|
|
Gpio getRunningLedPin() {
|
|
|
|
return Gpio::Unassigned;
|
|
|
|
}
|
|
|
|
|
|
|
|
Gpio getWarningLedPin() {
|
|
|
|
return Gpio::Unassigned;
|
2024-04-21 06:30:53 -07:00
|
|
|
}
|
|
|
|
|
2024-04-28 07:47:53 -07:00
|
|
|
static void setSdCardSpi3() {
|
|
|
|
engineConfiguration->isSdCardEnabled = true;
|
|
|
|
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
|
|
|
engineConfiguration->spi3mosiPin = Gpio::C12;
|
|
|
|
engineConfiguration->spi3misoPin = Gpio::C11;
|
|
|
|
engineConfiguration->spi3sckPin = Gpio::C10;
|
|
|
|
engineConfiguration->is_enabled_spi_3 = true;
|
|
|
|
engineConfiguration->sdCardCsPin = Gpio::D2;
|
|
|
|
}
|
|
|
|
|
2024-04-21 06:30:53 -07:00
|
|
|
// board-specific configuration setup
|
|
|
|
void setBoardDefaultConfiguration() {
|
2024-04-28 07:02:07 -07:00
|
|
|
// Battery sense on PA2
|
|
|
|
engineConfiguration->vbattAdcChannel = EFI_ADC_2;
|
|
|
|
|
|
|
|
// all analog inputs have same divider on-board, we assume additional divider for vbatt on carrier board
|
|
|
|
// 6.34k high side/ 1k low side
|
|
|
|
// engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;
|
|
|
|
|
|
|
|
// same 470 and 910 on all analog inputs
|
2024-04-30 07:15:34 -07:00
|
|
|
engineConfiguration->analogInputDividerCoefficient = 1.55f;
|
|
|
|
engineConfiguration->adcVcc = 3.3f;
|
2024-04-28 07:02:07 -07:00
|
|
|
|
2024-04-28 07:47:53 -07:00
|
|
|
setSdCardSpi3();
|
|
|
|
|
2024-04-21 06:30:53 -07:00
|
|
|
// engineConfiguration->injectionPins[0] = Gpio::F13;
|
|
|
|
// engineConfiguration->ignitionPins[0] = Gpio::E15;
|
|
|
|
|
|
|
|
// engineConfiguration->triggerInputPins[0] = Gpio::B1;
|
|
|
|
// engineConfiguration->triggerInputPins[1] = Gpio::Unassigned;
|
|
|
|
|
|
|
|
// engineConfiguration->map.sensor.hwChannel = EFI_ADC_3;
|
|
|
|
|
|
|
|
// engineConfiguration->clt.adcChannel = EFI_ADC_1;
|
|
|
|
|
|
|
|
// engineConfiguration->iat.adcChannel = EFI_ADC_2;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// engineConfiguration->clt.config.bias_resistor = 2490;
|
|
|
|
// engineConfiguration->iat.config.bias_resistor = 2490;
|
|
|
|
|
|
|
|
|
2023-12-04 06:47:45 -08:00
|
|
|
}
|