2022-05-12 09:48:41 +02:00
|
|
|
#ifndef MISSION_DEVICES_MAX31865EIVEHANDLER_H_
|
|
|
|
#define MISSION_DEVICES_MAX31865EIVEHANDLER_H_
|
|
|
|
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
2022-05-14 09:41:28 +02:00
|
|
|
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
2022-05-12 09:48:41 +02:00
|
|
|
|
|
|
|
#include "devicedefinitions/Max31865Definitions.h"
|
|
|
|
|
|
|
|
class Max31865EiveHandler : public DeviceHandlerBase {
|
|
|
|
public:
|
|
|
|
Max31865EiveHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
|
2022-05-12 12:12:47 +02:00
|
|
|
void setInstantNormal(bool instantNormal);
|
2022-05-14 09:41:28 +02:00
|
|
|
void setDebugMode(bool enable, uint32_t divider);
|
2022-05-13 15:16:10 +02:00
|
|
|
void setDeviceInfo(uint8_t idx, std::string location);
|
2022-05-12 09:48:41 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void doStartUp() override;
|
|
|
|
void doShutDown() override;
|
|
|
|
void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
|
|
|
|
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
|
|
|
|
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
|
|
|
|
void fillCommandAndReplyMap() override;
|
|
|
|
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData,
|
|
|
|
size_t commandDataLen) override;
|
|
|
|
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
|
|
|
|
size_t* foundLen) override;
|
|
|
|
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
|
|
|
|
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
|
|
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
|
|
|
LocalDataPoolManager& poolManager) override;
|
2022-05-13 17:25:06 +02:00
|
|
|
ReturnValue_t initialize() override;
|
2022-05-12 09:48:41 +02:00
|
|
|
|
|
|
|
void simpleCommand(EiveMax31855::RtdCommands cmd);
|
|
|
|
std::array<uint8_t, 12> cmdBuf = {};
|
2022-05-12 12:12:47 +02:00
|
|
|
uint8_t idx = 0;
|
|
|
|
std::string locString = "Unknown";
|
2022-05-12 09:48:41 +02:00
|
|
|
EiveMax31855::ReadOutStruct exchangeStruct;
|
2022-05-14 09:41:28 +02:00
|
|
|
bool debugMode = false;
|
|
|
|
size_t structLen = 0;
|
2022-05-12 09:48:41 +02:00
|
|
|
bool instantNormal = false;
|
|
|
|
MAX31865::Max31865Set sensorDataset;
|
2022-05-14 09:41:28 +02:00
|
|
|
PeriodicOperationDivider debugDivider;
|
2022-05-12 09:48:41 +02:00
|
|
|
enum class InternalState { NONE, ON, ACTIVE, INACTIVE } state = InternalState::NONE;
|
|
|
|
bool transitionOk = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_DEVICES_MAX31865EIVEHANDLER_H_ */
|