Update for new yocto rootfs #217

Merged
meierj merged 38 commits from mueller/yocto-rootfs into develop 2022-04-22 10:21:54 +02:00
27 changed files with 658 additions and 1736 deletions
Showing only changes of commit 25138d8931 - Show all commits

View File

@ -10,8 +10,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void*
return;
}
if (pdu == GOMSPACE::Pdu::PDU1) {
PDU1::SwitchChannels typedChannel = static_cast<PDU1::SwitchChannels>(channel);
if (typedChannel == PDU1::SwitchChannels::ACS_A_SIDE) {
PDU1::Channels typedChannel = static_cast<PDU1::Channels>(channel);
if (typedChannel == PDU1::Channels::ACS_A_SIDE) {
if (state) {
gpioComIF->pullHigh(gpioIds::GNSS_0_NRESET);
} else {
@ -20,8 +20,8 @@ void pcdu::switchCallback(GOMSPACE::Pdu pdu, uint8_t channel, bool state, void*
}
} else if (pdu == GOMSPACE::Pdu::PDU2) {
PDU2::SwitchChannels typedChannel = static_cast<PDU2::SwitchChannels>(channel);
if (typedChannel == PDU2::SwitchChannels::ACS_B_SIDE) {
PDU2::Channels typedChannel = static_cast<PDU2::Channels>(channel);
if (typedChannel == PDU2::Channels::ACS_B_SIDE) {
if (state) {
gpioComIF->pullHigh(gpioIds::GNSS_1_NRESET);
} else {

View File

@ -1,72 +1,6 @@
#ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
#include "OBSWConfig.h"
#include <fsfw/power/definitions.h>
#include <array>
#include <cstdint>
namespace pcduSwitches {
/* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches: power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V,
PDU1_CH3_MGT_5V,
PDU1_CH4_SUS_NOMINAL_3V3,
PDU1_CH5_SOLAR_CELL_EXP_5V,
PDU1_CH6_PLOC_12V,
PDU1_CH7_ACS_A_SIDE_3V3,
PDU1_CH8_UNOCCUPIED,
PDU2_CH0_Q7S,
PDU2_CH1_PL_PCDU_BATT_0_14V8,
PDU2_CH2_RW_5V,
PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
PDU2_CH4_SUS_REDUNDANT_3V3,
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
PDU2_CH6_PL_PCDU_BATT_1_14V8,
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
PDU2_CH8_PAYLOAD_CAMERA,
NUMBER_OF_SWITCHES
};
static const uint8_t ON = 1;
static const uint8_t OFF = 0;
// Output states after reboot of the PDUs
const std::array<uint8_t, NUMBER_OF_SWITCHES> INIT_SWITCH_STATES = {
// PDU 1
// Because the TE0720 is not connected to the PCDU, this switch is always on
#ifdef TE0720_1CFA
ON,
#else
OFF,
#endif
OFF,
OFF,
OFF,
OFF,
OFF,
OFF,
OFF,
OFF,
// PDU 2
ON,
OFF,
OFF,
OFF,
OFF,
OFF,
OFF,
OFF,
OFF
};
}
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
#endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */

@ -1 +1 @@
Subproject commit 5ad9fb94af3312d29863527106396395f7b808a5
Subproject commit 9a92c7de0a2fedfcc638c0517e3edea123e977f8

View File

@ -280,7 +280,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
TcsBoardHelper helper(rtdIds);
TcsBoardAssembly* tcsBoardAss =
new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
static_cast<void>(tcsBoardAss);
#endif // OBSW_ADD_RTD_DEVICES == 1
}

View File

@ -408,7 +408,7 @@ void SpiTestClass::max1227RadSensorTest(int fd) {
transfer(fd, gpioIds::CS_RAD_SENSOR);
usleep(65);
spiTransferStruct[0].len = 24;
std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, 24);
std::memmove(sendBuffer.data(), sendBuffer.data() + 1, 24);
transfer(fd, gpioIds::CS_RAD_SENSOR);
int16_t tempRaw = ((recvBuffer[22] & 0x0f) << 8) | recvBuffer[23];
float temp = max1227::getTemperature(tempRaw);

View File

@ -141,11 +141,12 @@ ReturnValue_t CspComIF::cspTransfer(uint8_t cspAddress, uint8_t cspPort, const u
int cmdLen, uint16_t querySize) {
uint32_t timeout_ms = 1000;
uint16_t bytesRead = 0;
int32_t expectedSize = (int32_t)querySize;
int32_t expectedSize = static_cast<int32_t>(querySize);
vectorBufferIter iter = cspDeviceMap.find(cspAddress);
if (iter == cspDeviceMap.end()) {
sif::error << "CSP device with address " << cspAddress << " no found in"
<< " device map" << std::endl;
return RETURN_FAILED;
}
uint8_t* replyBuffer = iter->second.data();

View File

@ -3,7 +3,6 @@
#include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/timemanager/Clock.h"
#include "linux/utility/utility.h"
#include "mission/utility/compileTime.h"

View File

@ -756,6 +756,7 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894" moduleId="org.eclipse.cdt.core.settings" name="eive-q7s-release">
<macros>
<stringMacro name="Q7S_SYSROOT" type="VALUE_TEXT" value="C:\Xilinx\cortexa9hf-neon-xiphos-linux-gnueabi"/>
<stringMacro name="Q7S_SYSROOT_UNIX" type="VALUE_TEXT" value="${HOME}/Xilinx/cortexa9hf-neon-xiphos-linux-gnueabi"/>
</macros>
<externalSettings/>
<extensions>
@ -818,8 +819,8 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.420747124" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants.743473065" name="Disable loop invariant move (-fno-move-loop-invariants)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.nomoveloopinvariants"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.other.1937642597" name="Other optimization flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.other"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.2006936773" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Custom" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.42890232" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id" value="2029746065" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name.2006936773" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.name" value="Linaro ARMv7 Linux GNU EABI HF" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id.42890232" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.toolchain.id" value="4014586055" valueType="string"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.syntaxonly.1649131445" name="Check syntax only (-fsyntax-only)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.syntaxonly"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedantic.1978386125" name="Pedantic (-pedantic)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedantic"/>
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedanticerrors.1857256861" name="Pedantic warnings as errors (-pedantic-errors)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.warnings.pedanticerrors"/>
@ -859,12 +860,11 @@
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811" name="GNU Arm Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1810457326" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive_obsw}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${Q7S_SYSROOT_UNIX}/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/linux/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1774225921" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LINUX=1"/>
@ -873,12 +873,11 @@
</tool>
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.281959373" name="GNU Arm Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1282228801" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive_obsw}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${Q7S_SYSROOT_UNIX}/usr/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/linux/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw/fsfw/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/eive-obsw}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.41651526" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="LINUX=1"/>
@ -1533,9 +1532,18 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1522927967;cdt.managedbuild.tool.gnu.cpp.compiler.input.305765911">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.628631287;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.216437361">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1405808772;cdt.managedbuild.tool.gnu.cpp.compiler.input.1960112549">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.c.compiler.base.1946711528;cdt.managedbuild.tool.gnu.c.compiler.input.584209663">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1551006500">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2065184927;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.920837857">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
@ -1551,42 +1559,6 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1775596945;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1775596945.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1154394228;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1228307894">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.539225324;cdt.managedbuild.tool.gnu.cpp.compiler.input.1848997248">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2081570054">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.397223006;cdt.managedbuild.tool.gnu.c.compiler.input.1482659499">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1191599857;cdt.managedbuild.tool.gnu.cpp.compiler.input.1443212512">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.438317679;cdt.managedbuild.tool.gnu.c.compiler.input.336445831">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1316209993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.646655988;cdt.managedbuild.tool.gnu.cpp.compiler.input.1437856797">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1992099127;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.234631061">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.628631287;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.216437361">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.715561087;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1004720080">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.;cdt.managedbuild.tool.gnu.c.compiler.base.1946711528;cdt.managedbuild.tool.gnu.c.compiler.input.584209663">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1551006500">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1535302916;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.96000231">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
@ -1599,16 +1571,25 @@
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.364559455;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.364559455.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.1970346305;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2096585345">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.1043649249.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.539225324;cdt.managedbuild.tool.gnu.cpp.compiler.input.1848997248">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.447898075.;cdt.managedbuild.tool.gnu.c.compiler.base.623389075;cdt.managedbuild.tool.gnu.c.compiler.input.1382191457">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1358447993;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1822075528">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2081570054">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.775472168.;cdt.managedbuild.tool.gnu.c.compiler.base.1565023847;cdt.managedbuild.tool.gnu.c.compiler.input.1227677208">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.397223006;cdt.managedbuild.tool.gnu.c.compiler.input.1482659499">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1631077874.1323243318.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.449221513;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1048106331">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.438317679;cdt.managedbuild.tool.gnu.c.compiler.input.336445831">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.1939781894.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2002501811;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.1316209993">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.646655988;cdt.managedbuild.tool.gnu.cpp.compiler.input.1437856797">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1595165802;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1925043110">

View File

@ -1,6 +1,7 @@
#include "GomspaceDeviceHandler.h"
#include <common/config/commonObjects.h>
#include <fsfw/datapool/PoolReadGuard.h>
#include "devicedefinitions/GomSpacePackets.h"
#include "devicedefinitions/powerDefinitions.h"
@ -356,6 +357,44 @@ ReturnValue_t GomspaceDeviceHandler::setParamCallback(SetParamMessageUnpacker& u
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t GomspaceDeviceHandler::initializePduPool(
localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager,
std::array<uint8_t, PDU::CHANNELS_LEN> initOutEnb) {
localDataPoolMap.emplace(P60System::pool::PDU_CURRENTS, new PoolEntry<int16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_VOLTAGES, new PoolEntry<int16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_CONV_EN, new PoolEntry<uint8_t>(3));
localDataPoolMap.emplace(P60System::pool::PDU_OUT_ENABLE,
new PoolEntry<uint8_t>(initOutEnb.data(), initOutEnb.size()));
localDataPoolMap.emplace(P60System::pool::PDU_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_LATCHUPS, new PoolEntry<uint16_t>(9));
localDataPoolMap.emplace(P60System::pool::PDU_DEVICES, new PoolEntry<uint8_t>(8));
localDataPoolMap.emplace(P60System::pool::PDU_STATUSES, new PoolEntry<uint8_t>(8));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
return RETURN_OK;
}
ReturnValue_t GomspaceDeviceHandler::generateResetWatchdogCmd() {
WatchdogResetCommand watchdogResetCommand;
size_t cspPacketLen = 0;
@ -405,3 +444,110 @@ ReturnValue_t GomspaceDeviceHandler::printStatus(DeviceCommandId_t cmd) {
sif::info << "No printHkTable implementation given.." << std::endl;
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t GomspaceDeviceHandler::parsePduHkTable(PDU::PduCoreHk& coreHk, PDU::PduAuxHk& auxHk,
const uint8_t* packet) {
uint16_t dataOffset = 0;
PoolReadGuard pg0(&coreHk);
PoolReadGuard pg1(&auxHk);
if (pg0.getReadResult() != HasReturnvaluesIF::RETURN_OK or
pg1.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Reading PDU1 datasets failed!" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
/* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table
* address. */
dataOffset += 12;
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
coreHk.currents[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
dataOffset += 4;
}
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
coreHk.voltages[idx] = (packet[dataOffset] << 8) | packet[dataOffset + 1];
dataOffset += 4;
}
auxHk.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
auxHk.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
coreHk.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
for (uint8_t idx = 0; idx < 3; idx++) {
auxHk.converterEnable[idx] = packet[dataOffset];
dataOffset += 3;
}
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
coreHk.outputEnables[idx] = packet[dataOffset];
dataOffset += 3;
}
auxHk.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
coreHk.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset);
dataOffset += 4;
coreHk.battMode = *(packet + dataOffset);
/* +10 because here begins the second gomspace csp packet */
dataOffset += 3 + 10;
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
auxHk.latchups[idx] = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
}
for (uint8_t idx = 0; idx < PDU::DEVICES_NUM; idx++) {
auxHk.deviceTypes[idx] = *(packet + dataOffset);
dataOffset += 3;
}
for (uint8_t idx = 0; idx < PDU::DEVICES_NUM; idx++) {
auxHk.devicesStatus[idx] = *(packet + dataOffset);
dataOffset += 3;
}
auxHk.gndWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.i2cWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.canWdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.csp1WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.csp2WdtReboots = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.groundWatchdogSecondsLeft = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.i2cWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.canWatchdogSecondsLeft = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
auxHk.csp1WatchdogPingsLeft = *(packet + dataOffset);
dataOffset += 3;
auxHk.csp2WatchdogPingsLeft = *(packet + dataOffset);
coreHk.setChanged(true);
if (not coreHk.isValid()) {
coreHk.setValidity(true, true);
}
if (not auxHk.isValid()) {
auxHk.setValidity(true, true);
}
return RETURN_OK;
}

View File

@ -110,6 +110,12 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
virtual ReturnValue_t childCommandHook(DeviceCommandId_t cmd, const uint8_t *commandData,
size_t commandDataLen);
ReturnValue_t parsePduHkTable(PDU::PduCoreHk &coreHk, PDU::PduAuxHk &auxHk,
const uint8_t *packet);
ReturnValue_t initializePduPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager,
std::array<uint8_t, PDU::CHANNELS_LEN> initOutEnb);
private:
SetParamMessageUnpacker setParamCacher;
/**

View File

@ -118,14 +118,17 @@ ReturnValue_t IMTQHandler::buildCommandFromCommand(DeviceCommandId_t deviceComma
case (IMTQ::START_ACTUATION_DIPOLE): {
/* IMTQ expects low byte first */
commandBuffer[0] = IMTQ::CC::START_ACTUATION_DIPOLE;
commandBuffer[1] = *(commandData + 1);
commandBuffer[2] = *(commandData);
commandBuffer[3] = *(commandData + 3);
commandBuffer[4] = *(commandData + 2);
commandBuffer[5] = *(commandData + 5);
commandBuffer[6] = *(commandData + 4);
commandBuffer[7] = *(commandData + 7);
commandBuffer[8] = *(commandData + 6);
if(commandData == nullptr) {
return DeviceHandlerIF::INVALID_COMMAND_PARAMETER;
}
commandBuffer[1] = commandData[1];
commandBuffer[2] = commandData[0];
commandBuffer[3] = commandData[3];
commandBuffer[4] = commandData[2];
commandBuffer[5] = commandData[5];
commandBuffer[6] = commandData[4];
commandBuffer[7] = commandData[7];
commandBuffer[8] = commandData[6];
rawPacket = commandBuffer;
rawPacketLen = 9;
return RETURN_OK;

View File

@ -111,7 +111,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
dataOffset += 6;
coreHk.bootCount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
if(firstHk) {
if (firstHk) {
triggerEvent(P60_BOOT_COUNT, coreHk.bootCount.value);
}
dataOffset += 6;
@ -216,11 +216,11 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
using namespace P60System;
localDataPoolMap.emplace(pool::CURRENTS, &hkCurrents);
localDataPoolMap.emplace(pool::P60_CURRENTS, &hkCurrents);
localDataPoolMap.emplace(pool::VOLTAGES, &hkVoltages);
localDataPoolMap.emplace(pool::P60_VOLTAGES, &hkVoltages);
localDataPoolMap.emplace(pool::OUTPUT_ENABLE, &outputEnables);
localDataPoolMap.emplace(pool::P60_OUTPUT_ENABLE, &outputEnables);
localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::P60DOCK_TEMPERATURE_2, new PoolEntry<int16_t>({0}));

View File

@ -11,8 +11,9 @@
PCDUHandler::PCDUHandler(object_id_t setObjectId, size_t cmdQueueSize)
: SystemObject(setObjectId),
poolManager(this, nullptr),
pdu2HkTableDataset(this),
pdu1HkTableDataset(this),
pdu1CoreHk(this),
pdu2CoreHk(this),
switcherSet(this),
cmdQueueSize(cmdQueueSize) {
auto mqArgs = MqArgs(setObjectId, static_cast<void*>(this));
commandQueue = QueueFactory::instance()->createMessageQueue(
@ -51,8 +52,8 @@ ReturnValue_t PCDUHandler::initialize() {
return RETURN_FAILED;
}
result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage(
static_cast<uint32_t>(P60System::SetIds::PDU_2), this->getObjectId(), commandQueue->getId(),
true);
static_cast<uint32_t>(P60System::SetIds::PDU_2_CORE), this->getObjectId(),
commandQueue->getId(), true);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
<< "PDU2Handler" << std::endl;
@ -67,8 +68,8 @@ ReturnValue_t PCDUHandler::initialize() {
return RETURN_FAILED;
}
result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage(
static_cast<uint32_t>(P60System::SetIds::PDU_1), this->getObjectId(), commandQueue->getId(),
true);
static_cast<uint32_t>(P60System::SetIds::PDU_1_CORE), this->getObjectId(),
commandQueue->getId(), true);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
<< "PDU1Handler" << std::endl;
@ -79,9 +80,13 @@ ReturnValue_t PCDUHandler::initialize() {
}
void PCDUHandler::initializeSwitchStates() {
using namespace pcduSwitches;
for (uint8_t idx = 0; idx < Switches::NUMBER_OF_SWITCHES; idx++) {
switchStates[idx] = INIT_SWITCH_STATES[idx];
using namespace pcdu;
for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) {
if (idx < PDU::CHANNELS_LEN) {
switchStates[idx] = INIT_SWITCHES_PDU1[idx];
} else {
switchStates[idx] = INIT_SWITCHES_PDU2[idx];
}
}
}
@ -103,11 +108,12 @@ void PCDUHandler::readCommandQueue() {
MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); }
void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) {
if (sid == sid_t(objects::PDU2_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_2))) {
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
if (sid == sid_t(objects::PDU2_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_2_CORE))) {
updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset);
updatePdu2SwitchStates();
} else if (sid == sid_t(objects::PDU1_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_1))) {
updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset);
} else if (sid ==
sid_t(objects::PDU1_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_1_CORE))) {
updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset);
updatePdu1SwitchStates();
} else {
sif::error << "PCDUHandler::handleChangedDataset: Invalid sid" << std::endl;
@ -120,21 +126,19 @@ void PCDUHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet
HousekeepingSnapshot packetUpdate(reinterpret_cast<uint8_t*>(datasetTimeStamp),
sizeof(CCSDSTime::CDS_short), dataset);
const uint8_t* packet_ptr = NULL;
size_t size;
const uint8_t* packet_ptr = nullptr;
size_t size = 0;
result = IPCStore->getData(storeId, &packet_ptr, &size);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to get data from IPCStore."
<< std::endl;
}
dataset->read();
result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::MACHINE);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to deserialize received packet "
"in hk table dataset"
<< std::endl;
}
dataset->commit();
result = IPCStore->deleteData(storeId);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::updateHkTableDataset: Failed to delete data in IPCStore"
@ -143,29 +147,32 @@ void PCDUHandler::updateHkTableDataset(store_address_t storeId, LocalPoolDataSet
}
void PCDUHandler::updatePdu2SwitchStates() {
using namespace pcduSwitches;
using namespace pcdu;
using namespace PDU2;
GOMSPACE::Pdu pdu = GOMSPACE::Pdu::PDU2;
PoolReadGuard rg(&pdu2HkTableDataset);
if (rg.getReadResult() == RETURN_OK) {
PoolReadGuard rg0(&switcherSet);
if (rg0.getReadResult() == RETURN_OK) {
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
switcherSet.pdu2Switches[idx] = pdu2CoreHk.outputEnables[idx];
}
MutexGuard mg(pwrMutex);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH0_Q7S, pdu2HkTableDataset.outEnabledQ7S.value);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH0_Q7S, pdu2CoreHk.outputEnables[Channels::Q7S]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
pdu2HkTableDataset.outEnabledPlPCDUCh1.value);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH2_RW_5V,
pdu2HkTableDataset.outEnabledReactionWheels.value);
pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH1]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH2_RW_5V, pdu2CoreHk.outputEnables[Channels::RW]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value);
pdu2CoreHk.outputEnables[Channels::TCS_HEATER_IN]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH4_SUS_REDUNDANT_3V3,
pdu2HkTableDataset.outEnabledSUSRedundant.value);
pdu2CoreHk.outputEnables[Channels::SUS_REDUNDANT]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
pdu2HkTableDataset.outEnabledDeplMechanism.value);
pdu2CoreHk.outputEnables[Channels::DEPY_MECHANISM]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8,
pdu2HkTableDataset.outEnabledPlPCDUCh6.value);
pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH6]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
pdu2HkTableDataset.outEnabledAcsBoardSideB.value);
pdu2CoreHk.outputEnables[Channels::ACS_B_SIDE]);
checkAndUpdateSwitch(pdu, Switches::PDU2_CH8_PAYLOAD_CAMERA,
pdu2HkTableDataset.outEnabledPayloadCamera.value);
pdu2CoreHk.outputEnables[Channels::PAYLOAD_CAMERA]);
if (firstSwitchInfoPdu2) {
firstSwitchInfoPdu2 = false;
}
@ -176,27 +183,32 @@ void PCDUHandler::updatePdu2SwitchStates() {
}
void PCDUHandler::updatePdu1SwitchStates() {
using namespace pcduSwitches;
PoolReadGuard rg(&pdu1HkTableDataset);
using namespace pcdu;
using namespace PDU1;
PoolReadGuard rg0(&switcherSet);
GOMSPACE::Pdu pdu = GOMSPACE::Pdu::PDU1;
if (rg.getReadResult() == RETURN_OK) {
if (rg0.getReadResult() == RETURN_OK) {
for (uint8_t idx = 0; idx < PDU::CHANNELS_LEN; idx++) {
switcherSet.pdu1Switches[idx] = pdu1CoreHk.outputEnables[idx];
}
MutexGuard mg(pwrMutex);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH0_TCS_BOARD_3V3,
pdu1HkTableDataset.outEnabledTCSBoard3V3.value);
pdu1CoreHk.outputEnables[Channels::TCS_BOARD_3V3]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH1_SYRLINKS_12V,
pdu1HkTableDataset.outEnabledSyrlinks.value);
pdu1CoreHk.outputEnables[Channels::SYRLINKS]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH2_STAR_TRACKER_5V,
pdu1HkTableDataset.outEnabledStarTracker.value);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH3_MGT_5V, pdu1HkTableDataset.outEnabledMGT.value);
pdu1CoreHk.outputEnables[Channels::STR]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH3_MGT_5V, pdu1CoreHk.outputEnables[Channels::MGT]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH4_SUS_NOMINAL_3V3,
pdu1HkTableDataset.outEnabledSUSNominal.value);
pdu1CoreHk.outputEnables[Channels::SUS_NOMINAL]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH5_SOLAR_CELL_EXP_5V,
pdu1HkTableDataset.outEnabledSolarCellExp.value);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH6_PLOC_12V, pdu1HkTableDataset.outEnabledPLOC.value);
pdu1CoreHk.outputEnables[Channels::SOL_CELL_EXPERIMENT]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH6_PLOC_12V,
pdu1CoreHk.outputEnables[Channels::PLOC]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH7_ACS_A_SIDE_3V3,
pdu1HkTableDataset.outEnabledAcsBoardSideA.value);
pdu1CoreHk.outputEnables[Channels::ACS_A_SIDE]);
checkAndUpdateSwitch(pdu, Switches::PDU1_CH8_UNOCCUPIED,
pdu1HkTableDataset.outEnabledChannel8.value);
pdu1CoreHk.outputEnables[Channels::UNUSED]);
if (firstSwitchInfoPdu1) {
firstSwitchInfoPdu1 = false;
}
@ -208,7 +220,7 @@ void PCDUHandler::updatePdu1SwitchStates() {
LocalDataPoolManager* PCDUHandler::getHkManagerHandle() { return &poolManager; }
ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) {
using namespace pcduSwitches;
using namespace pcdu;
ReturnValue_t result;
uint16_t memoryAddress = 0;
size_t parameterValueSize = sizeof(uint8_t);
@ -216,94 +228,94 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
GomspaceDeviceHandler* pdu = nullptr;
switch (switchNr) {
case pcduSwitches::PDU1_CH0_TCS_BOARD_3V3: {
case pcdu::PDU1_CH0_TCS_BOARD_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH1_SYRLINKS_12V: {
case pcdu::PDU1_CH1_SYRLINKS_12V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SYRLINKS;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH2_STAR_TRACKER_5V: {
case pcdu::PDU1_CH2_STAR_TRACKER_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_STAR_TRACKER;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH3_MGT_5V: {
case pcdu::PDU1_CH3_MGT_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_MGT;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH4_SUS_NOMINAL_3V3: {
case pcdu::PDU1_CH4_SUS_NOMINAL_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH5_SOLAR_CELL_EXP_5V: {
case pcdu::PDU1_CH5_SOLAR_CELL_EXP_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH6_PLOC_12V: {
case pcdu::PDU1_CH6_PLOC_12V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH7_ACS_A_SIDE_3V3: {
case pcdu::PDU1_CH7_ACS_A_SIDE_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
case pcduSwitches::PDU1_CH8_UNOCCUPIED: {
case pcdu::PDU1_CH8_UNOCCUPIED: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break;
}
// This is a dangerous command. Reject/Igore it for now
case pcduSwitches::PDU2_CH0_Q7S: {
case pcdu::PDU2_CH0_Q7S: {
return RETURN_FAILED;
// memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S;
// pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
// break;
}
case pcduSwitches::PDU2_CH1_PL_PCDU_BATT_0_14V8: {
case pcdu::PDU2_CH1_PL_PCDU_BATT_0_14V8: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH2_RW_5V: {
case pcdu::PDU2_CH2_RW_5V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: {
case pcdu::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH4_SUS_REDUNDANT_3V3: {
case pcdu::PDU2_CH4_SUS_REDUNDANT_3V3: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: {
case pcdu::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH6_PL_PCDU_BATT_1_14V8: {
case pcdu::PDU2_CH6_PL_PCDU_BATT_1_14V8: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: {
case pcdu::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
}
case pcduSwitches::PDU2_CH8_PAYLOAD_CAMERA: {
case pcdu::PDU2_CH8_PAYLOAD_CAMERA: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA;
pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break;
@ -355,7 +367,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const {
if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) {
if (switchNr >= pcdu::NUMBER_OF_SWITCHES) {
sif::debug << "PCDUHandler::getSwitchState: Invalid switch number" << std::endl;
return RETURN_FAILED;
}
@ -377,212 +389,10 @@ object_id_t PCDUHandler::getObjectId() const { return SystemObject::getObjectId(
ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) {
using namespace pcduSwitches;
using namespace P60System;
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH0_Q7S]}));
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8]}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH2_RW_5V]}));
#ifdef TE0720_1CFA
localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V]}));
#endif
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_SUS_REDUNDANT,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH4_SUS_REDUNDANT_3V3]}));
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V]}));
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8]}));
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3]}));
localDataPoolMap.emplace(
pool::PDU2_OUT_EN_PAYLOAD_CAMERA,
new PoolEntry<uint8_t>({INIT_SWITCH_STATES[Switches::PDU2_CH8_PAYLOAD_CAMERA]}));
localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_STAR_TRACKER, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SUS_NOMINAL, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH0_TCS_BOARD_3V3]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_SYRLINKS,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH1_SYRLINKS_12V]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_STAR_TRACKER,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH2_STAR_TRACKER_5V]}));
localDataPoolMap.emplace(pool::PDU1_VOLTAGE_OUT_MGT,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH3_MGT_5V]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH4_SUS_NOMINAL_3V3]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH5_SOLAR_CELL_EXP_5V]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_PLOC,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH6_PLOC_12V]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH7_ACS_A_SIDE_3V3]}));
localDataPoolMap.emplace(
pool::PDU1_VOLTAGE_OUT_CHANNEL8,
new PoolEntry<int16_t>({INIT_SWITCH_STATES[Switches::PDU1_CH8_UNOCCUPIED]}));
localDataPoolMap.emplace(pool::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_SOLAR_CELL_EXP, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_TCS_BOARD_3V3, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_STAR_TRACKER, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_SOLAR_CELL_EXP, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
using namespace pcdu;
localDataPoolMap.emplace(PoolIds::PDU1_SWITCHES, &pdu1Switches);
localDataPoolMap.emplace(PoolIds::PDU2_SWITCHES, &pdu2Switches);
poolManager.subscribeForPeriodicPacket(switcherSet.getSid(), false, 5.0, true);
return HasReturnvaluesIF::RETURN_OK;
}
@ -602,17 +412,17 @@ uint32_t PCDUHandler::getPeriodicOperationFrequency() const { return pstInterval
void PCDUHandler::setTaskIF(PeriodicTaskIF* task) { executingTask = task; }
LocalPoolDataSetBase* PCDUHandler::getDataSetHandle(sid_t sid) {
if (sid == pdu2HkTableDataset.getSid()) {
return &pdu2HkTableDataset;
if (sid == switcherSet.getSid()) {
return &switcherSet;
} else {
sif::error << "PCDUHandler::getDataSetHandle: Invalid sid" << std::endl;
return nullptr;
}
}
void PCDUHandler::checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcduSwitches::Switches switchIdx,
void PCDUHandler::checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx,
uint8_t setValue) {
using namespace pcduSwitches;
using namespace pcdu;
if (switchStates[switchIdx] != setValue) {
#if OBSW_INITIALIZE_SWITCHES == 1
// This code initializes the switches to the default init switch states on every reboot.

View File

@ -2,6 +2,7 @@
#define MISSION_DEVICES_PCDUHANDLER_H_
#include <devices/powerSwitcherList.h>
#include <fsfw/datapool/PoolEntry.h>
#include <fsfw/datapoollocal/HasLocalDataPoolIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/power/PowerSwitchIF.h>
@ -56,21 +57,29 @@ class PCDUHandler : public PowerSwitchIF,
/** Housekeeping manager. Handles updates of local pool variables. */
LocalDataPoolManager poolManager;
/** Hk table dataset of PDU1 */
PDU1::Pdu1CoreHk pdu1CoreHk;
/**
* The dataset holding the hk table of PDU2. This dataset is a copy of the PDU2 HK dataset
* of the PDU2Handler. Each time the PDU2Handler updates his HK dataset, a copy is sent
* to this object via a HousekeepingMessage.
*/
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
PDU2::Pdu2CoreHk pdu2CoreHk;
pcdu::SwitcherStates switcherSet;
PoolEntry<uint8_t> pdu1Switches =
PoolEntry<uint8_t>(pcdu::INIT_SWITCHES_PDU1.data(), pcdu::INIT_SWITCHES_PDU1.size());
PoolEntry<uint8_t> pdu2Switches =
PoolEntry<uint8_t>(pcdu::INIT_SWITCHES_PDU2.data(), pcdu::INIT_SWITCHES_PDU2.size());
/** The timeStamp of the current pdu2HkTableDataset */
CCSDSTime::CDS_short timeStampPdu2HkDataset;
/** Hk table dataset of PDU1 */
PDU1::PDU1HkTableDataset pdu1HkTableDataset;
/** The timeStamp of the current pdu1HkTableDataset */
CCSDSTime::CDS_short timeStampPdu1HkDataset;
uint8_t switchStates[pcduSwitches::NUMBER_OF_SWITCHES];
uint8_t switchStates[pcdu::NUMBER_OF_SWITCHES];
/**
* Pointer to the IPCStore.
* This caches the pointer received from the objectManager in the constructor.
@ -119,7 +128,7 @@ class PCDUHandler : public PowerSwitchIF,
*/
void updateHkTableDataset(store_address_t storeId, LocalPoolDataSetBase* dataset,
CCSDSTime::CDS_short* datasetTimeStamp);
void checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcduSwitches::Switches switchIdx, uint8_t setValue);
void checkAndUpdateSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx, uint8_t setValue);
};
#endif /* MISSION_DEVICES_PCDUHANDLER_H_ */

