wideband/firmware/heater_control.h

32 lines
650 B
C
Raw Normal View History

2020-10-30 01:53:54 -07:00
#pragma once
2020-12-15 15:00:11 -08:00
#include <cstdint>
#include "can.h"
enum class HeaterState
{
Preheat,
WarmupRamp,
ClosedLoop,
Stopped,
2022-12-01 13:20:54 -08:00
NoHeaterSupply,
};
struct ISampler;
struct IHeaterController
{
virtual void Update(const ISampler& sampler, HeaterAllow heaterAllowState) = 0;
virtual bool IsRunningClosedLoop() const = 0;
virtual float GetHeaterEffectiveVoltage() const = 0;
virtual HeaterState GetHeaterState() const = 0;
};
const IHeaterController& GetHeaterController(int ch);
2020-10-30 01:53:54 -07:00
void StartHeaterControl();
float GetHeaterDuty(int ch);
HeaterState GetHeaterState(int ch);
const char* describeHeaterState(HeaterState state);