diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index 408d58c1..b2c24d5f 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -12,6 +12,6 @@ else() add_subdirectory(gpio) add_subdirectory(core) add_subdirectory(memory) - add_subdirectory(spiCallbacks) + add_subdirectory(callbacks) add_subdirectory(devices) endif() diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 3f83828a..74c91708 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -44,7 +44,7 @@ static constexpr uint32_t GPIO_MGM_1_RM3100_CS = 16; static constexpr uint32_t GPIO_MGM_3_RM3100_CS = 10; // Active low reset pin -static constexpr uint32_t GPIO_RESET_GNSS_0 = 8; // D22 +static constexpr uint32_t GPIO_RESET_GNSS_0 = 9; // C22 static constexpr uint32_t GPIO_RESET_GNSS_1 = 12; // B21 static constexpr uint32_t GPIO_RAD_SENSOR_CS = 19; // R18 diff --git a/bsp_q7s/spiCallbacks/CMakeLists.txt b/bsp_q7s/callbacks/CMakeLists.txt similarity index 76% rename from bsp_q7s/spiCallbacks/CMakeLists.txt rename to bsp_q7s/callbacks/CMakeLists.txt index 59d507e6..8c83e26f 100644 --- a/bsp_q7s/spiCallbacks/CMakeLists.txt +++ b/bsp_q7s/callbacks/CMakeLists.txt @@ -1,3 +1,4 @@ target_sources(${TARGET_NAME} PRIVATE rwSpiCallback.cpp + gnssCallback.cpp ) diff --git a/bsp_q7s/callbacks/gnssCallback.cpp b/bsp_q7s/callbacks/gnssCallback.cpp new file mode 100644 index 00000000..479f4a2b --- /dev/null +++ b/bsp_q7s/callbacks/gnssCallback.cpp @@ -0,0 +1,26 @@ +#include "gnssCallback.h" +#include "devices/gpioIds.h" + +#include "fsfw/tasks/TaskFactory.h" + +ReturnValue_t gps::triggerGpioResetPin(void *args) { + ResetArgs* resetArgs = reinterpret_cast(args); + if(args == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + if (resetArgs->gpioComIF == nullptr) { + return HasReturnvaluesIF::RETURN_FAILED; + } + gpioId_t gpioId; + if(resetArgs->gnss1) { + gpioId = gpioIds::GNSS_1_NRESET; + + } + else { + gpioId = gpioIds::GNSS_0_NRESET; + } + resetArgs->gpioComIF->pullLow(gpioId); + TaskFactory::delayTask(resetArgs->waitPeriodMs); + resetArgs->gpioComIF->pullHigh(gpioId); + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/bsp_q7s/callbacks/gnssCallback.h b/bsp_q7s/callbacks/gnssCallback.h new file mode 100644 index 00000000..9cbb6669 --- /dev/null +++ b/bsp_q7s/callbacks/gnssCallback.h @@ -0,0 +1,19 @@ +#ifndef BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ +#define BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ + +#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" +#include "fsfw/returnvalues/HasReturnvaluesIF.h" + +struct ResetArgs { + bool gnss1 = false; + LinuxLibgpioIF* gpioComIF = nullptr; + uint32_t waitPeriodMs = 100; +}; + +namespace gps { + +ReturnValue_t triggerGpioResetPin(void* args); + +} + +#endif /* BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ */ diff --git a/bsp_q7s/spiCallbacks/rwSpiCallback.cpp b/bsp_q7s/callbacks/rwSpiCallback.cpp similarity index 97% rename from bsp_q7s/spiCallbacks/rwSpiCallback.cpp rename to bsp_q7s/callbacks/rwSpiCallback.cpp index dce79c42..70fa3ebe 100644 --- a/bsp_q7s/spiCallbacks/rwSpiCallback.cpp +++ b/bsp_q7s/callbacks/rwSpiCallback.cpp @@ -1,9 +1,10 @@ -#include -#include -#include -#include -#include +#include "rwSpiCallback.h" #include "devices/gpioIds.h" +#include "mission/devices/RwHandler.h" + +#include "fsfw_hal/linux/spi/SpiCookie.h" +#include "fsfw_hal/linux/UnixFileGuard.h" +#include "fsfw/serviceinterface/ServiceInterface.h" namespace rwSpiCallback { diff --git a/bsp_q7s/spiCallbacks/rwSpiCallback.h b/bsp_q7s/callbacks/rwSpiCallback.h similarity index 93% rename from bsp_q7s/spiCallbacks/rwSpiCallback.h rename to bsp_q7s/callbacks/rwSpiCallback.h index e5a79e64..cc7c6cbe 100644 --- a/bsp_q7s/spiCallbacks/rwSpiCallback.h +++ b/bsp_q7s/callbacks/rwSpiCallback.h @@ -1,9 +1,9 @@ #ifndef BSP_Q7S_RW_SPI_CALLBACK_H_ #define BSP_Q7S_RW_SPI_CALLBACK_H_ -#include -#include -#include +#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw_hal/linux/spi/SpiComIF.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" namespace rwSpiCallback { diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 7ad33c9b..8fcbfa52 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -9,12 +9,13 @@ #include "devices/powerSwitcherList.h" #include "bsp_q7s/gpio/gpioCallbacks.h" #include "bsp_q7s/core/CoreController.h" -#include "bsp_q7s/spiCallbacks/rwSpiCallback.h" #include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/memory/FileSystemHandler.h" #include "bsp_q7s/devices/PlocSupervisorHandler.h" #include "bsp_q7s/devices/PlocUpdater.h" #include "bsp_q7s/devices/PlocMemoryDumper.h" +#include "bsp_q7s/callbacks/rwSpiCallback.h" +#include "bsp_q7s/callbacks/gnssCallback.h" #include "linux/devices/HeaterHandler.h" #include "linux/devices/SolarArrayDeploymentHandler.h" @@ -82,6 +83,9 @@ #include "linux/boardtest/LibgpiodTest.h" #endif +ResetArgs resetArgsGnss0; +ResetArgs resetArgsGnss1; + void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); } @@ -427,6 +431,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI "GNSS_1_NRESET", gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio); + + // GNSS enable pins must be pulled high gpioComIF->addGpios(gpioCookieAcsBoard); @@ -485,6 +491,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI objects::SPI_COM_IF, spiCookie); gyroL3gHandler->setStartUpImmediately(); + resetArgsGnss1.gnss1 = true; + resetArgsGnss1.gpioComIF = gpioComIF; + resetArgsGnss1.waitPeriodMs = 100; + resetArgsGnss0.gnss1 = false; + resetArgsGnss0.gpioComIF = gpioComIF; + resetArgsGnss0.waitPeriodMs = 100; auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV, UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER); uartCookieGps0->setToFlushInput(true); @@ -495,9 +507,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI uartCookieGps1->setReadCycles(6); auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookieGps0, true); + gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); gpsHandler0->setStartUpImmediately(); auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, uartCookieGps1, true); + gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1); gpsHandler1->setStartUpImmediately(); } diff --git a/fsfw b/fsfw index 924c150a..40adca5f 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 924c150af27484f9eb4439ec80c048b46c226890 +Subproject commit 40adca5f1d13ef8d6c712842ebc37e37fe449446 diff --git a/generators/.gitignore b/generators/.gitignore new file mode 100644 index 00000000..181d655f --- /dev/null +++ b/generators/.gitignore @@ -0,0 +1 @@ +.~lock* diff --git a/mission/devices/GPSHyperionHandler.cpp b/mission/devices/GPSHyperionHandler.cpp index 0dd1f751..80331c58 100644 --- a/mission/devices/GPSHyperionHandler.cpp +++ b/mission/devices/GPSHyperionHandler.cpp @@ -6,6 +6,11 @@ #include "lwgps/lwgps.h" +#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 +#include +#include +#endif + GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie, bool debugHyperionGps): DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this), @@ -47,6 +52,22 @@ ReturnValue_t GPSHyperionHandler::buildNormalDeviceCommand(DeviceCommandId_t *id ReturnValue_t GPSHyperionHandler::buildCommandFromCommand( DeviceCommandId_t deviceCommand, const uint8_t *commandData, size_t commandDataLen) { + // By default, send nothing + rawPacketLen = 0; + switch(deviceCommand) { + case(GpsHyperion::TRIGGER_RESET_PIN): { + if(resetCallback != nullptr) { + PoolReadGuard pg(&gpsSet); + // Set HK entries invalid + gpsSet.setValidity(false, true); + // The user needs to implement this. Don't touch states for now, the device should + // quickly reboot and send valid strings again. + actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand); + return resetCallback(resetCallbackArgs); + } + return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; + } + } return HasReturnvaluesIF::RETURN_OK; } @@ -54,9 +75,9 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, DeviceCommandId_t *foundId, size_t *foundLen) { // Pass data to GPS library if(len > 0) { - sif::info << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl; + sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl; if (internalState == InternalStates::WAIT_FIRST_MESSAGE) { - // TODO: Check whether data is valid by chcking whether NMEA start string is valid + // TODO: Check whether data is valid by checking whether NMEA start string is valid? commandExecuted = true; } int result = lwgps_process(&gpsData, start, len); @@ -83,7 +104,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, gpsSet.latitude.value = gpsData.latitude; // Negative longitude -> West direction gpsSet.longitude.value = gpsData.longitude; - gpsSet.altitude.value = gpsData.altitude; + if(gpsData.altitude > 600000.0 or gpsData.altitude < 400000.0) { + gpsSet.altitude.setValid(false); + } + else { + gpsSet.altitude.setValid(true); + gpsSet.altitude.value = gpsData.altitude; + } gpsSet.fixMode.value = gpsData.fix_mode; gpsSet.satInUse.value = gpsData.sats_in_use; Clock::TimeOfDay_t timeStruct = {}; @@ -102,6 +129,7 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, gpsSet.hours = gpsData.hours; gpsSet.minutes = gpsData.minutes; gpsSet.seconds = gpsData.seconds; + gpsSet.unixSeconds = timeval.tv_sec; if(debugHyperionGps) { sif::info << "GPS Data" << std::endl; printf("Valid status: %d\n", gpsData.is_valid); @@ -110,6 +138,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len, printf("Altitude: %f meters\n", gpsData.altitude); } #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 + std::string filename = "/mnt/sd0/gps_log.txt"; + std::ofstream gpsFile; + if(not std::filesystem::exists(filename)) { + gpsFile.open(filename, std::ofstream::out); + } + gpsFile.open(filename, std::ofstream::out | std::ofstream::app); + gpsFile.write(reinterpret_cast(start), len); #endif } *foundLen = len; @@ -149,12 +184,19 @@ ReturnValue_t GPSHyperionHandler::initializeLocalDataPool( void GPSHyperionHandler::fillCommandAndReplyMap() { // Reply length does not matter, packets should always arrive periodically insertInReplyMap(GpsHyperion::GPS_REPLY, 4, &gpsSet, 0, true); + insertInCommandMap(GpsHyperion::TRIGGER_RESET_PIN); } void GPSHyperionHandler::modeChanged() { internalState = InternalStates::NONE; } +void GPSHyperionHandler::setResetPinTriggerFunction(gpioResetFunction_t resetCallback, + void *args) { + this->resetCallback = resetCallback; + resetCallbackArgs = args; +} + void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId, uint32_t parameter) { } diff --git a/mission/devices/GPSHyperionHandler.h b/mission/devices/GPSHyperionHandler.h index ca7898ae..03c572a3 100644 --- a/mission/devices/GPSHyperionHandler.h +++ b/mission/devices/GPSHyperionHandler.h @@ -6,7 +6,6 @@ #include "devicedefinitions/GPSDefinitions.h" #include "lwgps/lwgps.h" - /** * @brief Device handler for the Hyperion HT-GPS200 device * @details @@ -15,12 +14,17 @@ */ class GPSHyperionHandler: public DeviceHandlerBase { public: + using gpioResetFunction_t = ReturnValue_t (*) (void* args); GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF* comCookie, bool debugHyperionGps = false); virtual ~GPSHyperionHandler(); + void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args); protected: + gpioResetFunction_t resetCallback = nullptr; + void* resetCallbackArgs = nullptr; + enum class InternalStates { NONE, WAIT_FIRST_MESSAGE, diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index d83de9fe..c7de02bb 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -75,6 +75,10 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand( } break; } + case(GOMSPACE::PRINT_OUT_ENB_STATUS): { + result = printStatus(deviceCommand); + break; + } case(GOMSPACE::REQUEST_HK_TABLE): { result = generateRequestFullHkTableCmd(hkTableReplySize); if(result != HasReturnvaluesIF::RETURN_OK){ @@ -95,6 +99,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap(){ this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3); this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3); this->insertInCommandMap(GOMSPACE::GNDWDT_RESET); + this->insertInCommandMap(GOMSPACE::PRINT_OUT_ENB_STATUS); } ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t *start, @@ -396,3 +401,8 @@ LocalPoolDataSetBase* GomspaceDeviceHandler::getDataSetHandle(sid_t sid) { void GomspaceDeviceHandler::setModeNormal() { mode = MODE_NORMAL; } + +ReturnValue_t GomspaceDeviceHandler::printStatus(DeviceCommandId_t cmd) { + sif::info << "No printHkTable implementation given.." << std::endl; + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index b73f3bb7..78257b83 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -88,6 +88,13 @@ protected: */ virtual ReturnValue_t generateRequestFullHkTableCmd(uint16_t hkTableSize); + /** + * This command handles printing the HK table to the console. This is useful for debugging + * purposes + * @return + */ + virtual ReturnValue_t printStatus(DeviceCommandId_t cmd); + /** * @brief Because housekeeping tables are device specific the handling of the reply is * given to the child class. diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index f6bd938a..8df972e5 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -1,11 +1,12 @@ +#include #include "PDU1Handler.h" #include #include 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), pdu1HkTableDataset( - this) { + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu1HkTableDataset), + pdu1HkTableDataset(this) { } PDU1Handler::~PDU1Handler() { @@ -55,25 +56,9 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac << std::endl; sif::info << "PDU1 channel 8 current: " << pdu1HkTableDataset.currentOutChannel8 << std::endl; - sif::info << "PDU1 TCS Board switch: " - << static_cast(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << std::endl; - sif::info << "PDU1 Syrlinks switch: " - << static_cast(pdu1HkTableDataset.outEnabledSyrlinks.value) << std::endl; - sif::info << "PDU1 star tracker switch: " - << static_cast(pdu1HkTableDataset.outEnabledStarTracker.value) << std::endl; - sif::info << "PDU1 MGT switch: " - << static_cast(pdu1HkTableDataset.outEnabledMGT.value) << std::endl; - sif::info << "PDU1 SUS nominal switch: " - << static_cast(pdu1HkTableDataset.outEnabledSUSNominal.value) << std::endl; - sif::info << "PDU1 solar cell experiment switch: " - << static_cast(pdu1HkTableDataset.outEnabledSolarCellExp.value) << std::endl; - sif::info << "PDU1 PLOC switch: " - << static_cast(pdu1HkTableDataset.outEnabledPLOC.value) << std::endl; - sif::info << "PDU1 ACS Side A switch: " - << static_cast(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << std::endl; - sif::info << "PDU1 channel 8 switch: " - << static_cast(pdu1HkTableDataset.outEnabledChannel8.value) << std::endl; - sif::info << "PDU1 battery mode: " << static_cast(pdu1HkTableDataset.battMode.value) << std::endl; + printOutputSwitchStates(); + sif::info << "PDU1 battery mode: " << + static_cast(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; @@ -87,9 +72,35 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac #endif } +void PDU1Handler::printOutputSwitchStates() { + sif::info << "PDU1 TCS Board switch: " << + static_cast(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << std::endl; + sif::info << "PDU1 Syrlinks switch: " << + static_cast(pdu1HkTableDataset.outEnabledSyrlinks.value) << std::endl; + sif::info << "PDU1 star tracker switch: " << + static_cast(pdu1HkTableDataset.outEnabledStarTracker.value) << std::endl; + sif::info << "PDU1 MGT switch: " << + static_cast(pdu1HkTableDataset.outEnabledMGT.value) << std::endl; + sif::info << "PDU1 SUS nominal switch: " << + static_cast(pdu1HkTableDataset.outEnabledSUSNominal.value) << std::endl; + sif::info << "PDU1 solar cell experiment switch: " << + static_cast(pdu1HkTableDataset.outEnabledSolarCellExp.value) << std::endl; + sif::info << "PDU1 PLOC switch: " << + static_cast(pdu1HkTableDataset.outEnabledPLOC.value) << std::endl; + sif::info << "PDU1 ACS Side A switch: " << + static_cast(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << std::endl; + sif::info << "PDU1 channel 8 switch: " << + static_cast(pdu1HkTableDataset.outEnabledChannel8.value) << std::endl; +} + void PDU1Handler::parseHkTableReply(const uint8_t *packet) { uint16_t dataOffset = 0; - pdu1HkTableDataset.read(); + 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; @@ -249,8 +260,10 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) { dataOffset += 3; pdu1HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset); - pdu1HkTableDataset.commit(); pdu1HkTableDataset.setChanged(true); + if(not pdu1HkTableDataset.isValid()) { + pdu1HkTableDataset.setValidity(true, true); + } } ReturnValue_t PDU1Handler::initializeLocalDataPool( @@ -341,3 +354,20 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool( return HasReturnvaluesIF::RETURN_OK; } +ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) { + switch(cmd) { + case(GOMSPACE::PRINT_OUT_ENB_STATUS): { + PoolReadGuard pg(&pdu1HkTableDataset); + ReturnValue_t readResult = pg.getReadResult(); + if(readResult != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading PDU1 HK table failed!" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + printOutputSwitchStates(); + return HasReturnvaluesIF::RETURN_OK; + } + default: { + return HasReturnvaluesIF::RETURN_FAILED; + } + } +} diff --git a/mission/devices/PDU1Handler.h b/mission/devices/PDU1Handler.h index ed22a6ef..fa73b584 100644 --- a/mission/devices/PDU1Handler.h +++ b/mission/devices/PDU1Handler.h @@ -32,11 +32,13 @@ protected: */ virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override; + ReturnValue_t printStatus(DeviceCommandId_t cmd) override; private: /** Dataset for the housekeeping table of the PDU1 */ PDU1::PDU1HkTableDataset pdu1HkTableDataset; + void printOutputSwitchStates(); void parseHkTableReply(const uint8_t *packet); }; diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index 47fab6b6..8789695e 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -1,20 +1,22 @@ +#include "OBSWConfig.h" #include "PDU2Handler.h" + #include -#include +#include 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), pdu2HkTableDataset( - this) { + GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, + PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu2HkTableDataset), + pdu2HkTableDataset(this) { } PDU2Handler::~PDU2Handler() { } ReturnValue_t PDU2Handler::buildNormalDeviceCommand( - DeviceCommandId_t * id) { - *id = GOMSPACE::REQUEST_HK_TABLE; - return buildCommandFromCommand(*id, NULL, 0); + DeviceCommandId_t * id) { + *id = GOMSPACE::REQUEST_HK_TABLE; + return buildCommandFromCommand(*id, NULL, 0); } void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { @@ -34,23 +36,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac sif::info << "PDU2 VBAT: " << vbat << std::endl; float temperatureC = pdu2HkTableDataset.temperature.value * 0.1; sif::info << "PDU2 Temperature: " << temperatureC << " °C" << std::endl; - sif::info << "PDU2 Q7S enable state: " << unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << std::endl; - sif::info << "PDU2 Payload PCDU channel 1 enable state: " - << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << std::endl; - sif::info << "PDU2 reaction wheels enable state: " - << unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << std::endl; - sif::info << "PDU2 TCS Board 8V heater input enable state: " - << unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << std::endl; - sif::info << "PDU2 redundant SUS group enable state: " - << unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << std::endl; - sif::info << "PDU2 deployment mechanism enable state: " - << unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << std::endl; - sif::info << "PDU2 PCDU channel 6 enable state: " - << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << std::endl; - sif::info << "PDU2 ACS board side B enable state: " - << unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << std::endl; - sif::info << "PDU2 payload camera enable state: " - << unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << 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; @@ -323,3 +309,42 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool( return HasReturnvaluesIF::RETURN_OK; } + +ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) { + switch(cmd) { + case(GOMSPACE::PRINT_OUT_ENB_STATUS): { + PoolReadGuard pg(&pdu2HkTableDataset); + ReturnValue_t readResult = pg.getReadResult(); + if(readResult != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Reading PDU2 HK table failed!" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + printOutputSwitchStates(); + return HasReturnvaluesIF::RETURN_OK; + } + default: { + return HasReturnvaluesIF::RETURN_FAILED; + } + } +} + +void PDU2Handler::printOutputSwitchStates() { + sif::info << "PDU2 Q7S enable state: " << + unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << std::endl; + sif::info << "PDU2 Payload PCDU channel 1 enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << std::endl; + sif::info << "PDU2 reaction wheels enable state: " + << unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << std::endl; + sif::info << "PDU2 TCS Board 8V heater input enable state: " + << unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << std::endl; + sif::info << "PDU2 redundant SUS group enable state: " + << unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << std::endl; + sif::info << "PDU2 deployment mechanism enable state: " + << unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << std::endl; + sif::info << "PDU2 PCDU channel 6 enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << std::endl; + sif::info << "PDU2 ACS board side B enable state: " + << unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << std::endl; + sif::info << "PDU2 payload camera enable state: " + << unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << std::endl; +} diff --git a/mission/devices/PDU2Handler.h b/mission/devices/PDU2Handler.h index ee30a12f..0aa7f0b5 100644 --- a/mission/devices/PDU2Handler.h +++ b/mission/devices/PDU2Handler.h @@ -20,25 +20,27 @@ */ class PDU2Handler: public GomspaceDeviceHandler { public: - PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); - virtual ~PDU2Handler(); + PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie); + virtual ~PDU2Handler(); - virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, - LocalDataPoolManager& poolManager) override; + virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; protected: - /** - * @brief As soon as the device is in MODE_NORMAL, this function is executed periodically. - */ - virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; - virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override; + /** + * @brief As soon as the device is in MODE_NORMAL, this function is executed periodically. + */ + virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; + virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override; + ReturnValue_t printStatus(DeviceCommandId_t cmd) override; private: - /** Dataset for the housekeeping table of the PDU2 */ - PDU2::PDU2HkTableDataset pdu2HkTableDataset; + /** Dataset for the housekeeping table of the PDU2 */ + PDU2::PDU2HkTableDataset pdu2HkTableDataset; - void parseHkTableReply(const uint8_t *packet); + void printOutputSwitchStates(); + void parseHkTableReply(const uint8_t *packet); }; #endif /* MISSION_DEVICES_PDU2HANDLER_H_ */ diff --git a/mission/devices/devicedefinitions/GPSDefinitions.h b/mission/devices/devicedefinitions/GPSDefinitions.h index 8f147651..90fdb123 100644 --- a/mission/devices/devicedefinitions/GPSDefinitions.h +++ b/mission/devices/devicedefinitions/GPSDefinitions.h @@ -7,6 +7,7 @@ namespace GpsHyperion { static constexpr DeviceCommandId_t GPS_REPLY = 0; +static constexpr DeviceCommandId_t TRIGGER_RESET_PIN = 5; static constexpr uint32_t DATASET_ID = 0; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 4600ecc7..f4e50466 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -15,594 +15,596 @@ #include namespace GOMSPACE{ - static const uint16_t IGNORE_CHECKSUM = 0xbb0; - /** The size of the header of a gomspace CSP packet. */ - static const uint8_t GS_HDR_LENGTH = 12; - /** CSP port to ping gomspace devices. */ - static const uint8_t PING_PORT = 1; - static const uint8_t REBOOT_PORT = 4; - /** CSP port of gomspace devices to request or set parameters */ - static const uint8_t PARAM_PORT = 7; - static const uint8_t P60_PORT_GNDWDT_RESET = 9; +static const uint16_t IGNORE_CHECKSUM = 0xbb0; +/** The size of the header of a gomspace CSP packet. */ +static const uint8_t GS_HDR_LENGTH = 12; +/** CSP port to ping gomspace devices. */ +static const uint8_t PING_PORT = 1; +static const uint8_t REBOOT_PORT = 4; +/** CSP port of gomspace devices to request or set parameters */ +static const uint8_t PARAM_PORT = 7; +static const uint8_t P60_PORT_GNDWDT_RESET = 9; + +/* Device commands are derived from the rparam.h of the gomspace lib */ +static const DeviceCommandId_t PING = 1; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t NONE = 2; // Set when no command is pending +static const DeviceCommandId_t REBOOT = 4; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t GNDWDT_RESET = 9; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND] +static const DeviceCommandId_t PRINT_OUT_ENB_STATUS = 17; //!< [EXPORT] : [COMMAND] - /* Device commands are derived from the rparam.h of the gomspace lib */ - static const DeviceCommandId_t PING = 0x1; //!< [EXPORT] : [COMMAND] - static const DeviceCommandId_t NONE = 0x2; // Set when no command is pending - static const DeviceCommandId_t REBOOT = 0x4; //!< [EXPORT] : [COMMAND] - static const DeviceCommandId_t GNDWDT_RESET = 0x9; //!< [EXPORT] : [COMMAND] - static const DeviceCommandId_t PARAM_GET = 0x00; //!< [EXPORT] : [COMMAND] - static const DeviceCommandId_t PARAM_SET = 0xFF; //!< [EXPORT] : [COMMAND] - static const DeviceCommandId_t REQUEST_HK_TABLE = 0x10; //!< [EXPORT] : [COMMAND] } namespace P60System { - enum P60SytemPoolIds: lp_id_t { - P60DOCK_CURRENT_ACU_VCC, - P60DOCK_CURRENT_PDU1_VCC, - P60DOCK_CURRENT_X3_IDLE_VCC, - P60DOCK_CURRENT_PDU2_VCC, - P60DOCK_CURRENT_ACU_VBAT, - P60DOCK_CURRENT_PDU1_VBAT, - P60DOCK_CURRENT_X3_IDLE_VBAT, - P60DOCK_CURRENT_PDU2_VBAT, - P60DOCK_CURRENT_STACK_VBAT, - P60DOCK_CURRENT_STACK_3V3, - P60DOCK_CURRENT_STACK_5V, - P60DOCK_CURRENT_GS3V3, - P60DOCK_CURRENT_GS5V, - P60DOCK_VOLTAGE_ACU_VCC, - P60DOCK_VOLTAGE_PDU1_VCC, - P60DOCK_VOLTAGE_X3_IDLE_VCC, - P60DOCK_VOLTAGE_PDU2_VCC, - P60DOCK_VOLTAGE_ACU_VBAT, - P60DOCK_VOLTAGE_PDU1_VBAT, - P60DOCK_VOLTAGE_X3_IDLE_VBAT, - P60DOCK_VOLTAGE_PDU2_VBAT, - P60DOCK_VOLTAGE_STACK_VBAT, - P60DOCK_VOLTAGE_STACK_3V3, - P60DOCK_VOLTAGE_STACK_5V, - P60DOCK_VOLTAGE_GS3V3, - P60DOCK_VOLTAGE_GS5V, - P60DOCK_OUTPUTENABLE_ACU_VCC, - P60DOCK_OUTPUTENABLE_PDU1_VCC, - P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, - P60DOCK_OUTPUTENABLE_PDU2_VCC, - P60DOCK_OUTPUTENABLE_ACU_VBAT, - P60DOCK_OUTPUTENABLE_PDU1_VBAT, - P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, - P60DOCK_OUTPUTENABLE_PDU2_VBAT, - P60DOCK_OUTPUTENABLE_STACK_VBAT, - P60DOCK_OUTPUTENABLE_STACK_3V3, - P60DOCK_OUTPUTENABLE_STACK_5V, - P60DOCK_OUTPUTENABLE_GS3V3, - P60DOCK_OUTPUTENABLE_GS5V, - P60DOCK_TEMPERATURE_1, - P60DOCK_TEMPERATURE_2, - P60DOCK_BOOT_CAUSE, - P60DOCK_BOOT_CNT, - P60DOCK_UPTIME, - P60DOCK_RESETCAUSE, - P60DOCK_BATT_MODE, - P60DOCK_HEATER_ON, - P60DOCK_CONV_5V_ENABLE_STATUS, - P60DOCK_LATCHUP_ACU_VCC, - P60DOCK_LATCHUP_PDU1_VCC, - P60DOCK_LATCHUP_X3_IDLE_VCC, - P60DOCK_LATCHUP_PDU2_VCC, - P60DOCK_LATCHUP_ACU_VBAT, - P60DOCK_LATCHUP_PDU1_VBAT, - P60DOCK_LATCHUP_X3_IDLE_VBAT, - P60DOCK_LATCHUP_PDU2_VBAT, - P60DOCK_LATCHUP_STACK_VBAT, - P60DOCK_LATCHUP_STACK_3V3, - P60DOCK_LATCHUP_STACK_5V, - P60DOCK_LATCHUP_GS3V3, - P60DOCK_LATCHUP_GS5V, - P60DOCK_VBAT_VALUE, - P60DOCK_VCC_CURRENT_VALUE, - P60DOCK_BATTERY_CURRENT, - P60DOCK_BATTERY_VOLTAGE, - P60DOCK_BATTERY_TEMPERATURE_1, - P60DOCK_BATTERY_TEMPERATURE_2, - P60DOCK_DEVICE_0, - P60DOCK_DEVICE_1, - P60DOCK_DEVICE_2, - P60DOCK_DEVICE_3, - P60DOCK_DEVICE_4, - P60DOCK_DEVICE_5, - P60DOCK_DEVICE_6, - P60DOCK_DEVICE_7, - P60DOCK_DEVICE_0_STATUS, - P60DOCK_DEVICE_1_STATUS, - P60DOCK_DEVICE_2_STATUS, - P60DOCK_DEVICE_3_STATUS, - P60DOCK_DEVICE_4_STATUS, - P60DOCK_DEVICE_5_STATUS, - P60DOCK_DEVICE_6_STATUS, - P60DOCK_DEVICE_7_STATUS, - P60DOCK_DEVICE_TYPE_GROUP, - P60DOCK_DEVICE_STATUS_GROUP, - P60DOCK_DEARM_STATUS, - P60DOCK_WDT_CNT_GND, - P60DOCK_WDT_CNT_I2C, - P60DOCK_WDT_CNT_CAN, - P60DOCK_WDT_CNT_CSP_1, - P60DOCK_WDT_CNT_CSP_2, - P60DOCK_WDT_GND_LEFT, - P60DOCK_WDT_I2C_LEFT, - P60DOCK_WDT_CAN_LEFT, - P60DOCK_WDT_CSP_LEFT_1, - P60DOCK_WDT_CSP_LEFT_2, - P60DOCK_BATT_CHARGE_CURRENT, - P60DOCK_BATT_DISCHARGE_CURRENT, - P60DOCK_ANT6_DEPL, - P60DOCK_AR6_DEPL, +enum P60SytemPoolIds: lp_id_t { + P60DOCK_CURRENT_ACU_VCC, + P60DOCK_CURRENT_PDU1_VCC, + P60DOCK_CURRENT_X3_IDLE_VCC, + P60DOCK_CURRENT_PDU2_VCC, + P60DOCK_CURRENT_ACU_VBAT, + P60DOCK_CURRENT_PDU1_VBAT, + P60DOCK_CURRENT_X3_IDLE_VBAT, + P60DOCK_CURRENT_PDU2_VBAT, + P60DOCK_CURRENT_STACK_VBAT, + P60DOCK_CURRENT_STACK_3V3, + P60DOCK_CURRENT_STACK_5V, + P60DOCK_CURRENT_GS3V3, + P60DOCK_CURRENT_GS5V, + P60DOCK_VOLTAGE_ACU_VCC, + P60DOCK_VOLTAGE_PDU1_VCC, + P60DOCK_VOLTAGE_X3_IDLE_VCC, + P60DOCK_VOLTAGE_PDU2_VCC, + P60DOCK_VOLTAGE_ACU_VBAT, + P60DOCK_VOLTAGE_PDU1_VBAT, + P60DOCK_VOLTAGE_X3_IDLE_VBAT, + P60DOCK_VOLTAGE_PDU2_VBAT, + P60DOCK_VOLTAGE_STACK_VBAT, + P60DOCK_VOLTAGE_STACK_3V3, + P60DOCK_VOLTAGE_STACK_5V, + P60DOCK_VOLTAGE_GS3V3, + P60DOCK_VOLTAGE_GS5V, + P60DOCK_OUTPUTENABLE_ACU_VCC, + P60DOCK_OUTPUTENABLE_PDU1_VCC, + P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, + P60DOCK_OUTPUTENABLE_PDU2_VCC, + P60DOCK_OUTPUTENABLE_ACU_VBAT, + P60DOCK_OUTPUTENABLE_PDU1_VBAT, + P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, + P60DOCK_OUTPUTENABLE_PDU2_VBAT, + P60DOCK_OUTPUTENABLE_STACK_VBAT, + P60DOCK_OUTPUTENABLE_STACK_3V3, + P60DOCK_OUTPUTENABLE_STACK_5V, + P60DOCK_OUTPUTENABLE_GS3V3, + P60DOCK_OUTPUTENABLE_GS5V, + P60DOCK_TEMPERATURE_1, + P60DOCK_TEMPERATURE_2, + P60DOCK_BOOT_CAUSE, + P60DOCK_BOOT_CNT, + P60DOCK_UPTIME, + P60DOCK_RESETCAUSE, + P60DOCK_BATT_MODE, + P60DOCK_HEATER_ON, + P60DOCK_CONV_5V_ENABLE_STATUS, + P60DOCK_LATCHUP_ACU_VCC, + P60DOCK_LATCHUP_PDU1_VCC, + P60DOCK_LATCHUP_X3_IDLE_VCC, + P60DOCK_LATCHUP_PDU2_VCC, + P60DOCK_LATCHUP_ACU_VBAT, + P60DOCK_LATCHUP_PDU1_VBAT, + P60DOCK_LATCHUP_X3_IDLE_VBAT, + P60DOCK_LATCHUP_PDU2_VBAT, + P60DOCK_LATCHUP_STACK_VBAT, + P60DOCK_LATCHUP_STACK_3V3, + P60DOCK_LATCHUP_STACK_5V, + P60DOCK_LATCHUP_GS3V3, + P60DOCK_LATCHUP_GS5V, + P60DOCK_VBAT_VALUE, + P60DOCK_VCC_CURRENT_VALUE, + P60DOCK_BATTERY_CURRENT, + P60DOCK_BATTERY_VOLTAGE, + P60DOCK_BATTERY_TEMPERATURE_1, + P60DOCK_BATTERY_TEMPERATURE_2, + P60DOCK_DEVICE_0, + P60DOCK_DEVICE_1, + P60DOCK_DEVICE_2, + P60DOCK_DEVICE_3, + P60DOCK_DEVICE_4, + P60DOCK_DEVICE_5, + P60DOCK_DEVICE_6, + P60DOCK_DEVICE_7, + P60DOCK_DEVICE_0_STATUS, + P60DOCK_DEVICE_1_STATUS, + P60DOCK_DEVICE_2_STATUS, + P60DOCK_DEVICE_3_STATUS, + P60DOCK_DEVICE_4_STATUS, + P60DOCK_DEVICE_5_STATUS, + P60DOCK_DEVICE_6_STATUS, + P60DOCK_DEVICE_7_STATUS, + P60DOCK_DEVICE_TYPE_GROUP, + P60DOCK_DEVICE_STATUS_GROUP, + P60DOCK_DEARM_STATUS, + P60DOCK_WDT_CNT_GND, + P60DOCK_WDT_CNT_I2C, + P60DOCK_WDT_CNT_CAN, + P60DOCK_WDT_CNT_CSP_1, + P60DOCK_WDT_CNT_CSP_2, + P60DOCK_WDT_GND_LEFT, + P60DOCK_WDT_I2C_LEFT, + P60DOCK_WDT_CAN_LEFT, + P60DOCK_WDT_CSP_LEFT_1, + P60DOCK_WDT_CSP_LEFT_2, + P60DOCK_BATT_CHARGE_CURRENT, + P60DOCK_BATT_DISCHARGE_CURRENT, + 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, + 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, + /** 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, - /** ACU Ids */ - ACU_CURRENT_IN_CHANNEL0, - ACU_CURRENT_IN_CHANNEL1, - ACU_CURRENT_IN_CHANNEL2, - ACU_CURRENT_IN_CHANNEL3, - ACU_CURRENT_IN_CHANNEL4, - ACU_CURRENT_IN_CHANNEL5, - ACU_VOLTAGE_IN_CHANNEL0, - ACU_VOLTAGE_IN_CHANNEL1, - ACU_VOLTAGE_IN_CHANNEL2, - ACU_VOLTAGE_IN_CHANNEL3, - ACU_VOLTAGE_IN_CHANNEL4, - ACU_VOLTAGE_IN_CHANNEL5, - ACU_VCC, - ACU_VBAT, - ACU_TEMPERATURE_1, - ACU_TEMPERATURE_2, - ACU_TEMPERATURE_3, - ACU_MPPT_MODE, - ACU_VBOOST_CHANNEL0, - ACU_VBOOST_CHANNEL1, - ACU_VBOOST_CHANNEL2, - ACU_VBOOST_CHANNEL3, - ACU_VBOOST_CHANNEL4, - ACU_VBOOST_CHANNEL5, - ACU_POWER_CHANNEL0, - ACU_POWER_CHANNEL1, - ACU_POWER_CHANNEL2, - ACU_POWER_CHANNEL3, - ACU_POWER_CHANNEL4, - ACU_POWER_CHANNEL5, - ACU_DAC_EN_0, - ACU_DAC_EN_1, - ACU_DAC_EN_2, - ACU_DAC_RAW_0, - ACU_DAC_RAW_1, - ACU_DAC_RAW_2, - ACU_DAC_RAW_3, - ACU_DAC_RAW_4, - ACU_DAC_RAW_5, - ACU_BOOTCAUSE, - ACU_BOOTCNT, - ACU_UPTIME, - ACU_RESET_CAUSE, - ACU_MPPT_TIME, - ACU_MPPT_PERIOD, - ACU_DEVICE_0, - ACU_DEVICE_1, - ACU_DEVICE_2, - ACU_DEVICE_3, - ACU_DEVICE_4, - ACU_DEVICE_5, - ACU_DEVICE_6, - ACU_DEVICE_7, - ACU_DEVICE_0_STATUS, - ACU_DEVICE_1_STATUS, - ACU_DEVICE_2_STATUS, - ACU_DEVICE_3_STATUS, - ACU_DEVICE_4_STATUS, - ACU_DEVICE_5_STATUS, - ACU_DEVICE_6_STATUS, - ACU_DEVICE_7_STATUS, - ACU_WDT_CNT_GND, - ACU_WDT_GND_LEFT - }; + /** ACU Ids */ + ACU_CURRENT_IN_CHANNEL0, + ACU_CURRENT_IN_CHANNEL1, + ACU_CURRENT_IN_CHANNEL2, + ACU_CURRENT_IN_CHANNEL3, + ACU_CURRENT_IN_CHANNEL4, + ACU_CURRENT_IN_CHANNEL5, + ACU_VOLTAGE_IN_CHANNEL0, + ACU_VOLTAGE_IN_CHANNEL1, + ACU_VOLTAGE_IN_CHANNEL2, + ACU_VOLTAGE_IN_CHANNEL3, + ACU_VOLTAGE_IN_CHANNEL4, + ACU_VOLTAGE_IN_CHANNEL5, + ACU_VCC, + ACU_VBAT, + ACU_TEMPERATURE_1, + ACU_TEMPERATURE_2, + ACU_TEMPERATURE_3, + ACU_MPPT_MODE, + ACU_VBOOST_CHANNEL0, + ACU_VBOOST_CHANNEL1, + ACU_VBOOST_CHANNEL2, + ACU_VBOOST_CHANNEL3, + ACU_VBOOST_CHANNEL4, + ACU_VBOOST_CHANNEL5, + ACU_POWER_CHANNEL0, + ACU_POWER_CHANNEL1, + ACU_POWER_CHANNEL2, + ACU_POWER_CHANNEL3, + ACU_POWER_CHANNEL4, + ACU_POWER_CHANNEL5, + ACU_DAC_EN_0, + ACU_DAC_EN_1, + ACU_DAC_EN_2, + ACU_DAC_RAW_0, + ACU_DAC_RAW_1, + ACU_DAC_RAW_2, + ACU_DAC_RAW_3, + ACU_DAC_RAW_4, + ACU_DAC_RAW_5, + ACU_BOOTCAUSE, + ACU_BOOTCNT, + ACU_UPTIME, + ACU_RESET_CAUSE, + ACU_MPPT_TIME, + ACU_MPPT_PERIOD, + ACU_DEVICE_0, + ACU_DEVICE_1, + ACU_DEVICE_2, + ACU_DEVICE_3, + ACU_DEVICE_4, + ACU_DEVICE_5, + ACU_DEVICE_6, + ACU_DEVICE_7, + ACU_DEVICE_0_STATUS, + ACU_DEVICE_1_STATUS, + ACU_DEVICE_2_STATUS, + ACU_DEVICE_3_STATUS, + ACU_DEVICE_4_STATUS, + ACU_DEVICE_5_STATUS, + ACU_DEVICE_6_STATUS, + ACU_DEVICE_7_STATUS, + ACU_WDT_CNT_GND, + ACU_WDT_GND_LEFT +}; } namespace P60Dock { - /** Max reply size reached when requesting full hk table */ - static const uint16_t MAX_REPLY_LENGTH = 407; +/** Max reply size reached when requesting full hk table */ +static const uint16_t MAX_REPLY_LENGTH = 407; - static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408; - static const uint16_t MAX_HKTABLE_ADDRESS = 187; - static const uint16_t HK_TABLE_SIZE = 188; +static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408; +static const uint16_t MAX_HKTABLE_ADDRESS = 187; +static const uint16_t HK_TABLE_SIZE = 188; - static const uint8_t HK_TABLE_DATA_SET_ID = 0x3; - static const uint8_t HK_TABLE_ENTRIES = 100; +static const uint8_t HK_TABLE_DATA_SET_ID = 0x3; +static const uint8_t HK_TABLE_ENTRIES = 100; - /** - * Requesting the full housekeeping table from the P60 dock will generate a reply comprising - * 402 bytes of data. - */ - static const uint16_t HK_TABLE_REPLY_SIZE = 407; +/** + * Requesting the full housekeeping table from the P60 dock will generate a reply comprising + * 402 bytes of data. + */ +static const uint16_t HK_TABLE_REPLY_SIZE = 407; - /** - * @brief This class defines a dataset for the hk table of the P60 Dock. - */ - class HkTableDataset: - public StaticLocalDataSet { - public: +/** + * @brief This class defines a dataset for the hk table of the P60 Dock. + */ +class HkTableDataset: + public StaticLocalDataSet { + public: - HkTableDataset(HasLocalDataPoolIF* owner): - StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { - } + HkTableDataset(HasLocalDataPoolIF* owner): + StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { + } - HkTableDataset(object_id_t objectId): - StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { - } + HkTableDataset(object_id_t objectId): + StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { + } - /** Measured output currents */ - lp_var_t currentAcuVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_ACU_VCC, this); - lp_var_t currentPdu1Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_PDU1_VCC, this); - lp_var_t currentX3IdleVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_X3_IDLE_VCC, this); - lp_var_t currentPdu2Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_PDU2_VCC, this); - lp_var_t currentAcuVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_ACU_VBAT, this); - lp_var_t currentPdu1Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_PDU1_VBAT, this); - lp_var_t currentX3IdleVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, this); - lp_var_t currentPdu2Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_PDU2_VBAT, this); - lp_var_t currentStackVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_STACK_VBAT, this); - lp_var_t currentStack3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_STACK_3V3, this); - lp_var_t currentStack5V = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_STACK_5V, this); - lp_var_t currentGS3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_GS3V3, this); - lp_var_t currentGS5V = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENT_GS5V, this); + /** Measured output currents */ + lp_var_t currentAcuVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_ACU_VCC, this); + lp_var_t currentPdu1Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_PDU1_VCC, this); + lp_var_t currentX3IdleVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_X3_IDLE_VCC, this); + lp_var_t currentPdu2Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_PDU2_VCC, this); + lp_var_t currentAcuVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_ACU_VBAT, this); + lp_var_t currentPdu1Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_PDU1_VBAT, this); + lp_var_t currentX3IdleVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_X3_IDLE_VBAT, this); + lp_var_t currentPdu2Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_PDU2_VBAT, this); + lp_var_t currentStackVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_STACK_VBAT, this); + lp_var_t currentStack3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_STACK_3V3, this); + lp_var_t currentStack5V = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_STACK_5V, this); + lp_var_t currentGS3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_GS3V3, this); + lp_var_t currentGS5V = lp_var_t(sid.objectId, + P60System::P60DOCK_CURRENT_GS5V, this); - /** Measured output voltages */ - lp_var_t voltageAcuVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_ACU_VCC, this); - lp_var_t voltagePdu1Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_PDU1_VCC, this); - lp_var_t voltageX3IdleVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, this); - lp_var_t voltagePdu2Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_PDU2_VCC, this); - lp_var_t voltageAcuVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_ACU_VBAT, this); - lp_var_t voltagePdu1Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_PDU1_VBAT, this); - lp_var_t voltageX3IdleVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, this); - lp_var_t voltagePdu2Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_PDU2_VBAT, this); - lp_var_t voltageStackVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_STACK_VBAT, this); - lp_var_t voltageStack3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_STACK_3V3, this); - lp_var_t voltageStack5V = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_STACK_5V, this); - lp_var_t voltageGS3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_GS3V3, this); - lp_var_t voltageGS5V = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGE_GS5V, this); + /** Measured output voltages */ + lp_var_t voltageAcuVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_ACU_VCC, this); + lp_var_t voltagePdu1Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_PDU1_VCC, this); + lp_var_t voltageX3IdleVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_X3_IDLE_VCC, this); + lp_var_t voltagePdu2Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_PDU2_VCC, this); + lp_var_t voltageAcuVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_ACU_VBAT, this); + lp_var_t voltagePdu1Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_PDU1_VBAT, this); + lp_var_t voltageX3IdleVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_X3_IDLE_VBAT, this); + lp_var_t voltagePdu2Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_PDU2_VBAT, this); + lp_var_t voltageStackVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_STACK_VBAT, this); + lp_var_t voltageStack3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_STACK_3V3, this); + lp_var_t voltageStack5V = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_STACK_5V, this); + lp_var_t voltageGS3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_GS3V3, this); + lp_var_t voltageGS5V = lp_var_t(sid.objectId, + P60System::P60DOCK_VOLTAGE_GS5V, this); - /** Output enable states */ - lp_var_t outputEnableStateAcuVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, this); - lp_var_t outputEnableStatePdu1Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, this); - lp_var_t outputEnableStateX3IdleVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, this); - lp_var_t outputEnableStatePdu2Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, this); - lp_var_t outputEnableStateAcuVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, this); - lp_var_t outputEnableStatePdu1Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, this); - lp_var_t outputEnableStateX3IdleVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, this); - lp_var_t outputEnableStatePdu2Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, this); - lp_var_t outputEnableStateStackVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, this); - lp_var_t outputEnableStateStack3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, this); - lp_var_t outputEnableStateStack5V = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_STACK_5V, this); - lp_var_t outputEnableStateGS3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_GS3V3, this); - lp_var_t outputEnableStateGS5V = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUTENABLE_GS5V, this); + /** Output enable states */ + lp_var_t outputEnableStateAcuVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_ACU_VCC, this); + lp_var_t outputEnableStatePdu1Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_PDU1_VCC, this); + lp_var_t outputEnableStateX3IdleVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VCC, this); + lp_var_t outputEnableStatePdu2Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_PDU2_VCC, this); + lp_var_t outputEnableStateAcuVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_ACU_VBAT, this); + lp_var_t outputEnableStatePdu1Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_PDU1_VBAT, this); + lp_var_t outputEnableStateX3IdleVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_X3_IDLE_VBAT, this); + lp_var_t outputEnableStatePdu2Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_PDU2_VBAT, this); + lp_var_t outputEnableStateStackVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_STACK_VBAT, this); + lp_var_t outputEnableStateStack3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_STACK_3V3, this); + lp_var_t outputEnableStateStack5V = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_STACK_5V, this); + lp_var_t outputEnableStateGS3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_GS3V3, this); + lp_var_t outputEnableStateGS5V = lp_var_t(sid.objectId, + P60System::P60DOCK_OUTPUTENABLE_GS5V, this); - lp_var_t temperature1 = lp_var_t(sid.objectId, - P60System::P60DOCK_TEMPERATURE_1, this); - lp_var_t temperature2 = lp_var_t(sid.objectId, - P60System::P60DOCK_TEMPERATURE_2, this); + lp_var_t temperature1 = lp_var_t(sid.objectId, + P60System::P60DOCK_TEMPERATURE_1, this); + lp_var_t temperature2 = lp_var_t(sid.objectId, + P60System::P60DOCK_TEMPERATURE_2, this); - lp_var_t bootcause = lp_var_t(sid.objectId, - P60System::P60DOCK_BOOT_CAUSE, this); - lp_var_t bootCount = lp_var_t(sid.objectId, - P60System::P60DOCK_BOOT_CNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, - P60System::P60DOCK_UPTIME, this); - lp_var_t resetcause = lp_var_t(sid.objectId, - P60System::P60DOCK_RESETCAUSE, this); - lp_var_t battMode = lp_var_t(sid.objectId, - P60System::P60DOCK_BATT_MODE, this); - /** Battery heater control only possible on BP4 packs */ - lp_var_t heaterOn = lp_var_t(sid.objectId, - P60System::P60DOCK_HEATER_ON, this); - lp_var_t converter5VStatus = lp_var_t(sid.objectId, - P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this); + lp_var_t bootcause = lp_var_t(sid.objectId, + P60System::P60DOCK_BOOT_CAUSE, this); + lp_var_t bootCount = lp_var_t(sid.objectId, + P60System::P60DOCK_BOOT_CNT, this); + lp_var_t uptime = lp_var_t(sid.objectId, + P60System::P60DOCK_UPTIME, this); + lp_var_t resetcause = lp_var_t(sid.objectId, + P60System::P60DOCK_RESETCAUSE, this); + lp_var_t battMode = lp_var_t(sid.objectId, + P60System::P60DOCK_BATT_MODE, this); + /** Battery heater control only possible on BP4 packs */ + lp_var_t heaterOn = lp_var_t(sid.objectId, + P60System::P60DOCK_HEATER_ON, this); + lp_var_t converter5VStatus = lp_var_t(sid.objectId, + P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this); - /** Number of detected latchups on each output channel */ - lp_var_t latchupsAcuVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_ACU_VCC, this); - lp_var_t latchupsPdu1Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_PDU1_VCC, this); - lp_var_t latchupsX3IdleVcc = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, this); - lp_var_t latchupsPdu2Vcc = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_PDU2_VCC, this); - lp_var_t latchupsAcuVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_ACU_VBAT, this); - lp_var_t latchupsPdu1Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_PDU1_VBAT, this); - lp_var_t latchupsX3IdleVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, this); - lp_var_t latchupsPdu2Vbat = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_PDU2_VBAT, this); - lp_var_t latchupsStackVbat = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_STACK_VBAT, this); - lp_var_t latchupsStack3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_STACK_3V3, this); - lp_var_t latchupsStack5V = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_STACK_5V, this); - lp_var_t latchupsGS3V3 = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_GS3V3, this); - lp_var_t latchupsGS5V = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_GS5V, this); + /** Number of detected latchups on each output channel */ + lp_var_t latchupsAcuVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_ACU_VCC, this); + lp_var_t latchupsPdu1Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_PDU1_VCC, this); + lp_var_t latchupsX3IdleVcc = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_X3_IDLE_VCC, this); + lp_var_t latchupsPdu2Vcc = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_PDU2_VCC, this); + lp_var_t latchupsAcuVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_ACU_VBAT, this); + lp_var_t latchupsPdu1Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_PDU1_VBAT, this); + lp_var_t latchupsX3IdleVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_X3_IDLE_VBAT, this); + lp_var_t latchupsPdu2Vbat = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_PDU2_VBAT, this); + lp_var_t latchupsStackVbat = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_STACK_VBAT, this); + lp_var_t latchupsStack3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_STACK_3V3, this); + lp_var_t latchupsStack5V = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_STACK_5V, this); + lp_var_t latchupsGS3V3 = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_GS3V3, this); + lp_var_t latchupsGS5V = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_GS5V, this); - lp_var_t vbatVoltageValue = lp_var_t(sid.objectId, - P60System::P60DOCK_VBAT_VALUE, this); - lp_var_t vccCurrent = lp_var_t(sid.objectId, - P60System::P60DOCK_VCC_CURRENT_VALUE, this); - lp_var_t batteryCurrent = lp_var_t(sid.objectId, - P60System::P60DOCK_BATTERY_CURRENT, this); - lp_var_t batteryVoltage = lp_var_t(sid.objectId, - P60System::P60DOCK_BATTERY_VOLTAGE, this); + lp_var_t vbatVoltageValue = lp_var_t(sid.objectId, + P60System::P60DOCK_VBAT_VALUE, this); + lp_var_t vccCurrent = lp_var_t(sid.objectId, + P60System::P60DOCK_VCC_CURRENT_VALUE, this); + lp_var_t batteryCurrent = lp_var_t(sid.objectId, + P60System::P60DOCK_BATTERY_CURRENT, this); + lp_var_t batteryVoltage = lp_var_t(sid.objectId, + P60System::P60DOCK_BATTERY_VOLTAGE, this); - lp_var_t batteryTemperature1 = lp_var_t(sid.objectId, - P60System::P60DOCK_BATTERY_TEMPERATURE_1, this); - lp_var_t batteryTemperature2 = lp_var_t(sid.objectId, - P60System::P60DOCK_BATTERY_TEMPERATURE_2, this); + lp_var_t batteryTemperature1 = lp_var_t(sid.objectId, + P60System::P60DOCK_BATTERY_TEMPERATURE_1, this); + lp_var_t batteryTemperature2 = lp_var_t(sid.objectId, + P60System::P60DOCK_BATTERY_TEMPERATURE_2, this); - lp_var_t device0 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_7, this); - lp_var_t device0Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_0_STATUS, this); - lp_var_t device1Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_1_STATUS, this); - lp_var_t device2Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_2_STATUS, this); - lp_var_t device3Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_3_STATUS, this); - lp_var_t device4Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_4_STATUS, this); - lp_var_t device5Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_5_STATUS, this); - lp_var_t device6Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_6_STATUS, this); - lp_var_t device7Status = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_7_STATUS, this); + lp_var_t device0Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_0_STATUS, this); + lp_var_t device1Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_1_STATUS, this); + lp_var_t device2Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_2_STATUS, this); + lp_var_t device3Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_3_STATUS, this); + lp_var_t device4Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_4_STATUS, this); + lp_var_t device5Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_5_STATUS, this); + lp_var_t device6Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_6_STATUS, this); + lp_var_t device7Status = lp_var_t(sid.objectId, + P60System::P60DOCK_DEVICE_7_STATUS, this); - lp_var_t dearmStatus = lp_var_t(sid.objectId, - P60System::P60DOCK_DEARM_STATUS, this); + lp_var_t dearmStatus = lp_var_t(sid.objectId, + P60System::P60DOCK_DEARM_STATUS, this); - /** Number of reboots due to gnd, i2c, csp watchdog timeout */ - lp_var_t wdtCntGnd = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CNT_GND, this); - lp_var_t wdtCntI2c = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CNT_I2C, this); - lp_var_t wdtCntCan = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CNT_CAN, this); - lp_var_t wdtCntCsp1 = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CNT_CSP_1, this); - lp_var_t wdtCntCsp2 = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CNT_CSP_2, this); + /** Number of reboots due to gnd, i2c, csp watchdog timeout */ + lp_var_t wdtCntGnd = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CNT_GND, this); + lp_var_t wdtCntI2c = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CNT_I2C, this); + lp_var_t wdtCntCan = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CNT_CAN, this); + lp_var_t wdtCntCsp1 = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CNT_CSP_1, this); + lp_var_t wdtCntCsp2 = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CNT_CSP_2, this); - lp_var_t wdtGndLeft = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_GND_LEFT, this); - lp_var_t wdtI2cLeft = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_I2C_LEFT, this); - lp_var_t wdtCanLeft = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CAN_LEFT, this); - lp_var_t wdtCspLeft1 = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CSP_LEFT_1, this); - lp_var_t wdtCspLeft2 = lp_var_t(sid.objectId, - P60System::P60DOCK_WDT_CSP_LEFT_2, this); - lp_var_t batteryChargeCurrent = lp_var_t(sid.objectId, - P60System::P60DOCK_BATT_CHARGE_CURRENT, this); - lp_var_t batteryDischargeCurrent = lp_var_t(sid.objectId, - P60System::P60DOCK_BATT_DISCHARGE_CURRENT, this); - lp_var_t ant6Depl = lp_var_t(sid.objectId, - P60System::P60DOCK_ANT6_DEPL, this); - lp_var_t ar6Depl = lp_var_t(sid.objectId, - P60System::P60DOCK_AR6_DEPL, this); - }; + lp_var_t wdtGndLeft = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_GND_LEFT, this); + lp_var_t wdtI2cLeft = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_I2C_LEFT, this); + lp_var_t wdtCanLeft = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CAN_LEFT, this); + lp_var_t wdtCspLeft1 = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CSP_LEFT_1, this); + lp_var_t wdtCspLeft2 = lp_var_t(sid.objectId, + P60System::P60DOCK_WDT_CSP_LEFT_2, this); + lp_var_t batteryChargeCurrent = lp_var_t(sid.objectId, + P60System::P60DOCK_BATT_CHARGE_CURRENT, this); + lp_var_t batteryDischargeCurrent = lp_var_t(sid.objectId, + P60System::P60DOCK_BATT_DISCHARGE_CURRENT, this); + lp_var_t ant6Depl = lp_var_t(sid.objectId, + P60System::P60DOCK_ANT6_DEPL, this); + lp_var_t ar6Depl = lp_var_t(sid.objectId, + P60System::P60DOCK_AR6_DEPL, this); +}; } @@ -610,597 +612,597 @@ namespace P60Dock { * @brief Constants common for both PDU1 and PDU2. */ namespace PDU{ - /** When retrieving full configuration parameter table */ - static const uint16_t MAX_REPLY_LENGTH = 318; - static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316; - 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; +/** When retrieving full configuration parameter table */ +static const uint16_t MAX_REPLY_LENGTH = 318; +static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316; +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; } namespace PDU1 { - static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4 - /** - * Addresses within configuration table to enable or disable output channels. Refer also to - * gs-man-nanopower-p60-pdu-200.pdf on page 16. - */ - static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3 = 0x48; - static const uint16_t CONFIG_ADDRESS_OUT_EN_SYRLINKS = 0x49; - static const uint16_t CONFIG_ADDRESS_OUT_EN_STAR_TRACKER = 0x50; - static const uint16_t CONFIG_ADDRESS_OUT_EN_MGT = 0x51; - static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL = 0x52; - static const uint16_t CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP = 0x53; - static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x54; - static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x55; - static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x56; +static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4 +/** + * Addresses within configuration table to enable or disable output channels. Refer also to + * gs-man-nanopower-p60-pdu-200.pdf on page 16. + */ +static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3 = 0x48; +static const uint16_t CONFIG_ADDRESS_OUT_EN_SYRLINKS = 0x49; +static const uint16_t CONFIG_ADDRESS_OUT_EN_STAR_TRACKER = 0x50; +static const uint16_t CONFIG_ADDRESS_OUT_EN_MGT = 0x51; +static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL = 0x52; +static const uint16_t CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP = 0x53; +static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x54; +static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x55; +static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x56; + +/** + * @brief This class defines a dataset for the hk table of the PDU1. + */ +class PDU1HkTableDataset : + public StaticLocalDataSet { + public: + + PDU1HkTableDataset(HasLocalDataPoolIF* owner): + StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { + } + + PDU1HkTableDataset(object_id_t objectId): + StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { + } + + /** Measured output currents */ + lp_var_t currentOutTCSBoard3V3 = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); + lp_var_t currentOutSyrlinks = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_SYRLINKS, this); + lp_var_t currentOutStarTracker = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_STAR_TRACKER, this); + lp_var_t currentOutMGT = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_MGT, this); + lp_var_t currentOutSUSNominal = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, this); + lp_var_t currentOutSolarCellExp = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); + lp_var_t currentOutPLOC = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_PLOC, this); + lp_var_t currentOutACSBoardSideA = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t currentOutChannel8 = lp_var_t(sid.objectId, + P60System::PDU1_CURRENT_OUT_CHANNEL8, this); + /** Measured voltage of output channels */ + lp_var_t voltageOutTCSBoard3V3 = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); + lp_var_t voltageOutSyrlinks = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_SYRLINKS, this); + lp_var_t voltageOutStarTracker = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); + lp_var_t voltageOutMGT = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_MGT, this); + lp_var_t voltageOutSUSNominal = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); + lp_var_t voltageOutSolarCellExp = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); + lp_var_t voltageOutPLOC = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_PLOC, this); + lp_var_t voltageOutACSBoardSideA = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); + lp_var_t voltageOutChannel8 = lp_var_t(sid.objectId, + P60System::PDU1_VOLTAGE_OUT_CHANNEL8, this); + /** Measured VCC */ + lp_var_t vcc = lp_var_t(sid.objectId, + P60System::PDU1_VCC, this); + /** Measured VBAT */ + lp_var_t vbat = lp_var_t(sid.objectId, + P60System::PDU1_VBAT, this); + lp_var_t temperature = lp_var_t(sid.objectId, + P60System::PDU1_TEMPERATURE, this); + /** Output converter enable status */ + lp_var_t converterEnable1 = lp_var_t(sid.objectId, + P60System::PDU1_CONV_EN_1, this); + lp_var_t converterEnable2 = lp_var_t(sid.objectId, + P60System::PDU1_CONV_EN_2, this); + lp_var_t converterEnable3 = lp_var_t(sid.objectId, + P60System::PDU1_CONV_EN_3, this); + + /** Output channels enable status */ + lp_var_t outEnabledTCSBoard3V3 = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this); + lp_var_t outEnabledSyrlinks = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_SYRLINKS, this); + lp_var_t outEnabledStarTracker = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_STAR_TRACKER, this); + lp_var_t outEnabledMGT = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_MGT, this); + lp_var_t outEnabledSUSNominal = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_SUS_NOMINAL, this); + lp_var_t outEnabledSolarCellExp = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, this); + lp_var_t outEnabledPLOC = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_PLOC, this); + lp_var_t outEnabledAcsBoardSideA = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); + lp_var_t outEnabledChannel8 = lp_var_t(sid.objectId, + P60System::PDU1_OUT_EN_CHANNEL8, this); + lp_var_t bootcause = lp_var_t(sid.objectId, + P60System::PDU1_BOOTCAUSE, this); + /** Number of reboots */ + lp_var_t bootcount = lp_var_t(sid.objectId, + P60System::PDU1_BOOTCNT, this); + /** Uptime in seconds */ + lp_var_t uptime = lp_var_t(sid.objectId, + P60System::PDU1_UPTIME, this); + lp_var_t resetcause = lp_var_t(sid.objectId, + P60System::PDU1_RESETCAUSE, this); + /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ + lp_var_t battMode = lp_var_t(sid.objectId, + P60System::PDU1_BATT_MODE, this); + + /** Number of detected latchups on each output channel */ + lp_var_t latchupsTcsBoard3V3 = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_TCS_BOARD_3V3, this); + lp_var_t latchupsSyrlinks = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_SYRLINKS, this); + lp_var_t latchupsStarTracker = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_STAR_TRACKER, this); + lp_var_t latchupsMgt = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_MGT, this); + lp_var_t latchupsSusNominal = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_SUS_NOMINAL, this); + lp_var_t latchupsSolarCellExp = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, this); + lp_var_t latchupsPloc = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_PLOC, this); + lp_var_t latchupsAcsBoardSideA = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); + lp_var_t latchupsChannel8 = lp_var_t(sid.objectId, + P60System::PDU1_LATCHUP_CHANNEL8, this); /** - * @brief This class defines a dataset for the hk table of the PDU1. + * 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. */ - class PDU1HkTableDataset : - public StaticLocalDataSet { - public: + lp_var_t device0 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_7, this); + /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ + lp_var_t device0Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_0_STATUS, this); + lp_var_t device1Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_1_STATUS, this); + lp_var_t device2Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_2_STATUS, this); + lp_var_t device3Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_3_STATUS, this); + lp_var_t device4Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_4_STATUS, this); + lp_var_t device5Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_5_STATUS, this); + lp_var_t device6Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_6_STATUS, this); + lp_var_t device7Status = lp_var_t(sid.objectId, + P60System::PDU1_DEVICE_7_STATUS, this); - PDU1HkTableDataset(HasLocalDataPoolIF* owner): - StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { - } - - PDU1HkTableDataset(object_id_t objectId): - StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { - } - - /** Measured output currents */ - lp_var_t currentOutTCSBoard3V3 = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this); - lp_var_t currentOutSyrlinks = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_SYRLINKS, this); - lp_var_t currentOutStarTracker = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_STAR_TRACKER, this); - lp_var_t currentOutMGT = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_MGT, this); - lp_var_t currentOutSUSNominal = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, this); - lp_var_t currentOutSolarCellExp = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this); - lp_var_t currentOutPLOC = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_PLOC, this); - lp_var_t currentOutACSBoardSideA = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this); - lp_var_t currentOutChannel8 = lp_var_t(sid.objectId, - P60System::PDU1_CURRENT_OUT_CHANNEL8, this); - /** Measured voltage of output channels */ - lp_var_t voltageOutTCSBoard3V3 = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this); - lp_var_t voltageOutSyrlinks = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_SYRLINKS, this); - lp_var_t voltageOutStarTracker = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, this); - lp_var_t voltageOutMGT = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_MGT, this); - lp_var_t voltageOutSUSNominal = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this); - lp_var_t voltageOutSolarCellExp = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this); - lp_var_t voltageOutPLOC = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_PLOC, this); - lp_var_t voltageOutACSBoardSideA = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this); - lp_var_t voltageOutChannel8 = lp_var_t(sid.objectId, - P60System::PDU1_VOLTAGE_OUT_CHANNEL8, this); - /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, - P60System::PDU1_VCC, this); - /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, - P60System::PDU1_VBAT, this); - lp_var_t temperature = lp_var_t(sid.objectId, - P60System::PDU1_TEMPERATURE, this); - /** Output converter enable status */ - lp_var_t converterEnable1 = lp_var_t(sid.objectId, - P60System::PDU1_CONV_EN_1, this); - lp_var_t converterEnable2 = lp_var_t(sid.objectId, - P60System::PDU1_CONV_EN_2, this); - lp_var_t converterEnable3 = lp_var_t(sid.objectId, - P60System::PDU1_CONV_EN_3, this); - - /** Output channels enable status */ - lp_var_t outEnabledTCSBoard3V3 = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this); - lp_var_t outEnabledSyrlinks = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_SYRLINKS, this); - lp_var_t outEnabledStarTracker = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_STAR_TRACKER, this); - lp_var_t outEnabledMGT = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_MGT, this); - lp_var_t outEnabledSUSNominal = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_SUS_NOMINAL, this); - lp_var_t outEnabledSolarCellExp = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, this); - lp_var_t outEnabledPLOC = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_PLOC, this); - lp_var_t outEnabledAcsBoardSideA = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this); - lp_var_t outEnabledChannel8 = lp_var_t(sid.objectId, - P60System::PDU1_OUT_EN_CHANNEL8, this); - lp_var_t bootcause = lp_var_t(sid.objectId, - P60System::PDU1_BOOTCAUSE, this); - /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, - P60System::PDU1_BOOTCNT, this); - /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, - P60System::PDU1_UPTIME, this); - lp_var_t resetcause = lp_var_t(sid.objectId, - P60System::PDU1_RESETCAUSE, this); - /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, - P60System::PDU1_BATT_MODE, this); - - /** Number of detected latchups on each output channel */ - lp_var_t latchupsTcsBoard3V3 = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_TCS_BOARD_3V3, this); - lp_var_t latchupsSyrlinks = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_SYRLINKS, this); - lp_var_t latchupsStarTracker = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_STAR_TRACKER, this); - lp_var_t latchupsMgt = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_MGT, this); - lp_var_t latchupsSusNominal = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_SUS_NOMINAL, this); - lp_var_t latchupsSolarCellExp = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_SOLAR_CELL_EXP, this); - lp_var_t latchupsPloc = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_PLOC, this); - lp_var_t latchupsAcsBoardSideA = lp_var_t(sid.objectId, - P60System::PDU1_LATCHUP_ACS_BOARD_SIDE_A, this); - lp_var_t latchupsChannel8 = lp_var_t(sid.objectId, - P60System::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 device0 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_7, this); - /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ - lp_var_t device0Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_0_STATUS, this); - lp_var_t device1Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_1_STATUS, this); - lp_var_t device2Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_2_STATUS, this); - lp_var_t device3Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_3_STATUS, this); - lp_var_t device4Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_4_STATUS, this); - lp_var_t device5Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_5_STATUS, this); - lp_var_t device6Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_6_STATUS, this); - lp_var_t device7Status = lp_var_t(sid.objectId, - P60System::PDU1_DEVICE_7_STATUS, this); - - /** Number of reboots triggered by the ground watchdog */ - lp_var_t gndWdtReboots = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CNT_GND, this); - /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ - lp_var_t i2cWdtReboots = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CNT_I2C, this); - /** Number of reboots triggered through the CAN watchdog */ - lp_var_t canWdtReboots = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CNT_CAN, this); - /** Number of reboots triggered through the CSP watchdog */ - lp_var_t csp1WdtReboots = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CNT_CSP1, this); - lp_var_t csp2WdtReboots = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CNT_CSP2, this); - /** Ground watchdog remaining seconds before rebooting */ - lp_var_t groundWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU1_WDT_GND_LEFT, this); - /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ - lp_var_t i2cWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU1_WDT_I2C_LEFT, this); - /** CAN watchdog remaining seconds before rebooting. */ - lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CAN_LEFT, this); - /** CSP watchdogs remaining pings before rebooting. */ - lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CSP_LEFT1, this); - lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, - P60System::PDU1_WDT_CSP_LEFT2, this); - }; + /** Number of reboots triggered by the ground watchdog */ + lp_var_t gndWdtReboots = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CNT_GND, this); + /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ + lp_var_t i2cWdtReboots = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CNT_I2C, this); + /** Number of reboots triggered through the CAN watchdog */ + lp_var_t canWdtReboots = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CNT_CAN, this); + /** Number of reboots triggered through the CSP watchdog */ + lp_var_t csp1WdtReboots = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CNT_CSP1, this); + lp_var_t csp2WdtReboots = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CNT_CSP2, this); + /** Ground watchdog remaining seconds before rebooting */ + lp_var_t groundWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU1_WDT_GND_LEFT, this); + /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ + lp_var_t i2cWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU1_WDT_I2C_LEFT, this); + /** CAN watchdog remaining seconds before rebooting. */ + lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CAN_LEFT, this); + /** CSP watchdogs remaining pings before rebooting. */ + lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CSP_LEFT1, this); + lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, + P60System::PDU1_WDT_CSP_LEFT2, this); +}; } namespace PDU2 { - static const uint32_t HK_TABLE_DATA_SET_ID = 0x2; - /** - * Addresses within configuration table to enable or disable output channels. Refer also to - * gs-man-nanopower-p60-pdu-200.pdf on page 16. - */ - static const uint16_t CONFIG_ADDRESS_OUT_EN_Q7S = 0x48; - static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1 = 0x49; - static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A; - static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B; - static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C; - static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D; - static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC = 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; +static const uint32_t HK_TABLE_DATA_SET_ID = 0x2; +/** + * Addresses within configuration table to enable or disable output channels. Refer also to + * gs-man-nanopower-p60-pdu-200.pdf on page 16. + */ +static const uint16_t CONFIG_ADDRESS_OUT_EN_Q7S = 0x48; +static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1 = 0x49; +static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A; +static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B; +static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C; +static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D; +static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC = 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 { + public: + + PDU2HkTableDataset(HasLocalDataPoolIF* owner): + StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { + } + + PDU2HkTableDataset(object_id_t objectId): + StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { + } + + /** Measured output currents */ + lp_var_t currentOutQ7S = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_Q7S, this); + lp_var_t currentOutPayloadPCDUCh1 = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t currentOutReactionWheels = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_RW, this); + lp_var_t currentOutTCSBoardHeaterIn = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t currentOutSUSRedundant = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); + lp_var_t currentOutDeplMechanism = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t currentOutPayloadPCDUCh6 = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t currentOutACSBoardSideB = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t currentOutPayloadCamera = lp_var_t(sid.objectId, + P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); + /** Measured voltage of output channels */ + lp_var_t voltageOutQ7S = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_Q7S, this); + lp_var_t voltageOutPayloadPCDUCh1 = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); + lp_var_t voltageOutReactionWheels = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_RW, this); + lp_var_t voltageOutTCSBoardHeaterIn = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); + lp_var_t voltageOutSUSRedundant = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); + lp_var_t voltageOutDeplMechanism = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); + lp_var_t voltageOutPayloadPCDUCh6 = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); + lp_var_t voltageOutACSBoardSideB = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); + lp_var_t voltageOutPayloadCamera = lp_var_t(sid.objectId, + P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); + /** Measured VCC */ + lp_var_t vcc = lp_var_t(sid.objectId, + P60System::PDU2_VCC, this); + /** Measured VBAT */ + lp_var_t vbat = lp_var_t(sid.objectId, + P60System::PDU2_VBAT, this); + lp_var_t temperature = lp_var_t(sid.objectId, + P60System::PDU2_TEMPERATURE, this); + /** Output converter enable status */ + lp_var_t converterEnable1 = lp_var_t(sid.objectId, + P60System::PDU2_CONV_EN_1, this); + lp_var_t converterEnable2 = lp_var_t(sid.objectId, + P60System::PDU2_CONV_EN_2, this); + lp_var_t converterEnable3 = lp_var_t(sid.objectId, + P60System::PDU2_CONV_EN_3, this); + /** Output channels enable status */ + lp_var_t outEnabledQ7S = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_Q7S, this); + lp_var_t outEnabledPlPCDUCh1 = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); + lp_var_t outEnabledReactionWheels = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_RW, this); + lp_var_t outEnabledTCSBoardHeaterIn = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); + lp_var_t outEnabledSUSRedundant = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_SUS_REDUNDANT, this); + lp_var_t outEnabledDeplMechanism = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); + lp_var_t outEnabledPlPCDUCh6 = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); + lp_var_t outEnabledAcsBoardSideB = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); + lp_var_t outEnabledPayloadCamera = lp_var_t(sid.objectId, + P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this); + + lp_var_t bootcause = lp_var_t(sid.objectId, + P60System::PDU2_BOOTCAUSE, this); + /** Number of reboots */ + lp_var_t bootcount = lp_var_t(sid.objectId, + P60System::PDU2_BOOTCNT, this); + /** Uptime in seconds */ + lp_var_t uptime = lp_var_t(sid.objectId, + P60System::PDU2_UPTIME, this); + lp_var_t resetcause = lp_var_t(sid.objectId, + P60System::PDU2_RESETCAUSE, this); + /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ + lp_var_t battMode = lp_var_t(sid.objectId, + P60System::PDU2_BATT_MODE, this); + + /** Number of detected latchups on each output channel */ + lp_var_t latchupsQ7S = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_Q7S, this); + lp_var_t latchupsPayloadPcduCh1 = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); + lp_var_t latchupsRw = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_RW, this); + lp_var_t latchupsTcsBoardHeaterIn = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); + lp_var_t latchupsSusRedundant = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_SUS_REDUNDANT, this); + lp_var_t latchupsDeplMenchanism = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); + lp_var_t latchupsPayloadPcduCh6 = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); + lp_var_t latchupsAcsBoardSideB = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); + lp_var_t latchupsPayloadCamera = lp_var_t(sid.objectId, + P60System::PDU2_LATCHUP_PAYLOAD_CAMERA, this); /** - * @brief This class defines a dataset for the hk table of the PDU2. + * 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. */ - class PDU2HkTableDataset: - public StaticLocalDataSet { - public: + lp_var_t device0 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_7, this); + /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ + lp_var_t device0Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_0_STATUS, this); + lp_var_t device1Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_1_STATUS, this); + lp_var_t device2Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_2_STATUS, this); + lp_var_t device3Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_3_STATUS, this); + lp_var_t device4Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_4_STATUS, this); + lp_var_t device5Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_5_STATUS, this); + lp_var_t device6Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_6_STATUS, this); + lp_var_t device7Status = lp_var_t(sid.objectId, + P60System::PDU2_DEVICE_7_STATUS, this); - PDU2HkTableDataset(HasLocalDataPoolIF* owner): - StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { - } - - PDU2HkTableDataset(object_id_t objectId): - StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { - } - - /** Measured output currents */ - lp_var_t currentOutQ7S = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_Q7S, this); - lp_var_t currentOutPayloadPCDUCh1 = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this); - lp_var_t currentOutReactionWheels = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_RW, this); - lp_var_t currentOutTCSBoardHeaterIn = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this); - lp_var_t currentOutSUSRedundant = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, this); - lp_var_t currentOutDeplMechanism = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this); - lp_var_t currentOutPayloadPCDUCh6 = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t currentOutACSBoardSideB = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this); - lp_var_t currentOutPayloadCamera = lp_var_t(sid.objectId, - P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this); - /** Measured voltage of output channels */ - lp_var_t voltageOutQ7S = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_Q7S, this); - lp_var_t voltageOutPayloadPCDUCh1 = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this); - lp_var_t voltageOutReactionWheels = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_RW, this); - lp_var_t voltageOutTCSBoardHeaterIn = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this); - lp_var_t voltageOutSUSRedundant = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this); - lp_var_t voltageOutDeplMechanism = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this); - lp_var_t voltageOutPayloadPCDUCh6 = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this); - lp_var_t voltageOutACSBoardSideB = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this); - lp_var_t voltageOutPayloadCamera = lp_var_t(sid.objectId, - P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this); - /** Measured VCC */ - lp_var_t vcc = lp_var_t(sid.objectId, - P60System::PDU2_VCC, this); - /** Measured VBAT */ - lp_var_t vbat = lp_var_t(sid.objectId, - P60System::PDU2_VBAT, this); - lp_var_t temperature = lp_var_t(sid.objectId, - P60System::PDU2_TEMPERATURE, this); - /** Output converter enable status */ - lp_var_t converterEnable1 = lp_var_t(sid.objectId, - P60System::PDU2_CONV_EN_1, this); - lp_var_t converterEnable2 = lp_var_t(sid.objectId, - P60System::PDU2_CONV_EN_2, this); - lp_var_t converterEnable3 = lp_var_t(sid.objectId, - P60System::PDU2_CONV_EN_3, this); - /** Output channels enable status */ - lp_var_t outEnabledQ7S = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_Q7S, this); - lp_var_t outEnabledPlPCDUCh1 = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this); - lp_var_t outEnabledReactionWheels = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_RW, this); - lp_var_t outEnabledTCSBoardHeaterIn = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this); - lp_var_t outEnabledSUSRedundant = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_SUS_REDUNDANT, this); - lp_var_t outEnabledDeplMechanism = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this); - lp_var_t outEnabledPlPCDUCh6 = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this); - lp_var_t outEnabledAcsBoardSideB = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this); - lp_var_t outEnabledPayloadCamera = lp_var_t(sid.objectId, - P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this); - - lp_var_t bootcause = lp_var_t(sid.objectId, - P60System::PDU2_BOOTCAUSE, this); - /** Number of reboots */ - lp_var_t bootcount = lp_var_t(sid.objectId, - P60System::PDU2_BOOTCNT, this); - /** Uptime in seconds */ - lp_var_t uptime = lp_var_t(sid.objectId, - P60System::PDU2_UPTIME, this); - lp_var_t resetcause = lp_var_t(sid.objectId, - P60System::PDU2_RESETCAUSE, this); - /** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */ - lp_var_t battMode = lp_var_t(sid.objectId, - P60System::PDU2_BATT_MODE, this); - - /** Number of detected latchups on each output channel */ - lp_var_t latchupsQ7S = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_Q7S, this); - lp_var_t latchupsPayloadPcduCh1 = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH1, this); - lp_var_t latchupsRw = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_RW, this); - lp_var_t latchupsTcsBoardHeaterIn = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_TCS_BOARD_HEATER_IN, this); - lp_var_t latchupsSusRedundant = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_SUS_REDUNDANT, this); - lp_var_t latchupsDeplMenchanism = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_DEPLOYMENT_MECHANISM, this); - lp_var_t latchupsPayloadPcduCh6 = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_PAYLOAD_PCDU_CH6, this); - lp_var_t latchupsAcsBoardSideB = lp_var_t(sid.objectId, - P60System::PDU2_LATCHUP_ACS_BOARD_SIDE_B, this); - lp_var_t latchupsPayloadCamera = lp_var_t(sid.objectId, - P60System::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 device0 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_7, this); - /** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */ - lp_var_t device0Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_0_STATUS, this); - lp_var_t device1Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_1_STATUS, this); - lp_var_t device2Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_2_STATUS, this); - lp_var_t device3Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_3_STATUS, this); - lp_var_t device4Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_4_STATUS, this); - lp_var_t device5Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_5_STATUS, this); - lp_var_t device6Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_6_STATUS, this); - lp_var_t device7Status = lp_var_t(sid.objectId, - P60System::PDU2_DEVICE_7_STATUS, this); - - /** Number of reboots triggered by the ground watchdog */ - lp_var_t gndWdtReboots = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CNT_GND, this); - /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ - lp_var_t i2cWdtReboots = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CNT_I2C, this); - /** Number of reboots triggered through the CAN watchdog */ - lp_var_t canWdtReboots = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CNT_CAN, this); - /** Number of reboots triggered through the CSP watchdog */ - lp_var_t csp1WdtReboots = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CNT_CSP1, this); - lp_var_t csp2WdtReboots = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CNT_CSP2, this); - /** Ground watchdog remaining seconds before rebooting */ - lp_var_t groundWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU2_WDT_GND_LEFT, this); - /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ - lp_var_t i2cWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU2_WDT_I2C_LEFT, this); - /** CAN watchdog remaining seconds before rebooting. */ - lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CAN_LEFT, this); - /** CSP watchdog remaining pings before rebooting. */ - lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CSP_LEFT1, this); - lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, - P60System::PDU2_WDT_CSP_LEFT2, this); - }; + /** Number of reboots triggered by the ground watchdog */ + lp_var_t gndWdtReboots = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CNT_GND, this); + /** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */ + lp_var_t i2cWdtReboots = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CNT_I2C, this); + /** Number of reboots triggered through the CAN watchdog */ + lp_var_t canWdtReboots = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CNT_CAN, this); + /** Number of reboots triggered through the CSP watchdog */ + lp_var_t csp1WdtReboots = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CNT_CSP1, this); + lp_var_t csp2WdtReboots = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CNT_CSP2, this); + /** Ground watchdog remaining seconds before rebooting */ + lp_var_t groundWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU2_WDT_GND_LEFT, this); + /** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */ + lp_var_t i2cWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU2_WDT_I2C_LEFT, this); + /** CAN watchdog remaining seconds before rebooting. */ + lp_var_t canWatchdogSecondsLeft = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CAN_LEFT, this); + /** CSP watchdog remaining pings before rebooting. */ + lp_var_t csp1WatchdogPingsLeft = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CSP_LEFT1, this); + lp_var_t csp2WatchdogPingsLeft = lp_var_t(sid.objectId, + P60System::PDU2_WDT_CSP_LEFT2, this); +}; } namespace ACU { - static const uint32_t HK_TABLE_DATA_SET_ID = 0x4; +static const uint32_t HK_TABLE_DATA_SET_ID = 0x4; - /* When receiving full housekeeping (telemetry) table */ - static const uint16_t MAX_REPLY_LENGTH = 262; - static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26; - static const uint16_t MAX_HKTABLE_ADDRESS = 120; - static const uint8_t HK_TABLE_ENTRIES = 64; - static const uint16_t HK_TABLE_REPLY_SIZE = 262; +/* When receiving full housekeeping (telemetry) table */ +static const uint16_t MAX_REPLY_LENGTH = 262; +static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26; +static const uint16_t MAX_HKTABLE_ADDRESS = 120; +static const uint8_t HK_TABLE_ENTRIES = 64; +static const uint16_t HK_TABLE_REPLY_SIZE = 262; - /** - * @brief This class defines a dataset for the hk table of the ACU. - */ - class HkTableDataset: - public StaticLocalDataSet { - public: +/** + * @brief This class defines a dataset for the hk table of the ACU. + */ +class HkTableDataset: + public StaticLocalDataSet { + public: - HkTableDataset(HasLocalDataPoolIF* owner): - StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { - } + HkTableDataset(HasLocalDataPoolIF* owner): + StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { + } - HkTableDataset(object_id_t objectId): - StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { - } + HkTableDataset(object_id_t objectId): + StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { + } - lp_var_t currentInChannel0 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL0, this); - lp_var_t currentInChannel1 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL1, this); - lp_var_t currentInChannel2 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL2, this); - lp_var_t currentInChannel3 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL3, this); - lp_var_t currentInChannel4 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL4, this); - lp_var_t currentInChannel5 = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_CHANNEL5, this); + lp_var_t currentInChannel0 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL0, this); + lp_var_t currentInChannel1 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL1, this); + lp_var_t currentInChannel2 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL2, this); + lp_var_t currentInChannel3 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL3, this); + lp_var_t currentInChannel4 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL4, this); + lp_var_t currentInChannel5 = lp_var_t(sid.objectId, + P60System::ACU_CURRENT_IN_CHANNEL5, this); - lp_var_t voltageInChannel0 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL0, this); - lp_var_t voltageInChannel1 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL1, this); - lp_var_t voltageInChannel2 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL2, this); - lp_var_t voltageInChannel3 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL3, this); - lp_var_t voltageInChannel4 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL4, this); - lp_var_t voltageInChannel5 = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_CHANNEL5, this); + lp_var_t voltageInChannel0 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL0, this); + lp_var_t voltageInChannel1 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL1, this); + lp_var_t voltageInChannel2 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL2, this); + lp_var_t voltageInChannel3 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL3, this); + lp_var_t voltageInChannel4 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL4, this); + lp_var_t voltageInChannel5 = lp_var_t(sid.objectId, + P60System::ACU_VOLTAGE_IN_CHANNEL5, this); - lp_var_t vcc = lp_var_t(sid.objectId, - P60System::ACU_VCC, this); - lp_var_t vbat = lp_var_t(sid.objectId, - P60System::ACU_VBAT, this); + lp_var_t vcc = lp_var_t(sid.objectId, + P60System::ACU_VCC, this); + lp_var_t vbat = lp_var_t(sid.objectId, + P60System::ACU_VBAT, this); - lp_var_t temperature1 = lp_var_t(sid.objectId, - P60System::ACU_TEMPERATURE_1, this); - lp_var_t temperature2 = lp_var_t(sid.objectId, - P60System::ACU_TEMPERATURE_2, this); - lp_var_t temperature3 = lp_var_t(sid.objectId, - P60System::ACU_TEMPERATURE_3, this); + lp_var_t temperature1 = lp_var_t(sid.objectId, + P60System::ACU_TEMPERATURE_1, this); + lp_var_t temperature2 = lp_var_t(sid.objectId, + P60System::ACU_TEMPERATURE_2, this); + lp_var_t temperature3 = lp_var_t(sid.objectId, + P60System::ACU_TEMPERATURE_3, this); - lp_var_t mpptMode = lp_var_t(sid.objectId, - P60System::ACU_MPPT_MODE, this); + lp_var_t mpptMode = lp_var_t(sid.objectId, + P60System::ACU_MPPT_MODE, this); - lp_var_t vboostInChannel0 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL0, this); - lp_var_t vboostInChannel1 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL1, this); - lp_var_t vboostInChannel2 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL2, this); - lp_var_t vboostInChannel3 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL3, this); - lp_var_t vboostInChannel4 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL4, this); - lp_var_t vboostInChannel5 = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_CHANNEL5, this); + lp_var_t vboostInChannel0 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL0, this); + lp_var_t vboostInChannel1 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL1, this); + lp_var_t vboostInChannel2 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL2, this); + lp_var_t vboostInChannel3 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL3, this); + lp_var_t vboostInChannel4 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL4, this); + lp_var_t vboostInChannel5 = lp_var_t(sid.objectId, + P60System::ACU_VBOOST_CHANNEL5, this); - lp_var_t powerInChannel0 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL0, this); - lp_var_t powerInChannel1 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL1, this); - lp_var_t powerInChannel2 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL2, this); - lp_var_t powerInChannel3 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL3, this); - lp_var_t powerInChannel4 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL4, this); - lp_var_t powerInChannel5 = lp_var_t(sid.objectId, - P60System::ACU_POWER_CHANNEL5, this); + lp_var_t powerInChannel0 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL0, this); + lp_var_t powerInChannel1 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL1, this); + lp_var_t powerInChannel2 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL2, this); + lp_var_t powerInChannel3 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL3, this); + lp_var_t powerInChannel4 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL4, this); + lp_var_t powerInChannel5 = lp_var_t(sid.objectId, + P60System::ACU_POWER_CHANNEL5, this); - lp_var_t dac0Enable = lp_var_t(sid.objectId, - P60System::ACU_DAC_EN_0, this); - lp_var_t dac1Enable = lp_var_t(sid.objectId, - P60System::ACU_DAC_EN_1, this); - lp_var_t dac2Enable = lp_var_t(sid.objectId, - P60System::ACU_DAC_EN_2, this); + lp_var_t dac0Enable = lp_var_t(sid.objectId, + P60System::ACU_DAC_EN_0, this); + lp_var_t dac1Enable = lp_var_t(sid.objectId, + P60System::ACU_DAC_EN_1, this); + lp_var_t dac2Enable = lp_var_t(sid.objectId, + P60System::ACU_DAC_EN_2, this); - lp_var_t dacRawChannelVal0 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_0, this); - lp_var_t dacRawChannelVal1 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_1, this); - lp_var_t dacRawChannelVal2 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_2, this); - lp_var_t dacRawChannelVal3 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_3, this); - lp_var_t dacRawChannelVal4 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_4, this); - lp_var_t dacRawChannelVal5 = lp_var_t(sid.objectId, - P60System::ACU_DAC_RAW_5, this); + lp_var_t dacRawChannelVal0 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_0, this); + lp_var_t dacRawChannelVal1 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_1, this); + lp_var_t dacRawChannelVal2 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_2, this); + lp_var_t dacRawChannelVal3 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_3, this); + lp_var_t dacRawChannelVal4 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_4, this); + lp_var_t dacRawChannelVal5 = lp_var_t(sid.objectId, + P60System::ACU_DAC_RAW_5, this); - lp_var_t bootCause = lp_var_t(sid.objectId, - P60System::ACU_BOOTCAUSE, this); - lp_var_t bootcnt = lp_var_t(sid.objectId, - P60System::ACU_BOOTCNT, this); - lp_var_t uptime = lp_var_t(sid.objectId, - P60System::ACU_UPTIME, this); - lp_var_t resetCause = lp_var_t(sid.objectId, - P60System::ACU_RESET_CAUSE, this); - lp_var_t mpptTime = lp_var_t(sid.objectId, - P60System::ACU_MPPT_TIME, this); - lp_var_t mpptPeriod = lp_var_t(sid.objectId, - P60System::ACU_MPPT_PERIOD, this); + lp_var_t bootCause = lp_var_t(sid.objectId, + P60System::ACU_BOOTCAUSE, this); + lp_var_t bootcnt = lp_var_t(sid.objectId, + P60System::ACU_BOOTCNT, this); + lp_var_t uptime = lp_var_t(sid.objectId, + P60System::ACU_UPTIME, this); + lp_var_t resetCause = lp_var_t(sid.objectId, + P60System::ACU_RESET_CAUSE, this); + lp_var_t mpptTime = lp_var_t(sid.objectId, + P60System::ACU_MPPT_TIME, this); + lp_var_t mpptPeriod = lp_var_t(sid.objectId, + P60System::ACU_MPPT_PERIOD, this); - lp_var_t device0 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_0, this); - lp_var_t device1 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_1, this); - lp_var_t device2 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_2, this); - lp_var_t device3 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_3, this); - lp_var_t device4 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_4, this); - lp_var_t device5 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_5, this); - lp_var_t device6 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_6, this); - lp_var_t device7 = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_7, this); + lp_var_t device0 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_0, this); + lp_var_t device1 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_1, this); + lp_var_t device2 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_2, this); + lp_var_t device3 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_3, this); + lp_var_t device4 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_4, this); + lp_var_t device5 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_5, this); + lp_var_t device6 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_6, this); + lp_var_t device7 = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_7, this); - lp_var_t device0Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_0_STATUS, this); - lp_var_t device1Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_1_STATUS, this); - lp_var_t device2Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_2_STATUS, this); - lp_var_t device3Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_3_STATUS, this); - lp_var_t device4Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_4_STATUS, this); - lp_var_t device5Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_5_STATUS, this); - lp_var_t device6Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_6_STATUS, this); - lp_var_t device7Status = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_7_STATUS, this); + lp_var_t device0Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_0_STATUS, this); + lp_var_t device1Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_1_STATUS, this); + lp_var_t device2Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_2_STATUS, this); + lp_var_t device3Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_3_STATUS, this); + lp_var_t device4Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_4_STATUS, this); + lp_var_t device5Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_5_STATUS, this); + lp_var_t device6Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_6_STATUS, this); + lp_var_t device7Status = lp_var_t(sid.objectId, + P60System::ACU_DEVICE_7_STATUS, this); - lp_var_t wdtCntGnd = lp_var_t(sid.objectId, - P60System::ACU_WDT_CNT_GND, this); - lp_var_t wdtGndLeft = lp_var_t(sid.objectId, - P60System::ACU_WDT_GND_LEFT, this); - }; + lp_var_t wdtCntGnd = lp_var_t(sid.objectId, + P60System::ACU_WDT_CNT_GND, this); + lp_var_t wdtGndLeft = lp_var_t(sid.objectId, + P60System::ACU_WDT_GND_LEFT, this); +}; } #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */