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_silver_boardConfigOverrides ()
 
static void alphax_silver_boardDefaultConfiguration ()
 
static void board_init_ext_gpios ()
 
static void alphax_silver_boardInitHardware ()
 Board-specific initialization code.
 
void boardOnConfigurationChange (engine_configuration_s *)
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaLowSideOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
void setup_custom_board_overrides ()
 

Variables

static OutputPin alphaTempPullUp
 
static OutputPin alphaTachSelPullUp
 
static OutputPin alphaHall1PullUp
 
static OutputPin alphaHall2PullUp
 
static OutputPin alphaHall34PullUp
 
static const tle9104_config tle9104_cfg [BOARD_TLE9104_COUNT]
 
static Gpio OUTPUTS []
 

Function Documentation

◆ alphax_silver_boardConfigOverrides()

static void alphax_silver_boardConfigOverrides ( )
static

Definition at line 43 of file board_configuration.cpp.

43 {
44 /* Force PWR_EN as TLE9104s are powered from +5VA */
46
49
50 /* Two TLE9104 */
52 engineConfiguration->vrThreshold[0].pin = Gpio::MM100_OUT_PWM2;
53}
static constexpr engine_configuration_s * engineConfiguration
void setHellenCan()
void hellenMegaModule()
void setHellenMegaEnPin(bool enableBoardOnStartUp)
static void enableHellenSpi3()

Referenced by setup_custom_board_overrides().

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

◆ alphax_silver_boardDefaultConfiguration()

static void alphax_silver_boardDefaultConfiguration ( )
static

Definition at line 55 of file board_configuration.cpp.

55 {
60 setInline4();
61}
void setInline4()
static void setupDefaultSensorInputs()
static void setIgnitionPins()
static void setInjectorPins()
void setHellenMMbaro()

Referenced by setup_custom_board_overrides().

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

◆ alphax_silver_boardInitHardware()

static void alphax_silver_boardInitHardware ( )
static

Board-specific initialization code.

Definition at line 206 of file board_configuration.cpp.

206 {
207 alphaTempPullUp.initPin("a-temp", Gpio::MM100_IGN8); // E6
208 alphaTachSelPullUp.initPin("Tach PullUp", Gpio::MM100_OUT_PWM1);
209 alphaHall1PullUp.initPin("hall1 PullUp", Gpio::MM100_IGN5);
210 alphaHall2PullUp.initPin("hall2 PullUp", Gpio::MM100_IGN6);
211 alphaHall34PullUp.initPin("hall3 PullUp", Gpio::MM100_IGN7);
213}
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
Definition efi_gpio.cpp:711
static OutputPin alphaTempPullUp
static OutputPin alphaHall1PullUp
static void board_init_ext_gpios()
static OutputPin alphaTachSelPullUp
static OutputPin alphaHall2PullUp
static OutputPin alphaHall34PullUp

Referenced by setup_custom_board_overrides().

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

◆ board_init_ext_gpios()

static void board_init_ext_gpios ( )
static

Definition at line 172 of file board_configuration.cpp.

172 {
173 /* Waste of RAM, switch to palSetPadMode() and palSetPort() */
174 {
175 static OutputPin TleCs0;
176 TleCs0.initPin("TLE9104 CS0", Gpio::A15);
177 TleCs0.setValue(1);
178 }
179 {
180 static OutputPin TleCs1;
181 TleCs1.initPin("TLE9104 CS1", Gpio::B12);
182 TleCs1.setValue(1);
183 }
184 {
185 static OutputPin TleCs2;
186 TleCs2.initPin("TLE9104 CS2", Gpio::E1);
187 TleCs2.setValue(1);
188 }
189
190 {
191 static OutputPin TleReset;
192 TleReset.initPin("TLE9104 Reset", Gpio::B14);
193 TleReset.setValue(1);
194
195 static OutputPin TleEn;
196 TleEn.initPin("TLE9104 En", Gpio::B15);
197 TleEn.setValue(1);
198 }
199
201}
Single output pin reference and state.
Definition efi_output.h:49
void setValue(const char *msg, int logicValue, bool isForce=false)
Definition efi_gpio.cpp:604
static const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT]
void initAll9104(const tle9104_config *configs)
Definition tle9104.cpp:568
Here is the call graph for this function:

◆ boardOnConfigurationChange()

void boardOnConfigurationChange ( engine_configuration_s previousConfiguration)

◆ getBoardMetaLowSideOutputsCount()

int getBoardMetaLowSideOutputsCount ( )

Definition at line 244 of file board_configuration.cpp.

244 {
245 return getBoardMetaOutputsCount() - 4;
246}
int getBoardMetaOutputsCount()
Here is the call graph for this function:

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 248 of file board_configuration.cpp.

248 {
249 return OUTPUTS;
250}
static Gpio OUTPUTS[]

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 240 of file board_configuration.cpp.

240 {
241 return efi::size(OUTPUTS);
242}

◆ setIgnitionPins()

static void setIgnitionPins ( )
static

Definition at line 23 of file board_configuration.cpp.

23 {
24 engineConfiguration->ignitionPins[0] = Gpio::MM100_IGN1;
25 engineConfiguration->ignitionPins[1] = Gpio::MM100_IGN2;
26 engineConfiguration->ignitionPins[2] = Gpio::MM100_IGN3;
27 engineConfiguration->ignitionPins[3] = Gpio::MM100_IGN4;
28}

◆ setInjectorPins()

static void setInjectorPins ( )
static

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 252 of file board_configuration.cpp.

252 {
256}
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_silver_boardDefaultConfiguration()
static void alphax_silver_boardInitHardware()
Board-specific initialization code.
static void alphax_silver_boardConfigOverrides()
Here is the call graph for this function:

