continued pl pcdu handler
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
8953f6f60d
commit
c683097635
@ -44,11 +44,9 @@
|
||||
#include "linux/csp/CspComIF.h"
|
||||
#include "linux/csp/CspCookie.h"
|
||||
#include "linux/devices/GPSHyperionLinuxController.h"
|
||||
#include "linux/devices/PayloadPcduHandler.h"
|
||||
#include "linux/devices/SolarArrayDeploymentHandler.h"
|
||||
#include "linux/devices/SusHandler.h"
|
||||
#include "linux/devices/devicedefinitions/SusDefinitions.h"
|
||||
#include "linux/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/devices/ACUHandler.h"
|
||||
#include "mission/devices/BpxBatteryHandler.h"
|
||||
@ -60,6 +58,7 @@
|
||||
#include "mission/devices/PCDUHandler.h"
|
||||
#include "mission/devices/PDU1Handler.h"
|
||||
#include "mission/devices/PDU2Handler.h"
|
||||
#include "mission/devices/PayloadPcduHandler.h"
|
||||
#include "mission/devices/PlocMPSoCHandler.h"
|
||||
#include "mission/devices/RadiationSensorHandler.h"
|
||||
#include "mission/devices/RwHandler.h"
|
||||
@ -71,6 +70,7 @@
|
||||
#include "mission/devices/devicedefinitions/RadSensorDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/RwDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||
#include "mission/tmtc/CCSDSHandler.h"
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
|
@ -296,35 +296,29 @@ void SpiTestClass::performOneShotMax1227Test() {
|
||||
adcCfg.testRadSensorExtConvWithDelay = false;
|
||||
adcCfg.testRadSensorIntConv = false;
|
||||
|
||||
adcCfg.testSus[0].doTest = true;
|
||||
adcCfg.testSus[0].intConv = true;
|
||||
adcCfg.testSus[6].doTest = true;
|
||||
adcCfg.testSus[6].intConv = true;
|
||||
bool setAllSusOn = false;
|
||||
bool susIntConv = false;
|
||||
bool susExtConv = false;
|
||||
if (setAllSusOn) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].doTest = true;
|
||||
}
|
||||
} else {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].doTest = false;
|
||||
}
|
||||
}
|
||||
|
||||
adcCfg.testSus[1].doTest = true;
|
||||
adcCfg.testSus[1].intConv = true;
|
||||
adcCfg.testSus[7].doTest = true;
|
||||
adcCfg.testSus[7].intConv = true;
|
||||
|
||||
adcCfg.testSus[10].doTest = true;
|
||||
adcCfg.testSus[10].intConv = true;
|
||||
adcCfg.testSus[4].doTest = true;
|
||||
adcCfg.testSus[4].intConv = true;
|
||||
|
||||
adcCfg.testSus[11].doTest = true;
|
||||
adcCfg.testSus[11].intConv = true;
|
||||
adcCfg.testSus[5].doTest = true;
|
||||
adcCfg.testSus[5].intConv = true;
|
||||
|
||||
adcCfg.testSus[2].doTest = true;
|
||||
adcCfg.testSus[2].intConv = true;
|
||||
adcCfg.testSus[3].doTest = true;
|
||||
adcCfg.testSus[3].intConv = true;
|
||||
|
||||
adcCfg.testSus[8].doTest = true;
|
||||
adcCfg.testSus[8].intConv = true;
|
||||
adcCfg.testSus[9].doTest = true;
|
||||
adcCfg.testSus[9].intConv = true;
|
||||
if (susIntConv) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].intConv = true;
|
||||
}
|
||||
}
|
||||
if (susExtConv) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].extConv = true;
|
||||
}
|
||||
}
|
||||
|
||||
adcCfg.plPcduAdcExtConv = false;
|
||||
adcCfg.plPcduAdcIntConv = true;
|
||||
@ -334,7 +328,7 @@ void SpiTestClass::performOneShotMax1227Test() {
|
||||
void SpiTestClass::performPeriodicMax1227Test() {
|
||||
using namespace max1227;
|
||||
adcCfg.testRadSensorExtConvWithDelay = false;
|
||||
adcCfg.testRadSensorIntConv = false;
|
||||
adcCfg.testRadSensorIntConv = true;
|
||||
|
||||
adcCfg.plPcduAdcExtConv = false;
|
||||
adcCfg.plPcduAdcIntConv = false;
|
||||
|
@ -1,10 +1,10 @@
|
||||
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
|
||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/controller/ExtendedControllerBase.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||
|
||||
#ifdef FSFW_OSAL_LINUX
|
||||
#include <gps.h>
|
||||
|
@ -85,6 +85,8 @@ debugging. */
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
|
@ -360,8 +360,8 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1 && OBSW_ADD_ACS_HANDLERS == 1
|
||||
bool enableAside = true;
|
||||
bool enableBside = false;
|
||||
bool enableAside = false;
|
||||
bool enableBside = true;
|
||||
if (enableAside) {
|
||||
// A side
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0,
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include <fsfw/src/fsfw/datapool/PoolReadGuard.h>
|
||||
#include "PayloadPcduHandler.h"
|
||||
|
||||
#include <fsfw/src/fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
|
||||
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
||||
@ -217,6 +219,22 @@ ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
case (SETUP_CMD): {
|
||||
break;
|
||||
}
|
||||
case (READ_TEMP): {
|
||||
uint8_t tempStartIdx = TEMP_REPLY_SIZE - 2;
|
||||
adcSet.tempC.value =
|
||||
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
||||
break;
|
||||
}
|
||||
case (READ_CMD): {
|
||||
PoolReadGuard pg(&adcSet);
|
||||
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||
return pg.getReadResult();
|
||||
}
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcSet.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (READ_WITH_TEMP): {
|
||||
PoolReadGuard pg(&adcSet);
|
||||
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
|
||||
@ -226,9 +244,13 @@ ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
adcSet.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2];
|
||||
}
|
||||
uint8_t tempStartIdx = ADC_REPLY_SIZE + TEMP_REPLY_SIZE - 2;
|
||||
adcSet.tempC.value = max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
||||
adcSet.tempC.value =
|
||||
max1227::getTemperature(packet[tempStartIdx] << 8 | packet[tempStartIdx + 2]);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
@ -244,3 +266,7 @@ ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& l
|
||||
localDataPoolMap.emplace(plpcdu::PlPcduPoolIds::TEMP, &tempC);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void PayloadPcduHandler::setToGoToNormalModeImmediately(bool enable) {
|
||||
this->goToNormalMode = enable;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw/timemanager/Countdown.h>
|
||||
|
||||
#include "devicedefinitions/payloadPcduDefinitions.h"
|
||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||
|
||||
@ -24,6 +25,8 @@ class PayloadPcduHandler : DeviceHandlerBase {
|
||||
public:
|
||||
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF);
|
||||
|
||||
void setToGoToNormalModeImmediately(bool enable);
|
||||
|
||||
private:
|
||||
enum class States {
|
||||
PCDU_OFF,
|
||||
@ -50,6 +53,7 @@ class PayloadPcduHandler : DeviceHandlerBase {
|
||||
|
||||
enum class AdcStates { OFF, BOOT_DELAY, SEND_SETUP, NORMAL } adcState = AdcStates::OFF;
|
||||
|
||||
bool goToNormalMode = false;
|
||||
plpcdu::PlPcduAdcSet adcSet;
|
||||
std::array<uint8_t, plpcdu::MAX_ADC_REPLY_SIZE> cmdBuf = {};
|
||||
// This variable is tied to DRO +6 V voltage. Voltages, currents are monitored and the experiment
|
||||
|
@ -3,17 +3,16 @@
|
||||
|
||||
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include "mission/devices/max1227.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "mission/devices/max1227.h"
|
||||
|
||||
namespace plpcdu {
|
||||
|
||||
using namespace max1227;
|
||||
|
||||
enum PlPcduPoolIds: uint32_t {
|
||||
CHANNEL_VEC = 0,
|
||||
TEMP = 1
|
||||
};
|
||||
enum PlPcduPoolIds : uint32_t { CHANNEL_VEC = 0, TEMP = 1 };
|
||||
|
||||
static constexpr size_t MAX_ADC_REPLY_SIZE = 64;
|
||||
|
||||
@ -27,8 +26,8 @@ static constexpr size_t ADC_REPLY_SIZE = 25;
|
||||
// Conversion byte + 24 * zero
|
||||
static constexpr size_t TEMP_REPLY_SIZE = 25;
|
||||
|
||||
static constexpr uint8_t SETUP_BYTE = max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED,
|
||||
RefSel::INT_REF_NO_WAKEUP, DiffSel::NONE_0);
|
||||
static constexpr uint8_t SETUP_BYTE =
|
||||
max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED, RefSel::INT_REF_NO_WAKEUP, DiffSel::NONE_0);
|
||||
|
||||
static constexpr uint32_t ADC_SET_ID = READ_CMD;
|
||||
static constexpr uint8_t CHANNELS_NUM = 12;
|
||||
@ -40,13 +39,12 @@ class PlPcduAdcSet : public StaticLocalDataSet<DATASET_ENTRIES> {
|
||||
public:
|
||||
PlPcduAdcSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ADC_SET_ID) {}
|
||||
|
||||
PlPcduAdcSet(object_id_t objectId)
|
||||
: StaticLocalDataSet(sid_t(objectId, ADC_SET_ID)) {}
|
||||
PlPcduAdcSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ADC_SET_ID)) {}
|
||||
|
||||
lp_vec_t<uint16_t, 12> channels = lp_vec_t<uint16_t, 12>(sid.objectId, CHANNEL_VEC, this);
|
||||
lp_var_t<float> tempC = lp_var_t<float>(sid.objectId, TEMP, this);
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace plpcdu
|
||||
|
||||
#endif /* LINUX_DEVICES_DEVICEDEFINITIONS_PAYLOADPCDUDEFINITIONS_H_ */
|
||||
|
@ -40,9 +40,7 @@ enum DiffSel : uint8_t {
|
||||
BIPOLAR_CFG = 0b11
|
||||
};
|
||||
|
||||
constexpr uint8_t buildResetByte(bool fifoOnly) {
|
||||
return (1 << 4) | (fifoOnly << 3);
|
||||
}
|
||||
constexpr uint8_t buildResetByte(bool fifoOnly) { return (1 << 4) | (fifoOnly << 3); }
|
||||
|
||||
constexpr uint8_t buildConvByte(ScanModes scanMode, uint8_t channel, bool readTemp) {
|
||||
return (1 << 7) | (channel << 3) | (scanMode << 1) | readTemp;
|
||||
|
Loading…
Reference in New Issue
Block a user