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

Detailed Description

Configuration defaults for the 2chan board.

Author
andreika prome.nosp@m.theu.nosp@m.s.pcb.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Andrey Belomutskiy, (c) 2012-2020

Definition in file board_configuration.cpp.

Functions

static void setInjectorPins ()
 
static void setIgnitionPins ()
 
static void setupDefaultSensorInputs ()
 
static void alphax_2chan_boardInitHardware ()
 
static void customBoardOnConfigurationChange (engine_configuration_s *)
 
static bool isMegaModuleRevision ()
 
static void alphax_2chan_ConfigOverrides ()
 
static void alphax_2chan_defaultConfiguration ()
 Board-specific configuration defaults.
 
void boardPrepareForStop ()
 
int getBoardMetaOutputsCount ()
 
GpiogetBoardMetaOutputs ()
 
void setup_custom_board_overrides ()
 

Variables

static OutputPin alphaTachPullUp
 
static OutputPin alphaTempPullUp
 
static OutputPin alphaCrankPPullUp
 
static OutputPin alphaCrankNPullUp
 
static OutputPin alpha2stepPullDown
 
static OutputPin alphaCamPullDown
 
static Gpio OUTPUTS []
 

Function Documentation

◆ alphax_2chan_boardInitHardware()

static void alphax_2chan_boardInitHardware ( )
static

Definition at line 58 of file board_configuration.cpp.

58 {
59
60 alphaTachPullUp.initPin("a-tach", Gpio::H144_OUT_IO1);
61 alphaTempPullUp.initPin("a-temp", Gpio::H144_OUT_IO4);
62 alphaCrankPPullUp.initPin("a-crank-p", Gpio::H144_OUT_IO2);
63 alphaCrankNPullUp.initPin("a-crank-n", Gpio::H144_OUT_IO5);
64 alpha2stepPullDown.initPin("a-2step", Gpio::H144_OUT_IO7);
65 alphaCamPullDown.initPin("a-cam", Gpio::H144_OUT_IO8);
66}
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
Definition efi_gpio.cpp:711
static OutputPin alphaCamPullDown
static OutputPin alphaTachPullUp
static OutputPin alphaCrankPPullUp
static OutputPin alphaTempPullUp
static OutputPin alpha2stepPullDown
static OutputPin alphaCrankNPullUp

Referenced by setup_custom_board_overrides().

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

◆ alphax_2chan_ConfigOverrides()

static void alphax_2chan_ConfigOverrides ( )
static

Definition at line 86 of file board_configuration.cpp.

86 {
88#ifndef EFI_BOOTLOADER
90
91 // rev.D uses SPI1 pins for CAN2, but rev.E and later uses mega-module meaning SPI1 for SD-card
95 } else {
96 setHellenEnPin(Gpio::H144_OUT_IO3);
97 }
98
99 // todo: is it time for some helper method to work with sets?!
100 bool isBeforeRevG = hellenBoardId == BOARD_ID_ALPHA2CH_B ||
101 hellenBoardId == BOARD_ID_ALPHA2CH_C ||
102 hellenBoardId == BOARD_ID_ALPHA2CH_D ||
103 hellenBoardId == BOARD_ID_ALPHA2CH_E ||
104 hellenBoardId == BOARD_ID_ALPHA2CH_F;
105
106 if (isBeforeRevG) {
107 engineConfiguration->vrThreshold[0].pin = Gpio::H144_OUT_PWM6;
108 } else {
109 engineConfiguration->vrThreshold[0].pin = Gpio::Unassigned; // rev G started to use MAX9924
110 }
111
112 engineConfiguration->vrThreshold[1].pin = Gpio::Unassigned; // 2chan never had second VR
114#endif // EFI_BOOTLOADER
115
116 setHellenCan();
117}
EngineState engineState
Definition engine.h:344
@ Unassigned
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
static bool isMegaModuleRevision()
void hellenMegaSdWithAccelerometer()
void setHellenCan()
void setHellenVbatt()
void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp)
void setHellenMegaEnPin(bool enableBoardOnStartUp)
void setDefaultHellenAtPullUps(float pullup=HELLEN_DEFAULT_AT_PULLUP)
hellenBoardId("Detected Board ID", SensorCategory.SENSOR_INPUTS, FieldType.INT16, 1368, 1.0, 0.0, 3000.0, "id")

Referenced by setup_custom_board_overrides().

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

◆ alphax_2chan_defaultConfiguration()

static void alphax_2chan_defaultConfiguration ( )
static

