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

Detailed Description

Configuration defaults for the Proteus board.

Author
Matthew Kennedy, (c) 2019

Definition in file board_configuration.cpp.

Functions

static void setInjectorPins ()
 
static void setIgnitionPins ()
 
Gpio getCommsLedPin ()
 
Gpio getRunningLedPin ()
 
Gpio getWarningLedPin ()
 
static void setupVbatt ()
 
static void setupEtb ()
 
static void setupDefaultSensorInputs ()
 
static void setupSdCard ()
 
static void proteus_boardConfigOverrides ()
 
static void proteus_boardDefaultConfiguration ()
 Board-specific configuration defaults.
 
void boardPrepareForStop ()
 
int getBoardMetaLowSideOutputsCount ()
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaDcOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
void setup_custom_board_overrides ()
 

Variables

static const brain_pin_e injPins []
 
static const brain_pin_e ignPins []
 
static Gpio PROTEUS_SLINGSHOT_OUTPUTS []
 
static Gpio PROTEUS_SBC_OUTPUTS []
 
static Gpio PROTEUS_M73_OUTPUTS []
 
static Gpio PROTEUS_SUBARU_OUTPUTS []
 
static Gpio PROTEUS_CANAM_OUTPUTS []
 
static Gpio PROTEUS_HARLEY_OUTPUTS []
 
static Gpio PROTEUS_OUTPUTS []
 

Function Documentation

◆ boardPrepareForStop()

void boardPrepareForStop ( )

Definition at line 186 of file board_configuration.cpp.

186 {
187 // Wake on the CAN RX pin
188 palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE);
189}

◆ getBoardMetaDcOutputsCount()

int getBoardMetaDcOutputsCount ( )

Definition at line 340 of file board_configuration.cpp.

340 {
342 return 2;
343 }
348 ) {
349 return 1;
350 }
351 return 1;
352/* return 2; proteus has two h-b ridges but stim board is short on channels to test :( */
353}
static constexpr engine_configuration_s * engineConfiguration

◆ getBoardMetaLowSideOutputsCount()

int getBoardMetaLowSideOutputsCount ( )

Definition at line 264 of file board_configuration.cpp.

Here is the call graph for this function:

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 355 of file board_configuration.cpp.

355 {
358 }
361 }
364 }
367 }
369 return PROTEUS_SBC_OUTPUTS;
370 }
372 return PROTEUS_M73_OUTPUTS;
373 }
374 return PROTEUS_OUTPUTS;
375}
static Gpio PROTEUS_M73_OUTPUTS[]
static Gpio PROTEUS_SUBARU_OUTPUTS[]
static Gpio PROTEUS_CANAM_OUTPUTS[]
static Gpio PROTEUS_HARLEY_OUTPUTS[]
static Gpio PROTEUS_OUTPUTS[]
static Gpio PROTEUS_SBC_OUTPUTS[]
static Gpio PROTEUS_SLINGSHOT_OUTPUTS[]

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 318 of file board_configuration.cpp.

318 {
320 return efi::size(PROTEUS_SUBARU_OUTPUTS);
321 }
323 return efi::size(PROTEUS_CANAM_OUTPUTS);
324 }
326 return efi::size(PROTEUS_SLINGSHOT_OUTPUTS);
327 }
329 return efi::size(PROTEUS_HARLEY_OUTPUTS);
330 }
332 return efi::size(PROTEUS_SBC_OUTPUTS);
333 }
335 return efi::size(PROTEUS_M73_OUTPUTS);
336 }
337 return efi::size(PROTEUS_OUTPUTS);
338}

◆ getCommsLedPin()

Gpio getCommsLedPin ( )

Definition at line 52 of file board_configuration.cpp.

52 {
53 return Gpio::E4;
54}

◆ getRunningLedPin()

Gpio getRunningLedPin ( )

Definition at line 56 of file board_configuration.cpp.

56 {
57 return Gpio::E5;
58}

◆ getWarningLedPin()

Gpio getWarningLedPin ( )

Definition at line 60 of file board_configuration.cpp.

60 {
61 return Gpio::E6;
62}

◆ proteus_boardConfigOverrides()

static void proteus_boardConfigOverrides ( )
static

Definition at line 138 of file board_configuration.cpp.

138 {
139 setupSdCard();
140 setupVbatt();
141
142 engineConfiguration->clt.config.bias_resistor = PROTEUS_DEFAULT_AT_PULLUP;
143 engineConfiguration->iat.config.bias_resistor = PROTEUS_DEFAULT_AT_PULLUP;
144
149
152}
static void setupVbatt()
static void setupSdCard()

