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 ()
 
void boardOnConfigurationChange (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 88 of file board_configuration.cpp.

88 {
90#ifndef EFI_BOOTLOADER
92
93 // rev.D uses SPI1 pins for CAN2, but rev.E and later uses mega-module meaning SPI1 for SD-card
97 } else {
98 setHellenEnPin(Gpio::H144_OUT_IO3);
99 }
100
101 // todo: is it time for some helper method to work with sets?!
102 bool isBeforeRevG = hellenBoardId == BOARD_ID_ALPHA2CH_B ||
103 hellenBoardId == BOARD_ID_ALPHA2CH_C ||
104 hellenBoardId == BOARD_ID_ALPHA2CH_D ||
105 hellenBoardId == BOARD_ID_ALPHA2CH_E ||
106 hellenBoardId == BOARD_ID_ALPHA2CH_F;
107
108 if (isBeforeRevG) {
109 engineConfiguration->vrThreshold[0].pin = Gpio::H144_OUT_PWM6;
110 } else {
111 engineConfiguration->vrThreshold[0].pin = Gpio::Unassigned; // rev G started to use MAX9924
112 }
113
114 engineConfiguration->vrThreshold[1].pin = Gpio::Unassigned; // 2chan never had second VR
116#endif // EFI_BOOTLOADER
117
118 setHellenCan();
119}
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.

See also setDefaultEngineConfiguration

Definition at line 127 of file board_configuration.cpp.

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

◆ boardOnConfigurationChange()

void boardOnConfigurationChange ( engine_configuration_s previousConfiguration)

◆ boardPrepareForStop()

void boardPrepareForStop ( )

Definition at line 158 of file board_configuration.cpp.

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

◆ getBoardMetaOutputs()

Gpio * getBoardMetaOutputs ( )

Definition at line 172 of file board_configuration.cpp.

172 {
173 return OUTPUTS;
174}
static Gpio OUTPUTS[]

Referenced by initQcBenchControls(), and setPin().

Here is the caller graph for this function:

◆ getBoardMetaOutputsCount()

int getBoardMetaOutputsCount ( )

Definition at line 168 of file board_configuration.cpp.

168 {
169 return efi::size(OUTPUTS);
170}

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

Here is the caller graph for this function:

◆ isMegaModuleRevision()

static bool isMegaModuleRevision ( )
static

Definition at line 79 of file board_configuration.cpp.

79 {
80#ifndef EFI_BOOTLOADER
82 return hellenBoardId != BOARD_ID_ALPHA2CH_B && hellenBoardId != BOARD_ID_ALPHA2CH_C && hellenBoardId != BOARD_ID_ALPHA2CH_D;
83#else
84 return true;
85#endif // EFI_BOOTLOADER
86}

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 176 of file board_configuration.cpp.

176 {
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
static void alphax_2chan_ConfigOverrides()
static void alphax_2chan_boardInitHardware()
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 163 of file board_configuration.cpp.

163 {
164 Gpio::H144_LS_1,
165 Gpio::H144_LS_2,
166};

Referenced by getBoardMetaOutputs(), and getBoardMetaOutputsCount().

Go to the source code of this file.