rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
config
boards
hellen
hellen-honda-k
board_configuration.cpp
Go to the documentation of this file.
1
/**
2
* @file boards/hellen/hellen-honda-k/board_configuration.cpp
3
*
4
* See https://rusefi.com/s/XX
5
*
6
* @author Andrey Belomutskiy, (c) 2012-2023
7
*/
8
9
#include "
pch.h
"
10
#include "
defaults.h
"
11
#include "
hellen_meta.h
"
12
#include "
honda_k_dbc.h
"
13
#include "
board_overrides.h
"
14
15
static
void
setInjectorPins
() {
16
engineConfiguration
->injectionPins[0] = Gpio::H144_LS_1;
17
engineConfiguration
->injectionPins[1] = Gpio::H144_LS_2;
18
engineConfiguration
->injectionPins[2] = Gpio::H144_LS_3;
19
engineConfiguration
->injectionPins[3] = Gpio::H144_LS_4;
20
}
21
22
static
void
setIgnitionPins
() {
23
engineConfiguration
->ignitionPins[0] = Gpio::H144_IGN_1;
24
engineConfiguration
->ignitionPins[1] = Gpio::H144_IGN_2;
25
engineConfiguration
->ignitionPins[2] = Gpio::H144_IGN_3;
26
engineConfiguration
->ignitionPins[3] = Gpio::H144_IGN_4;
27
}
28
29
static
void
setupDefaultSensorInputs
() {
30
engineConfiguration
->vehicleSpeedSensorInputPin = Gpio::H144_IN_VSS;
31
32
engineConfiguration
->tps1_1AdcChannel = H144_IN_TPS;
33
34
35
engineConfiguration
->map.sensor.hwChannel = H144_IN_MAP1;
36
37
engineConfiguration
->afr.hwChannel = EFI_ADC_NONE;
38
39
engineConfiguration
->clt.adcChannel = H144_IN_CLT;
40
41
engineConfiguration
->iat.adcChannel = H144_IN_IAT;
42
}
43
44
void
onBoardStandBy
() {
45
efiPrintf(
"K: onBoardStandBy"
);
46
hellenBoardStandBy
();
47
}
48
49
static
void
hellen_honda_k_boardConfigOverrides
() {
50
setHellenMegaEnPin
();
51
52
hellenMegaModule
();
53
configureHellenCanTerminator
();
54
55
56
engineConfiguration
->triggerInputPins[0] = Gpio::H144_IN_RES1;
57
engineConfiguration
->camInputs[0] = Gpio::H144_IN_RES3;
58
// ex or in?
59
engineConfiguration
->camInputs[1] = Gpio::H144_IN_RES2;
60
61
62
// //ETB1
63
// // PWM pin
64
// engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM2;
65
// // DIR pin
66
// engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
67
// // Disable pin
68
// engineConfiguration->etbIo[0].disablePin = Gpio::H144_OUT_IO12;
69
// // Unused
70
// engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
71
72
}
73
74
/**
75
* @brief Board-specific configuration defaults.
76
*
77
78
*
79
80
*/
81
static
void
hellen_honda_k_boardDefaultConfiguration
() {
82
setInjectorPins
();
83
setIgnitionPins
();
84
setHondaK
();
85
86
// not override since sometimes we have issues?
87
setHellenMMbaro
();
88
89
engineConfiguration
->displayLogicLevelsInEngineSniffer =
true
;
90
91
engineConfiguration
->camSyncOnSecondCrankRevolution =
true
;
92
engineConfiguration
->globalTriggerAngleOffset = 303;
93
94
engineConfiguration
->enableSoftwareKnock =
true
;
95
96
setHellenCan
();
97
98
engineConfiguration
->vvtPins[0] = Gpio::H144_OUT_PWM4;
99
100
gppwm_channel *vtsControl = &
engineConfiguration
->gppwm[0];
101
vtsControl->pin = Gpio::H144_OUT_IO6;
102
103
engineConfiguration
->fuelPumpPin = Gpio::H144_OUT_IO13;
104
engineConfiguration
->idle.solenoidPin = Gpio::H144_LS_6;
105
engineConfiguration
->fanPin = Gpio::H144_OUT_IO12;
106
engineConfiguration
->mainRelayPin = Gpio::H144_OUT_IO3;
107
engineConfiguration
->malfunctionIndicatorPin = Gpio::H144_OUT_IO7;
108
109
// how come this is not denso 183?!
110
engineConfiguration
->map.sensor.type = MT_CUSTOM;
111
engineConfiguration
->map.sensor.lowValue = 11.4;
112
engineConfiguration
->mapLowValueVoltage = 0.5;
113
engineConfiguration
->map.sensor.highValue = 170.7;
114
engineConfiguration
->mapHighValueVoltage = 4.8;
115
116
engineConfiguration
->enableKline =
true
;
117
config
->hondaKcltGaugeAdder = 50;
118
engineConfiguration
->kLineBaudRate = 9600;
119
engineConfiguration
->hondaK =
true
;
120
engineConfiguration
->verboseKLine =
true
;
121
122
engineConfiguration
->brakePedalPin = Gpio::H144_IN_CAM;
123
engineConfiguration
->acRelayPin = Gpio::H144_LS_5;
124
engineConfiguration
->tachOutputPin = Gpio::H144_OUT_IO10;
125
// A/C switch on k-line
126
127
// "required" hardware is done - set some reasonable defaults
128
setupDefaultSensorInputs
();
129
130
engineConfiguration
->etbFunctions[0] = DC_None;
131
engineConfiguration
->etbFunctions[1] = DC_Wastegate;
132
133
// Some sensible defaults for other options
134
setCrankOperationMode
();
135
136
setAlgorithm
(engine_load_mode_e::LM_SPEED_DENSITY);
137
138
engineConfiguration
->injectorCompensationMode = ICM_FixedRailPressure;
139
140
#ifndef EFI_BOOTLOADER
141
setCommonNTCSensorParameters
(&
engineConfiguration
->clt);
142
setCommonNTCSensorParameters
(&
engineConfiguration
->iat);
143
#endif
// EFI_BOOTLOADER
144
setTPS1Calibration
(100, 650);
145
hellenWbo
();
146
147
setAccelerometerSpi
();
148
}
149
150
static
Gpio
OUTPUTS
[] = {
151
Gpio::H144_LS_1,
// 1 inj 1
152
Gpio::H144_LS_2,
153
Gpio::H144_LS_3,
154
Gpio::H144_LS_4,
// 4
155
Gpio::H144_LS_5,
// 5 E18 - AC Relay
156
Gpio::H144_LS_6,
// 6 A12 Idle Air Control
157
Gpio::H144_LS_7,
// 7 intake runner
158
Gpio::H144_LS_8,
// 8 Lockout Solenoid
159
Gpio::H144_OUT_IO12,
// 9 Radiator Relay Output
160
Gpio::H144_OUT_PWM6,
// 10 B21 - EVAP
161
Gpio::H144_OUT_PWM5,
// 11 B23 VTC VVT
162
Gpio::H144_OUT_IO3,
// 12 E7 Main Relay Control
163
Gpio::H144_OUT_IO7,
// 13: E31 Check Engine
164
Gpio::H144_OUT_IO13,
// E1 Fuel Relay
165
Gpio::H144_OUT_PWM8,
// C11 Aux Low 3
166
Gpio::H144_OUT_IO9,
// B18 Alternator Control
167
// low-side with pull-up, faking push-pull
168
Gpio::H144_OUT_IO10,
// 17: E26 Tachometer
169
// high side starts here
170
Gpio::H144_OUT_IO6,
// B15 VTEC/VTS Output
171
Gpio::H144_IGN_1,
// A30 - IGN1
172
Gpio::H144_IGN_2,
// A29 - IGN2
173
Gpio::H144_IGN_3,
// A28 - IGN3
174
Gpio::H144_IGN_4,
// A27 - IGN4
175
};
176
177
int
getBoardMetaOutputsCount
() {
178
return
efi::size(
OUTPUTS
);
179
}
180
181
int
getBoardMetaLowSideOutputsCount
() {
182
return
getBoardMetaOutputsCount
() - 5;
183
}
184
185
Gpio
*
getBoardMetaOutputs
() {
186
return
OUTPUTS
;
187
}
188
189
void
setup_custom_board_overrides
() {
190
custom_board_DefaultConfiguration
=
hellen_honda_k_boardDefaultConfiguration
;
191
custom_board_ConfigOverrides
=
hellen_honda_k_boardConfigOverrides
;
192
}
setup_custom_board_overrides
void setup_custom_board_overrides()
Definition
board_configuration.cpp:40
board_overrides.h
Gpio
Gpio
Definition
rusefi_hw_enums.h:14
setTPS1Calibration
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)
Definition
default_base_engine.cpp:440
defaults.h
custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
Definition
engine_configuration.cpp:71
custom_board_DefaultConfiguration
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
Definition
engine_configuration.cpp:70
setCrankOperationMode
void setCrankOperationMode()
Definition
engine_configuration.cpp:717
config
static constexpr persistent_config_s * config
Definition
engine_configuration.h:82
engineConfiguration
static constexpr engine_configuration_s * engineConfiguration
Definition
engine_configuration.h:81
setAlgorithm
void setAlgorithm(engine_load_mode_e algo)
Definition
engine_math.cpp:153
setupDefaultSensorInputs
static void setupDefaultSensorInputs()
Definition
board_configuration.cpp:42
OUTPUTS
static Gpio OUTPUTS[]
Definition
board_configuration.cpp:161
setIgnitionPins
static void setIgnitionPins()
Definition
board_configuration.cpp:35
getBoardMetaOutputsCount
int getBoardMetaOutputsCount()
Definition
board_configuration.cpp:166
getBoardMetaOutputs
Gpio * getBoardMetaOutputs()
Definition
board_configuration.cpp:170
setInjectorPins
static void setInjectorPins()
Definition
board_configuration.cpp:23
getBoardMetaLowSideOutputsCount
int getBoardMetaLowSideOutputsCount()
Definition
board_configuration.cpp:276
hellen_honda_k_boardDefaultConfiguration
static void hellen_honda_k_boardDefaultConfiguration()
Board-specific configuration defaults.
Definition
board_configuration.cpp:81
onBoardStandBy
void onBoardStandBy()
Definition
board_configuration.cpp:44
hellen_honda_k_boardConfigOverrides
static void hellen_honda_k_boardConfigOverrides()
Definition
board_configuration.cpp:49
hellenBoardStandBy
void hellenBoardStandBy()
Definition
hellen_common.cpp:172
configureHellenCanTerminator
void configureHellenCanTerminator()
Definition
hellen_common.cpp:212
setHellenCan
void setHellenCan()
Definition
hellen_common.cpp:12
hellenMegaModule
void hellenMegaModule()
Definition
hellen_common.cpp:195
hellenWbo
void hellenWbo()
Definition
hellen_common.cpp:7
setHellenMegaEnPin
void setHellenMegaEnPin(bool enableBoardOnStartUp)
Definition
hellen_common.cpp:163
setAccelerometerSpi
static void setAccelerometerSpi()
Definition
hellen_logic.h:64
setHellenMMbaro
void setHellenMMbaro()
Definition
hellen_logic.h:108
hellen_meta.h
setHondaK
void setHondaK()
Definition
honda_k_dbc.cpp:15
honda_k_dbc.h
pch.h
setCommonNTCSensorParameters
void setCommonNTCSensorParameters(ThermistorConf *thermistorConf)
Definition
thermistors.cpp:33
Generated on Sat Dec 13 2025 01:49:58 for rusEFI by
1.9.8