Referenced by setup_custom_board_overrides().

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

◆ proteus_boardDefaultConfiguration()

static void proteus_boardDefaultConfiguration ( )
static

Board-specific configuration defaults.

See also setDefaultEngineConfiguration

Definition at line 161 of file board_configuration.cpp.

161 {
164 setupEtb();
165
167
168 // "required" hardware is done - set some reasonable defaults
170
172
173#if HW_PROTEUS & EFI_PROD_CODE
174 engineConfiguration->mainRelayPin = Gpio::PROTEUS_LS_12;
175 engineConfiguration->fanPin = Gpio::PROTEUS_LS_11;
176 engineConfiguration->fuelPumpPin = Gpio::PROTEUS_LS_10;
177#endif // HW_PROTEUS
178
179 // If we're running as hardware CI, borrow a few extra pins for that
180#ifdef HARDWARE_CI
183#endif
184}
static void setupDefaultSensorInputs()
static void setIgnitionPins()
static void setInjectorPins()
static void setupEtb()

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 47 of file board_configuration.cpp.

47 {
49}
static const brain_pin_e ignPins[]

◆ setInjectorPins()

static void setInjectorPins ( )
static

Definition at line 43 of file board_configuration.cpp.

43 {
45}
static const brain_pin_e injPins[]

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 378 of file board_configuration.cpp.

378 {
381}
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
static void proteus_boardConfigOverrides()
static void proteus_boardDefaultConfiguration()
Board-specific configuration defaults.
Here is the call graph for this function:

◆ setupDefaultSensorInputs()

static void setupDefaultSensorInputs ( )
static

Definition at line 104 of file board_configuration.cpp.

104 {
105 // trigger inputs
106 // Digital channel 1 as default - others not set
107 engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_1;
109
111
112
113 engineConfiguration->clt.adcChannel = PROTEUS_IN_CLT;
114 engineConfiguration->iat.adcChannel = PROTEUS_IN_IAT;
115 engineConfiguration->tps1_1AdcChannel = PROTEUS_IN_TPS;
116 engineConfiguration->map.sensor.hwChannel = PROTEUS_IN_MAP;
117
118 // see also enableAemXSeries
119 // pin #28 WBO AFR "Analog Volt 10"
120 engineConfiguration->afr.hwChannel = PROTEUS_IN_ANALOG_VOLT_10;
121}
@ Unassigned
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]

◆ setupEtb()

static void setupEtb ( )
static

Definition at line 77 of file board_configuration.cpp.

77 {
78 // TLE9201 driver
79 // This chip has three control pins:
80 // DIR - sets direction of the motor
81 // PWM - pwm control (enable high, coast low)
82 // DIS - disables motor (enable low)
83
84 // Throttle #1
85 // PWM pin
87 // DIR pin
89 // Disable pin
91
92 // Throttle #2
93 // PWM pin
95 // DIR pin
97 // Disable pin
99
100 // we only have pwm/dir, no dira/dirb
102}

◆ setupSdCard()

static void setupSdCard ( )
static

Definition at line 123 of file board_configuration.cpp.

123 {
124 engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
126
131
136}

Referenced by proteus_boardConfigOverrides().

Here is the caller graph for this function:

◆ setupVbatt()

static void setupVbatt ( )
static

Definition at line 64 of file board_configuration.cpp.

Variable Documentation

◆ ignPins

const brain_pin_e ignPins[]
static
Initial value:
= {
Gpio::PROTEUS_IGN_1,
Gpio::PROTEUS_IGN_2,
Gpio::PROTEUS_IGN_3,
Gpio::PROTEUS_IGN_4,
Gpio::PROTEUS_IGN_5,
Gpio::PROTEUS_IGN_6,
Gpio::PROTEUS_IGN_7,
Gpio::PROTEUS_IGN_8,
Gpio::PROTEUS_IGN_9,
Gpio::PROTEUS_IGN_10,
Gpio::PROTEUS_IGN_11,
Gpio::PROTEUS_IGN_12,
}

Definition at line 28 of file board_configuration.cpp.