Board-specific configuration defaults.

Definition at line 125 of file board_configuration.cpp.

125 {
128
129 if (isMegaModuleRevision()) {
131 engineConfiguration->map.sensor.hwChannel = H144_IN_MAP3; // On-board MAP
132 engineConfiguration->map.sensor.type = MT_MPXH6400;
133 } else {
134 engineConfiguration->map.sensor.hwChannel = H144_IN_MAP2; // B2 external signal
135 engineConfiguration->baroSensor.type = MT_MPXH6400;
136 engineConfiguration->baroSensor.hwChannel = H144_IN_MAP3; // On-board MAP
137 }
138
140
141 engineConfiguration->fuelPumpPin = Gpio::H144_OUT_PWM2;
142 engineConfiguration->fanPin = Gpio::H144_OUT_PWM4;
143 engineConfiguration->tachOutputPin = Gpio::H144_OUT_PWM3;
144
145 // "required" hardware is done - set some reasonable defaults
147
148 setInline4();
149
150 engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS; // IM_WASTED_SPARK
151
152 engineConfiguration->launchActivationMode = CLUTCH_INPUT_LAUNCH;
153// ? engineConfiguration->malfunctionIndicatorPin = Gpio::G4; //1E - Check Engine Light
154}
void setInline4()
static constexpr persistent_config_s * config
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:

◆ boardPrepareForStop()

void boardPrepareForStop ( )

Definition at line 156 of file board_configuration.cpp.

156 {
157 // Wake on the CAN RX pin
158 palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE);
159}

◆ customBoardOnConfigurationChange()

static void customBoardOnConfigurationChange ( engine_configuration_s )
static

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 170 of file board_configuration.cpp.

170 {
171 return OUTPUTS;
172}
static Gpio OUTPUTS[]

Referenced by initQcBenchControls(), and setPin().

Here is the caller graph for this function:

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 166 of file board_configuration.cpp.

166 {
167 return efi::size(OUTPUTS);
168}

Referenced by getBoardMetaLowSideOutputsCount(), sendOutBoardMeta(), and setPin().

Here is the caller graph for this function:

◆ isMegaModuleRevision()

static bool isMegaModuleRevision ( )
static

Definition at line 77 of file board_configuration.cpp.

77 {
78#ifndef EFI_BOOTLOADER
80 return hellenBoardId != BOARD_ID_ALPHA2CH_B && hellenBoardId != BOARD_ID_ALPHA2CH_C && hellenBoardId != BOARD_ID_ALPHA2CH_D;
81#else
82 return true;
83#endif // EFI_BOOTLOADER
84}

Referenced by alphax_2chan_ConfigOverrides(), and alphax_2chan_defaultConfiguration().

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

◆ setIgnitionPins()

static void setIgnitionPins ( )
static

Definition at line 35 of file board_configuration.cpp.

Referenced by alphax_2chan_defaultConfiguration(), alphax_4chan_defaultConfiguration(), alphax_8chan_defaultConfiguration(), alphax_8chan_reva_boardDefaultConfiguration(), alphax_gold_boardDefaultConfiguration(), alphax_silver_boardDefaultConfiguration(), alphax_silver_revA_boardDefaultConfiguration(), hellen112_17_boardDefaultConfiguration(), hellen121_nissan_boardDefaultConfiguration(), hellen121_vag_boardDefaultConfiguration(), hellen128_boardDefaultConfiguration(), hellen154_hyundai_boardDefaultConfiguration(), hellen154hyundai_f7_boardDefaultConfiguration(), hellen81_boardDefaultConfiguration(), hellen88_boardDefaultConfiguration(), hellen_gm_e67_boardDefaultConfiguration(), hellen_honda_k_boardDefaultConfiguration(), hellen_MiataNA6_boardDefaultConfiguration(), hellen_MiataNA96_boardDefaultConfiguration(), hellen_MiataNB1_boardDefaultConfiguration(), hellen_MiataNB2_boardDefaultConfiguration(), m74_9_boardDefaultConfiguration(), microrusefi_boardDefaultConfiguration(), proteus_boardDefaultConfiguration(), s105_boardDefaultConfiguration(), super_uaefi_boardDefaultConfiguration(), and uaefi_boardDefaultConfiguration().

Here is the caller graph for this function:

◆ setInjectorPins()

static void setInjectorPins ( )
static

Definition at line 23 of file board_configuration.cpp.

