24static bool is5vpInit =
false;
94 static int currentHellenEnValue = -1;
97 if (currentHellenEnValue != value) {
98 currentHellenEnValue = value;
109 efiPrintf(
"Turning board ON [%s]", msg);
112 chThdSleepMilliseconds(1);
118#if (EFI_FILE_LOGGING || EFI_CONFIGURATION_STORAGE) && EFI_PROD_CODE
121 efiPrintf(
"Long poll for SD card unmount");
124#if EFI_CONFIGURATION_STORAGE
129 chThdSleepMilliseconds(10);
134 }
while (timeout > 0);
135#if EFI_CONFIGURATION_STORAGE
137 chThdSleepMilliseconds(10);
142 efiPrintf(
"Turning board off [%s]", msg);
156 if (enableBoardOnStartUp) {
175 chThdSleepMilliseconds(200);
207 criticalError(
"probably broken MEMS configuration?");
216 terminatorControlPin.
initPin(
"CAN-term", H_SPI3_CS);
222#ifndef EFI_BOOTLOADER
243#if (HELLEN_BOARD_MM64 == TRUE)
247#if (HELLEN_BOARD_MM100 == TRUE)
248 if (hwChannel == MM100_IN_CRANK_ANALOG) [[unlikely]]
250#if (HELLEN_BOARD_MM144 == TRUE)
251 if (hwChannel == H144_IN_CRANK_ANALOG) [[unlikely]]
253#if (HELLEN_BOARD_MM176 == TRUE)
254 if (hwChannel == MM176_IN_CRANK_ANALOG) [[unlikely]]
259 return (4.7f + 2.445f) / 4.7f;
265#ifndef EFI_BOOTLOADER
274 efiPrintf(
" *** turning SD power ONLY ***");
280 efiPrintf(
" *** turning board ON to power SD card ***");
282 chThdSleepMilliseconds(200);
void efiSetPadMode(const char *msg, brain_pin_e brainPin, iomode_t mode)
static void ResetFilters()
Single output pin reference and state.
void initPin(const char *msg, brain_pin_e brainPin, pin_output_mode_e outputMode, bool forceInitWithFatalError=false)
bool getLogicValue() const
void setValue(const char *msg, int logicValue, bool isForce=false)
bool isInitialized() const
efitimesec_t getTimeNowS()
Current system time in seconds (32 bits)
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
int hackHellenBoardId(int detectedId)
int detectHellenBoardId()
void hellenBoardStandBy()
ObdCode boardGetAnalogDiagnostic()
void setHellen64MegaEnPin()
PUBLIC_API_WEAK bool isBoardWithPowerManagement()
void configureHellenCanTerminator()
void hellenMegaSdWithAccelerometer()
Timer hellenEnPinStateChange
void hellenEnableEn(const char *msg)
static void init5vpDiag()
void hellenMegaAccelerometerPreInitCS2Pin()
OutputPin accelerometerChipSelect
float getAnalogInputDividerCoefficient(adc_channel_e hwChannel)
void setHellenAnalogDividers()
PUBLIC_API_WEAK bool onHellenSdChange(int value)
bool boardEnableSendWidebandInfo()
bool getHellenBoardEnabled()
void hellenDisableEn(const char *msg)
static void setHellenEnValue(int value)
void detectHellenBoardType()
void setHellenEnPin(Gpio pin, bool enableBoardOnStartUp)
void setHellenMegaEnPin(bool enableBoardOnStartUp)
static bool hellenEnPinInitialized
PUBLIC_API_WEAK void onHellenEnChange(int value)
bool fansDisabledByBoardStatus()
void hellenDisableEnSilently()
void setDefaultHellenAtPullUps(float pullup=HELLEN_DEFAULT_AT_PULLUP)
static void setHellenSdCardSpi1Hardware()
bool efiReadPin(brain_pin_e pin)
UNUSED(samplingTimeSeconds)
void sdCardRequestMode(SD_MODE mode)
SD_MODE sdCardGetCurrentMode(void)
@ OBD_ECM_VSS_OUTPUT_A_MALFUNCTION
bool isBrainPinValid(brain_pin_e brainPin)
bool storageIsStorageRegistered(StorageType type)
bool storagRequestUnregisterStorage(StorageType id)
bool storagRequestRegisterStorage(StorageType id)
float analogInputDividerCoefficient
bool boardUseCanTerminator
adc_channel_e vbattAdcChannel