rusefi/firmware/controllers/sensors/frequency_sensor.h

25 lines
540 B
C
Raw Normal View History

#include "functional_sensor.h"
#include "timer.h"
#include "biquad.h"
class FrequencySensor : public FunctionalSensor {
public:
FrequencySensor(SensorType type, efitick_t timeoutPeriod, float filterParameter)
: FunctionalSensor(type, timeoutPeriod)
{
m_filter.configureLowpass(1, filterParameter);
}
void init(brain_pin_e pin);
2022-03-28 20:30:37 -07:00
void initIfValid(brain_pin_e pin, SensorConverter &converter);
void deInit();
void onEdge(efitick_t nowNt);
private:
Timer m_edgeTimer;
brain_pin_e m_pin = GPIO_UNASSIGNED;
Biquad m_filter;
};