View File

@ -3,12 +3,13 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include "OBSWConfig.h"
#include "devices/powerSwitcherList.h"
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
pdu1HkTableDataset(this) {}
coreHk(this),
auxHk(this) {}
PDU1Handler::~PDU1Handler() {}
@ -19,52 +20,7 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
parseHkTableReply(packet);
handleDeviceTM(&pdu1HkTableDataset, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU1 == 1
pdu1HkTableDataset.read();
sif::info << "PDU1 TCS Board voltage: " << pdu1HkTableDataset.voltageOutTCSBoard3V3 << std::endl;
sif::info << "PDU1 Syrlinks voltage: " << pdu1HkTableDataset.voltageOutSyrlinks << std::endl;
sif::info << "PDU1 star tracker voltage: " << pdu1HkTableDataset.voltageOutStarTracker
<< std::endl;
sif::info << "PDU1 MGT voltage: " << pdu1HkTableDataset.voltageOutMGT << std::endl;
sif::info << "PDU1 SUS nominal voltage: " << pdu1HkTableDataset.voltageOutSUSNominal << std::endl;
sif::info << "PDU1 solar cell experiment voltage: " << pdu1HkTableDataset.voltageOutSolarCellExp
<< std::endl;
sif::info << "PDU1 PLOC voltage: " << pdu1HkTableDataset.voltageOutPLOC << std::endl;
sif::info << "PDU1 ACS Side A voltage: " << pdu1HkTableDataset.voltageOutACSBoardSideA
<< std::endl;
sif::info << "PDU1 channel 8 voltage: " << pdu1HkTableDataset.voltageOutACSBoardSideA
<< std::endl;
sif::info << "PDU1 TCS Board current: " << pdu1HkTableDataset.currentOutTCSBoard3V3 << std::endl;
sif::info << "PDU1 Syrlinks current: " << pdu1HkTableDataset.currentOutSyrlinks << std::endl;
sif::info << "PDU1 star tracker current: " << pdu1HkTableDataset.currentOutStarTracker
<< std::endl;
sif::info << "PDU1 MGT current: " << pdu1HkTableDataset.currentOutMGT << std::endl;
sif::info << "PDU1 SUS nominal current: " << pdu1HkTableDataset.currentOutSUSNominal << std::endl;
sif::info << "PDU1 solar cell experiment current: " << pdu1HkTableDataset.currentOutSolarCellExp
<< std::endl;
sif::info << "PDU1 PLOC current: " << pdu1HkTableDataset.currentOutPLOC << std::endl;
sif::info << "PDU1 ACS Side A current: " << pdu1HkTableDataset.currentOutACSBoardSideA
<< std::endl;
sif::info << "PDU1 channel 8 current: " << pdu1HkTableDataset.currentOutChannel8 << std::endl;
printOutputSwitchStates();
sif::info << "PDU1 battery mode: " << static_cast<unsigned int>(pdu1HkTableDataset.battMode.value)
<< std::endl;
sif::info << "PDU1 VCC: " << pdu1HkTableDataset.vcc << " mV" << std::endl;
float vbat = pdu1HkTableDataset.vbat.value * 0.001;
sif::info << "PDU1 VBAT: " << vbat << "V" << std::endl;
float temperatureC = pdu1HkTableDataset.temperature.value * 0.1;
sif::info << "PDU1 Temperature: " << temperatureC << " °C" << std::endl;
sif::info << "PDU1 csp1 watchdog pings before reboot: "
<< static_cast<unsigned int>(pdu1HkTableDataset.csp1WatchdogPingsLeft.value)
<< std::endl;
sif::info << "PDU1 csp2 watchdog pings before reboot: "
<< static_cast<unsigned int>(pdu1HkTableDataset.csp2WatchdogPingsLeft.value)
<< std::endl;
pdu1HkTableDataset.commit();
#endif
handleDeviceTM(&coreHk, id, true);
}
void PDU1Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) {
@ -123,315 +79,22 @@ ReturnValue_t PDU1Handler::setParamCallback(SetParamMessageUnpacker &unpacker,
}
void PDU1Handler::parseHkTableReply(const uint8_t *packet) {
uint16_t dataOffset = 0;
PoolReadGuard pg(&pdu1HkTableDataset);
ReturnValue_t readResult = pg.getReadResult();
if (readResult != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Reading PDU1 HK table failed!" << std::endl;
return;
}
/* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table
* address. */
dataOffset += 12;
pdu1HkTableDataset.currentOutTCSBoard3V3 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutStarTracker =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutMGT = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutSUSNominal =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutSolarCellExp =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutPLOC = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutACSBoardSideA =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.currentOutChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutTCSBoard3V3 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutStarTracker =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutMGT = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutSUSNominal =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutSolarCellExp =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutPLOC = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutACSBoardSideA =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.voltageOutChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.converterEnable1 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.converterEnable2 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.converterEnable3 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledTCSBoard3V3 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledSyrlinks = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledStarTracker = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledMGT = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledSUSNominal = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledSolarCellExp = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledPLOC = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledAcsBoardSideA = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.outEnabledChannel8 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset);
dataOffset += 4;
pdu1HkTableDataset.battMode = *(packet + dataOffset);
/* +10 because here begins the second gomspace csp packet */
dataOffset += 3 + 10;
pdu1HkTableDataset.latchupsTcsBoard3V3 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsSyrlinks = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsStarTracker = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsMgt = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsSusNominal = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsSolarCellExp =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsPloc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsAcsBoardSideA =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.latchupsChannel8 = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu1HkTableDataset.device0 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device1 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device2 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device3 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device4 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device5 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device6 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device7 = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device0Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device1Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device2Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device3Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device4Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device5Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device6Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.device7Status = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.gndWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.i2cWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.canWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.csp1WdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.csp2WdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.groundWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.i2cWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.canWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu1HkTableDataset.csp1WatchdogPingsLeft = *(packet + dataOffset);
dataOffset += 3;
pdu1HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset);
pdu1HkTableDataset.setChanged(true);
if (not pdu1HkTableDataset.isValid()) {
pdu1HkTableDataset.setValidity(true, true);
}
GomspaceDeviceHandler::parsePduHkTable(coreHk, auxHk, packet);
}
ReturnValue_t PDU1Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_MGT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_PLOC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SYRLINKS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_STAR_TRACKER, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_MGT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_PLOC, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A,
new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_OUT_EN_CHANNEL8, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SYRLINKS, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_STAR_TRACKER,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_MGT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_PLOC, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A,
new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_LATCHUP_CHANNEL8, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(P60System::pool::PDU1_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(pdu1HkTableDataset.getSid(), false, 10.0, false);
initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU1);
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true);
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}
LocalPoolDataSetBase *PDU1Handler::getDataSetHandle(sid_t sid) {
if (sid == pdu1HkTableDataset.getSid()) {
return &pdu1HkTableDataset;
if (sid == coreHk.getSid()) {
return &coreHk;
} else if (sid == auxHk.getSid()) {
return &auxHk;
}
return nullptr;
}
@ -440,7 +103,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
ReturnValue_t result = RETURN_OK;
switch (cmd) {
case (GOMSPACE::PRINT_SWITCH_V_I): {
PoolReadGuard pg(&pdu1HkTableDataset);
PoolReadGuard pg(&coreHk);
result = pg.getReadResult();
if (result != HasReturnvaluesIF::RETURN_OK) {
break;
@ -449,7 +112,7 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
break;
}
case (GOMSPACE::PRINT_LATCHUPS): {
PoolReadGuard pg(&pdu1HkTableDataset);
PoolReadGuard pg(&auxHk);
result = pg.getReadResult();
if (result != HasReturnvaluesIF::RETURN_OK) {
break;
@ -468,72 +131,46 @@ ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
}
void PDU1Handler::printHkTableSwitchVI() {
using namespace PDU1;
sif::info << "PDU1 Info: " << std::endl;
sif::info << "Boot Cause: " << pdu1HkTableDataset.bootcause << " | Boot Count: " << std::setw(4)
<< std::right << pdu1HkTableDataset.bootcount << std::endl;
sif::info << "Reset Cause: " << pdu1HkTableDataset.resetcause
<< " | Battery Mode: " << static_cast<int>(pdu1HkTableDataset.battMode.value)
<< std::endl;
sif::info << "Boot Cause: " << auxHk.bootcause << " | Boot Count: " << std::setw(4) << std::right
<< coreHk.bootcount << std::endl;
sif::info << "Reset Cause: " << auxHk.resetcause
<< " | Battery Mode: " << static_cast<int>(coreHk.battMode.value) << std::endl;
sif::info << "SwitchState, Currents [mA], Voltages [mV]:" << std::endl;
sif::info << std::setw(30) << std::left << "TCS Board" << std::dec << "| "
<< unsigned(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << ", " << std::setw(4)
<< std::right << pdu1HkTableDataset.currentOutTCSBoard3V3.value << ", " << std::setw(4)
<< pdu1HkTableDataset.voltageOutTCSBoard3V3.value << std::endl;
sif::info << std::setw(30) << std::left << "Syrlinks" << std::dec << "| "
<< unsigned(pdu1HkTableDataset.outEnabledSyrlinks.value) << ", " << std::setw(4)
<< std::right << pdu1HkTableDataset.currentOutSyrlinks.value << ", " << std::setw(4)
<< pdu1HkTableDataset.voltageOutSyrlinks.value << std::endl;
sif::info << std::setw(30) << std::left << "Star Tracker" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledStarTracker.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutStarTracker.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutStarTracker.value << std::endl;
sif::info << std::setw(30) << std::left << "MGT" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledMGT.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutMGT.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutMGT.value << std::endl;
sif::info << std::setw(30) << std::left << "SuS nominal" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSUSNominal.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutSUSNominal.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutSUSNominal.value << std::endl;
sif::info << std::setw(30) << std::left << "Solar Cell Experiment" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSolarCellExp.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutSolarCellExp.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutSolarCellExp.value << std::endl;
sif::info << std::setw(30) << std::left << "PLOC" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledPLOC.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutPLOC.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutPLOC.value << std::endl;
sif::info << std::setw(30) << std::left << "ACS Side A" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutACSBoardSideA.value
<< ", " << std::setw(4) << pdu1HkTableDataset.voltageOutACSBoardSideA.value
<< std::endl;
sif::info << std::setw(30) << std::left << "Channel 8" << std::dec << "| "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledChannel8.value) << ", "
<< std::setw(4) << std::right << pdu1HkTableDataset.currentOutChannel8.value << ", "
<< std::setw(4) << pdu1HkTableDataset.voltageOutChannel8.value << std::right
<< std::endl;
auto printerHelper = [&](std::string channelStr, Channels idx) {
sif::info << std::setw(30) << std::left << channelStr << std::dec << "| "
<< unsigned(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right
<< coreHk.currents[idx] << ", " << std::setw(4) << coreHk.voltages[idx] << std::endl;
};
printerHelper("TCS Board", Channels::TCS_BOARD_3V3);
printerHelper("Syrlinks", Channels::SYRLINKS);
printerHelper("Star Tracker", Channels::STR);
printerHelper("MGT", Channels::MGT);
printerHelper("SUS Nominal", Channels::SUS_NOMINAL);
printerHelper("SCEX", Channels::SOL_CELL_EXPERIMENT);
printerHelper("PLOC", Channels::PLOC);
printerHelper("ACS Board A Side", Channels::ACS_A_SIDE);
printerHelper("Channel 8", Channels::UNUSED);
printerHelper("Syrlinks", Channels::SYRLINKS);
}
void PDU1Handler::printHkTableLatchups() {
using namespace PDU1;
sif::info << "PDU1 Latchup Information" << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsTcsBoard3V3 << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Syrlinks" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsSyrlinks << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Star Tracker" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsStarTracker << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "MGT" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsMgt << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsSusNominal << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Solar Cell Experiment" << std::dec
<< "| " << std::setw(4) << std::right << pdu1HkTableDataset.latchupsSolarCellExp
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "PLOC" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsPloc << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS A Side" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsAcsBoardSideA << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Channel 8" << std::dec << "| "
<< std::setw(4) << std::right << pdu1HkTableDataset.latchupsChannel8 << std::endl;
auto printerHelper = [&](std::string channelStr, Channels idx) {
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| "
<< std::setw(4) << std::right << auxHk.latchups[idx] << std::endl;
};
printerHelper("TCS Board", Channels::TCS_BOARD_3V3);
printerHelper("Syrlinks", Channels::SYRLINKS);
printerHelper("Star Tracker", Channels::STR);
printerHelper("MGT", Channels::MGT);
printerHelper("SUS Nominal", Channels::SUS_NOMINAL);
printerHelper("SCEX", Channels::SOL_CELL_EXPERIMENT);
printerHelper("PLOC", Channels::PLOC);
printerHelper("ACS Board A Side", Channels::ACS_A_SIDE);
printerHelper("Channel 8", Channels::UNUSED);
printerHelper("Syrlinks", Channels::SYRLINKS);
}

View File

@ -43,7 +43,8 @@ class PDU1Handler : public GomspaceDeviceHandler {
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24;
/** Dataset for the housekeeping table of the PDU1 */
PDU1::PDU1HkTableDataset pdu1HkTableDataset;
PDU1::Pdu1CoreHk coreHk;
PDU1::Pdu1AuxHk auxHk;
GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr;
void* hookArgs = nullptr;

View File

@ -3,12 +3,13 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include "OBSWConfig.h"
#include "devices/powerSwitcherList.h"
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
pdu2HkTableDataset(this) {}
coreHk(this),
auxHk(this) {}
PDU2Handler::~PDU2Handler() {}
@ -23,29 +24,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
* Hk table will be sent to the commander if hk table request was not triggered by the
* PDU2Handler itself.
*/
handleDeviceTM(&pdu2HkTableDataset, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PDU2 == 1
pdu2HkTableDataset.read();
sif::info << "PDU2 Q7S current voltage: " << pdu2HkTableDataset.voltageOutQ7S << " mV"
<< std::endl;
sif::info << "PDU2 VCC: " << pdu2HkTableDataset.vcc << " mV" << std::endl;
float vbat = pdu2HkTableDataset.vbat.value * 0.1;
sif::info << "PDU2 VBAT: " << vbat << std::endl;
float temperatureC = pdu2HkTableDataset.temperature.value * 0.1;
sif::info << "PDU2 Temperature: " << temperatureC << " °C" << std::endl;
printOutputSwitchStates();
sif::info << "PDU2 uptime: " << pdu2HkTableDataset.uptime << " seconds" << std::endl;
sif::info << "PDU2 battery mode: " << unsigned(pdu2HkTableDataset.battMode.value) << std::endl;
sif::info << "PDU2 ground watchdog reboots: " << pdu2HkTableDataset.gndWdtReboots << std::endl;
sif::info << "PDU2 ground watchdog timer seconds left: "
<< pdu2HkTableDataset.groundWatchdogSecondsLeft << " seconds" << std::endl;
sif::info << "PDU2 csp1 watchdog pings before reboot: "
<< unsigned(pdu2HkTableDataset.csp1WatchdogPingsLeft.value) << std::endl;
sif::info << "PDU2 csp2 watchdog pings before reboot: "
<< unsigned(pdu2HkTableDataset.csp2WatchdogPingsLeft.value) << std::endl;
pdu2HkTableDataset.commit();
#endif
handleDeviceTM(&coreHk, id, true);
}
void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void *args) {
@ -54,313 +33,23 @@ void PDU2Handler::assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, vo
}
LocalPoolDataSetBase *PDU2Handler::getDataSetHandle(sid_t sid) {
if (sid == pdu2HkTableDataset.getSid()) {
return &pdu2HkTableDataset;
if (sid == coreHk.getSid()) {
return &coreHk;
} else if (sid == auxHk.getSid()) {
return &auxHk;
}
return nullptr;
}
void PDU2Handler::parseHkTableReply(const uint8_t *packet) {
uint16_t dataOffset = 0;
pdu2HkTableDataset.read();
/**
* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table
* address.
*/
dataOffset += 12;
pdu2HkTableDataset.currentOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutPayloadPCDUCh1 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutReactionWheels =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutTCSBoardHeaterIn =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutSUSRedundant =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutDeplMechanism =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutPayloadPCDUCh6 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutACSBoardSideB =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.currentOutPayloadCamera =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutPayloadPCDUCh1 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutReactionWheels =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutTCSBoardHeaterIn =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutSUSRedundant =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutDeplMechanism =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutPayloadPCDUCh6 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutACSBoardSideB =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.voltageOutPayloadCamera =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.vcc = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.vbat = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.temperature = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.converterEnable1 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.converterEnable2 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.converterEnable3 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledQ7S = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledPlPCDUCh1 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledReactionWheels = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledTCSBoardHeaterIn = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledSUSRedundant = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledDeplMechanism = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledPlPCDUCh6 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledAcsBoardSideB = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.outEnabledPayloadCamera = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.bootcause = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.bootcount = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.uptime = *(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.resetcause = *(packet + dataOffset + 1) << 8 | *(packet + dataOffset);
dataOffset += 4;
pdu2HkTableDataset.battMode = *(packet + dataOffset);
/* +10 because here begins the second gomspace csp packet */
dataOffset += 3 + 10;
pdu2HkTableDataset.latchupsQ7S = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsPayloadPcduCh1 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsRw = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsTcsBoardHeaterIn =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsSusRedundant =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsDeplMenchanism =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsPayloadPcduCh6 =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsAcsBoardSideB =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.latchupsPayloadCamera =
*(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4;
pdu2HkTableDataset.device0 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device1 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device2 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device3 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device4 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device5 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device6 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device7 = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device0Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device1Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device2Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device3Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device4Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device5Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device6Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.device7Status = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.gndWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.i2cWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.canWdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.csp1WdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.csp2WdtReboots = *(packet + dataOffset) << 24 |
*(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.groundWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.i2cWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.canWatchdogSecondsLeft =
*(packet + dataOffset) << 24 | *(packet + dataOffset + 1) << 16 |
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6;
pdu2HkTableDataset.csp1WatchdogPingsLeft = *(packet + dataOffset);
dataOffset += 3;
pdu2HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset);
pdu2HkTableDataset.commit();
pdu2HkTableDataset.setChanged(true);
GomspaceDeviceHandler::parsePduHkTable(coreHk, auxHk, packet);
}
ReturnValue_t PDU2Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
using namespace P60System;
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VCC, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_VBAT, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_TEMPERATURE, new PoolEntry<int16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_CONV_EN_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>({0}));
#ifdef TE0720_1CFA
localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({1}));
#else
localDataPoolMap.emplace(pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>({0}));
#endif
localDataPoolMap.emplace(pool::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_BOOTCNT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_UPTIME, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_RESETCAUSE, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_BATT_MODE, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_Q7S, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_RW, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_SUS_REDUNDANT, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_LATCHUP_PAYLOAD_CAMERA, new PoolEntry<uint16_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_0, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_2, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_3, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_4, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_5, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_6, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_7, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP1, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CNT_CSP2, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT1, new PoolEntry<uint8_t>({0}));
localDataPoolMap.emplace(pool::PDU2_WDT_CSP_LEFT2, new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(pdu2HkTableDataset.getSid(), false, 10.0, false);
initializePduPool(localDataPoolMap, poolManager, pcdu::INIT_SWITCHES_PDU2);
poolManager.subscribeForPeriodicPacket(coreHk.getSid(), false, 10.0, true);
poolManager.subscribeForPeriodicPacket(auxHk.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}
@ -368,7 +57,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
ReturnValue_t result = RETURN_OK;
switch (cmd) {
case (GOMSPACE::PRINT_SWITCH_V_I): {
PoolReadGuard pg(&pdu2HkTableDataset);
PoolReadGuard pg(&coreHk);
result = pg.getReadResult();
if (result != HasReturnvaluesIF::RETURN_OK) {
break;
@ -377,7 +66,7 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
break;
}
case (GOMSPACE::PRINT_LATCHUPS): {
PoolReadGuard pg(&pdu2HkTableDataset);
PoolReadGuard pg(&auxHk);
result = pg.getReadResult();
if (result != HasReturnvaluesIF::RETURN_OK) {
break;
@ -396,77 +85,45 @@ ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
}
void PDU2Handler::printHkTableSwitchVI() {
using namespace PDU2;
sif::info << "PDU2 Info:" << std::endl;
sif::info << "Boot Cause: " << pdu2HkTableDataset.bootcause << " | Boot Count: " << std::setw(4)
<< std::right << pdu2HkTableDataset.bootcount << std::endl;
sif::info << "Reset Cause: " << pdu2HkTableDataset.resetcause
<< " | Battery Mode: " << static_cast<int>(pdu2HkTableDataset.battMode.value)
<< std::endl;
sif::info << "Boot Cause: " << auxHk.bootcause << " | Boot Count: " << std::setw(4) << std::right
<< coreHk.bootcount << std::endl;
sif::info << "Reset Cause: " << auxHk.resetcause
<< " | Battery Mode: " << static_cast<int>(coreHk.battMode.value) << std::endl;
sif::info << "SwitchState, Currents [mA], Voltages [mV]: " << std::endl;
sif::info << std::setw(30) << std::left << "Q7S" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutQ7S.value << ", " << std::setw(4)
<< pdu2HkTableDataset.voltageOutQ7S.value << std::endl;
sif::info << std::setw(30) << std::left << "Payload PCDU Channel 1" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutPayloadPCDUCh1.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutPayloadPCDUCh1.value << std::endl;
sif::info << std::setw(30) << std::left << "Reaction Wheels" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutReactionWheels.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutReactionWheels.value << std::endl;
sif::info << std::setw(30) << std::left << "TCS Board Heater Input" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutTCSBoardHeaterIn.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutTCSBoardHeaterIn.value << std::endl;
sif::info << std::setw(30) << std::left << "SuS Redundant" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutSUSRedundant.value << ", " << std::setw(4)
<< pdu2HkTableDataset.voltageOutSUSRedundant.value << std::endl;
sif::info << std::setw(30) << std::left << "Deployment mechanism" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutDeplMechanism.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutDeplMechanism.value << std::endl;
sif::info << std::setw(30) << std::left << "Payload PCDU Channel 6" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutPayloadPCDUCh6.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutPayloadPCDUCh6.value << std::endl;
sif::info << std::setw(30) << std::left << "ACS Board Side B" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutACSBoardSideB.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutACSBoardSideB.value << std::endl;
sif::info << std::setw(30) << std::left << "Payload Camera" << std::dec << "| "
<< unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << ", " << std::setw(4)
<< std::right << pdu2HkTableDataset.currentOutPayloadCamera.value << ", "
<< std::setw(4) << pdu2HkTableDataset.voltageOutPayloadCamera.value << std::right
<< std::endl;
auto printerHelper = [&](std::string channelStr, Channels idx) {
sif::info << std::setw(30) << std::left << channelStr << std::dec << "| "
<< unsigned(coreHk.outputEnables[idx]) << ", " << std::setw(4) << std::right
<< coreHk.currents[idx] << ", " << std::setw(4) << coreHk.voltages[idx] << std::endl;
};
printerHelper("Q7S", Channels::Q7S);
printerHelper("PL PCDU CH1", Channels::PAYLOAD_PCDU_CH1);
printerHelper("Reaction Wheels", Channels::RW);
printerHelper("TCS Board Heater Input", Channels::TCS_HEATER_IN);
printerHelper("SUS Redundant", Channels::SUS_REDUNDANT);
printerHelper("Deployment Mechanism", Channels::DEPY_MECHANISM);
printerHelper("PL PCDU CH6", Channels::PAYLOAD_PCDU_CH6);
printerHelper("ACS Board B Side", Channels::ACS_B_SIDE);
printerHelper("Payload Camera", Channels::PAYLOAD_CAMERA);
}
void PDU2Handler::printHkTableLatchups() {
using namespace PDU2;
sif::info << "PDU2 Latchup Information" << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Q7S" << std::dec << "| "
<< std::setw(4) << std::right << pdu2HkTableDataset.latchupsQ7S << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 1" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh1
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Reaction Wheels" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsRw << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board Heater Input" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsTcsBoardHeaterIn
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "SuS Nominal" << std::dec << "| "
<< std::setw(4) << std::right << pdu2HkTableDataset.latchupsSusRedundant << std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Deployment mechanism" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsDeplMenchanism
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload PCDU Channel 6" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadPcduCh6
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "ACS Board Side B" << std::dec
<< "| " << std::setw(4) << std::right << pdu2HkTableDataset.latchupsAcsBoardSideB
<< std::endl;
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "Payload Camera" << std::dec << "| "
<< std::setw(4) << std::right << pdu2HkTableDataset.latchupsPayloadCamera << std::endl;
auto printerHelper = [&](std::string channelStr, Channels idx) {
sif::info << std::setw(MAX_CHANNEL_STR_WIDTH) << std::left << "TCS Board" << std::dec << "| "
<< std::setw(4) << std::right << auxHk.latchups[idx] << std::endl;
};
printerHelper("Q7S", Channels::Q7S);
printerHelper("PL PCDU CH1", Channels::PAYLOAD_PCDU_CH1);
printerHelper("Reaction Wheels", Channels::RW);
printerHelper("TCS Board Heater Input", Channels::TCS_HEATER_IN);
printerHelper("SUS Redundant", Channels::SUS_REDUNDANT);
printerHelper("Deployment Mechanism", Channels::DEPY_MECHANISM);
printerHelper("PL PCDU CH6", Channels::PAYLOAD_PCDU_CH6);
printerHelper("ACS Board B Side", Channels::ACS_B_SIDE);
printerHelper("Payload Camera", Channels::PAYLOAD_CAMERA);
}
ReturnValue_t PDU2Handler::setParamCallback(SetParamMessageUnpacker &unpacker,

View File

@ -42,7 +42,8 @@ class PDU2Handler : public GomspaceDeviceHandler {
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24;
/** Dataset for the housekeeping table of the PDU2 */
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
PDU2::Pdu2CoreHk coreHk;
PDU2::Pdu2AuxHk auxHk;
GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr;
void* hookArgs = nullptr;

View File

@ -7,7 +7,7 @@
SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(
object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF* gpioCookie_,
object_id_t mainLineSwitcherObjectId_, pcduSwitches::Switches mainLineSwitch_, gpioId_t deplSA1,
object_id_t mainLineSwitcherObjectId_, pcdu::Switches mainLineSwitch_, gpioId_t deplSA1,
gpioId_t deplSA2, uint32_t burnTimeMs)
: SystemObject(setObjectId_),
gpioDriverId(gpioDriverId_),

View File

@ -43,8 +43,8 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
*/
SolarArrayDeploymentHandler(object_id_t setObjectId, object_id_t gpioDriverId,
CookieIF* gpioCookie, object_id_t mainLineSwitcherObjectId,
pcduSwitches::Switches mainLineSwitch, gpioId_t deplSA1,
gpioId_t deplSA2, uint32_t burnTimeMs);
pcdu::Switches mainLineSwitch, gpioId_t deplSA1, gpioId_t deplSA2,
uint32_t burnTimeMs);
virtual ~SolarArrayDeploymentHandler();

View File

@ -4,9 +4,12 @@
#include <fsfw/datapoollocal/LocalPoolVariable.h>
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
#include <fsfw/power/definitions.h>
#include <cstdint>
#include "devices/powerSwitcherList.h"
namespace GOMSPACE {
enum class Pdu { PDU1, PDU2 };
@ -45,14 +48,22 @@ namespace P60System {
enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 };
enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 };
enum class SetIds : uint32_t {
PDU_1_CORE = 1,
PDU_1_AUX = 2,
PDU_2_CORE = 3,
PDU_2_AUX = 4,
P60_CORE = 5,
P60_AUX = 6,
ACU = 7
};
namespace pool {
enum Ids : lp_id_t {
CURRENTS,
VOLTAGES,
OUTPUT_ENABLE,
P60_CURRENTS,
P60_VOLTAGES,
P60_OUTPUT_ENABLE,
P60DOCK_TEMPERATURE_1,
P60DOCK_TEMPERATURE_2,
P60DOCK_BOOT_CAUSE,
@ -90,154 +101,32 @@ enum Ids : lp_id_t {
P60DOCK_ANT6_DEPL,
P60DOCK_AR6_DEPL,
PDU1_CURRENT_OUT_TCS_BOARD_3V3,
PDU1_CURRENT_OUT_SYRLINKS,
PDU1_CURRENT_OUT_STAR_TRACKER,
PDU1_CURRENT_OUT_MGT,
PDU1_CURRENT_OUT_SUS_NOMINAL,
PDU1_CURRENT_OUT_SOLAR_CELL_EXP,
PDU1_CURRENT_OUT_PLOC,
PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A,
PDU1_CURRENT_OUT_CHANNEL8,
PDU1_VOLTAGE_OUT_TCS_BOARD_3V3,
PDU1_VOLTAGE_OUT_SYRLINKS,
PDU1_VOLTAGE_OUT_STAR_TRACKER,
PDU1_VOLTAGE_OUT_MGT,
PDU1_VOLTAGE_OUT_SUS_NOMINAL,
PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP,
PDU1_VOLTAGE_OUT_PLOC,
PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A,
PDU1_VOLTAGE_OUT_CHANNEL8,
PDU1_VCC,
PDU1_VBAT,
PDU1_TEMPERATURE,
PDU1_CONV_EN_1,
PDU1_CONV_EN_2,
PDU1_CONV_EN_3,
PDU1_OUT_EN_TCS_BOARD_3V3,
PDU1_OUT_EN_SYRLINKS,
PDU1_OUT_EN_STAR_TRACKER,
PDU1_OUT_EN_MGT,
PDU1_OUT_EN_SUS_NOMINAL,
PDU1_OUT_EN_SOLAR_CELL_EXP,
PDU1_OUT_EN_PLOC,
PDU1_OUT_EN_ACS_BOARD_SIDE_A,
PDU1_OUT_EN_CHANNEL8,
PDU1_BOOTCAUSE,
PDU1_BOOTCNT,
PDU1_UPTIME,
PDU1_RESETCAUSE,
PDU1_BATT_MODE,
PDU1_LATCHUP_TCS_BOARD_3V3,
PDU1_LATCHUP_SYRLINKS,
PDU1_LATCHUP_STAR_TRACKER,
PDU1_LATCHUP_MGT,
PDU1_LATCHUP_SUS_NOMINAL,
PDU1_LATCHUP_SOLAR_CELL_EXP,
PDU1_LATCHUP_PLOC,
PDU1_LATCHUP_ACS_BOARD_SIDE_A,
PDU1_LATCHUP_CHANNEL8,
PDU1_DEVICE_0,
PDU1_DEVICE_1,
PDU1_DEVICE_2,
PDU1_DEVICE_3,
PDU1_DEVICE_4,
PDU1_DEVICE_5,
PDU1_DEVICE_6,
PDU1_DEVICE_7,
PDU1_DEVICE_0_STATUS,
PDU1_DEVICE_1_STATUS,
PDU1_DEVICE_2_STATUS,
PDU1_DEVICE_3_STATUS,
PDU1_DEVICE_4_STATUS,
PDU1_DEVICE_5_STATUS,
PDU1_DEVICE_6_STATUS,
PDU1_DEVICE_7_STATUS,
PDU1_WDT_CNT_GND,
PDU1_WDT_CNT_I2C,
PDU1_WDT_CNT_CAN,
PDU1_WDT_CNT_CSP1,
PDU1_WDT_CNT_CSP2,
PDU1_WDT_GND_LEFT,
PDU1_WDT_I2C_LEFT,
PDU1_WDT_CAN_LEFT,
PDU1_WDT_CSP_LEFT1,
PDU1_WDT_CSP_LEFT2,
/** PDU2 Ids */
PDU2_CURRENT_OUT_Q7S,
PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
PDU2_CURRENT_OUT_RW,
PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
PDU2_CURRENT_OUT_SUS_REDUNDANT,
PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
PDU2_CURRENT_OUT_PAYLOAD_CAMERA,
PDU2_VOLTAGE_OUT_Q7S,
PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
PDU2_VOLTAGE_OUT_RW,
PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
PDU2_VOLTAGE_OUT_SUS_REDUNDANT,
PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA,
PDU2_VCC,
PDU2_VBAT,
PDU2_TEMPERATURE,
PDU2_CONV_EN_1,
PDU2_CONV_EN_2,
PDU2_CONV_EN_3,
PDU2_OUT_EN_Q7S,
PDU2_OUT_EN_PAYLOAD_PCDU_CH1,
PDU2_OUT_EN_RW,
PDU2_OUT_EN_TCS_BOARD_HEATER_IN,
PDU2_OUT_EN_SUS_REDUNDANT,
PDU2_OUT_EN_DEPLOYMENT_MECHANISM,
PDU2_OUT_EN_PAYLOAD_PCDU_CH6,
PDU2_OUT_EN_ACS_BOARD_SIDE_B,
PDU2_OUT_EN_PAYLOAD_CAMERA,
PDU2_BOOTCAUSE,
PDU2_BOOTCNT,
PDU2_UPTIME,
PDU2_RESETCAUSE,
PDU2_BATT_MODE,
PDU2_LATCHUP_Q7S,
PDU2_LATCHUP_PAYLOAD_PCDU_CH1,
PDU2_LATCHUP_RW,
PDU2_LATCHUP_TCS_BOARD_HEATER_IN,
PDU2_LATCHUP_SUS_REDUNDANT,
PDU2_LATCHUP_DEPLOYMENT_MECHANISM,
PDU2_LATCHUP_PAYLOAD_PCDU_CH6,
PDU2_LATCHUP_ACS_BOARD_SIDE_B,
PDU2_LATCHUP_PAYLOAD_CAMERA,
PDU2_DEVICE_0,
PDU2_DEVICE_1,
PDU2_DEVICE_2,
PDU2_DEVICE_3,
PDU2_DEVICE_4,
PDU2_DEVICE_5,
PDU2_DEVICE_6,
PDU2_DEVICE_7,
PDU2_DEVICE_0_STATUS,
PDU2_DEVICE_1_STATUS,
PDU2_DEVICE_2_STATUS,
PDU2_DEVICE_3_STATUS,
PDU2_DEVICE_4_STATUS,
PDU2_DEVICE_5_STATUS,
PDU2_DEVICE_6_STATUS,
PDU2_DEVICE_7_STATUS,
PDU2_WDT_CNT_GND,
PDU2_WDT_CNT_I2C,
PDU2_WDT_CNT_CAN,
PDU2_WDT_CNT_CSP1,
PDU2_WDT_CNT_CSP2,
PDU2_WDT_GND_LEFT,
PDU2_WDT_I2C_LEFT,
PDU2_WDT_CAN_LEFT,
PDU2_WDT_CSP_LEFT1,
PDU2_WDT_CSP_LEFT2,
// IDs for both PDUs
PDU_CURRENTS,
PDU_VOLTAGES,
PDU_VCC,
PDU_VBAT,
PDU_TEMPERATURE,
PDU_CONV_EN,
PDU_OUT_ENABLE,
PDU_BOOTCAUSE,
PDU_BOOTCNT,
PDU_UPTIME,
PDU_RESETCAUSE,
PDU_BATT_MODE,
PDU_LATCHUPS,
PDU_DEVICES,
PDU_STATUSES,
PDU_WDT_CNT_GND,
PDU_WDT_CNT_I2C,
PDU_WDT_CNT_CAN,
PDU_WDT_CNT_CSP1,
PDU_WDT_CNT_CSP2,
PDU_WDT_GND_LEFT,
PDU_WDT_I2C_LEFT,
PDU_WDT_CAN_LEFT,
PDU_WDT_CSP_LEFT1,
PDU_WDT_CSP_LEFT2,
/** ACU Ids */
ACU_CURRENT_IN_CHANNEL0,
@ -302,7 +191,7 @@ enum Ids : lp_id_t {
ACU_DEVICE_6_STATUS,
ACU_DEVICE_7_STATUS,
ACU_WDT_CNT_GND,
ACU_WDT_GND_LEFT
ACU_WDT_GND_LEFT,
};
}
} // namespace P60System
@ -373,18 +262,18 @@ class CoreHkSet : public StaticLocalDataSet<16> {
/** Measured output currents */
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN> currents =
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::CURRENTS,
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::P60_CURRENTS,
this);
/** Measured output voltages */
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN> voltages =
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::VOLTAGES,
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::P60_VOLTAGES,
this);
/** Output enable states */
lp_vec_t<uint8_t, P60Dock::hk::Index::CHNLS_LEN> outputEnables =
lp_vec_t<uint8_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::OUTPUT_ENABLE,
this);
lp_vec_t<uint8_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId,
P60System::pool::P60_OUTPUT_ENABLE, this);
lp_var_t<uint32_t> bootCount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this);
lp_var_t<uint8_t> battMode =
@ -495,11 +384,110 @@ static const uint16_t MAX_HKTABLE_ADDRESS = 141;
/** The size of the csp reply containing the housekeeping table data */
static const uint16_t HK_TABLE_REPLY_SIZE = 303;
static const uint8_t HK_TABLE_ENTRIES = 73;
static constexpr uint8_t CHANNELS_LEN = 9;
static constexpr uint8_t DEVICES_NUM = 8;
class PduCoreHk : public StaticLocalDataSet<9> {
public:
PduCoreHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
PduCoreHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
/** Measured output currents */
lp_vec_t<int16_t, 9> currents =
lp_vec_t<int16_t, 9>(sid.objectId, P60System::pool::PDU_CURRENTS, this);
/** Measured output currents */
lp_vec_t<int16_t, 9> voltages =
lp_vec_t<int16_t, 9>(sid.objectId, P60System::pool::PDU_VOLTAGES, this);
/** Output switch states */
lp_vec_t<uint8_t, 9> outputEnables =
lp_vec_t<uint8_t, 9>(sid.objectId, P60System::pool::PDU_OUT_ENABLE, this);
/** Number of reboots */
lp_var_t<uint32_t> bootcount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_BOOTCNT, this);
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
lp_var_t<uint8_t> battMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_BATT_MODE, this);
lp_var_t<int16_t> temperature =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_TEMPERATURE, this);
};
/**
* @brief This class defines a dataset for the hk table of a PDU
*/
class PduAuxHk : public StaticLocalDataSet<36> {
public:
PduAuxHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
PduAuxHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
/** Measured VCC */
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_VCC, this);
/** Measured VBAT */
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_VBAT, this);
/** Output converter enable status */
lp_vec_t<uint8_t, 3> converterEnable =
lp_vec_t<uint8_t, 3>(sid.objectId, P60System::pool::PDU_CONV_EN, this);
lp_var_t<uint32_t> bootcause =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_BOOTCAUSE, this);
/** Uptime in seconds */
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_UPTIME, this);
lp_var_t<uint16_t> resetcause =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU_RESETCAUSE, this);
/** Number of detected latchups on each output channel */
lp_vec_t<uint16_t, 9> latchups =
lp_vec_t<uint16_t, 9>(sid.objectId, P60System::pool::PDU_LATCHUPS, this);
/**
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
*/
lp_vec_t<uint8_t, 8> deviceTypes =
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::PDU_DEVICES, this);
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
lp_vec_t<uint8_t, 8> devicesStatus =
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::PDU_STATUSES, this);
/** Number of reboots triggered by the ground watchdog */
lp_var_t<uint32_t> gndWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_GND, this);
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_I2C, this);
/** Number of reboots triggered through the CAN watchdog */
lp_var_t<uint32_t> canWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CAN, this);
/** Number of reboots triggered through the CSP watchdog */
lp_var_t<uint32_t> csp1WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP1, this);
lp_var_t<uint32_t> csp2WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP2, this);
/** Ground watchdog remaining seconds before rebooting */
lp_var_t<uint32_t> groundWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_GND_LEFT, this);
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_I2C_LEFT, this);
/** CAN watchdog remaining seconds before rebooting. */
lp_var_t<uint32_t> canWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CAN_LEFT, this);
/** CSP watchdogs remaining pings before rebooting. */
lp_var_t<uint8_t> csp2WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT1, this);
lp_var_t<uint8_t> csp1WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT2, this);
};
} // namespace PDU
namespace PDU1 {
enum SwitchChannels : uint8_t {
enum Channels : uint8_t {
TCS_BOARD_3V3 = 0,
SYRLINKS = 1,
STR = 2,
@ -508,7 +496,8 @@ enum SwitchChannels : uint8_t {
SOL_CELL_EXPERIMENT = 5,
PLOC = 6,
ACS_A_SIDE = 7,
UNUSED = 8
UNUSED = 8,
LEN = 9
};
/**
@ -525,185 +514,29 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x4E;
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x4F;
static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50;
/**
* @brief This class defines a dataset for the hk table of the PDU1.
*/
class PDU1HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
class Pdu1CoreHk : public ::PDU::PduCoreHk {
public:
PDU1HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1)) {}
Pdu1CoreHk(HasLocalDataPoolIF* owner)
: PduCoreHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1_CORE)) {}
PDU1HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1))) {}
/** Measured output currents */
lp_var_t<int16_t> currentOutTCSBoard3V3 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this);
lp_var_t<int16_t> currentOutSyrlinks =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SYRLINKS, this);
lp_var_t<int16_t> currentOutStarTracker =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_STAR_TRACKER, this);
lp_var_t<int16_t> currentOutMGT =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_MGT, this);
lp_var_t<int16_t> currentOutSUSNominal =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SUS_NOMINAL, this);
lp_var_t<int16_t> currentOutSolarCellExp =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this);
lp_var_t<int16_t> currentOutPLOC =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_PLOC, this);
lp_var_t<int16_t> currentOutACSBoardSideA =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this);
lp_var_t<int16_t> currentOutChannel8 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_CURRENT_OUT_CHANNEL8, this);
/** Measured voltage of output channels */
lp_var_t<int16_t> voltageOutTCSBoard3V3 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this);
lp_var_t<int16_t> voltageOutSyrlinks =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SYRLINKS, this);
lp_var_t<int16_t> voltageOutStarTracker =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_STAR_TRACKER, this);
lp_var_t<int16_t> voltageOutMGT =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_MGT, this);
lp_var_t<int16_t> voltageOutSUSNominal =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this);
lp_var_t<int16_t> voltageOutSolarCellExp =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this);
lp_var_t<int16_t> voltageOutPLOC =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_PLOC, this);
lp_var_t<int16_t> voltageOutACSBoardSideA =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this);
lp_var_t<int16_t> voltageOutChannel8 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VOLTAGE_OUT_CHANNEL8, this);
/** Measured VCC */
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VCC, this);
/** Measured VBAT */
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_VBAT, this);
lp_var_t<int16_t> temperature =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU1_TEMPERATURE, this);
/** Output converter enable status */
lp_var_t<uint8_t> converterEnable1 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_CONV_EN_1, this);
lp_var_t<uint8_t> converterEnable2 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_CONV_EN_2, this);
lp_var_t<uint8_t> converterEnable3 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_CONV_EN_3, this);
/** Output channels enable status */
lp_var_t<uint8_t> outEnabledTCSBoard3V3 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_TCS_BOARD_3V3, this);
lp_var_t<uint8_t> outEnabledSyrlinks =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_SYRLINKS, this);
lp_var_t<uint8_t> outEnabledStarTracker =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_STAR_TRACKER, this);
lp_var_t<uint8_t> outEnabledMGT =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_MGT, this);
lp_var_t<uint8_t> outEnabledSUSNominal =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_SUS_NOMINAL, this);
lp_var_t<uint8_t> outEnabledSolarCellExp =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_SOLAR_CELL_EXP, this);
lp_var_t<uint8_t> outEnabledPLOC =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_PLOC, this);
lp_var_t<uint8_t> outEnabledAcsBoardSideA =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this);
lp_var_t<uint8_t> outEnabledChannel8 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_OUT_EN_CHANNEL8, this);
lp_var_t<uint32_t> bootcause =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_BOOTCAUSE, this);
/** Number of reboots */
lp_var_t<uint32_t> bootcount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_BOOTCNT, this);
/** Uptime in seconds */
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_UPTIME, this);
lp_var_t<uint16_t> resetcause =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_RESETCAUSE, this);
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
lp_var_t<uint8_t> battMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_BATT_MODE, this);
/** Number of detected latchups on each output channel */
lp_var_t<uint16_t> latchupsTcsBoard3V3 =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_TCS_BOARD_3V3, this);
lp_var_t<uint16_t> latchupsSyrlinks =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_SYRLINKS, this);
lp_var_t<uint16_t> latchupsStarTracker =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_STAR_TRACKER, this);
lp_var_t<uint16_t> latchupsMgt =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_MGT, this);
lp_var_t<uint16_t> latchupsSusNominal =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_SUS_NOMINAL, this);
lp_var_t<uint16_t> latchupsSolarCellExp =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_SOLAR_CELL_EXP, this);
lp_var_t<uint16_t> latchupsPloc =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_PLOC, this);
lp_var_t<uint16_t> latchupsAcsBoardSideA =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this);
lp_var_t<uint16_t> latchupsChannel8 =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU1_LATCHUP_CHANNEL8, this);
/**
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
*/
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_0, this);
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_1, this);
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_2, this);
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_3, this);
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_4, this);
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_5, this);
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_6, this);
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_7, this);
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
lp_var_t<uint8_t> device0Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_0_STATUS, this);
lp_var_t<uint8_t> device1Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_1_STATUS, this);
lp_var_t<uint8_t> device2Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_2_STATUS, this);
lp_var_t<uint8_t> device3Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_3_STATUS, this);
lp_var_t<uint8_t> device4Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_4_STATUS, this);
lp_var_t<uint8_t> device5Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_5_STATUS, this);
lp_var_t<uint8_t> device6Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_6_STATUS, this);
lp_var_t<uint8_t> device7Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_DEVICE_7_STATUS, this);
/** Number of reboots triggered by the ground watchdog */
lp_var_t<uint32_t> gndWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CNT_GND, this);
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CNT_I2C, this);
/** Number of reboots triggered through the CAN watchdog */
lp_var_t<uint32_t> canWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CNT_CAN, this);
/** Number of reboots triggered through the CSP watchdog */
lp_var_t<uint32_t> csp1WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP1, this);
lp_var_t<uint32_t> csp2WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CNT_CSP2, this);
/** Ground watchdog remaining seconds before rebooting */
lp_var_t<uint32_t> groundWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_GND_LEFT, this);
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_I2C_LEFT, this);
/** CAN watchdog remaining seconds before rebooting. */
lp_var_t<uint32_t> canWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU1_WDT_CAN_LEFT, this);
/** CSP watchdogs remaining pings before rebooting. */
lp_var_t<uint8_t> csp2WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT1, this);
lp_var_t<uint8_t> csp1WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU1_WDT_CSP_LEFT2, this);
Pdu1CoreHk(object_id_t objectId)
: PduCoreHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1_CORE)) {}
};
class Pdu1AuxHk : public ::PDU::PduAuxHk {
public:
Pdu1AuxHk(HasLocalDataPoolIF* owner)
: PduAuxHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1_AUX)) {}
Pdu1AuxHk(object_id_t objectId)
: PduAuxHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1_AUX)) {}
};
} // namespace PDU1
namespace PDU2 {
enum SwitchChannels : uint8_t {
enum Channels : uint8_t {
Q7S = 0,
PAYLOAD_PCDU_CH1 = 1,
RW = 2,
@ -712,7 +545,8 @@ enum SwitchChannels : uint8_t {
DEPY_MECHANISM = 5,
PAYLOAD_PCDU_CH6 = 6,
ACS_B_SIDE = 7,
PAYLOAD_CAMERA = 8
PAYLOAD_CAMERA = 8,
LEN = 9
};
/**
@ -729,180 +563,24 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6 = 0x4E;
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50;
/**
* @brief This class defines a dataset for the hk table of the PDU2.
*/
class PDU2HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
class Pdu2CoreHk : public ::PDU::PduCoreHk {
public:
PDU2HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2)) {}
Pdu2CoreHk(HasLocalDataPoolIF* owner)
: PduCoreHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2_CORE)) {}
PDU2HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2))) {}
/** Measured output currents */
lp_var_t<int16_t> currentOutQ7S =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_Q7S, this);
lp_var_t<int16_t> currentOutPayloadPCDUCh1 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this);
lp_var_t<int16_t> currentOutReactionWheels =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_RW, this);
lp_var_t<int16_t> currentOutTCSBoardHeaterIn =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this);
lp_var_t<int16_t> currentOutSUSRedundant =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_SUS_REDUNDANT, this);
lp_var_t<int16_t> currentOutDeplMechanism =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this);
lp_var_t<int16_t> currentOutPayloadPCDUCh6 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this);
lp_var_t<int16_t> currentOutACSBoardSideB =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this);
lp_var_t<int16_t> currentOutPayloadCamera =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this);
/** Measured voltage of output channels */
lp_var_t<int16_t> voltageOutQ7S =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_Q7S, this);
lp_var_t<int16_t> voltageOutPayloadPCDUCh1 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this);
lp_var_t<int16_t> voltageOutReactionWheels =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_RW, this);
lp_var_t<int16_t> voltageOutTCSBoardHeaterIn =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this);
lp_var_t<int16_t> voltageOutSUSRedundant =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this);
lp_var_t<int16_t> voltageOutDeplMechanism =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this);
lp_var_t<int16_t> voltageOutPayloadPCDUCh6 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this);
lp_var_t<int16_t> voltageOutACSBoardSideB =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this);
lp_var_t<int16_t> voltageOutPayloadCamera =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this);
/** Measured VCC */
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VCC, this);
/** Measured VBAT */
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_VBAT, this);
lp_var_t<int16_t> temperature =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU2_TEMPERATURE, this);
/** Output converter enable status */
lp_var_t<uint8_t> converterEnable1 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_CONV_EN_1, this);
lp_var_t<uint8_t> converterEnable2 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_CONV_EN_2, this);
lp_var_t<uint8_t> converterEnable3 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_CONV_EN_3, this);
/** Output channels enable status */
lp_var_t<uint8_t> outEnabledQ7S =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_Q7S, this);
lp_var_t<uint8_t> outEnabledPlPCDUCh1 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this);
lp_var_t<uint8_t> outEnabledReactionWheels =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_RW, this);
lp_var_t<uint8_t> outEnabledTCSBoardHeaterIn =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this);
lp_var_t<uint8_t> outEnabledSUSRedundant =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_SUS_REDUNDANT, this);
lp_var_t<uint8_t> outEnabledDeplMechanism =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this);
lp_var_t<uint8_t> outEnabledPlPCDUCh6 =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this);
lp_var_t<uint8_t> outEnabledAcsBoardSideB =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this);
lp_var_t<uint8_t> outEnabledPayloadCamera =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_OUT_EN_PAYLOAD_CAMERA, this);
lp_var_t<uint32_t> bootcause =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_BOOTCAUSE, this);
/** Number of reboots */
lp_var_t<uint32_t> bootcount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_BOOTCNT, this);
/** Uptime in seconds */
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_UPTIME, this);
lp_var_t<uint16_t> resetcause =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_RESETCAUSE, this);
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
lp_var_t<uint8_t> battMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_BATT_MODE, this);
/** Number of detected latchups on each output channel */
lp_var_t<uint16_t> latchupsQ7S =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_Q7S, this);
lp_var_t<uint16_t> latchupsPayloadPcduCh1 =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this);
lp_var_t<uint16_t> latchupsRw =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_RW, this);
lp_var_t<uint16_t> latchupsTcsBoardHeaterIn =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this);
lp_var_t<uint16_t> latchupsSusRedundant =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_SUS_REDUNDANT, this);
lp_var_t<uint16_t> latchupsDeplMenchanism =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this);
lp_var_t<uint16_t> latchupsPayloadPcduCh6 =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this);
lp_var_t<uint16_t> latchupsAcsBoardSideB =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this);
lp_var_t<uint16_t> latchupsPayloadCamera =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU2_LATCHUP_PAYLOAD_CAMERA, this);
/**
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
*/
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_0, this);
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_1, this);
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_2, this);
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_3, this);
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_4, this);
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_5, this);
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_6, this);
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_7, this);
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
lp_var_t<uint8_t> device0Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_0_STATUS, this);
lp_var_t<uint8_t> device1Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_1_STATUS, this);
lp_var_t<uint8_t> device2Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_2_STATUS, this);
lp_var_t<uint8_t> device3Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_3_STATUS, this);
lp_var_t<uint8_t> device4Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_4_STATUS, this);
lp_var_t<uint8_t> device5Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_5_STATUS, this);
lp_var_t<uint8_t> device6Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_6_STATUS, this);
lp_var_t<uint8_t> device7Status =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_DEVICE_7_STATUS, this);
/** Number of reboots triggered by the ground watchdog */
lp_var_t<uint32_t> gndWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CNT_GND, this);
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CNT_I2C, this);
/** Number of reboots triggered through the CAN watchdog */
lp_var_t<uint32_t> canWdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CNT_CAN, this);
/** Number of reboots triggered through the CSP watchdog */
lp_var_t<uint32_t> csp1WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP1, this);
lp_var_t<uint32_t> csp2WdtReboots =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CNT_CSP2, this);
/** Ground watchdog remaining seconds before rebooting */
lp_var_t<uint32_t> groundWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_GND_LEFT, this);
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_I2C_LEFT, this);
/** CAN watchdog remaining seconds before rebooting. */
lp_var_t<uint32_t> canWatchdogSecondsLeft =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU2_WDT_CAN_LEFT, this);
/** CSP watchdog remaining pings before rebooting. */
lp_var_t<uint8_t> csp1WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT1, this);
lp_var_t<uint8_t> csp2WatchdogPingsLeft =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU2_WDT_CSP_LEFT2, this);
Pdu2CoreHk(object_id_t objectId)
: PduCoreHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2_CORE)) {}
};
class Pdu2AuxHk : public ::PDU::PduAuxHk {
public:
Pdu2AuxHk(HasLocalDataPoolIF* owner)
: PduAuxHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2_AUX)) {}
Pdu2AuxHk(object_id_t objectId)
: PduAuxHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2_AUX)) {}
};
} // namespace PDU2
namespace ACU {
@ -1054,4 +732,65 @@ class HkTableDataset : public StaticLocalDataSet<HK_TABLE_ENTRIES> {
};
} // namespace ACU
namespace pcdu {
enum PoolIds : uint32_t { PDU1_SWITCHES, PDU2_SWITCHES };
/* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches : power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V,
PDU1_CH3_MGT_5V,
PDU1_CH4_SUS_NOMINAL_3V3,
PDU1_CH5_SOLAR_CELL_EXP_5V,
PDU1_CH6_PLOC_12V,
PDU1_CH7_ACS_A_SIDE_3V3,
PDU1_CH8_UNOCCUPIED,
PDU2_CH0_Q7S,
PDU2_CH1_PL_PCDU_BATT_0_14V8,
PDU2_CH2_RW_5V,
PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
PDU2_CH4_SUS_REDUNDANT_3V3,
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
PDU2_CH6_PL_PCDU_BATT_1_14V8,
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
PDU2_CH8_PAYLOAD_CAMERA
};
static constexpr uint8_t NUMBER_OF_SWITCHES = 18;
static const uint8_t ON = 1;
static const uint8_t OFF = 0;
// Output states after reboot of the PDUs
const std::array<uint8_t, PDU::CHANNELS_LEN> INIT_SWITCHES_PDU1 = {
// Because the TE0720 is not connected to the PCDU, this switch is always on
#ifdef TE0720_1CFA
ON,
#else
OFF,
#endif
OFF, OFF, OFF, OFF, OFF, OFF, OFF, OFF,
};
const std::array<uint8_t, PDU::CHANNELS_LEN> INIT_SWITCHES_PDU2 = {ON, OFF, OFF, OFF, OFF,
OFF, OFF, OFF, OFF};
static constexpr uint32_t SWITCHER_SET_ID = 0;
class SwitcherStates : public StaticLocalDataSet<NUMBER_OF_SWITCHES> {
public:
SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {}
SwitcherStates(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SWITCHER_SET_ID)) {}
lp_vec_t<uint8_t, PDU::CHANNELS_LEN> pdu1Switches =
lp_vec_t<uint8_t, PDU::CHANNELS_LEN>(sid.objectId, PDU1_SWITCHES, this);
lp_vec_t<uint8_t, PDU::CHANNELS_LEN> pdu2Switches =
lp_vec_t<uint8_t, PDU::CHANNELS_LEN>(sid.objectId, PDU2_SWITCHES, this);
};
} // namespace pcdu
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */

View File

@ -4,6 +4,8 @@
#include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/serviceinterface.h>
#include "OBSWConfig.h"
AcsBoardAssembly::AcsBoardAssembly(object_id_t objectId, object_id_t parentId,
PowerSwitchIF* switcher, AcsBoardHelper helper, GpioIF* gpioIF)
: DualLaneAssemblyBase(objectId, parentId, switcher, SWITCH_A, SWITCH_B,

View File

@ -105,10 +105,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
void selectGpsInDualMode(duallane::Submodes side);
private:
static constexpr pcduSwitches::Switches SWITCH_A =
pcduSwitches::Switches::PDU1_CH7_ACS_A_SIDE_3V3;
static constexpr pcduSwitches::Switches SWITCH_B =
pcduSwitches::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3;
static constexpr pcdu::Switches SWITCH_A = pcdu::Switches::PDU1_CH7_ACS_A_SIDE_3V3;
static constexpr pcdu::Switches SWITCH_B = pcdu::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3;
bool tryingOtherSide = false;
bool dualModeErrorSwitch = true;

View File

@ -2,10 +2,11 @@
#include <fsfw/ipc/QueueFactory.h>
#include "OBSWConfig.h"
DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId,
PowerSwitchIF* pwrSwitcher,
pcduSwitches::Switches switch1,
pcduSwitches::Switches switch2, Event pwrTimeoutEvent,
PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1,
pcdu::Switches switch2, Event pwrTimeoutEvent,
Event sideSwitchNotAllowedEvent,
Event transitionOtherSideFailedEvent)
: AssemblyBase(objectId, parentId, 20),

View File

@ -19,9 +19,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3;
DualLaneAssemblyBase(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
pcduSwitches::Switches switch1, pcduSwitches::Switches switch2,
Event pwrSwitchTimeoutEvent, Event sideSwitchNotAllowedEvent,
Event transitionOtherSideFailedEvent);
pcdu::Switches switch1, pcdu::Switches switch2, Event pwrSwitchTimeoutEvent,
Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent);
protected:
// This helper object complete encapsulates power switching

View File

@ -43,10 +43,8 @@ class SusAssembly : public DualLaneAssemblyBase {
private:
enum class States { IDLE, SWITCHING_POWER, MODE_COMMANDING } state = States::IDLE;
static constexpr pcduSwitches::Switches SWITCH_NOM =
pcduSwitches::Switches::PDU1_CH4_SUS_NOMINAL_3V3;
static constexpr pcduSwitches::Switches SWITCH_RED =
pcduSwitches::Switches::PDU2_CH4_SUS_REDUNDANT_3V3;
static constexpr pcdu::Switches SWITCH_NOM = pcdu::Switches::PDU1_CH4_SUS_NOMINAL_3V3;
static constexpr pcdu::Switches SWITCH_RED = pcdu::Switches::PDU2_CH4_SUS_REDUNDANT_3V3;
FixedArrayList<ModeListEntry, NUMBER_SUN_SENSORS> modeTable;
SusAssHelper helper;

2
tmtc

@ -1 +1 @@
Subproject commit a6c91640a15e1a1e1291ab9c300e93f96351ee5e
Subproject commit 091cf2dd632c71a0fa8000312bb11e84f1a755db