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

Functions

static void setInjectorPins ()
 
static void setIgnitionPins ()
 
static void setupDefaultSensorInputs ()
 
static void alphax_8chan_boardInitHardware ()
 
static void customBoardOnConfigurationChange (engine_configuration_s *)
 
static void alphax_8chan_boardConfigOverrides ()
 
void set8chanDefaultETBPins ()
 
static void alphax_8chan_defaultConfiguration ()
 
void boardPrepareForStop ()
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaLowSideOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
int getBoardMetaDcOutputsCount ()
 
void setup_custom_board_overrides ()
 
int boardGetAnalogInputDiagnostic (adc_channel_e hwChannel, float voltage)
 

Variables

static OutputPin alphaCrankPPullUp
 
static OutputPin alphaHall1PullDown
 
static OutputPin alphaHall2PullDown
 
static OutputPin alphaHall3PullDown
 
static OutputPin alphaHall4PullDown
 
static OutputPin alphaHall5PullDown
 
static OutputPin alphaFlexPullDown
 
static OutputPin tempPullUp
 
static Gpio OUTPUTS_GM_GEN4 []
 
static Gpio OUTPUTS []
 

Function Documentation

◆ alphax_8chan_boardConfigOverrides()

static void alphax_8chan_boardConfigOverrides ( )
static

Definition at line 101 of file board_configuration.cpp.

101 {
103 setHellenCan();
105}
void setHellenCan()
void hellenMegaModule()
void setHellenCan2()

Referenced by setup_custom_board_overrides().

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

◆ alphax_8chan_boardInitHardware()

static void alphax_8chan_boardInitHardware ( )
static

Definition at line 76 of file board_configuration.cpp.

76 {
77 // technically same thing as setHellenMegaEnPin() since underlying pin E10 is same as H144_GP8
78 setHellenEnPin(Gpio::MM176_EN_PIN);
79
80 alphaCrankPPullUp.initPin("Crank-PullUp", Gpio::MM176_GP16);
81 alphaHall1PullDown.initPin("PullDown-Hall1", Gpio::MM176_OUT_IO10);
82 alphaHall2PullDown.initPin("PullDown-Hall2", Gpio::MM176_GP21);
83 alphaHall3PullDown.initPin("PullDown-Hall3", Gpio::MM176_GP22);
84 alphaHall4PullDown.initPin("PullDown-Hall4", Gpio::MM176_GP23);
85 alphaHall5PullDown.initPin("PullDown-Hall5", Gpio::MM176_GP24);
86 alphaFlexPullDown.initPin("PullDown-Flex", Gpio::MM176_GP25);
87 tempPullUp.initPin("Temp PullUp", Gpio::MM176_OUT_IO12);
88}
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
Definition efi_gpio.cpp:711
static OutputPin alphaCrankPPullUp
static OutputPin tempPullUp
static OutputPin alphaHall2PullDown
static OutputPin alphaHall5PullDown
static OutputPin alphaHall3PullDown
static OutputPin alphaFlexPullDown
static OutputPin alphaHall1PullDown
static OutputPin alphaHall4PullDown
void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp)

Referenced by setup_custom_board_overrides().

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

◆ alphax_8chan_defaultConfiguration()

static void alphax_8chan_defaultConfiguration ( )
static

Definition at line 112 of file board_configuration.cpp.

112 {
116// engineConfiguration->vvtPins[0] = Gpio::H144_OUT_PWM7;
117// engineConfiguration->vvtPins[1] = Gpio::H144_OUT_PWM8;
118
120
122
123 engineConfiguration->mainRelayPin = Gpio::MM176_GP1;
124// engineConfiguration->fanPin = Gpio::H144_OUT_IO11;
125// engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO12;
126// engineConfiguration->tachOutputPin = Gpio::H144_OUT_IO13;
127
128 // "required" hardware is done - set some reasonable defaults
131
133 engineConfiguration->firingOrder = FO_1_3_4_2;
134
135 engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
136
137 engineConfiguration->launchActivationMode = CLUTCH_INPUT_LAUNCH;
138
139 engineConfiguration->vrThreshold[0].pin = Gpio::MM176_OUT_PWM11;
140 engineConfiguration->vrThreshold[1].pin = Gpio::MM176_OUT_PWM12;
141 //engineConfiguration->vrThreshold[2].pin = Gpio::MM176_OUT_PWM13;
142
143 hellenWbo();
144}
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
static void setupDefaultSensorInputs()
static void setIgnitionPins()
static void setInjectorPins()
void set8chanDefaultETBPins()
void hellenWbo()
void setHellenMMbaro()

