34 lines
729 B
C
34 lines
729 B
C
|
#pragma once
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
constexpr uint8_t TEMPERATURE_SENSOR_MAX_COUNT = 2;
|
||
|
|
||
|
constexpr uint8_t temperatureSensorNotAvailable = 0;
|
||
|
constexpr uint8_t temperatureSensorFailure = 1;
|
||
|
constexpr uint8_t temperatureMinimumValue = 2;
|
||
|
|
||
|
enum class TemperatureStatus {
|
||
|
|
||
|
sensorNotFound = temperatureSensorNotAvailable,
|
||
|
|
||
|
sensorError = temperatureSensorFailure,
|
||
|
|
||
|
temperatureIsValid = temperatureMinimumValue,
|
||
|
};
|
||
|
|
||
|
struct Temperature {
|
||
|
|
||
|
TemperatureStatus status;
|
||
|
|
||
|
/**
|
||
|
* @brief The temperature value, in millidegrees celsius
|
||
|
* This value is only valid if the status is `temperatureIsValid`
|
||
|
*/
|
||
|
long value;
|
||
|
};
|
||
|
|
||
|
|
||
|
void temperatureConfigure();
|
||
|
|
||
|
void temperaturePerformUpdate(Temperature* temperatures);
|