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

Functions

Gpio getCommsLedPin ()
 
Gpio getWarningLedPin ()
 
Gpio getRunningLedPin ()
 
static void setInjectorPins ()
 
static void setIgnitionPins ()
 
static void setupEtb ()
 
static void m74_9_boardDefaultConfiguration ()
 Board-specific configuration defaults.
 
static void m74_9_boardConfigOverrides ()
 
static void board_init_ext_gpios ()
 
void boardInit ()
 Board-specific initialization code.
 
int getBoardMetaOutputsCount ()
 
int getBoardMetaDcOutputsCount ()
 
void setup_custom_board_overrides ()
 

Variables

static struct l9779_config l9779_cfg
 
static Gpio OUTPUTS []
 

Function Documentation

◆ board_init_ext_gpios()

static void board_init_ext_gpios ( )
static

Definition at line 152 of file board_configuration.cpp.

153{
154 int ret;
155
157 if (ret < 0) {
158 /* error */
159 }
160}
@ L9779_IGN_1
int l9779_add(brain_pin_e base, unsigned int index, const l9779_config *cfg)
L9779 driver add.
Definition l9779.cpp:733
static struct l9779_config l9779_cfg
Here is the call graph for this function:

◆ boardInit()

void boardInit ( void  )

Board-specific initialization code.

Definition at line 165 of file board_configuration.cpp.

165 {
167}
static void board_init_ext_gpios()
Here is the call graph for this function:

◆ getBoardMetaDcOutputsCount()

int getBoardMetaDcOutputsCount ( )

Definition at line 190 of file board_configuration.cpp.

190 {
191 return 1;
192}

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 186 of file board_configuration.cpp.

186 {
187 return efi::size(OUTPUTS);
188}
static Gpio OUTPUTS[]

◆ getCommsLedPin()

Gpio getCommsLedPin ( )

Definition at line 8 of file board_configuration.cpp.

8 {
9 // this board has LEDs
10 return Gpio::Unassigned;
11}
@ Unassigned

◆ getRunningLedPin()

Gpio getRunningLedPin ( )

Definition at line 18 of file board_configuration.cpp.

18 {
19 // this board has LEDs
20 return Gpio::Unassigned;
21}

◆ getWarningLedPin()

Gpio getWarningLedPin ( )

Definition at line 13 of file board_configuration.cpp.

13 {
14 // this board has LEDs
15 return Gpio::Unassigned;
16}

◆ m74_9_boardConfigOverrides()

static void m74_9_boardConfigOverrides ( )
static

Definition at line 102 of file board_configuration.cpp.

Referenced by setup_custom_board_overrides().

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

◆ m74_9_boardDefaultConfiguration()

static void m74_9_boardDefaultConfiguration ( )
static

Board-specific configuration defaults.

Definition at line 64 of file board_configuration.cpp.

64 {
67
69 engineConfiguration->firingOrder = FO_1_3_4_2;
70
71 engineConfiguration->ignitionMode = IM_WASTED_SPARK;
73 engineConfiguration->injectionMode = IM_SEQUENTIAL;
74
75 /* SPI1 is used for communication with L9779 */
77
81
84
85// todo engineConfiguration->clt.adcChannel = EFI_ADC_; // ADC3 PF5
86// todo engineConfiguration->iat.adcChannel = EFI_ADC_; // ADC3 PF6
87// todo engineConfiguration->map.sensor.hwChannel = EFI_ADC_;
88
89 // ?k high side/?k low side = ? ratio divider todo is the value below right?
91
92// todo engineConfiguration->vbattDividerCoeff = (33 + 6.8) / 6.8; // 5.835
93
94// engineConfiguration->vbattAdcChannel = EFI_ADC_;
96
97 setTPS1Inputs(EFI_ADC_12, EFI_ADC_13);
98
99 setPPSInputs(EFI_ADC_10, EFI_ADC_11);
100}
void setPPSInputs(adc_channel_e pps1, adc_channel_e pps2)
void setTPS1Inputs(adc_channel_e tps1, adc_channel_e tps2)
static void setIgnitionPins()
static void setInjectorPins()
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:

◆ setIgnitionPins()

static void setIgnitionPins ( )
static

◆ setInjectorPins()

static void setInjectorPins ( )
static

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 193 of file board_configuration.cpp.

