basic MGM polling done
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||
#include <fsfw/tasks/SemaphoreIF.h>
|
||||
#include <fsfw_hal/devicehandlers/devicedefinitions/mgmRm3100Helpers.h>
|
||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||
#include <mission/devices/devicedefinitions/acsPolling.h>
|
||||
#include <mission/devices/devicedefinitions/gyroAdisHelpers.h>
|
||||
@ -25,41 +26,46 @@ class AcsBoardPolling : public SystemObject,
|
||||
std::array<uint8_t, 32> cmdBuf;
|
||||
std::array<uint8_t, 32> replyBuf;
|
||||
|
||||
bool mgm0L3IsOn = false;
|
||||
SpiCookie* mgm0L3Cookie = nullptr;
|
||||
bool mgm1Rm3100IsOn = false;
|
||||
SpiCookie* mgm1Rm3100Cookie = nullptr;
|
||||
bool mgm2L3IsOn = false;
|
||||
SpiCookie* mgm2L3Cookie = nullptr;
|
||||
bool mgm3Rm3100IsOn = false;
|
||||
SpiCookie* mgm3Rm3100Cookie = nullptr;
|
||||
|
||||
struct GyroAdis {
|
||||
adis1650x::Type type;
|
||||
bool isOn = false;
|
||||
bool performStartup = false;
|
||||
struct DevBase {
|
||||
SpiCookie* cookie = nullptr;
|
||||
Countdown countdown;
|
||||
bool performStartup = false;
|
||||
acs::SimpleSensorMode mode = acs::SimpleSensorMode::OFF;
|
||||
ReturnValue_t replyResult;
|
||||
};
|
||||
|
||||
struct GyroAdis : public DevBase {
|
||||
adis1650x::Type type;
|
||||
Countdown countdown;
|
||||
acs::Adis1650XReply ownReply;
|
||||
acs::Adis1650XReply readerReply;
|
||||
};
|
||||
GyroAdis gyro0Adis{};
|
||||
GyroAdis gyro2Adis{};
|
||||
|
||||
struct GyroL3g {
|
||||
bool performStartup = false;
|
||||
SpiCookie* cookie = nullptr;
|
||||
acs::SimpleSensorMode mode = acs::SimpleSensorMode::OFF;
|
||||
struct GyroL3g : public DevBase {
|
||||
uint8_t sensorCfg[5];
|
||||
ReturnValue_t replyResult;
|
||||
acs::GyroL3gReply ownReply;
|
||||
acs::GyroL3gReply readerReply;
|
||||
};
|
||||
GyroL3g gyro1L3g{};
|
||||
GyroL3g gyro3L3g{};
|
||||
|
||||
struct MgmRm3100 : public DevBase {
|
||||
uint8_t tmrcValue = mgmRm3100::TMRC_DEFAULT_37HZ_VALUE;
|
||||
acs::MgmRm3100Reply ownReply;
|
||||
acs::MgmRm3100Reply readerReply;
|
||||
};
|
||||
MgmRm3100 mgm1Rm3100;
|
||||
MgmRm3100 mgm3Rm3100;
|
||||
|
||||
struct MgmLis3 : public DevBase {
|
||||
uint8_t cfg[5]{};
|
||||
acs::MgmLis3Reply ownReply;
|
||||
acs::MgmLis3Reply readerReply;
|
||||
};
|
||||
MgmLis3 mgm0Lis3;
|
||||
MgmLis3 mgm2Lis3;
|
||||
|
||||
uint8_t* rawReply = nullptr;
|
||||
size_t dummy = 0;
|
||||
|
||||
@ -74,6 +80,8 @@ class AcsBoardPolling : public SystemObject,
|
||||
|
||||
void gyroL3gHandler(GyroL3g& l3g);
|
||||
void gyroAdisHandler(GyroAdis& gyro);
|
||||
void mgmLis3Handler(MgmLis3& mgm);
|
||||
void mgmRm3100Handler(MgmRm3100& mgm);
|
||||
// Special readout: 16us stall time between small 2 byte transfers.
|
||||
ReturnValue_t readAdisCfg(SpiCookie& spiCookie, size_t transferLen);
|
||||
};
|
||||
|
Reference in New Issue
Block a user