rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
board_configuration.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "board_overrides.h"
3
4/**
5 * @brief Board-specific configuration defaults.
6
7 */
8
9/* NOTE:
10 * All outputs are in open drain mode as pull-up to 5V is
11 * used as level shifter for MOSFETs/IGBTs */
12
21
23 // this board has no warning led
24 return Gpio::Unassigned;
25}
26
28 // this board has no comms led
29 return Gpio::Unassigned;
30}
31
35
44
48
49 strcpy(engineConfiguration->engineMake, "UAZ");
50 strcpy(engineConfiguration->engineCode, "451");
51
52 // No LEDs on this board, do we need some unused pin tp toggle? PC14 of LSI did not work for blinking, any better alternatives?
53
56 engineConfiguration->tachOutputPin = Gpio::B8; /* not populated by default */
58 //engineConfiguration->idle.solenoidPin = ?
60 engineConfiguration->fanPin = Gpio::D6; /* not populated by default */
61 engineConfiguration->fanPinMode = OM_OPENDRAIN;
62 //engineConfiguration->mainRelayPin = ?;
64
66 engineConfiguration->firingOrder = FO_1_2_4_3;
67
68 engineConfiguration->ignitionMode = IM_WASTED_SPARK;
70 engineConfiguration->injectionMode = IM_SEQUENTIAL;
71
73
77 engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
81}
82
83static void setupVbatt() {
84 // There are two different input dividers:
85 // 22K (high) + 22K (low) on IAT and CLT
86 // 22K (high) + 41.2K (low) on TPS and MAP
88 // TODO: TPS and MAP
89 //engineConfiguration->analogInputDividerCoefficient = (22.0 + 41.2) / 22.0;
90
91 // 68K + 6.8k
92 engineConfiguration->vbattDividerCoeff = (68 + 6.8) / 6.8;
93
94 // pin input +12 from Main Relay
96
98}
99
101 setupVbatt();
102
103 //1.5K
106
107 //CAN 1 bus overwrites
110}
111
113 switch (hwChannel) {
114 /* MAP, TPS, MAF (na), AC press (na) */
115 case EFI_ADC_0:
116 case EFI_ADC_1:
117 case EFI_ADC_11:
118 case EFI_ADC_6:
119 return (22.0 + 41.2) / 41.2;
120
121 /* IAT, CLT */
122 case EFI_ADC_3:
123 case EFI_ADC_14:
124 /* no divider, 1.5K pull-up to 3.3V, 22K pull-down */
125 /* TODO: handle both pull-up and pull-down */
126 return 1.0;
127
128 /* AFR 1, AFR 2 (na), knock (TBD) */
129 case EFI_ADC_7:
130 case EFI_ADC_5:
131 case EFI_ADC_2:
132 /* no divider */
133 return 1.0;
134
135 /* +12 sense, Ignition switch */
136 case EFI_ADC_9:
137 case EFI_ADC_8:
138 return (68.0 + 6.8) / 6.8;
139
140 /* 5V feedback */
141 case EFI_ADC_10:
142 return (10.0 + 10.0) / 10.0;
143
144 /* Ignition feedback */
145 case EFI_ADC_12:
146 case EFI_ADC_13:
147 /* TBD */
148 return 1.0;
149
150 default:
152 }
154}
155
Gpio getWarningLedPin()
Gpio getCommsLedPin()
Gpio getRunningLedPin()
void setup_custom_board_overrides()
@ Unassigned
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
static constexpr engine_configuration_s * engineConfiguration
static void setIgnitionPins()
static void setInjectorPins()
static void setupVbatt()
float getAnalogInputDividerCoefficient(adc_channel_e hwChannel)
static void s105_boardDefaultConfiguration()
static void s105_boardConfigOverrides()
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]