rusefi/firmware/controllers/trigger/trigger_emulator_algo.h

36 lines
999 B
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file trigger_emulator_algo.h
*
* @date Mar 3, 2014
2020-01-13 18:57:43 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2020-01-20 22:40:11 -08:00
#pragma once
2015-07-10 06:01:56 -07:00
// 1 crank and CAMS_PER_BANK cam channels
#define NUM_EMULATOR_CHANNELS (1 + CAMS_PER_BANK)
class PwmConfig;
class MultiChannelStateSequence;
void initTriggerEmulator();
void startTriggerEmulatorPins();
void stopTriggerEmulatorPins();
void setTriggerEmulatorRPM(int value);
void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration);
// Start & stop trigger emulation
2023-04-19 17:29:33 -07:00
void enableTriggerStimulator(bool incGlobalConfiguration = true);
void enableExternalTriggerStimulator();
void disableTriggerStimulator();
2015-07-10 06:01:56 -07:00
class TriggerEmulatorHelper {
public:
TriggerEmulatorHelper();
2023-11-02 12:51:25 -07:00
void handleEmulatorCallback(int channel, const MultiChannelStateSequence& mcss, int stateIndex);
2015-07-10 06:01:56 -07:00
};
2019-03-03 21:40:22 -08:00
int getPreviousIndex(const int currentIndex, const int size);
bool needEvent(const int currentIndex, const MultiChannelStateSequence& mcss, int channelIndex);
2019-03-03 21:40:22 -08:00