12#if (EFI_SHAFT_POSITION_INPUT && HAL_USE_COMP) || defined(__DOXYGEN__)
34#ifdef EFI_TRIGGER_COMP_ADAPTIVE_HYSTERESIS
41#ifdef TRIGGER_COMP_EXTREME_LOGGING
53 int isPrimary = (comp == EFI_COMP_PRIMARY_DEVICE);
91 constexpr float maxDacValue = 255.0f;
97 efiPrintf(
"startTIPins(): already enabled!");
113 efiPrintf(
"startTIPins(): cDac=%d hystMin=%d hystMax=%d satRpm=%.0f satFreq*1k=%f period=%d",
115#ifdef EFI_TRIGGER_COMP_ADAPTIVE_HYSTERESIS
116 efiPrintf(
"startTIPins(): ADAPTIVE_HYSTERESIS enabled!");
119 int channel = EFI_COMP_TRIGGER_CHANNEL;
130 compEnable(EFI_COMP_PRIMARY_DEVICE);
136 efiPrintf(
"stopTIPins(): already disabled!");
140 efiPrintf(
"stopTIPins();");
142 compDisable(EFI_COMP_PRIMARY_DEVICE);
145 for (
int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
146 if (isConfigurationChanged(bc.triggerInputPins[i])) {
150 if (isConfigurationChanged(camInput)) {
TriggerCentral triggerCentral
TriggerWaveform triggerShape
float interpolateClamped(float x1, float y1, float x2, float y2, float x)
float efiRound(float value, float precision)
static EngineAccessor engine
engine_configuration_s & activeConfiguration
static constexpr engine_configuration_s * engineConfiguration
void comp_lld_set_dac_value(COMPDriver *compp, uint32_t value)
Set the DAC value used by comp.
void comp_lld_channel_enable(COMPDriver *compp, uint32_t channel)
Configures and activates an EXT channel (used by comp)
uint32_t comp_lld_get_status(COMPDriver *compp)
Driver configuration structure.
Structure representing an COMP driver.
scaled_channel< uint8_t, 50, 1 > triggerCompHystMax
scaled_channel< uint8_t, 1, 50 > triggerCompSensorSatRpm
scaled_channel< uint8_t, 50, 1 > triggerCompCenterVolt
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
scaled_channel< uint8_t, 50, 1 > triggerCompHystMin
void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp)
void hwHandleVvtCamSignal(bool isRising, efitick_t nowNt, int index)