193 {
196}
std::optional< setup_custom_board_overrides_type > custom_board_ConfigOverrides
std::optional< setup_custom_board_overrides_type > custom_board_DefaultConfiguration
static void m74_9_boardConfigOverrides()
static void m74_9_boardDefaultConfiguration()
Board-specific configuration defaults.
Here is the call graph for this function:

◆ setupEtb()

static void setupEtb ( )
static

Definition at line 42 of file board_configuration.cpp.

42 {
43 // TLE9201 driver
44 // This chip has three control pins:
45 // DIR - sets direction of the motor
46 // PWM - pwm control (enable high, coast low)
47 // DIS - disables motor (enable low)
48
49 // PWM pin
51 // DIR pin
53// // Disable pin todo clarify if we have it?
54// engineConfiguration->etbIo[0].disablePin = Gpio::C8;
55
56 // we only have pwm/dir, no dira/dirb
58}

Referenced by m74_9_boardConfigOverrides(), microrusefi_boardConfigOverrides(), and proteus_boardDefaultConfiguration().

Here is the caller graph for this function:

Variable Documentation

◆ l9779_cfg

struct l9779_config l9779_cfg
static

Definition at line 109 of file board_configuration.cpp.

109 {
110 .spi_bus = &SPID1,
111 .spi_config = {
112 .circular = false,
113#ifdef _CHIBIOS_RT_CONF_VER_6_1_
114 .end_cb = nullptr,
115#else
116 .slave = false,
117 .data_cb = nullptr,
118 .error_cb = nullptr,
119#endif
120 .ssport = GPIOE,
121 .sspad = 12,
122 .cr1 =
123 SPI_CR1_16BIT_MODE |
124 SPI_CR1_SSM |
125 SPI_CR1_SSI |
126 SPI_CR1_LSBFIRST | //LSB first
127 ((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
128 SPI_CR1_MSTR |
129 SPI_CR1_CPHA |
130 0,
131 .cr2 = SPI_CR2_16BIT_MODE
132 },
133 .direct_gpio = {
134 /* ignition pre-drivers */
135 [0] = {.port = GPIOF, .pad = 12},
136 [1] = {.port = GPIOF, .pad = 13},
137 [2] = {.port = GPIOF, .pad = 14},
138 [3] = {.port = GPIOF, .pad = 15},
139 /* IN1 .. IN7 */
140 [4] = {.port = GPIOE, .pad = 8},
141 [5] = {.port = GPIOE, .pad = 9},
142 [6] = {.port = GPIOE, .pad = 10},
143 [7] = {.port = GPIOE, .pad = 11},
144 [8] = {.port = GPIOG, .pad = 5},
145 [9] = {.port = GPIOG, .pad = 6},
146 [10] = {.port = GPIOG, .pad = 7},
147 },
148 /* PWM signal */
149 .pwm_gpio = {.port = NULL, .pad = 0}
150};
SPIDriver SPID1
SPI0 driver identifier.
Definition hal_spi_lld.c:42

Referenced by board_init_ext_gpios().

◆ OUTPUTS

Gpio OUTPUTS[]
static
Initial value:

Definition at line 169 of file board_configuration.cpp.

169 {
170 Gpio::L9779_OUT_4, // Injector 1
171 Gpio::L9779_OUT_3, // Injector 2
172// Gpio::L9779_OUT_2, // Injector 3
173// Gpio::L9779_OUT_1, // Injector 4
174// Gpio::L9779_OUT_6, // Oxygen sensor 1 heater
175// Gpio::L9779_OUT_5, // EVAP solenoid control
176// Gpio::L9779_OUT_7, // Oxygen sensor 2 heater
177// Gpio::L9779_IGN_1, // Coil 1 (< +2.5v) / Coils 1,4
178// Gpio::L9779_IGN_3, // Coil 3 (< +2.5v) / Coils 2,4
179// Gpio::L9779_OUT_17, // Air compressor control
180// Gpio::L9779_OUT_14, // Secondary starter relay
181// Gpio::L9779_OUT_15, // FAN 1 relay
182// Gpio::L9779_OUT_16, // FAN 2 relay
183// Gpio::L9779_OUT_13, // Fuel pump relay
184};

Go to the source code of this file.