Referenced by setup_custom_board_overrides().

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

◆ boardGetAnalogInputDiagnostic()

int boardGetAnalogInputDiagnostic ( adc_channel_e  hwChannel,
float  voltage 
)

Definition at line 262 of file board_configuration.cpp.

262 {
263 /* we do not check voltage for valid ragne yet */
264 (void)voltage;
265
266 switch (hwChannel) {
267 /* inputs that may be affected by incorrect reference voltage */
268 case MM176_IN_TPS_ANALOG:
269 case MM176_IN_TPS2_ANALOG:
270 case MM176_IN_PPS1_ANALOG:
271 case MM176_IN_PPS2_ANALOG:
272 case MM176_IN_IAT_ANALOG:
273 case MM176_IN_AT1_ANALOG:
274 case MM176_IN_CLT_ANALOG:
275 case MM176_IN_AT2_ANALOG:
276 //case MM176_IN_O2S_ANALOG:
277 //case MM176_IN_O2S2_ANALOG:
278 case MM176_IN_MAP1_ANALOG:
279 case MM176_IN_MAP2_ANALOG:
280 case MM176_IN_AUX1_ANALOG:
281 case MM176_IN_AUX2_ANALOG:
282 case MM176_IN_AUX3_ANALOG:
283 case MM176_IN_AUX4_ANALOG:
284 /* TODO: more? */
285 return (boardGetAnalogDiagnostic() == ObdCode::None) ? 0 : -1;
286 /* all other inputs should not rely on output 5V */
287 default:
288 return 0;
289 }
290
291 return 0;
292}
ObdCode boardGetAnalogDiagnostic()
Here is the call graph for this function:

◆ boardPrepareForStop()

void boardPrepareForStop ( )

Definition at line 146 of file board_configuration.cpp.

146 {
147 // Wake on the CAN RX pin
148 palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE);
149}

◆ customBoardOnConfigurationChange()

static void customBoardOnConfigurationChange ( engine_configuration_s )
static

Definition at line 90 of file board_configuration.cpp.

90 {
99}
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
Here is the call graph for this function:

◆ getBoardMetaDcOutputsCount()

int getBoardMetaDcOutputsCount ( )

Definition at line 246 of file board_configuration.cpp.

246 {
248 // STATIC_BOARD_ID_PLATINUM_GM_GEN4
249 return 1;
250 }
251 return 2;
252}

◆ getBoardMetaLowSideOutputsCount()

int getBoardMetaLowSideOutputsCount ( )

Definition at line 232 of file board_configuration.cpp.

232 {
235 }
236 return getBoardMetaOutputsCount() - 6;
237}
int getBoardMetaOutputsCount()
Here is the call graph for this function:

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 239 of file board_configuration.cpp.

239 {
241 return OUTPUTS_GM_GEN4;
242 }
243 return OUTPUTS;
244}
static Gpio OUTPUTS[]
static Gpio OUTPUTS_GM_GEN4[]

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 225 of file board_configuration.cpp.

225 {
227 return efi::size(OUTPUTS_GM_GEN4);
228 }
229 return efi::size(OUTPUTS);
230}

◆ set8chanDefaultETBPins()

void set8chanDefaultETBPins ( )

Definition at line 107 of file board_configuration.cpp.

107 {
108 setupTLE9201IncludingStepper(/*controlPin*/Gpio::MM176_OUT_PWM9, Gpio::MM176_GP6, Gpio::MM176_GP7);
109 setupTLE9201IncludingStepper(/*controlPin*/Gpio::MM176_OUT_PWM18, Gpio::MM176_GP10, Gpio::MM176_GP11, 1);
110}
void setupTLE9201IncludingStepper(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex)
Here is the call graph for this function:

