2020-10-30 01:53:54 -07:00
|
|
|
#pragma once
|
|
|
|
|
2020-12-15 15:00:11 -08:00
|
|
|
#include <cstdint>
|
|
|
|
|
2023-06-23 14:38:17 -07:00
|
|
|
#include "can.h"
|
|
|
|
|
2022-05-11 01:41:07 -07:00
|
|
|
enum class HeaterState
|
|
|
|
{
|
|
|
|
Preheat,
|
|
|
|
WarmupRamp,
|
|
|
|
ClosedLoop,
|
|
|
|
Stopped,
|
2022-12-01 13:20:54 -08:00
|
|
|
NoHeaterSupply,
|
2022-05-11 01:41:07 -07:00
|
|
|
};
|
|
|
|
|
2023-06-23 14:38:17 -07:00
|
|
|
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();
|
2022-08-29 17:19:30 -07:00
|
|
|
float GetHeaterDuty(int ch);
|
|
|
|
HeaterState GetHeaterState(int ch);
|
2022-05-11 01:41:07 -07:00
|
|
|
const char* describeHeaterState(HeaterState state);
|