heading towards completion for low level rw polling task
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -19,7 +19,7 @@ static const size_t SIZE_GET_TEMPERATURE_REPLY = 8;
|
||||
/** Max size when requesting telemetry */
|
||||
static const size_t SIZE_GET_TELEMETRY_REPLY = 91;
|
||||
|
||||
enum SpecialRwRequest : uint8_t {
|
||||
enum class SpecialRwRequest : uint8_t {
|
||||
REQUEST_NONE = 0,
|
||||
RESET_MCU = 1,
|
||||
INIT_RW_CONTROLLER = 2,
|
||||
@ -27,47 +27,6 @@ enum SpecialRwRequest : uint8_t {
|
||||
NUM_REQUESTS
|
||||
};
|
||||
|
||||
struct RwReplies {
|
||||
friend class RwPollingTask;
|
||||
|
||||
public:
|
||||
RwReplies(const uint8_t* rawData) : rawData(rawData) {
|
||||
rwStatusReply = rawData;
|
||||
setSpeedReply = rawData + SIZE_GET_RW_STATUS;
|
||||
getLastResetStatusReply = setSpeedReply + SIZE_SET_SPEED_REPLY;
|
||||
clearLastResetStatusReply = getLastResetStatusReply + SIZE_GET_RESET_STATUS;
|
||||
readTemperatureReply = clearLastResetStatusReply + SIZE_CLEAR_RESET_STATUS;
|
||||
hkDataReply = readTemperatureReply + SIZE_GET_TEMPERATURE_REPLY;
|
||||
initRwControllerReply = hkDataReply + SIZE_GET_TELEMETRY_REPLY;
|
||||
}
|
||||
|
||||
const uint8_t* getClearLastResetStatusReply() const { return clearLastResetStatusReply; }
|
||||
|
||||
const uint8_t* getGetLastResetStatusReply() const { return getLastResetStatusReply; }
|
||||
|
||||
const uint8_t* getHkDataReply() const { return hkDataReply; }
|
||||
|
||||
const uint8_t* getInitRwControllerReply() const { return initRwControllerReply; }
|
||||
|
||||
const uint8_t* getRawData() const { return rawData; }
|
||||
|
||||
const uint8_t* getReadTemperatureReply() const { return readTemperatureReply; }
|
||||
|
||||
const uint8_t* getRwStatusReply() const { return rwStatusReply; }
|
||||
|
||||
const uint8_t* getSetSpeedReply() const { return setSpeedReply; }
|
||||
|
||||
private:
|
||||
const uint8_t* rawData;
|
||||
const uint8_t* rwStatusReply;
|
||||
const uint8_t* setSpeedReply;
|
||||
const uint8_t* getLastResetStatusReply;
|
||||
const uint8_t* clearLastResetStatusReply;
|
||||
const uint8_t* readTemperatureReply;
|
||||
const uint8_t* hkDataReply;
|
||||
const uint8_t* initRwControllerReply;
|
||||
};
|
||||
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER;
|
||||
|
||||
static const ReturnValue_t SPI_WRITE_FAILURE = MAKE_RETURN_CODE(0xB0);
|
||||
@ -299,4 +258,50 @@ class RwSpeedActuationSet : public StaticLocalDataSet<2> {
|
||||
|
||||
} // namespace rws
|
||||
|
||||
struct RwReplies {
|
||||
friend class RwPollingTask;
|
||||
|
||||
public:
|
||||
RwReplies(const uint8_t* rawData) : rawData(const_cast<uint8_t*>(rawData)) { initPointers(); }
|
||||
|
||||
const uint8_t* getClearLastResetStatusReply() const { return clearLastResetStatusReply; }
|
||||
|
||||
const uint8_t* getGetLastResetStatusReply() const { return getLastResetStatusReply; }
|
||||
|
||||
const uint8_t* getHkDataReply() const { return hkDataReply; }
|
||||
|
||||
const uint8_t* getInitRwControllerReply() const { return initRwControllerReply; }
|
||||
|
||||
const uint8_t* getRawData() const { return rawData; }
|
||||
|
||||
const uint8_t* getReadTemperatureReply() const { return readTemperatureReply; }
|
||||
|
||||
const uint8_t* getRwStatusReply() const { return rwStatusReply; }
|
||||
|
||||
const uint8_t* getSetSpeedReply() const { return setSpeedReply; }
|
||||
|
||||
private:
|
||||
RwReplies(uint8_t* rwData) : rawData(rwData) { initPointers(); }
|
||||
|
||||
void initPointers() {
|
||||
rwStatusReply = rawData;
|
||||
setSpeedReply = rawData + rws::SIZE_GET_RW_STATUS;
|
||||
getLastResetStatusReply = setSpeedReply + rws::SIZE_SET_SPEED_REPLY;
|
||||
clearLastResetStatusReply = getLastResetStatusReply + rws::SIZE_GET_RESET_STATUS;
|
||||
readTemperatureReply = clearLastResetStatusReply + rws::SIZE_CLEAR_RESET_STATUS;
|
||||
hkDataReply = readTemperatureReply + rws::SIZE_GET_TEMPERATURE_REPLY;
|
||||
initRwControllerReply = hkDataReply + rws::SIZE_GET_TELEMETRY_REPLY;
|
||||
dummyPointer = initRwControllerReply + rws::SIZE_INIT_RW;
|
||||
}
|
||||
uint8_t* rawData;
|
||||
uint8_t* rwStatusReply;
|
||||
uint8_t* setSpeedReply;
|
||||
uint8_t* getLastResetStatusReply;
|
||||
uint8_t* clearLastResetStatusReply;
|
||||
uint8_t* readTemperatureReply;
|
||||
uint8_t* hkDataReply;
|
||||
uint8_t* initRwControllerReply;
|
||||
uint8_t* dummyPointer;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_RWHELPERS_H_ */
|
||||
|
Reference in New Issue
Block a user