rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
controllers
actuators
gppwm
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
7
struct
gppwm_channel
;
8
class
OutputPin
;
9
struct
IPwm
;
10
class
ValueProvider3D
;
11
12
struct
GppwmResult
{
13
percent_t
Result
;
14
float
X
;
15
float
Y
;
16
};
17
18
class
GppwmChannel
{
19
public
:
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
27
private
:
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
};
GppwmChannel
Definition
gppwm_channel.h:18
GppwmChannel::m_usePwm
bool m_usePwm
Definition
gppwm_channel.h:33
GppwmChannel::getOutput
GppwmResult getOutput(size_t index) const
Definition
gppwm_channel.cpp:54
GppwmChannel::setOutput
float setOutput(float result)
Definition
gppwm_channel.cpp:9
GppwmChannel::m_output
OutputPin * m_output
Definition
gppwm_channel.h:35
GppwmChannel::m_state
bool m_state
Definition
gppwm_channel.h:29
GppwmChannel::init
void init(bool usePwm, IPwm *pwm, OutputPin *outputPin, const ValueProvider3D *table, const gppwm_channel *config)
Definition
gppwm_channel.cpp:41
GppwmChannel::m_config
const gppwm_channel * m_config
Definition
gppwm_channel.h:32
GppwmChannel::m_pwm
IPwm * m_pwm
Definition
gppwm_channel.h:34
GppwmChannel::update
GppwmResult update(size_t index)
Definition
gppwm_channel.cpp:80
GppwmChannel::m_table
const ValueProvider3D * m_table
Definition
gppwm_channel.h:36
OutputPin
Single output pin reference and state.
Definition
efi_output.h:49
ValueProvider3D
Definition
table_helper.h:25
float
config
static constexpr persistent_config_s * config
Definition
engine_configuration.h:81
gppwm.h
rusefi_types.h
GppwmResult
Definition
gppwm_channel.h:12
GppwmResult::Result
percent_t Result
Definition
gppwm_channel.h:13
GppwmResult::Y
float Y
Definition
gppwm_channel.h:15
GppwmResult::X
float X
Definition
gppwm_channel.h:14
IPwm
Definition
pwm_generator_logic.h:111
gppwm_channel
Definition
engine_configuration_generated_structures_alphax-2chan.h:320
Generated on Sat Sep 27 2025 00:10:04 for rusEFI by
1.9.8