fome-fw/firmware/controllers/trigger/trigger_emulator_algo.h

37 lines
1.1 KiB
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
#include "engine.h"
class PwmConfig;
class MultiChannelStateSequence;
void initTriggerEmulator(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void startTriggerEmulatorPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void stopTriggerEmulatorPins();
void setTriggerEmulatorRPM(int value DECLARE_ENGINE_PARAMETER_SUFFIX);
void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousConfiguration);
// Start & stop trigger emulation
void enableTriggerStimulator();
void enableExternalTriggerStimulator();
void disableTriggerStimulator();
2015-07-10 06:01:56 -07:00
class TriggerEmulatorHelper {
public:
TriggerEmulatorHelper();
2021-06-25 09:01:59 -07:00
void handleEmulatorCallback(const int size, const MultiChannelStateSequence& mcss, int stateIndex DECLARE_ENGINE_PARAMETER_SUFFIX);
2015-07-10 06:01:56 -07:00
};
void initTriggerEmulatorLogic(DECLARE_ENGINE_PARAMETER_SIGNATURE);
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 int size, const MultiChannelStateSequence& mcss, int channelIndex);
2019-03-03 21:40:22 -08:00