28 {
29 Gpio::PROTEUS_IGN_1,
30 Gpio::PROTEUS_IGN_2,
31 Gpio::PROTEUS_IGN_3,
32 Gpio::PROTEUS_IGN_4,
33 Gpio::PROTEUS_IGN_5,
34 Gpio::PROTEUS_IGN_6,
35 Gpio::PROTEUS_IGN_7,
36 Gpio::PROTEUS_IGN_8,
37 Gpio::PROTEUS_IGN_9,
38 Gpio::PROTEUS_IGN_10,
39 Gpio::PROTEUS_IGN_11,
40 Gpio::PROTEUS_IGN_12,
41};

Referenced by setIgnitionPins().

◆ injPins

const brain_pin_e injPins[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_LS_3,
Gpio::PROTEUS_LS_4,
Gpio::PROTEUS_LS_5,
Gpio::PROTEUS_LS_6,
Gpio::PROTEUS_LS_7,
Gpio::PROTEUS_LS_8,
Gpio::PROTEUS_LS_9,
Gpio::PROTEUS_LS_10,
Gpio::PROTEUS_LS_11,
Gpio::PROTEUS_LS_12
}

Definition at line 13 of file board_configuration.cpp.

13 {
14 Gpio::PROTEUS_LS_1,
15 Gpio::PROTEUS_LS_2,
16 Gpio::PROTEUS_LS_3,
17 Gpio::PROTEUS_LS_4,
18 Gpio::PROTEUS_LS_5,
19 Gpio::PROTEUS_LS_6,
20 Gpio::PROTEUS_LS_7,
21 Gpio::PROTEUS_LS_8,
22 Gpio::PROTEUS_LS_9,
23 Gpio::PROTEUS_LS_10,
24 Gpio::PROTEUS_LS_11,
25 Gpio::PROTEUS_LS_12
26};

Referenced by setInjectorPins().

◆ PROTEUS_CANAM_OUTPUTS

Gpio PROTEUS_CANAM_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_LS_3,
Gpio::PROTEUS_LS_12,
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_15,
Gpio::PROTEUS_LS_4,
Gpio::PROTEUS_IGN_1,
Gpio::PROTEUS_IGN_2,
Gpio::PROTEUS_IGN_3,
}

Definition at line 242 of file board_configuration.cpp.

242 {
243 Gpio::PROTEUS_LS_1, // inj 1
244 Gpio::PROTEUS_LS_2, // inj 2
245 Gpio::PROTEUS_LS_3, // inj 3
246 Gpio::PROTEUS_LS_12, // main relay
247 Gpio::PROTEUS_LS_14, // starter
248 Gpio::PROTEUS_LS_15, // intercooler fan
249 Gpio::PROTEUS_LS_4, // accessories relay
250 Gpio::PROTEUS_IGN_1,
251 Gpio::PROTEUS_IGN_2,
252 Gpio::PROTEUS_IGN_3,
253};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_HARLEY_OUTPUTS

Gpio PROTEUS_HARLEY_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_IGN_1,
Gpio::PROTEUS_IGN_2,
Gpio::PROTEUS_IGN_8,
Gpio::PROTEUS_IGN_9,
}

Definition at line 255 of file board_configuration.cpp.

255 {
256 Gpio::PROTEUS_LS_1,
257 Gpio::PROTEUS_LS_2,
258 Gpio::PROTEUS_IGN_1,
259 Gpio::PROTEUS_IGN_2,
260 Gpio::PROTEUS_IGN_8, // ACR
261 Gpio::PROTEUS_IGN_9, // ACR2
262};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_M73_OUTPUTS

Gpio PROTEUS_M73_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_LS_3,
Gpio::PROTEUS_LS_4,
Gpio::PROTEUS_LS_5,
Gpio::PROTEUS_LS_6,
Gpio::PROTEUS_LS_7,
Gpio::PROTEUS_LS_8,
Gpio::PROTEUS_LS_9,
Gpio::PROTEUS_LS_10,
Gpio::PROTEUS_LS_11,
Gpio::PROTEUS_LS_12,
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_15,
}

Definition at line 212 of file board_configuration.cpp.

212 {
213 Gpio::PROTEUS_LS_1, // inj 1
214 Gpio::PROTEUS_LS_2, // inj 2
215 Gpio::PROTEUS_LS_3,
216 Gpio::PROTEUS_LS_4,
217 Gpio::PROTEUS_LS_5,
218 Gpio::PROTEUS_LS_6,
219 Gpio::PROTEUS_LS_7,
220 Gpio::PROTEUS_LS_8,
221 Gpio::PROTEUS_LS_9, // inj 9
222 Gpio::PROTEUS_LS_10, // inj 10
223 Gpio::PROTEUS_LS_11, // inj 11
224 Gpio::PROTEUS_LS_12, // inj 12
225 Gpio::PROTEUS_LS_14, // starter control or aux output
226 Gpio::PROTEUS_LS_15, // radiator fan relay output white
227
228
229 //Gpio::PROTEUS_LS_13, // main relay
230 //Gpio::PROTEUS_LS_16, // main relay
231};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_OUTPUTS

