rusefi-1/firmware/controllers/actuators/gppwm/gppwm_channel.h

30 lines
631 B
C
Raw Normal View History

#pragma once
#include "gppwm.h"
class OutputPin;
class SimplePwm;
class ValueProvider3D;
class GppwmChannel {
public:
DECLARE_ENGINE_PTR;
void init(bool usePwm, SimplePwm* pwm, OutputPin* outputPin, const ValueProvider3D* table, const gppwm_channel* config);
float update();
2020-10-19 19:44:44 -07:00
percent_t getOutput() const;
void setOutput(float result);
2020-09-03 19:52:29 -07:00
private:
// Store the current state so we can apply hysteresis
bool m_state = false;
// Configuration fields
const gppwm_channel* m_config = nullptr;
bool m_usePwm = false;
SimplePwm* m_pwm = nullptr;
OutputPin* m_output = nullptr;
const ValueProvider3D* m_table = nullptr;
};