fome-fw/firmware/controllers/sensors/frequency_sensor.h

31 lines
663 B
C
Raw Normal View History

/**
* @file frequency_sensor.h
*/
#include "functional_sensor.h"
#include "timer.h"
#include "biquad.h"
class FrequencySensor : public FunctionalSensor {
public:
FrequencySensor(SensorType type, efitick_t timeoutPeriod)
: FunctionalSensor(type, timeoutPeriod)
{ }
void initIfValid(brain_pin_e pin, SensorConverter &converter, float filterParameter);
void deInit();
2022-09-20 20:00:42 -07:00
// sad workaround: we are not good at BiQuad configuring
bool useBiQuad = true;
2022-10-05 20:37:07 -07:00
void showInfo(const char* sensorName) const override;
void onEdge(efitick_t nowNt);
int eventCounter = 0;
private:
Timer m_edgeTimer;
brain_pin_e m_pin = Gpio::Unassigned;
Biquad m_filter;
};