diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index a5c09d0b..66ec1d89 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -85,7 +85,7 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand( default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } - return HasReturnvaluesIF::RETURN_FAILED; + return HasReturnvaluesIF::RETURN_OK; } void GomspaceDeviceHandler::fillCommandAndReplyMap(){ @@ -93,7 +93,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap(){ this->insertInCommandMap(GOMSPACE::REBOOT); this->insertInCommandAndReplyMap(GOMSPACE::PARAM_SET, 3); this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3); - this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3, hkTableDataset); + this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3); this->insertInCommandMap(GOMSPACE::GNDWDT_RESET); } @@ -383,3 +383,12 @@ uint32_t GomspaceDeviceHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 0; } + +LocalPoolDataSetBase* GomspaceDeviceHandler::getDataSetHandle(sid_t sid) { + if(sid == hkTableDataset->getSid()) { + return hkTableDataset; + } + else { + return nullptr; + } +} diff --git a/mission/devices/GomspaceDeviceHandler.h b/mission/devices/GomspaceDeviceHandler.h index e23032a2..7bdefef3 100644 --- a/mission/devices/GomspaceDeviceHandler.h +++ b/mission/devices/GomspaceDeviceHandler.h @@ -84,6 +84,8 @@ protected: */ virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) = 0; + virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + private: /** diff --git a/mission/devices/PDU1Handler.cpp b/mission/devices/PDU1Handler.cpp index 9b42bd03..cddfccce 100644 --- a/mission/devices/PDU1Handler.cpp +++ b/mission/devices/PDU1Handler.cpp @@ -17,10 +17,10 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand( } void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { - const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH; - size_t size = (size_t)hkTableSize; - pdu1HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG); - FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu1HkTableDataset); - handleDeviceTM(&fullTableReply, id, true); +// const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH; +// size_t size = (size_t)hkTableSize; +// pdu1HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG); +// FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu1HkTableDataset); +// handleDeviceTM(&fullTableReply, id, true); } diff --git a/mission/devices/PDU2Handler.cpp b/mission/devices/PDU2Handler.cpp index e211fa87..0718790d 100644 --- a/mission/devices/PDU2Handler.cpp +++ b/mission/devices/PDU2Handler.cpp @@ -18,14 +18,22 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand( } void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) { + + ReturnValue_t result; + /* Pointer points to beginning of payload data */ + pdu2HkTableDataset.read(); const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH; size_t size = (size_t)hkTableSize; - pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG); - FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset); - handleDeviceTM(&fullTableReply, id, true); + result = pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG); + if (result != RETURN_OK) { + sif::debug << "PDU2Handler::letChildHandleHkReply: Failed to deserialize housekeeping " + << "packet array into pdu2HkTableDataset" << std::endl; + return; + } +// FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu2HkTableDataset); +// handleDeviceTM(&fullTableReply, id, true); #if OBSW_ENHANCED_PRINTOUT == 1 - pdu2HkTableDataset.read(); float temperatureC = pdu2HkTableDataset.temperature.value; sif::info << "PDU2 Temperature: " << temperatureC << "°C" << std::endl; pdu2HkTableDataset.commit(); diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 3fed966d..ac0f0ac4 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -37,21 +37,6 @@ namespace GOMSPACE{ namespace P60System { enum P60SytemPoolIds: lp_id_t { -// typedef struct CurrentOut { -// int16_t acuVcc; -// int16_t pdu1Vcc; -// int16_t x3VccIdle; -// int16_t pdu2Vcc; -// int16_t acuVbat; -// int16_t pdu1Vbat; -// int16_t x3VbatIdle; -// int16_t pdu2Vbat; -// int16_t stackVbat; -// int16_t stack3V3; -// int16_t stackV5; -// int16_t gs3v3; -// int16_t gs5V; -// } CurrentOut_t; P60DOCK_CURRENT_ACU_VCC, P60DOCK_CURRENT_PDU1_VCC, P60DOCK_CURRENT_X3_IDLE_VCC, @@ -78,9 +63,21 @@ namespace P60System { P60DOCK_VOLTAGE_STACK_5V, P60DOCK_VOLTAGE_GS3V3, P60DOCK_VOLTAGE_GS5V, - - P60DOCK_OUTPUT_ENABLE_STATES, - P60DOCK_TEMPERATURE, + 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, @@ -88,12 +85,41 @@ namespace P60System { P60DOCK_BATT_MODE, P60DOCK_HEATER_ON, P60DOCK_CONV_5V_ENABLE_STATUS, - P60DOCK_LATCHUP_GROUP, + 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_TEMPERATURES, + 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, @@ -174,6 +200,7 @@ namespace P60System { PDU1_WDT_CAN_LEFT, PDU1_WDT_CSP_LEFT, + /** PDU2 Ids */ PDU2_CURRENT_OUT_Q7S, PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, PDU2_CURRENT_OUT_RW, @@ -210,7 +237,15 @@ namespace P60System { PDU2_UPTIME, PDU2_RESETCAUSE, PDU2_BATT_MODE, - PDU2_LATCHUP, + PDU2_LATCHUP_OUT_Q7S, + PDU2_LATCHUP_OUT_PAYLOAD_PCDU_CH1, + PDU2_LATCHUP_OUT_RW, + PDU2_LATCHUP_OUT_TCS_BOARD_HEATER_IN, + PDU2_LATCHUP_OUT_SUS_REDUNDANT, + PDU2_LATCHUP_OUT_DEPLOYMENT_MECHANISM, + PDU2_LATCHUP_OUT_PAYLOAD_PCDU_CH6, + PDU2_LATCHUP_OUT_ACS_BOARD_SIDE_B, + PDU2_LATCHUP_OUT_PAYLOAD_CAMERA, PDU2_DEVICE_0, PDU2_DEVICE_1, PDU2_DEVICE_2, @@ -236,24 +271,69 @@ namespace P60System { PDU2_WDT_CAN_LEFT, PDU2_WDT_CSP_LEFT, - ACU_CURRENT_IN_GROUP, - ACU_VOLTAGE_IN_GROUP, + /** 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_GROUP, + ACU_TEMPERATURE_1, + ACU_TEMPERATURE_2, + ACU_TEMPERATURE_3, ACU_MPPT_MODE, - ACU_VBOOST_GROUP, + 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_POWER_GROUP, - ACU_DAC_EN_GROUP, - ACU_DAC_VAL_GROUP, + 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_TYPE_GROUP, - ACU_DEVICE_STATUS_GROUP, + 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 }; @@ -271,89 +351,7 @@ namespace P60Dock { 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 = 35; - - typedef struct VoltageOut { - uint16_t acuVcc; - uint16_t pdu1Vcc; - uint16_t x3VccIdle; - uint16_t pdu2Vcc; - uint16_t acuVbat; - uint16_t pdu1Vbat; - uint16_t x3VbatIdle; - uint16_t pdu2Vbat; - uint16_t stackVbat; - uint16_t stack3V3; - uint16_t stackV5; - uint16_t gs3v3; - uint16_t gs5V; - } VoltageOut_t; - - /** 1 - output is enabled, 0 - output disabled. */ - typedef struct OuputEnableState { - uint8_t acuVcc; - uint8_t pdu1Vcc; - uint8_t x3VccIdle; - uint8_t pdu2Vcc; - uint8_t acuVbat; - uint8_t pdu1Vbat; - uint8_t x3VbatIdle; - uint8_t pdu2Vbat; - uint8_t stackVbat; - uint8_t stack3V3; - uint8_t stackV5; - uint8_t gs3v3; - uint8_t gs5V; - } OuputEnableState_t; - - /** Latchup count for output channels */ - typedef struct LatchupGroup { - uint16_t acuVcc; - uint16_t pdu1Vcc; - uint16_t x3VccIdle; - uint16_t pdu2Vcc; - uint16_t acuVbat; - uint16_t pdu1Vbat; - uint16_t x3VbatIdle; - uint16_t pdu2Vbat; - uint16_t stackVbat; - uint16_t stack3V3; - uint16_t stackV5; - uint16_t gs3v3; - uint16_t gs5V; - } LatchupGroup_t; - - typedef struct Temperature { - int16_t location1; - int16_t location2; - } Temperature_t; - - typedef struct BatteryPackTemperature { - int16_t location1; - int16_t location2; - } BatteryPackTemperature_t; - - typedef struct DeviceTypeGroup { - uint8_t device0; - uint8_t device1; - uint8_t device2; - uint8_t device3; - uint8_t device4; - uint8_t device5; - uint8_t device6; - uint8_t device7; - } DeviceTypeGroup_t; - - typedef struct DeviceStatusGroup { - uint8_t device0; - uint8_t device1; - uint8_t device2; - uint8_t device3; - uint8_t device4; - uint8_t device5; - uint8_t device6; - uint8_t device7; - } DeviceStatusGroup_t; + static const uint8_t HK_TABLE_ENTRIES = 100; /** * @brief This class defines a dataset for the hk table of the P60 Dock. @@ -370,14 +368,95 @@ namespace P60Dock { StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { } - lp_var_t currentsOut = lp_var_t(sid.objectId, - P60System::P60DOCK_CURRENTS_OUT, this); - lp_var_t voltagesOut = lp_var_t(sid.objectId, - P60System::P60DOCK_VOLTAGES_OUT, this); - lp_var_t outputEnableStates = lp_var_t(sid.objectId, - P60System::P60DOCK_OUTPUT_ENABLE_STATES, this); - lp_var_t temperatures = lp_var_t(sid.objectId, - P60System::P60DOCK_TEMPERATURE, 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 currentStackVbata = 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 voltageStackVbata = 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 outputEnableStateStackVbata = 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 bootcause = lp_var_t(sid.objectId, P60System::P60DOCK_BOOT_CAUSE, this); lp_var_t bootCount = lp_var_t(sid.objectId, @@ -393,8 +472,35 @@ namespace P60Dock { P60System::P60DOCK_HEATER_ON, this); lp_var_t converter5VStatus = lp_var_t(sid.objectId, P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this); - lp_var_t latchupGroup = lp_var_t(sid.objectId, - P60System::P60DOCK_LATCHUP_GROUP, 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 latchupsStackVbata = 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, @@ -403,13 +509,47 @@ namespace P60Dock { P60System::P60DOCK_BATTERY_CURRENT, this); lp_var_t batteryVoltage = lp_var_t(sid.objectId, P60System::P60DOCK_BATTERY_VOLTAGE, this); - lp_var_t batteryTemperatures = lp_var_t(sid.objectId, - P60System::P60DOCK_BATTERY_TEMPERATURES, this); - lp_var_t deviceTypeGroup = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_TYPE_GROUP, this); - lp_var_t deviceStatusGroup = lp_var_t(sid.objectId, - P60System::P60DOCK_DEVICE_STATUS_GROUP, this); - lp_var_t dearmSatus = lp_var_t(sid.objectId, + + 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 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 wdtCntGnd = lp_var_t(sid.objectId, P60System::P60DOCK_WDT_CNT_GND, this); @@ -450,8 +590,8 @@ 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 = 140; - static const uint16_t HK_TABLE_SIZE = 145; + static const uint16_t MAX_HKTABLE_ADDRESS = 142; + static const uint16_t HK_TABLE_SIZE = 143; static const uint8_t HK_TABLE_ENTRIES = 60; } @@ -476,7 +616,7 @@ namespace PDU1 { * @brief This class defines a dataset for the hk table of the PDU1. */ class PDU1HkTableDataset : - public StaticLocalDataSet { + public StaticLocalDataSet { public: PDU1HkTableDataset(HasLocalDataPoolIF* owner): @@ -653,15 +793,15 @@ namespace PDU2 { * @brief This class defines a dataset for the hk table of the PDU2. */ class PDU2HkTableDataset: - public StaticLocalDataSet { + public StaticLocalDataSet { public: PDU2HkTableDataset(HasLocalDataPoolIF* owner): - StaticLocalDataSet(owner, PDU2::HK_TABLE_DATA_SET_ID) { + StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) { } PDU2HkTableDataset(object_id_t objectId): - StaticLocalDataSet(sid_t(objectId, PDU2::HK_TABLE_DATA_SET_ID)) { + StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { } /** Measured output currents */ @@ -732,6 +872,7 @@ namespace PDU2 { 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 */ @@ -745,6 +886,26 @@ namespace PDU2 { /** 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::P_LATCHUP_, 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 latchupsStackVbata = lp_var_t(sid.objectId, + P60System::P60DOCK_LATCHUP_STACK_VBAT, 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. @@ -812,94 +973,14 @@ namespace PDU2 { namespace ACU { - static const uint32_t HK_TABLE_DATA_SET_ID = 0x2; + static const uint32_t HK_TABLE_DATA_SET_ID = 0x4; /* When receiving full housekeeping (telemetry) table */ static const uint16_t MAX_REPLY_LENGTH = 124; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26; static const uint16_t MAX_HKTABLE_ADDRESS = 120; static const uint16_t HK_TABLE_SIZE = 125; - static const uint8_t HK_TABLE_ENTRIES = 21; - - typedef struct CurrentInGroup { - int16_t channel0; - int16_t channel1; - int16_t channel2; - int16_t channel3; - int16_t channel4; - int16_t channel5; - } CurrentInGroup_t; - - typedef struct VoltageInGroup { - uint16_t channel0; - uint16_t channel1; - uint16_t channel2; - uint16_t channel3; - uint16_t channel4; - uint16_t channel5; - } VoltageInGroup_t; - - typedef struct TemperatureGroup { - int16_t location1; - int16_t location2; - int16_t location3; - } TemperatureGroup_t; - - typedef struct VboostGroup { - uint16_t channel0; - uint16_t channel1; - uint16_t channel2; - uint16_t channel3; - uint16_t channel4; - uint16_t channel5; - } VboostGroup_t; - - typedef struct PowerGroup { - uint16_t channel0; - uint16_t channel1; - uint16_t channel2; - uint16_t channel3; - uint16_t channel4; - uint16_t channel5; - } PowerGroup_t; - - typedef struct DacEnablestatus { - uint8_t dac0; - uint8_t dac1; - uint8_t dac2; - } DacEnablestatus_t; - - - typedef struct DacRawChannelValues { - uint16_t channel0; - uint16_t channel1; - uint16_t channel2; - uint16_t channel3; - uint16_t channel4; - uint16_t channel5; - } DacRawChannelValues_t; - - typedef struct DeviceTypeGroup { - uint8_t device0; - uint8_t device1; - uint8_t device2; - uint8_t device3; - uint8_t device4; - uint8_t device5; - uint8_t device6; - uint8_t device7; - } DeviceTypeGroup_t; - - typedef struct DeviceStatusGroup { - uint8_t device0; - uint8_t device1; - uint8_t device2; - uint8_t device3; - uint8_t device4; - uint8_t device5; - uint8_t device6; - uint8_t device7; - } DeviceStatusGroup_t; + static const uint8_t HK_TABLE_ENTRIES = 64; /** * @brief This class defines a dataset for the hk table of the ACU. @@ -916,26 +997,93 @@ namespace ACU { StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) { } - lp_var_t currentInGroup = lp_var_t(sid.objectId, - P60System::ACU_CURRENT_IN_GROUP, this); - lp_var_t voltageInGroup = lp_var_t(sid.objectId, - P60System::ACU_VOLTAGE_IN_GROUP, 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 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 temperatureGroup = lp_var_t(sid.objectId, - P60System::ACU_TEMPERATURE_GROUP, 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 vboostGroup = lp_var_t(sid.objectId, - P60System::ACU_VBOOST_GROUP, this); - lp_var_t powerGroup = lp_var_t(sid.objectId, - P60System::ACU_POWER_GROUP, this); - lp_var_t dacEnableStatusGroup = lp_var_t(sid.objectId, - P60System::ACU_DAC_EN_GROUP, this); - lp_var_t dacRawChannelValues = lp_var_t(sid.objectId, - P60System::ACU_DAC_VAL_GROUP, 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 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 bootCause = lp_var_t(sid.objectId, P60System::ACU_BOOTCAUSE, this); lp_var_t bootcause = lp_var_t(sid.objectId, @@ -950,10 +1098,41 @@ namespace ACU { P60System::ACU_MPPT_TIME, this); lp_var_t mpptPeriod = lp_var_t(sid.objectId, P60System::ACU_MPPT_PERIOD, this); - lp_var_t deviceTypeGroup = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_TYPE_GROUP, this); - lp_var_t deviceStatusGroup = lp_var_t(sid.objectId, - P60System::ACU_DEVICE_STATUS_GROUP, 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 wdtCntGnd = lp_var_t(sid.objectId, P60System::ACU_WDT_CNT_GND, this); lp_var_t wdtGndLeft = lp_var_t(sid.objectId,