eive-obsw/linux/devices/devicedefinitions/StarTrackerDefinitions.h

65 lines
1.7 KiB
C
Raw Normal View History

2021-07-07 12:12:01 +02:00
#ifndef MISSION_STARTRACKER_DEFINITIONS_H_
#define MISSION_STARTRACKER_DEFINITIONS_H_
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include <fsfw/datapoollocal/LocalPoolVariable.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include "objects/systemObjectList.h"
namespace StarTracker {
/** This is the address of the star tracker */
static const uint8_t ADDRESS = 33;
enum PoolIds: lp_id_t {
STATUS,
TICKS,
TIME,
MCU_TEMPERATURE,
CMOS_TEMPERATURE
};
static const DeviceCommandId_t REQ_TEMPERATURE = 25;
static const uint32_t TEMPERATURE_SET_ID = REQ_TEMPERATURE;
/** Max size of unencoded frame */
static const size_t MAX_FRAME_SIZE = 1200;
static const uint8_t TEMPERATURE_SET_ENTRIES = 5;
2021-07-07 12:12:01 +02:00
/**
* @brief This dataset can be used to store the temperature of a reaction wheel.
*/
class TemperatureSet:
public StaticLocalDataSet<TEMPERATURE_SET_ENTRIES> {
public:
TemperatureSet(HasLocalDataPoolIF* owner):
StaticLocalDataSet(owner, TEMPERATURE_SET_ID) {
}
TemperatureSet(object_id_t objectId):
StaticLocalDataSet(sid_t(objectId, TEMPERATURE_SET_ID)) {
}
lp_var_t<uint8_t> status = lp_var_t<uint8_t>(sid.objectId,
PoolIds::STATUS, this);
lp_var_t<uint32_t> ticks = lp_var_t<uint32_t>(sid.objectId,
PoolIds::TICKS, this);
/** Unix time in microseconds */
lp_var_t<uint64_t> time = lp_var_t<uint64_t>(sid.objectId,
2021-07-07 12:12:01 +02:00
PoolIds::TIME, this);
lp_var_t<float> mcuTemperature = lp_var_t<float>(sid.objectId,
PoolIds::MCU_TEMPERATURE, this);
lp_var_t<float> cmosTemperature = lp_var_t<float>(sid.objectId,
PoolIds::CMOS_TEMPERATURE, this);
};
}
#endif /* MISSION_STARTRACKER_DEFINITIONS_H_ */