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

Functions

static void alphax_4kgdi_boardConfigOverrides ()
 
static void alphax_4kgdi_defaultConfiguration ()
 
static void alphax_4kGDI_boardInitHardware ()
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaLowSideOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
int getBoardMetaDcOutputsCount ()
 
void setup_custom_board_overrides ()
 

Variables

static OutputPin tempPullUp
 
static const tle9104_config tle9104_cfg [BOARD_TLE9104_COUNT]
 
static Gpio OUTPUTS []
 

Function Documentation

◆ alphax_4kgdi_boardConfigOverrides()

static void alphax_4kgdi_boardConfigOverrides ( )
static

Definition at line 10 of file board_configuration.cpp.

10 {
14 setupTLE9201(/*PWM controlPin*/Gpio::H144_OUT_PWM2, Gpio::H144_OUT_PWM3, Gpio::H144_OUT_PWM1);
18
19
22 engineConfiguration->mc33816_rstb = Gpio::H144_LS_8;
23 engineConfiguration->mc33816_driven = Gpio::H144_LS_7;
24 engineConfiguration->mc33816_flag0 = Gpio::H144_IN_RES3;
25}
void setupTLE9201(Gpio controlPin, Gpio direction, Gpio disable, int dcIndex)
static constexpr engine_configuration_s * engineConfiguration
void hellenMegaSdWithAccelerometer()
void setHellenCan()
void setHellenVbatt()
void setHellenMMbaro()
static void enableHellenSpi2()
void setDefaultHellenAtPullUps(float pullup=HELLEN_DEFAULT_AT_PULLUP)

Referenced by setup_custom_board_overrides().

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

◆ alphax_4kGDI_boardInitHardware()

static void alphax_4kGDI_boardInitHardware ( )
static

Definition at line 204 of file board_configuration.cpp.

204 {
206 {
207 static OutputPin csLs1;
208 csLs1.initPin("csLs1", Gpio::H144_GP_IO1);
209 csLs1.setValue(1);
210 }
211 {
212 static OutputPin csLs2;
213 csLs2.initPin("csLs2", Gpio::H144_GP_IO2);
214 csLs2.setValue(1);
215 }
216 {
217 static OutputPin csLs3;
218 csLs3.initPin("csLs3", Gpio::H144_GP_IO3);
219 csLs3.setValue(1);
220 }
221 {
222 static OutputPin csLs4;
223 csLs4.initPin("csLs4", Gpio::H144_GP_IO4);
224 csLs4.setValue(1);
225 }
226 {
227 static OutputPin TleEn;
228 TleEn.initPin("TLE9104 En", Gpio::H144_UART8_RX);
229 TleEn.setValue(1);
230 }
231 {
232 static OutputPin TleReset;
233 TleReset.initPin("TLE9104 Reset", Gpio::H144_UART8_TX);
234 TleReset.setValue(1);
235 }
236 {
237 static OutputPin csDcEtb;
238 csDcEtb.initPin("cs-dc-etb", Gpio::H144_GP_IO5);
239 csDcEtb.setValue(1);
240 }
241 {
242 static OutputPin csDcAux;
243 csDcAux.initPin("cs-dc-aux", Gpio::H144_GP_IO6);
244 csDcAux.setValue(1);
245 }
246
248 tempPullUp.initPin("Temp PullUp", Gpio::MM176_USB1ID);
249}
Single output pin reference and state.
Definition efi_output.h:49
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
Definition efi_gpio.cpp:711
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
static const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT]
static OutputPin tempPullUp
void setHellenMegaEnPin(bool enableBoardOnStartUp)
void initAll9104(const tle9104_config *configs)
Definition tle9104.cpp:568

Referenced by setup_custom_board_overrides().

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

◆ alphax_4kgdi_defaultConfiguration()

static void alphax_4kgdi_defaultConfiguration ( )
static

Definition at line 27 of file board_configuration.cpp.

