rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
board_configuration.cpp File Reference

Detailed Description

Configuration defaults for the hellen154hyundai board.

See https://rusefi.com/s/hellen154hyundai

Author
andreika prome.nosp@m.theu.nosp@m.s.pcb.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Andrey Belomutskiy, (c) 2012-2020

Definition in file board_configuration.cpp.

Functions

static void setInjectorPins ()
 
static void setIgnitionPins ()
 
static void setupDefaultSensorInputs ()
 
int hackHellenBoardId (int detectedId)
 
static void hellen154_hyundai_boardConfigOverrides ()
 
static void hellen154_hyundai_boardDefaultConfiguration ()
 Board-specific configuration defaults.
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaLowSideOutputsCount ()
 
int getBoardMetaDcOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
void setup_custom_board_overrides ()
 

Variables

static bool isFirstInvocation = true
 
static Gpio OUTPUTS []
 

Function Documentation

◆ getBoardMetaDcOutputsCount()

int getBoardMetaDcOutputsCount ( )

Definition at line 192 of file board_configuration.cpp.

192 {
193 return 2;
194}

◆ getBoardMetaLowSideOutputsCount()

int getBoardMetaLowSideOutputsCount ( )

Definition at line 188 of file board_configuration.cpp.

188 {
190}
int getBoardMetaOutputsCount()
Here is the call graph for this function:

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 196 of file board_configuration.cpp.

196 {
197 return OUTPUTS;
198}
static Gpio OUTPUTS[]

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 184 of file board_configuration.cpp.

184 {
185 return efi::size(OUTPUTS);
186}

◆ hackHellenBoardId()

int hackHellenBoardId ( int  detectedId)

Definition at line 55 of file board_configuration.cpp.

55 {
56 if (detectedId == BOARD_ID_VAG121_D) {
57 // wow something bad has happened to that batch of boards?!
58 return BOARD_ID_154HYUNDAI_C;
59 }
60 return detectedId;
61}

Referenced by detectHellenBoardType().

Here is the caller graph for this function:

◆ hellen154_hyundai_boardConfigOverrides()

static void hellen154_hyundai_boardConfigOverrides ( )
static

Definition at line 63 of file board_configuration.cpp.

63 {
65
67
69
70 // trigger inputs
72 // Direct hall-only cam input
73 // exhaust input same on both revisions
74 engineConfiguration->camInputs[1] = Gpio::H144_ORIGINAL_MCU_IN_D_AUX4;
75
76#ifndef EFI_BOOTLOADER
78
79 if (hellenBoardId == -1) {
80 engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_CRANK;
81 engineConfiguration->camInputs[0] = Gpio::H144_IN_CAM;
82
83 // control pins are inverted since overall ECU pinout seems to be inverted
84 engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
85 engineConfiguration->etbIo[0].directionPin2 = Gpio::H144_OUT_PWM2;
86 engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_IO12;
89
90 // first revision of did not have Hellen Board ID
91 // https://github.com/rusefi/hellen154hyundai/issues/55
96
98 isFirstInvocation = false;
99 efiSetPadMode("ETB FIX0", Gpio::H144_OUT_PWM4, PAL_MODE_INPUT_ANALOG);
100 efiSetPadMode("ETB FIX1", Gpio::H144_OUT_PWM5, PAL_MODE_INPUT_ANALOG);
101 efiSetPadMode("ETB FIX2", Gpio::H144_OUT_IO13, PAL_MODE_INPUT_ANALOG);
102 }
104 } else if (hellenBoardId == BOARD_ID_154HYUNDAI_C || hellenBoardId == BOARD_ID_154HYUNDAI_D) {
105 engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_SENS2;
106 engineConfiguration->camInputs[0] = Gpio::H144_IN_SENS3;
107
108
109 // todo You would not believe how you invert TLE9201 #4579
111
112 //ETB1
113 // PWM pin
114 engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM2;
115 // DIR pin
116 engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_OUT_PWM3;
117 // Disable pin
118 engineConfiguration->etbIo[0].disablePin = Gpio::H144_OUT_IO12;
119
120 // wastegate DC motor
121 //ETB2
122 // PWM pin
123 engineConfiguration->etbIo[1].controlPin = Gpio::H144_OUT_PWM4;
124 // DIR pin
125 engineConfiguration->etbIo[1].directionPin1 = Gpio::H144_OUT_PWM5;
126 // Disable pin
127 engineConfiguration->etbIo[1].disablePin = Gpio::H144_OUT_IO13;
128 }
129#endif // EFI_BOOTLOADER
130}
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
EngineState engineState
Definition engine.h:344
@ Unassigned
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
static bool isFirstInvocation
void setHellenVbatt()
void setHellenSdCardSpi2()
void setDefaultHellenAtPullUps(float pullup=HELLEN_DEFAULT_AT_PULLUP)
hellenBoardId("Detected Board ID", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 1368, 1.0, 0.0, 3000.0, "id")
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]

Referenced by setup_custom_board_overrides().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hellen154_hyundai_boardDefaultConfiguration()

static void hellen154_hyundai_boardDefaultConfiguration ( )
static

