rusefi-1/firmware/controllers/trigger/trigger_simulator.h

29 lines
897 B
C
Raw Normal View History

2015-09-23 18:02:33 -07:00
/*
* @file trigger_simulator.h
* @brief This class knows how to produce synthetic shaft signals based on triggerShape
*
* @date Sep 23, 2015
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-09-23 18:02:33 -07:00
*/
#pragma once
2015-09-23 18:02:33 -07:00
#include "trigger_decoder.h"
class TriggerStimulatorHelper {
public:
uint32_t findTriggerSyncPoint(TriggerWaveform * shape,
2018-02-05 14:41:05 -08:00
TriggerState *state DECLARE_ENGINE_PARAMETER_SUFFIX);
2015-09-23 18:02:33 -07:00
void assertSyncPositionAndSetDutyCycle(const TriggerStateCallback triggerCycleCallback,
const uint32_t index, TriggerState *state, TriggerWaveform * shape
2018-02-05 14:44:10 -08:00
DECLARE_ENGINE_PARAMETER_SUFFIX);
2018-02-05 14:41:05 -08:00
private:
// send next event so that we can see how state reacts
void feedSimulatedEvent(const TriggerStateCallback triggerCycleCallback, TriggerState *state, TriggerWaveform * shape, int i DECLARE_ENGINE_PARAMETER_SUFFIX);
2015-09-23 18:02:33 -07:00
};
2020-01-24 23:00:33 -08:00
bool isUsefulSignal(trigger_event_e signal DECLARE_CONFIG_PARAMETER_SUFFIX);