Gpio PROTEUS_OUTPUTS[]
static

Definition at line 283 of file board_configuration.cpp.

283 {
284Gpio::PROTEUS_LS_1,
285Gpio::PROTEUS_LS_2,
286Gpio::PROTEUS_LS_3,
287Gpio::PROTEUS_LS_4,
288Gpio::PROTEUS_LS_5,
289Gpio::PROTEUS_LS_6,
290Gpio::PROTEUS_LS_7,
291Gpio::PROTEUS_LS_8,
292Gpio::PROTEUS_LS_9,
293Gpio::PROTEUS_LS_10,
294Gpio::PROTEUS_LS_11,
295Gpio::PROTEUS_LS_12,
296Gpio::PROTEUS_LS_13,
297Gpio::PROTEUS_LS_14,
298Gpio::PROTEUS_LS_15,
299Gpio::PROTEUS_LS_16,
300 Gpio::PROTEUS_IGN_1,
301 Gpio::PROTEUS_IGN_2,
302 Gpio::PROTEUS_IGN_3,
303 Gpio::PROTEUS_IGN_4,
304 Gpio::PROTEUS_IGN_5,
305 Gpio::PROTEUS_IGN_6,
306 Gpio::PROTEUS_IGN_7,
307 Gpio::PROTEUS_IGN_8,
308 Gpio::PROTEUS_IGN_9,
309 Gpio::PROTEUS_IGN_10,
310 Gpio::PROTEUS_IGN_11,
311 Gpio::PROTEUS_IGN_12,
312 Gpio::PROTEUS_HS_1,
313 Gpio::PROTEUS_HS_2,
314 Gpio::PROTEUS_HS_3,
315 Gpio::PROTEUS_HS_4
316};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_SBC_OUTPUTS

Gpio PROTEUS_SBC_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_14,
Gpio::PROTEUS_LS_15,
Gpio::PROTEUS_LS_15,
Gpio::PROTEUS_LS_15,
Gpio::PROTEUS_LS_15,
}

Definition at line 199 of file board_configuration.cpp.

199 {
200 Gpio::PROTEUS_LS_14, // inj 1 four times
201 Gpio::PROTEUS_LS_14, // inj 1 four times
202 Gpio::PROTEUS_LS_14, // inj 1 four times
203 Gpio::PROTEUS_LS_14, // inj 1 four times
204
205 Gpio::PROTEUS_LS_15, // inj 4 four times
206 Gpio::PROTEUS_LS_15, // inj 4 four times
207 Gpio::PROTEUS_LS_15, // inj 4 four times
208 Gpio::PROTEUS_LS_15, // inj 4 four times
209
210};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_SLINGSHOT_OUTPUTS

Gpio PROTEUS_SLINGSHOT_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_LS_3,
Gpio::PROTEUS_LS_4,
}

Definition at line 192 of file board_configuration.cpp.

192 {
193 Gpio::PROTEUS_LS_1, // inj 1
194 Gpio::PROTEUS_LS_2, // inj 2
195 Gpio::PROTEUS_LS_3, // inj 3
196 Gpio::PROTEUS_LS_4, // inj 4
197};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

◆ PROTEUS_SUBARU_OUTPUTS

Gpio PROTEUS_SUBARU_OUTPUTS[]
static
Initial value:
= {
Gpio::PROTEUS_LS_1,
Gpio::PROTEUS_LS_2,
Gpio::PROTEUS_LS_3,
Gpio::PROTEUS_LS_4,
Gpio::PROTEUS_LS_12,
Gpio::PROTEUS_LS_14,
}

Definition at line 233 of file board_configuration.cpp.

233 {
234 Gpio::PROTEUS_LS_1, // inj 1
235 Gpio::PROTEUS_LS_2, // inj 2
236 Gpio::PROTEUS_LS_3, // inj 3
237 Gpio::PROTEUS_LS_4, // inj 4
238 Gpio::PROTEUS_LS_12, // main relay
239 Gpio::PROTEUS_LS_14, // starter
240};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

Go to the source code of this file.