-
Notifications
You must be signed in to change notification settings - Fork 6
/
board_configuration.cpp
72 lines (58 loc) · 1.67 KB
/
board_configuration.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "pch.h"
Gpio getCommsLedPin() {
return Gpio::D15;
}
Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
Gpio getWarningLedPin() {
return Gpio::Unassigned;
}
void setBoardDefaultConfiguration() {
engineConfiguration->vbattDividerCoeff = 10.2f;
engineConfiguration->vbattAdcChannel = EFI_ADC_11;
}
static Gpio OUTPUTS[] = {
Gpio::D11, //
Gpio::D12, //
Gpio::D13, //
Gpio::D14, //
Gpio::E11, //
Gpio::E12,
};
int getBoardMetaOutputsCount() {
return efi::size(OUTPUTS);
}
Gpio* getBoardMetaOutputs() {
return OUTPUTS;
}
void setCustomVbatt() {
// set vbatt_divider 5.835
// 33k / 6.8k
engineConfiguration->vbattDividerCoeff = 10.2; // 5.835
engineConfiguration->vbattAdcChannel = EFI_ADC_11;
}
/*
static void setInjectorPins() {
engineConfiguration->injectionPins[0] = Gpio::E0;
engineConfiguration->injectionPins[1] = Gpio::E6;
engineConfiguration->injectionPins[2] = Gpio::D9;
engineConfiguration->injectionPins[3] = Gpio::E3;
}
static void setIgnitionPins() {
engineConfiguration->ignitionPins[0] = Gpio::A8;
engineConfiguration->ignitionPins[1] = Gpio::C9;
engineConfiguration->ignitionPins[2] = Gpio::A10;
engineConfiguration->ignitionPins[3] = Gpio::C8;
}
void setBoardDefaultConfiguration() {
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
engineConfiguration->clt.adcChannel = EFI_ADC_1;
engineConfiguration->iat.adcChannel = EFI_ADC_13;
engineConfiguration->afr.hwChannel = EFI_ADC_14;
engineConfiguration->vbattAdcChannel = EFI_ADC_12;
engineConfiguration->analogInputDividerCoefficient = 10.2f;
engineConfiguration->triggerInputPins[0] = Gpio::B1;
engineConfiguration->triggerInputPins[1] = Gpio::A6;
}
*/