◆ setIgnitionPins()

static void setIgnitionPins ( )
static

Definition at line 38 of file board_configuration.cpp.

38 {
39 engineConfiguration->ignitionPins[0] = Gpio::MM176_IGN1;
40 engineConfiguration->ignitionPins[1] = Gpio::MM176_IGN2;
41 engineConfiguration->ignitionPins[2] = Gpio::MM176_IGN3;
42 engineConfiguration->ignitionPins[3] = Gpio::MM176_IGN4;
43}

◆ setInjectorPins()

static void setInjectorPins ( )
static

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 254 of file board_configuration.cpp.

254 {
258
260}
std::optional< setup_custom_board_overrides_type > custom_board_InitHardware
Definition hardware.cpp:77
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
std::optional< setup_custom_board_config_type > custom_board_OnConfigurationChange
static void customBoardOnConfigurationChange(engine_configuration_s *)
static void alphax_8chan_defaultConfiguration()
static void alphax_8chan_boardInitHardware()
static void alphax_8chan_boardConfigOverrides()
Here is the call graph for this function:

◆ setupDefaultSensorInputs()

static void setupDefaultSensorInputs ( )
static

Definition at line 45 of file board_configuration.cpp.

45 {
46 // trigger inputs, VR/hall crank
47 engineConfiguration->triggerInputPins[0] = Gpio::MM176_USB1ID; // 1B
48// engineConfiguration->triggerInputPins[1] = Gpio::H144_IN_CAM;
49 engineConfiguration->camInputs[0] = Gpio::MM176_IN_D1; // 15A
50 engineConfiguration->camInputs[1] = Gpio::MM176_IN_D2;
51 engineConfiguration->camInputs[2] = Gpio::MM176_IN_D3; // 24A
52 engineConfiguration->camInputs[3] = Gpio::MM176_IN_D4; // 9A
53 engineConfiguration->vvtMode[0] = VVT_SINGLE_TOOTH;
54 engineConfiguration->vvtMode[1] = VVT_SINGLE_TOOTH;
55
56 setTPS1Inputs(MM176_IN_TPS_ANALOG, MM176_IN_TPS2_ANALOG);
57
58 setPPSInputs(MM176_IN_PPS1_ANALOG, MM176_IN_PPS2_ANALOG);
59
60 // random values to have valid config
63
64
65// engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2;
66 engineConfiguration->baroSensor.type = MT_MPXH6400;
67// engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3;
68
69 engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
70
71 engineConfiguration->clt.adcChannel = MM176_IN_CLT_ANALOG;
72
73 engineConfiguration->iat.adcChannel = MM176_IN_IAT_ANALOG;
74}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
Here is the call graph for this function:

Variable Documentation

◆ alphaCrankPPullUp

OutputPin alphaCrankPPullUp
static

Definition at line 16 of file board_configuration.cpp.

◆ alphaFlexPullDown

OutputPin alphaFlexPullDown
static

◆ alphaHall1PullDown

OutputPin alphaHall1PullDown
static

◆ alphaHall2PullDown

OutputPin alphaHall2PullDown
static

◆ alphaHall3PullDown

OutputPin alphaHall3PullDown
static

◆ alphaHall4PullDown

OutputPin alphaHall4PullDown
static

◆ alphaHall5PullDown

OutputPin alphaHall5PullDown
static

◆ OUTPUTS

Gpio OUTPUTS[]
static

Definition at line 167 of file board_configuration.cpp.

