9#ifndef VR_SUPPLY_VOLTAGE
10#define VR_SUPPLY_VOLTAGE 3.3f
20 float thresholdVoltage = interpolate2d(rpm, cfg.rpmBins, cfg.values);
26 float duty = thresholdInputVoltage / VR_SUPPLY_VOLTAGE;
58 for (
int i = 0;i<VR_THRESHOLD_COUNT;i++) {
SingleTimerExecutor scheduler
Single output pin reference and state.
static float getOrZero(SensorType type)
void setSimplePwmDutyCycle(float dutyCycle) override
float interpolateClamped(float x1, float y1, float x2, float y2, float x)
static EngineAccessor engine
static constexpr engine_configuration_s * engineConfiguration
bool isBrainPinValid(brain_pin_e brainPin)
void startSimplePwmHard(SimplePwm *state, const char *msg, Scheduler *executor, brain_pin_e brainPin, OutputPin *output, float frequency, float dutyCycle)
vr_threshold_s vrThreshold[VR_THRESHOLD_COUNT]
scaled_channel< uint8_t, 1, 50 > rpmBins[6]
scaled_channel< uint8_t, 100, 1 > values[6]
void setRpmTableBin(TValue(&array)[TSize])
void setLinearCurve(TValue(&array)[TSize], float from, float to, float precision=0.01f)
void setDefaultVrThresholds()
static OutputPin pins[VR_THRESHOLD_COUNT]
void initVrThresholdPwm()
static SimplePwm pwms[VR_THRESHOLD_COUNT]
void updateVrThresholdPwm()