rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
gppwm_channel.h
Go to the documentation of this file.
1#pragma once
2
3#include "gppwm.h"
4
5#include "rusefi_types.h"
6
7struct gppwm_channel;
8class OutputPin;
9struct IPwm;
10class ValueProvider3D;
11
14 float X;
15 float Y;
16};
17
19public:
20 void init(bool usePwm, IPwm* pwm, OutputPin* outputPin, const ValueProvider3D* table, const gppwm_channel* config);
21 GppwmResult update(size_t index);
22 GppwmResult getOutput(size_t index) const;
23
24 // Returns actual output duty, with hysteresis applied
25 float setOutput(float result);
26
27private:
28 // Store the current state so we can apply hysteresis
29 bool m_state = false;
30
31 // Configuration fields
32 const gppwm_channel* m_config = nullptr;
33 bool m_usePwm = false;
34 IPwm* m_pwm = nullptr;
35 OutputPin* m_output = nullptr;
36 const ValueProvider3D* m_table = nullptr;
37};
GppwmResult getOutput(size_t index) const
float setOutput(float result)
OutputPin * m_output
void init(bool usePwm, IPwm *pwm, OutputPin *outputPin, const ValueProvider3D *table, const gppwm_channel *config)
const gppwm_channel * m_config
GppwmResult update(size_t index)
const ValueProvider3D * m_table
Single output pin reference and state.
Definition efi_output.h:49
static constexpr persistent_config_s * config
percent_t Result