rusefi-1/firmware/hw_layer/wave_analyzer_hw.h

36 lines
853 B
C
Raw Normal View History

2014-12-26 21:05:52 -08:00
/**
* @file wave_analyzer_hw.h
2014-08-29 07:52:33 -07:00
*
* @date Jun 23, 2013
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#ifndef WAVE_ANALYZER_HW_H_
#define WAVE_ANALYZER_HW_H_
#include "main.h"
2014-12-23 19:06:10 -08:00
#if HAL_USE_ICU || defined(__DOXYGEN__)
2014-08-29 07:52:33 -07:00
#include "listener_array.h"
typedef struct {
ICUDriver *driver;
2014-12-27 20:03:27 -08:00
bool_t isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH
2015-04-07 18:10:24 -07:00
volatile bool_t started;
2014-08-29 07:52:33 -07:00
2014-12-27 19:05:10 -08:00
// todo: make this a template & reduce number of listeners?
// todo: would one listener be enough?
2014-08-29 07:52:33 -07:00
IntListenerArray widthListeners;
IntListenerArray periodListeners;
} WaveReaderHw;
2015-04-07 18:10:24 -07:00
void turnOnCapturePin(brain_pin_e brainPin);
WaveReaderHw *initWaveAnalyzerDriver(brain_pin_e brainPin);
2014-12-27 20:03:27 -08:00
void startInputDriver(WaveReaderHw *hw, bool isActiveHigh);
2014-08-29 07:52:33 -07:00
ICUDriver * getInputCaptureDriver(brain_pin_e hwPin);
2014-12-23 19:06:10 -08:00
#endif
2014-08-29 07:52:33 -07:00
#endif /* WAVE_ANALYZER_HW_H_ */