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
|
|
|
|
2020-04-24 11:00:06 -07:00
|
|
|
class PwmConfig;
|
|
|
|
class MultiChannelStateSequence;
|
|
|
|
|
2021-11-16 01:15:29 -08:00
|
|
|
void initTriggerEmulator();
|
|
|
|
void startTriggerEmulatorPins();
|
2020-12-08 01:52:49 -08:00
|
|
|
void stopTriggerEmulatorPins();
|
2021-11-16 01:15:29 -08:00
|
|
|
void setTriggerEmulatorRPM(int value);
|
2020-04-24 11:00:06 -07:00
|
|
|
void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration);
|
|
|
|
|
2021-03-11 05:38:52 -08:00
|
|
|
// Start & stop trigger emulation
|
2023-04-19 17:29:33 -07:00
|
|
|
void enableTriggerStimulator(bool incGlobalConfiguration = true);
|
2021-03-11 05:38:52 -08:00
|
|
|
void enableExternalTriggerStimulator();
|
|
|
|
void disableTriggerStimulator();
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
class TriggerEmulatorHelper {
|
|
|
|
public:
|
|
|
|
TriggerEmulatorHelper();
|
2021-11-16 01:15:29 -08:00
|
|
|
void handleEmulatorCallback(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);
|
2021-11-10 16:47:27 -08:00
|
|
|
bool needEvent(const int currentIndex, const MultiChannelStateSequence& mcss, int channelIndex);
|
2019-03-03 21:40:22 -08:00
|
|
|
|