rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
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
15static 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
22static 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
31
33
34
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
45 efiPrintf("K: onBoardStandBy");
47}
48
51
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 * See also setDefaultEngineConfiguration
78 *
79
80 */
84 setHondaK();
85
86 // not override since sometimes we have issues?
88
90
93
95
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;
115
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
129
130 engineConfiguration->etbFunctions[0] = DC_None;
131 engineConfiguration->etbFunctions[1] = DC_Wastegate;
132
133 // Some sensible defaults for other options
135
136 setAlgorithm(engine_load_mode_e::LM_SPEED_DENSITY);
137
138 engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
139
140#ifndef EFI_BOOTLOADER
143#endif // EFI_BOOTLOADER
144 setTPS1Calibration(100, 650);
145 hellenWbo();
146
148}
149
150static 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
178 return efi::size(OUTPUTS);
179}
180
184
186 return OUTPUTS;
187}
188
void setup_custom_board_overrides()
void setTPS1Calibration(uint16_t tpsMin, uint16_t tpsMax)
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
void setCrankOperationMode()
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
void setAlgorithm(engine_load_mode_e algo)
static void setupDefaultSensorInputs()
static Gpio OUTPUTS[]
static void setIgnitionPins()
int getBoardMetaOutputsCount()
Gpio * getBoardMetaOutputs()
static void setInjectorPins()
int getBoardMetaLowSideOutputsCount()
static void hellen_honda_k_boardDefaultConfiguration()
Board-specific configuration defaults.
void onBoardStandBy()
static void hellen_honda_k_boardConfigOverrides()
void hellenBoardStandBy()
void configureHellenCanTerminator()
void setHellenCan()
void hellenMegaModule()
void hellenWbo()
void setHellenMegaEnPin(bool enableBoardOnStartUp)
static void setAccelerometerSpi()
void setHellenMMbaro()
void setHondaK()
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
void setCommonNTCSensorParameters(ThermistorConf *thermistorConf)