167 {
168 Gpio::MM176_INJ1, // 1D - Injector 1
169 Gpio::MM176_INJ2, // 2D - Injector 2
170 Gpio::MM176_INJ3, // 3D - Injector 3
171 Gpio::MM176_INJ4, // 4D - Injector 4
172 Gpio::MM176_INJ5, // 5D - Injector 5
173
174 Gpio::MM176_INJ6, // 6D - Injector 6
175 Gpio::MM176_INJ7, // 7D - Injector 7
176 Gpio::MM176_OUT_PWM1, // 8D - VVT 1
177 Gpio::MM176_GP3, // 9D - Fuel Pump
178 Gpio::MM176_GP2, // 10D - Fan
179
180 Gpio::MM176_GP1, // 11D - Main Relay
181 Gpio::MM176_OUT_IO8, // 12D - NOS
182 Gpio::MM176_INJ8, // 13D - Injector 8
183 Gpio::MM176_OUT_PWM2, // 14D - VVT 2
184 Gpio::MM176_OUT_IO13, // 15D - Tachometer
185
186 Gpio::MM176_OUT_PWM6, // 16C - Low Side 1
187 Gpio::MM176_GP17, // 19D - Injector 9
188 Gpio::MM176_OUT_PWM3, // 20D - VVT 3
189 Gpio::MM176_OUT_PWM4, // 21D - VVT 4
190 Gpio::MM176_OUT_PWM5, // 22C - Boost
191
192 Gpio::MM176_OUT_PWM7, // 23C - Low Side 2
193 Gpio::MM176_GP20, // 24D - Injector 12
194 Gpio::MM176_GP19, // 25D - Injector 11
195 Gpio::MM176_GP18, // 26D - Injector 10
196 Gpio::MM176_OUT_IO3, // 8C - Low Side 3
197
198 Gpio::MM176_OUT_IO4, // 9C - Low Side 4
199 Gpio::MM176_OUT_IO5, // 17C - Low Side 5
200 Gpio::MM176_OUT_IO6, // 25C - Low Side 6
201 Gpio::MM176_OUT_IO7, // 34C - Low Side 7
202 Gpio::MM176_OUT_PWM8, // 5C - High Side 1
203
204 Gpio::MM176_OUT_IO2, // 6C - High Side 2
205 Gpio::MM176_OUT_IO1, // 7C - High Side 3
206 Gpio::MM176_IGN1, // 11C - Ignition 1
207 Gpio::MM176_IGN3, // 13C - Ignition 3
208 Gpio::MM176_IGN5, // 14C - Ignition 5
209
210// Gpio::MM176_IGN8, // 15C - Ignition 8
211//
212// Gpio::MM176_IGN2, // 19C - Ignition 2
213// Gpio::MM176_IGN4, // 20C - Ignition 4
214// Gpio::MM176_IGN7, // 21C - Ignition 7
215// Gpio::MM176_SPI3_MISO, // 23C - Ignition 10
216//
217// Gpio::MM176_IGN6, // 28C - Ignition 6
218// Gpio::MM176_SPI3_SCK, // 29C - Ignition 9
219// Gpio::MM176_SPI3_MOSI, // 30C - Ignition 11
220// Gpio::MM176_SPI3_CS, // 31C - Ignition 12
221
222
223};

◆ OUTPUTS_GM_GEN4

Gpio OUTPUTS_GM_GEN4[]
static
Initial value:
= {
Gpio::MM176_INJ1,
Gpio::MM176_INJ2,
Gpio::MM176_INJ3,
Gpio::MM176_INJ4,
Gpio::MM176_INJ5,
Gpio::MM176_INJ6,
Gpio::MM176_INJ7,
Gpio::MM176_INJ8,
Gpio::MM176_GP1,
Gpio::MM176_GP2,
}

Definition at line 151 of file board_configuration.cpp.

151 {
152 Gpio::MM176_INJ1, // 1D - Injector 1
153 Gpio::MM176_INJ2, // 2D - Injector 2
154 Gpio::MM176_INJ3, // 3D - Injector 3
155 Gpio::MM176_INJ4, // 4D - Injector 4
156
157 Gpio::MM176_INJ5, // 5D - Injector 5
158 Gpio::MM176_INJ6, // 6D - Injector 6
159 Gpio::MM176_INJ7, // 7D - Injector 7
160 Gpio::MM176_INJ8, // 13D - Injector 8
161
162 Gpio::MM176_GP1, // 11D - Main Relay
163 Gpio::MM176_GP2, // 10D - Fan
164// Gpio::MM176_OUT_PWM1, // 8D - VVT 1
165};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ tempPullUp

OutputPin tempPullUp
static

Definition at line 24 of file board_configuration.cpp.

Go to the source code of this file.