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

34 lines
989 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,
2020-08-23 22:21:42 -07:00
const TriggerConfiguration * triggerConfiguration,
2020-08-23 23:23:13 -07:00
TriggerState *state);
2015-09-23 18:02:33 -07:00
void assertSyncPositionAndSetDutyCycle(const TriggerStateCallback triggerCycleCallback,
2020-08-23 22:21:42 -07:00
const TriggerConfiguration * triggerConfiguration,
const uint32_t index, TriggerState *state, TriggerWaveform * shape
2020-08-23 23:23:13 -07:00
);
2018-02-05 14:41:05 -08:00
private:
// send next event so that we can see how state reacts
2020-08-23 22:21:42 -07:00
void feedSimulatedEvent(const TriggerStateCallback triggerCycleCallback,
const TriggerConfiguration * triggerConfiguration,
TriggerState *state,
2020-08-23 23:23:13 -07:00
TriggerWaveform * shape, int i);
2015-09-23 18:02:33 -07:00
};
2020-08-23 23:23:13 -07:00
bool isUsefulSignal(trigger_event_e signal, const TriggerConfiguration * triggerConfiguration);