Board-specific configuration defaults.

See also setDefaultEngineConfiguration

Definition at line 139 of file board_configuration.cpp.

139 {
142
144 setHellenCan();
145
146 engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO9;
147 engineConfiguration->fanPin = Gpio::H144_OUT_IO7;
148 engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO3; // pin: 111a
149 // BK1 uses wire, BK2 uses CANbus
150 engineConfiguration->malfunctionIndicatorPin = Gpio::H144_OUT_PWM8;
151
152 engineConfiguration->brakePedalPin = Gpio::H144_IN_RES3;
153 engineConfiguration->clutchUpPin = Gpio::H144_IN_RES2;
154 engineConfiguration->acSwitch = Gpio::H144_IN_RES1;
155
156 // "required" hardware is done - set some reasonable defaults
158
159 engineConfiguration->etbFunctions[1] = DC_Wastegate;
160}
static void setupDefaultSensorInputs()
static void setIgnitionPins()
static void setInjectorPins()
void setHellenCan()

Referenced by setup_custom_board_overrides().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIgnitionPins()

static void setIgnitionPins ( )
static

Definition at line 25 of file board_configuration.cpp.

25 {
26 engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
27 engineConfiguration->ignitionPins[1] = Gpio::H144_IGN_2;
28 engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_3;
29 engineConfiguration->ignitionPins[3] = Gpio::H144_IGN_4;
30}

◆ setInjectorPins()

static void setInjectorPins ( )
static

Definition at line 18 of file board_configuration.cpp.

18 {
19 engineConfiguration->injectionPins[0] = Gpio::H144_LS_1;
20 engineConfiguration->injectionPins[1] = Gpio::H144_LS_2;
21 engineConfiguration->injectionPins[2] = Gpio::H144_LS_3;
22 engineConfiguration->injectionPins[3] = Gpio::H144_LS_4;
23}

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 200 of file board_configuration.cpp.

200 {
203}
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
static void hellen154_hyundai_boardConfigOverrides()
static void hellen154_hyundai_boardDefaultConfiguration()
Board-specific configuration defaults.
Here is the call graph for this function:

◆ setupDefaultSensorInputs()

static void setupDefaultSensorInputs ( )
static

Definition at line 32 of file board_configuration.cpp.

32 {
33 engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH;
34 engineConfiguration->vvtMode[1] = VVT_SINGLE_TOOTH;
35
37
38 setTPS1Inputs(H144_IN_TPS, H144_IN_AUX1_ANALOG);
39
40 setPPSInputs(EFI_ADC_3, EFI_ADC_14);
41
43
44 engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
45
46 engineConfiguration->clt.adcChannel = H144_IN_CLT;
47
48 engineConfiguration->iat.adcChannel = H144_IN_IAT;
49}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
Here is the call graph for this function:

Variable Documentation

◆ isFirstInvocation

bool isFirstInvocation = true
static

Definition at line 52 of file board_configuration.cpp.

◆ OUTPUTS

Gpio OUTPUTS[]
static
Initial value:
= {
Gpio::H144_LS_1,
Gpio::H144_LS_2,
Gpio::H144_LS_3,
Gpio::H144_LS_4,
Gpio::H144_LS_5,
Gpio::H144_LS_6,
Gpio::H144_LS_7,
Gpio::H144_OUT_IO7,
Gpio::H144_OUT_IO3,
Gpio::H144_OUT_IO9,
Gpio::H144_OUT_IO10,
Gpio::H144_OUT_IO8,
Gpio::H144_IGN_1,
Gpio::H144_IGN_2,
Gpio::H144_IGN_3,
Gpio::H144_IGN_4,
Gpio::H144_OUT_PWM8,
}

Definition at line 162 of file board_configuration.cpp.

162 {
163 Gpio::H144_LS_1, // 0: INJ_1 k25
164 Gpio::H144_LS_2, // INJ_2 k26
165 Gpio::H144_LS_3, // INJ_3 k27
166 Gpio::H144_LS_4, // 3: INJ_4 k28
167 Gpio::H144_LS_5, // VVT1
168 Gpio::H144_LS_6, // 5: VVT2
169 Gpio::H144_LS_7, // K47 BK1 Wastegate Solenoid
170 Gpio::H144_OUT_IO7, // Fan Relay Low
171 Gpio::H144_OUT_IO3, // Main Relay K64
172 Gpio::H144_OUT_IO9, // Fuel Pump K70
173 Gpio::H144_OUT_IO10, // 10: K87 AC Relay
174 Gpio::H144_OUT_IO8, // Fan Relay HI
175 Gpio::H144_IGN_1, // Coil 1
176 Gpio::H144_IGN_2, // Coil 2
177 Gpio::H144_IGN_3, // Coil 3
178 Gpio::H144_IGN_4, // Coil 4
179 Gpio::H144_OUT_PWM8, // MIL
180// QC procedure seems to not work for that one Gpio::H144_OUT_PWM7, // low side? Tacho unused CAN tachometer right?
181// Gpio::H_SPI1_SCK, // X8 AuxLS1
182};

Go to the source code of this file.