fome-fw/firmware/controllers/algo/signal_executor.h

50 lines
1.2 KiB
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file signal_executor.h
* @brief Asynchronous output signal header
*
* @date Feb 10, 2013
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#ifndef SPARKOUT_H_
#define SPARKOUT_H_
#include "rusefi_enums.h"
#include "global.h"
#include "efifeatures.h"
#include "io_pins.h"
#include "scheduler.h"
2015-01-13 10:06:16 -08:00
#include "efiGpio.h"
2014-08-29 07:52:33 -07:00
#if EFI_PROD_CODE
#include "datalogging.h"
#endif /* EFI_PROD_CODE */
#if EFI_SIGNAL_EXECUTOR_SLEEP
#include "signal_executor_sleep.h"
#endif /* EFI_SIGNAL_EXECUTOR_SLEEP */
/**
* @brief Asynchronous output signal data structure
*/
typedef struct OutputSignal_struct OutputSignal;
struct OutputSignal_struct {
2015-01-13 10:06:16 -08:00
NamedOutputPin *output;
2014-08-29 07:52:33 -07:00
/**
* We are alternating instances so that events which extend into next revolution are not reused while
* scheduling next revolution events
*/
scheduling_s signalTimerUp[2];
scheduling_s signalTimerDown[2];
};
2015-02-12 13:04:27 -08:00
void scheduleOutput(OutputSignal *signal, efitimeus_t nowUs, float delayUs, float durationUs);
2014-08-29 07:52:33 -07:00
void initSignalExecutor(void);
2015-01-19 13:03:56 -08:00
void scheduleByAngle(int rpm, scheduling_s *timer, angle_t angle, schfunc_t callback, void *param);
2014-08-29 07:52:33 -07:00
2015-01-19 11:04:10 -08:00
void initSignalExecutorImpl(void);
2014-08-29 07:52:33 -07:00
#endif /* SPARKOUT_H_ */