27 {
28 engineConfiguration->ignitionPins[0] = Gpio::H144_IGN_1;
29 engineConfiguration->ignitionPins[1] = Gpio::H144_IGN_2;
30 engineConfiguration->ignitionPins[2] = Gpio::H144_IGN_3;
31 engineConfiguration->ignitionPins[3] = Gpio::H144_IGN_4;
32
33 engineConfiguration->injectionPins[0] = Gpio::H144_LS_1;
34 engineConfiguration->injectionPins[1] = Gpio::H144_LS_2;
35 engineConfiguration->injectionPins[2] = Gpio::H144_LS_3;
36 engineConfiguration->injectionPins[3] = Gpio::H144_LS_4;
37
40
41 hellenWbo();
43
44 // port injectors
45// engineConfiguration->injectionPins[0] = Gpio::TLE9104_0_OUT_0;
46// engineConfiguration->injectionPins[1] = Gpio::TLE9104_0_OUT_1;
47// engineConfiguration->injectionPins[2] = Gpio::TLE9104_0_OUT_2;
48// engineConfiguration->injectionPins[3] = Gpio::TLE9104_0_OUT_3;
49
50 engineConfiguration->hpfpValvePin = Gpio::H144_LS_6; // start 6
51
56
57 engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_CRANK; // max9924 is the safer default
58 engineConfiguration->camInputs[0] = Gpio::H144_IN_SENS1; // Digital Input 1
59 engineConfiguration->camInputs[1] = Gpio::H144_IN_SENS2; // Digital Input 3
60
61 engineConfiguration->lowPressureFuel.hwChannel = H144_IN_AUX4_ANALOG;
65
67 engineConfiguration->clt.adcChannel = H144_IN_CLT;
68 engineConfiguration->iat.adcChannel = H144_IN_IAT;
69 setTPS1Inputs(H144_IN_TPS, H144_IN_TPS2);
70 setPPSInputs(H144_IN_PPS, H144_IN_PPS2);
71}
@ TLE9104_2_OUT_0
@ TLE9104_1_OUT_0
@ TLE9104_1_OUT_2
@ TLE9104_1_OUT_1
@ TLE9104_2_OUT_1
@ TLE9104_1_OUT_3
void setGDIFueling()
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
static constexpr persistent_config_s * config
void hellenWbo()
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:

◆ getBoardMetaDcOutputsCount()

int getBoardMetaDcOutputsCount ( )

Definition at line 284 of file board_configuration.cpp.

284 {
285 return 1;
286}

◆ getBoardMetaLowSideOutputsCount()

int getBoardMetaLowSideOutputsCount ( )

Definition at line 276 of file board_configuration.cpp.

276 {
277 return getBoardMetaOutputsCount() - 4;
278}
int getBoardMetaOutputsCount()

Referenced by sendOutBoardMeta().

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

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 280 of file board_configuration.cpp.

280 {
281 return OUTPUTS;
282}
static Gpio OUTPUTS[]

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 272 of file board_configuration.cpp.

272 {
273 return efi::size(OUTPUTS);
274}

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 288 of file board_configuration.cpp.

288 {
292}
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
static void alphax_4kgdi_defaultConfiguration()
static void alphax_4kgdi_boardConfigOverrides()
static void alphax_4kGDI_boardInitHardware()
Here is the call graph for this function:

Variable Documentation

◆ OUTPUTS

Gpio OUTPUTS[]
static
Initial value:

Definition at line 251 of file board_configuration.cpp.

251 {
252 Gpio::TLE9104_0_OUT_0, // 4B Port injector 1
253 Gpio::TLE9104_0_OUT_1, // 3B Port injector 2
254 Gpio::TLE9104_0_OUT_2, // 2B Port injector 3
255 Gpio::TLE9104_0_OUT_3, // 1B Port injector 4
256 Gpio::TLE9104_1_OUT_0, // 5B Main Relay Control
257 Gpio::TLE9104_1_OUT_1, // 7B Fuel Pump
258 Gpio::TLE9104_1_OUT_2, // 8B Fan 1
259 Gpio::TLE9104_1_OUT_3, // 9B Fan 2
260 Gpio::TLE9104_2_OUT_0, // 29B VVT1
261 Gpio::TLE9104_2_OUT_1, // 30B VVT2
262 Gpio::TLE9104_2_OUT_2, // 31B VVT3
263 Gpio::TLE9104_2_OUT_3, // 32B VVT4
264 Gpio::TLE9104_3_OUT_0, // 33A Wastegate Solenoid
265 Gpio::TLE9104_3_OUT_1, // 34A AC Control
266 Gpio::H144_IGN_4, // 11A Ignition 4
267 Gpio::H144_IGN_3, // 12A Ignition 3
268 Gpio::H144_IGN_2, // 13A Ignition 2
269 Gpio::H144_IGN_1, // 14A Ignition 1
270};

◆ tempPullUp

OutputPin tempPullUp
static

◆ tle9104_cfg

const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT]
static

Definition at line 73 of file board_configuration.cpp.