◆ setupDefaultSensorInputs()

static void setupDefaultSensorInputs ( )
static

Definition at line 30 of file board_configuration.cpp.

Variable Documentation

◆ alphaHall1PullUp

OutputPin alphaHall1PullUp
static

Definition at line 12 of file board_configuration.cpp.

◆ alphaHall2PullUp

OutputPin alphaHall2PullUp
static

Definition at line 13 of file board_configuration.cpp.

◆ alphaHall34PullUp

OutputPin alphaHall34PullUp
static

◆ alphaTachSelPullUp

OutputPin alphaTachSelPullUp
static

Definition at line 11 of file board_configuration.cpp.

◆ alphaTempPullUp

OutputPin alphaTempPullUp
static

Definition at line 10 of file board_configuration.cpp.

◆ OUTPUTS

Gpio OUTPUTS[]
static
Initial value:
= {
Gpio::MM100_IGN4,
Gpio::MM100_IGN1,
Gpio::MM100_IGN2,
Gpio::MM100_IGN3,
}
@ TLE9104_1_OUT_0
@ TLE9104_1_OUT_2
@ TLE9104_1_OUT_1

Definition at line 223 of file board_configuration.cpp.

223 {
224 Gpio::TLE9104_0_OUT_3, // 1A - Injector 4
225 Gpio::TLE9104_0_OUT_1, // 2A - Injector 3
226 Gpio::TLE9104_0_OUT_2, // 3A - Injector 2
227 Gpio::TLE9104_0_OUT_0, // 4A - Injector 1
228 Gpio::TLE9104_1_OUT_1, // 5A - Fuel Pump Relay
229 Gpio::TLE9104_1_OUT_2, // 6A - Idle Output
230 Gpio::TLE9104_1_OUT_0, // 14A - Tach Output
231// Gpio::TLE9104_2_OUT_0, // J10.4 - OUT_VVT1
232// Gpio::TLE9104_2_OUT_1, // J10.5 - OUT_VVT2
233// Gpio::TLE9104_2_OUT_3, // J10.2 - OUT_BOOST
234 Gpio::MM100_IGN4,
235 Gpio::MM100_IGN1,
236 Gpio::MM100_IGN2,
237 Gpio::MM100_IGN3,
238};

◆ tle9104_cfg

const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT]
static

Definition at line 70 of file board_configuration.cpp.

70 {
71 {
72 .spi_bus = &SPID3,
73 .spi_config = {
74 .circular = false,
75#ifdef _CHIBIOS_RT_CONF_VER_6_1_
76 .end_cb = nullptr,
77#else
78 .slave = false,
79 .data_cb = nullptr,
80 .error_cb = nullptr,
81#endif
82 // 9104_CSN_INJ
83 .ssport = GPIOA,
84 .sspad = 15,
85 .cr1 =
86 SPI_CR1_16BIT_MODE |
87 SPI_CR1_SSM |
88 SPI_CR1_SSI |
89 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
90 SPI_CR1_MSTR |
91 SPI_CR1_CPHA |
92 0,
93 .cr2 = SPI_CR2_16BIT_MODE
94 },
95 .direct_io = {
96 { .port = GPIOD, .pad = 3 }, // INJ1
97 { .port = GPIOD, .pad = 11 }, // INJ3
98 { .port = GPIOA, .pad = 9 }, // INJ2
99 { .port = GPIOD, .pad = 10 } // INJ4
100 },
101 .resn = Gpio::Unassigned, //Gpio::B14,
102 .en = Gpio::Unassigned //Gpio::B15
103 },
104 {
105 .spi_bus = &SPID3,
106 .spi_config = {
107 .circular = false,
108#ifdef _CHIBIOS_RT_CONF_VER_6_1_
109 .end_cb = nullptr,
110#else
111 .slave = false,
112 .data_cb = nullptr,
113 .error_cb = nullptr,
114#endif
115 // 9104_CSN_LS
116 .ssport = GPIOB,
117 .sspad = 12,
118 .cr1 =
119 SPI_CR1_16BIT_MODE |
120 SPI_CR1_SSM |
121 SPI_CR1_SSI |
122 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
123 SPI_CR1_MSTR |
124 SPI_CR1_CPHA |
125 0,
126 .cr2 = SPI_CR2_16BIT_MODE
127 },
128 .direct_io = {
129 { .port = GPIOA, .pad = 8 }, // TACH
130 { .port = GPIOD, .pad = 15 }, // PUMP_RELAY
131 { .port = GPIOD, .pad = 2 }, // IDLE
132 { .port = NULL, .pad = 0 } // no used, grounded
133 },
134 .resn = Gpio::Unassigned, //Gpio::B14,
135 .en = Gpio::Unassigned //Gpio::B15
136 },
137 {
138 .spi_bus = &SPID3,
139 .spi_config = {
140 .circular = false,
141#ifdef _CHIBIOS_RT_CONF_VER_6_1_
142 .end_cb = nullptr,
143#else
144 .slave = false,
145 .data_cb = nullptr,
146 .error_cb = nullptr,
147#endif
148 // 9104_CSN_LS2
149 .ssport = GPIOE,
150 .sspad = 1,
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 = GPIOD, .pad = 12 }, // VVT1
163 { .port = GPIOD, .pad = 14 }, // VVT2
164 { .port = NULL, .pad = 0 }, // no used, grounded
165 { .port = GPIOA, .pad = 10 } // BOOST
166 },
167 .resn = Gpio::Unassigned, //Gpio::B14,
168 .en = Gpio::Unassigned //Gpio::B15
169 }
170};
@ Unassigned

Go to the source code of this file.