rusEFI
The most advanced open source ECU
Typedefs | Functions | Variables
vvt.cpp File Reference

Typedefs

using vvt_map_t = Map3D< SCRIPT_TABLE_8, SCRIPT_TABLE_8, int8_t, uint16_t, uint16_t >
 

Functions

static bool shouldInvertVvt (int camIndex)
 
OutputPingetVvtOutputPin (int index)
 
static void applyVvtPinState (int stateIndex, PwmConfig *state)
 
static void turnVvtPidOn (int index)
 
void startVvtControlPins ()
 
void stopVvtControlPins ()
 
void initVvtActuators ()
 

Variables

static vvt_map_t vvtTable1
 
static vvt_map_t vvtTable2
 
static const char * vvtOutputNames [CAM_INPUTS_COUNT]
 
static OutputPin vvtPins [CAM_INPUTS_COUNT]
 
static SimplePwm vvtPwms [CAM_INPUTS_COUNT]
 

Typedef Documentation

◆ vvt_map_t

using vvt_map_t = Map3D<SCRIPT_TABLE_8, SCRIPT_TABLE_8, int8_t, uint16_t, uint16_t>

Definition at line 16 of file vvt.cpp.

Function Documentation

◆ applyVvtPinState()

static void applyVvtPinState ( int  stateIndex,
PwmConfig state 
)
static

Definition at line 149 of file vvt.cpp.

149  {
150  OutputPin *output = state->outputPins[0];
151  if (output == getOutputOnTheBenchTest()) {
152  return;
153  }
154  state->applyPwmValue(output, stateIndex);
155 }
const OutputPin * getOutputOnTheBenchTest()
Definition: bench_test.cpp:32
Single output pin reference and state.
Definition: efi_output.h:50
static ScState state

Referenced by turnVvtPidOn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVvtOutputPin()

OutputPin* getVvtOutputPin ( int  index)

Definition at line 145 of file vvt.cpp.

145  {
146  return &vvtPins[index];
147 }
static OutputPin vvtPins[CAM_INPUTS_COUNT]
Definition: vvt.cpp:142

Referenced by EnginePins::getOutputPinForBenchMode(), stopVvtControlPins(), turnVvtPidOn(), and vvtValveBench().

Here is the caller graph for this function:

◆ initVvtActuators()

void initVvtActuators ( )

Definition at line 182 of file vvt.cpp.

182  {
185  }
186 
189 
190 
191  engine->module<VvtController1>()->init(&vvtTable1, &vvtPwms[0]);
192  engine->module<VvtController2>()->init(&vvtTable2, &vvtPwms[1]);
193  engine->module<VvtController3>()->init(&vvtTable1, &vvtPwms[2]);
194  engine->module<VvtController4>()->init(&vvtTable2, &vvtPwms[3]);
195 
197 }
constexpr auto & module()
Definition: engine.h:174
void initTable(TValueInit(&table)[TRowNum][TColNum], const TXColumnInit(&columnBins)[TColNum], const TRowInit(&rowBins)[TRowNum])
Definition: table_helper.h:33
Engine * engine
persistent_config_s * config
engine_configuration_s * engineConfiguration
int8_t vvtTable1[SCRIPT_TABLE_8][SCRIPT_TABLE_8]
int8_t vvtTable2[SCRIPT_TABLE_8][SCRIPT_TABLE_8]
void startVvtControlPins()
Definition: vvt.cpp:170
static vvt_map_t vvtTable1
Definition: vvt.cpp:18
static SimplePwm vvtPwms[CAM_INPUTS_COUNT]
Definition: vvt.cpp:143
static vvt_map_t vvtTable2
Definition: vvt.cpp:19

Referenced by commonInitEngineController().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shouldInvertVvt()

static bool shouldInvertVvt ( int  camIndex)
static

Definition at line 86 of file vvt.cpp.

86  {
87  // grumble grumble, can't do an array of bits in c++
88  switch (camIndex) {
91  }
92 
93  return false;
94 }

Referenced by VvtController::getClosedLoop().

Here is the caller graph for this function:

◆ startVvtControlPins()

void startVvtControlPins ( )

Definition at line 170 of file vvt.cpp.

170  {
171  for (int i = 0;i <CAM_INPUTS_COUNT;i++) {
172  turnVvtPidOn(i);
173  }
174 }
static void turnVvtPidOn(int index)
Definition: vvt.cpp:157

Referenced by applyNewHardwareSettings(), and initVvtActuators().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopVvtControlPins()

void stopVvtControlPins ( )

Definition at line 176 of file vvt.cpp.

176  {
177  for (int i = 0;i < CAM_INPUTS_COUNT;i++) {
178  getVvtOutputPin(i)->deInit();
179  }
180 }
void deInit()
Definition: efi_gpio.cpp:781
OutputPin * getVvtOutputPin(int index)
Definition: vvt.cpp:145

Referenced by stopHardware().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ turnVvtPidOn()

static void turnVvtPidOn ( int  index)
static

Definition at line 157 of file vvt.cpp.

157  {
159  return;
160  }
161 
162  startSimplePwmExt(&vvtPwms[index], vvtOutputNames[index],
163  &engine->executor,
165  getVvtOutputPin(index),
168 }
SingleTimerExecutor executor
Definition: engine.h:240
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwmExt(SimplePwm *state, const char *msg, ExecutorInterface *executor, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)
static const char * vvtOutputNames[CAM_INPUTS_COUNT]
Definition: vvt.cpp:129
static void applyVvtPinState(int stateIndex, PwmConfig *state)
Definition: vvt.cpp:149

Referenced by startVvtControlPins().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ vvtOutputNames

const char* vvtOutputNames[CAM_INPUTS_COUNT]
static
Initial value:
= {
"Vvt Output#1",
#if CAM_INPUTS_COUNT > 1
"Vvt Output#2",
#endif
#if CAM_INPUTS_COUNT > 2
"Vvt Output#3",
#endif
#if CAM_INPUTS_COUNT > 3
"Vvt Output#4",
#endif
}

Definition at line 129 of file vvt.cpp.

Referenced by turnVvtPidOn().

◆ vvtPins

OutputPin vvtPins[CAM_INPUTS_COUNT]
static

Definition at line 142 of file vvt.cpp.

Referenced by getVvtOutputPin().

◆ vvtPwms

SimplePwm vvtPwms[CAM_INPUTS_COUNT]
static

Definition at line 143 of file vvt.cpp.

Referenced by initVvtActuators(), and turnVvtPidOn().

◆ vvtTable1

vvt_map_t vvtTable1
static

Definition at line 18 of file vvt.cpp.

Referenced by initVvtActuators().

◆ vvtTable2

vvt_map_t vvtTable2
static

Definition at line 19 of file vvt.cpp.

Referenced by initVvtActuators().

Go to the source code of this file.