TempTrack-ESP/include/temperature.h

34 lines
729 B
C
Raw Normal View History

2023-05-29 18:29:15 +02:00
#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);