14#define NO_PIN_PERIOD 500
24 , m_bank(BANK_BY_INDEX(p_index))
25 , m_cam(CAM_BY_INDEX(p_index))
59#if EFI_SHAFT_POSITION_INPUT
69#if EFI_PROD_CODE || EFI_UNIT_TEST
123#if EFI_SHAFT_POSITION_INPUT
141#if CAM_INPUTS_COUNT > 1
144#if CAM_INPUTS_COUNT > 2
147#if CAM_INPUTS_COUNT > 3
164 state->applyPwmValue(output, stateIndex);
181 for (
int i = 0;i <CAM_INPUTS_COUNT;i++) {
187 for (
int i = 0;i < CAM_INPUTS_COUNT;i++) {
const OutputPin * getOutputOnTheBenchTest()
Utility methods related to bench testing.
TriggerCentral triggerCentral
SingleTimerExecutor scheduler
RpmCalculator rpmCalculator
TunerStudioOutputChannels outputChannels
constexpr auto & module()
void initTable(TValueInit(&table)[TRowNum][TColNum], const TXColumnInit(&columnBins)[TColNum], const TRowInit(&rowBins)[TRowNum])
Single output pin reference and state.
bool isSame(const pid_s *parameters) const
void setErrorAmplification(float coef)
void postState(pid_status_s &pidStatus) const
void initPidClass(pid_s *parameters)
float getOutput(float target, float input)
Multi-channel software PWM output configuration.
float getSecondsSinceEngineStart(efitick_t nowNt) const
static float getOrZero(SensorType type)
angle_t getVVTPosition(uint8_t bankIndex, uint8_t camIndex)
virtual float getValue(float xColumn, float yRow) const =0
void onFastCallback() override
bool m_engineRunningLongEnough
expected< angle_t > getSetpoint() override
void onConfigurationChange(engine_configuration_s const *previousConfig) override
expected< percent_t > getOpenLoop(angle_t target) override
expected< percent_t > getClosedLoop(angle_t setpoint, angle_t observation) override
void setOutput(expected< percent_t > outputValue) override
const ValueProvider3D * m_targetMap
expected< angle_t > observePlant() override
void init(const ValueProvider3D *targetMap, IPwm *pwm)
static EngineAccessor engine
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
UNUSED(samplingTimeSeconds)
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwmExt(SimplePwm *state, const char *msg, Scheduler *executor, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *callback)
state("state", SensorCategory.SENSOR_INPUTS, FieldType.INT8, 1871, 1.0, -1.0, -1.0, "")
virtual void setSimplePwmDutyCycle(float dutyCycle)=0
pid_s auxPid[CAMS_PER_BANK]
output_pin_e vvtPins[CAM_INPUTS_COUNT]
bool invertVvtControlExhaust
bool invertVvtControlIntake
pwm_freq_t vvtOutputFrequency
uint16_t vvtActivationDelayMs
pid_status_s vvtStatus[CAM_INPUTS_COUNT]
uint16_t vvtTable1RpmBins[VVT_TABLE_SIZE]
uint16_t vvtTable1LoadBins[VVT_TABLE_SIZE]
uint16_t vvtTable2RpmBins[VVT_TABLE_SIZE]
int8_t vvtTable1[VVT_TABLE_SIZE][VVT_TABLE_SIZE]
int8_t vvtTable2[VVT_TABLE_SIZE][VVT_TABLE_SIZE]
uint16_t vvtTable2LoadBins[VVT_TABLE_SIZE]
scaled_channel< int16_t, 10, 1 > vvtTarget
scaled_channel< uint8_t, 2, 1 > vvtOutput
void stopVvtControlPins()
static OutputPin vvtPins[CAM_INPUTS_COUNT]
static const char * vvtOutputNames[CAM_INPUTS_COUNT]
void startVvtControlPins()
static void applyVvtPinState(int stateIndex, PwmConfig *state)
static vvt_map_t vvtTable1
static SimplePwm vvtPwms[CAM_INPUTS_COUNT]
static void turnVvtPidOn(int index)
static bool shouldInvertVvt(int camIndex)
static vvt_map_t vvtTable2
OutputPin * getVvtOutputPin(int index)