73 {
74 {
75 .spi_bus = &SPID2,
76 .spi_config = {
77 .circular = false,
78#ifdef _CHIBIOS_RT_CONF_VER_6_1_
79 .end_cb = nullptr,
80#else
81 .slave = false,
82 .data_cb = nullptr,
83 .error_cb = nullptr,
84#endif
85 .ssport = GPIOD, // H144_GP_IO1
86 .sspad = 4,
87 .cr1 =
88 SPI_CR1_16BIT_MODE |
89 SPI_CR1_SSM |
90 SPI_CR1_SSI |
91 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
92 SPI_CR1_MSTR |
93 SPI_CR1_CPHA |
94 0,
95 .cr2 = SPI_CR2_16BIT_MODE
96 },
97 .direct_io = {
98 { .port = GPIOD, .pad = 3 }, // H144_OUT_IO1
99 { .port = GPIOA, .pad = 9 }, // H144_OUT_IO2
100 { .port = GPIOG, .pad = 14 }, // H144_OUT_IO3
101 { .port = GPIOG, .pad = 5 } // H144_OUT_IO4
102 },
103 .resn = Gpio::Unassigned,
104 .en = Gpio::Unassigned
105 },
106 {
107 .spi_bus = &SPID2,
108 .spi_config = {
109 .circular = false,
110#ifdef _CHIBIOS_RT_CONF_VER_6_1_
111 .end_cb = nullptr,
112#else
113 .slave = false,
114 .data_cb = nullptr,
115 .error_cb = nullptr,
116#endif
117 .ssport = GPIOD, // H144_GP_IO2
118 .sspad = 7,
119 .cr1 =
120 SPI_CR1_16BIT_MODE |
121 SPI_CR1_SSM |
122 SPI_CR1_SSI |
123 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
124 SPI_CR1_MSTR |
125 SPI_CR1_CPHA |
126 0,
127 .cr2 = SPI_CR2_16BIT_MODE
128 },
129 .direct_io = {
130 { .port = GPIOD, .pad = 2 }, // H144_OUT_IO5
131 { .port = GPIOG, .pad = 11 }, // H144_OUT_IO6
132 { .port = GPIOG, .pad = 3 }, // H144_OUT_IO7
133 { .port = GPIOG, .pad = 4 } // H144_OUT_IO8
134 },
135 .resn = Gpio::Unassigned,
136 .en = Gpio::Unassigned
137 },
138 {
139 .spi_bus = &SPID2,
140 .spi_config = {
141 .circular = false,
142#ifdef _CHIBIOS_RT_CONF_VER_6_1_
143 .end_cb = nullptr,
144#else
145 .slave = false,
146 .data_cb = nullptr,
147 .error_cb = nullptr,
148#endif
149 .ssport = GPIOG, // H144_GP_IO3
150 .sspad = 10,
151 .cr1 =
152 SPI_CR1_16BIT_MODE |
153 SPI_CR1_SSM |
154 SPI_CR1_SSI |
155 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
156 SPI_CR1_MSTR |
157 SPI_CR1_CPHA |
158 0,
159 .cr2 = SPI_CR2_16BIT_MODE
160 },
161 .direct_io = {
162 { .port = GPIOG, .pad = 13 }, // H144_OUT_IO9
163 { .port = GPIOG, .pad = 12 }, // H144_OUT_IO10
164 { .port = GPIOG, .pad = 2 }, // H144_OUT_IO11 vvt3
165 { .port = GPIOA, .pad = 8 } // H144_OUT_IO12
166 },
167 .resn = Gpio::Unassigned,
168 .en = Gpio::Unassigned
169 },
170 {
171 .spi_bus = &SPID2,
172 .spi_config = {
173 .circular = false,
174#ifdef _CHIBIOS_RT_CONF_VER_6_1_
175 .end_cb = nullptr,
176#else
177 .slave = false,
178 .data_cb = nullptr,
179 .error_cb = nullptr,
180#endif
181 .ssport = GPIOG, // H144_GP_IO4
182 .sspad = 9,
183 .cr1 =
184 SPI_CR1_16BIT_MODE |
185 SPI_CR1_SSM |
186 SPI_CR1_SSI |
187 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
188 SPI_CR1_MSTR |
189 SPI_CR1_CPHA |
190 0,
191 .cr2 = SPI_CR2_16BIT_MODE
192 },
193 .direct_io = {
194 { .port = GPIOG, .pad = 6 }, // H144_OUT_IO13
195 { .port = GPIOF, .pad = 15 }, // H144_GP_IO7
196 { .port = nullptr, .pad = 0 }, // unused
197 { .port = nullptr, .pad = 0 } // unused
198 },
199 .resn = Gpio::Unassigned,
200 .en = Gpio::Unassigned
201 }
202 };
@ Unassigned
SPIDriver SPID2
SPI1 driver identifier.
Definition hal_spi_lld.c:47

Referenced by alphax_4kGDI_boardInitHardware(), and board_init_ext_gpios().

Go to the source code of this file.