Referenced by alphax_2chan_defaultConfiguration(), alphax_4chan_defaultConfiguration(), alphax_8chan_defaultConfiguration(), alphax_8chan_reva_boardDefaultConfiguration(), alphax_gold_boardDefaultConfiguration(), alphax_silver_boardDefaultConfiguration(), alphax_silver_revA_boardDefaultConfiguration(), hellen112_17_boardDefaultConfiguration(), hellen121_nissan_boardDefaultConfiguration(), hellen121_vag_boardDefaultConfiguration(), hellen128_boardDefaultConfiguration(), hellen154_hyundai_boardDefaultConfiguration(), hellen154hyundai_f7_boardDefaultConfiguration(), hellen81_boardDefaultConfiguration(), hellen88_boardDefaultConfiguration(), hellen_gm_e67_boardDefaultConfiguration(), hellen_honda_k_boardDefaultConfiguration(), hellen_MiataNA6_boardDefaultConfiguration(), hellen_MiataNA96_boardDefaultConfiguration(), hellen_MiataNB1_boardDefaultConfiguration(), hellen_MiataNB2_boardDefaultConfiguration(), m74_9_boardDefaultConfiguration(), microrusefi_boardDefaultConfiguration(), proteus_boardDefaultConfiguration(), s105_boardDefaultConfiguration(), super_uaefi_boardDefaultConfiguration(), and uaefi_boardDefaultConfiguration().

Here is the caller graph for this function:

◆ setup_custom_board_overrides()

void setup_custom_board_overrides ( )

Definition at line 174 of file board_configuration.cpp.

174 {
178
180}
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
std::optional< setup_custom_board_config_type > custom_board_OnConfigurationChange
static void alphax_2chan_ConfigOverrides()
static void alphax_2chan_boardInitHardware()
static void customBoardOnConfigurationChange(engine_configuration_s *)
static void alphax_2chan_defaultConfiguration()
Board-specific configuration defaults.
Here is the call graph for this function:

◆ setupDefaultSensorInputs()

static void setupDefaultSensorInputs ( )
static

Definition at line 42 of file board_configuration.cpp.

42 {
43 // trigger inputs, hall
44 engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_CRANK;
45 engineConfiguration->triggerInputPins[1] = Gpio::H144_IN_CAM;
47
49
50
51
53
54 engineConfiguration->clt.adcChannel = H144_IN_CLT;
55 engineConfiguration->iat.adcChannel = H144_IN_IAT;
56}
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]

Referenced by alphax_2chan_defaultConfiguration(), alphax_4chan_defaultConfiguration(), alphax_8chan_defaultConfiguration(), alphax_8chan_reva_boardDefaultConfiguration(), alphax_silver_boardDefaultConfiguration(), alphax_silver_revA_boardDefaultConfiguration(), hellen112_17_boardDefaultConfiguration(), hellen121_nissan_boardDefaultConfiguration(), hellen121_vag_boardDefaultConfiguration(), hellen128_boardDefaultConfiguration(), hellen154_hyundai_boardDefaultConfiguration(), hellen154hyundai_f7_boardDefaultConfiguration(), hellen81_boardDefaultConfiguration(), hellen88_boardDefaultConfiguration(), hellen_gm_e67_boardDefaultConfiguration(), hellen_honda_k_boardDefaultConfiguration(), hellen_MiataNA6_boardDefaultConfiguration(), hellen_MiataNA96_boardDefaultConfiguration(), hellen_MiataNB1_boardDefaultConfiguration(), hellen_MiataNB2_boardDefaultConfiguration(), microrusefi_boardDefaultConfiguration(), proteus_boardDefaultConfiguration(), super_uaefi_boardDefaultConfiguration(), and uaefi_boardDefaultConfiguration().

Here is the caller graph for this function:

Variable Documentation

◆ alpha2stepPullDown

OutputPin alpha2stepPullDown
static

◆ alphaCamPullDown

OutputPin alphaCamPullDown
static

◆ alphaCrankNPullUp

OutputPin alphaCrankNPullUp
static

◆ alphaCrankPPullUp

OutputPin alphaCrankPPullUp
static

◆ alphaTachPullUp

OutputPin alphaTachPullUp
static

◆ alphaTempPullUp

OutputPin alphaTempPullUp
static

◆ OUTPUTS

Gpio OUTPUTS[]
static
Initial value:
= {
Gpio::H144_LS_1,
Gpio::H144_LS_2,
}

Definition at line 161 of file board_configuration.cpp.

161 {
162 Gpio::H144_LS_1,
163 Gpio::H144_LS_2,
164};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

Go to the source code of this file.