save structs for datasets
This commit is contained in:
parent
fd1e4f3473
commit
be9409c80d
@ -165,7 +165,7 @@ void InitMission::initTasks(){
|
||||
UdpBridgeTask->startTask();
|
||||
UdpPollingTask->startTask();
|
||||
|
||||
// GomSpacePstTask->startTask();
|
||||
GomSpacePstTask->startTask();
|
||||
PollingSequenceTableTaskDefault->startTask();
|
||||
|
||||
PusVerification->startTask();
|
||||
|
@ -12,7 +12,7 @@
|
||||
// debugging.
|
||||
#define OBSW_ENHANCED_PRINTOUT 1
|
||||
|
||||
#define TE0720 1
|
||||
#define TE0720 0
|
||||
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
|
||||
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) :
|
||||
GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress,
|
||||
hkTableSize) {
|
||||
hkTableSize, &acuHkTableDataset), acuHkTableDataset(this) {
|
||||
}
|
||||
|
||||
ACUHandler::~ACUHandler() {
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
|
||||
/**
|
||||
* @brief Handler for the ACU of Gomspace. Monitors and controls the battery charging via
|
||||
* the solar pannels.
|
||||
* @brief Handler for the ACU from Gomspace. Monitors and controls the battery charging via
|
||||
* the solar panels.
|
||||
*/
|
||||
class ACUHandler: public GomspaceDeviceHandler {
|
||||
public:
|
||||
@ -19,6 +19,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
ACU::HkTableDataset acuHkTableDataset;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_ACUHANDLER_H_ */
|
||||
|
@ -3,12 +3,17 @@
|
||||
|
||||
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
|
||||
uint16_t hkTableSize) :
|
||||
DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress), maxHkTableAddress(
|
||||
maxHkTableAddress), hkTableSize(hkTableSize) {
|
||||
uint16_t hkTableSize, LocalPoolDataSetBase* hkTableDataset) :
|
||||
DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress),
|
||||
maxHkTableAddress(maxHkTableAddress), hkTableSize(hkTableSize), hkTableDataset(hkTableDataset) {
|
||||
mode = MODE_NORMAL;
|
||||
if (comCookie == NULL) {
|
||||
sif::error << "GomspaceDeviceHandler invalid com cookie" << std::endl;
|
||||
sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid com cookie"
|
||||
<< std::endl;
|
||||
}
|
||||
if (hkTableDataset == NULL) {
|
||||
sif::error << "GomspaceDeviceHandler::GomspaceDeviceHandler: Invalid hk table data set"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,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);
|
||||
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3, hkTableDataset);
|
||||
this->insertInCommandMap(GOMSPACE::GNDWDT_RESET);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
*/
|
||||
GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
|
||||
uint16_t hkTableSize);
|
||||
uint16_t hkTableSize, LocalPoolDataSetBase* hkTableDataset);
|
||||
virtual ~GomspaceDeviceHandler();
|
||||
|
||||
protected:
|
||||
@ -54,6 +54,8 @@ protected:
|
||||
/** The size of the housekeeping table (table id 4) */
|
||||
uint16_t hkTableSize;
|
||||
|
||||
LocalPoolDataSetBase* hkTableDataset = nullptr;
|
||||
|
||||
void doStartUp() override;
|
||||
void doShutDown() override;
|
||||
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id)
|
||||
|
@ -190,7 +190,7 @@ void HeaterHandler::handleSwitchOnCommand(HeaterMapIter heaterMapIter) {
|
||||
/* Check if command waits for main switch being set on and whether the timeout has expired */
|
||||
if (heaterMapIter->second.waitMainSwitchOn
|
||||
&& heaterMapIter->second.mainSwitchCountdown.hasTimedOut()) {
|
||||
//TODO: This requires the initiation of an FDIR procedure
|
||||
//TODO - This requires the initiation of an FDIR procedure
|
||||
triggerEvent(MAIN_SWITCH_TIMEOUT);
|
||||
heaterMapIter->second.active = false;
|
||||
return;
|
||||
|
@ -3,7 +3,7 @@
|
||||
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
|
||||
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) :
|
||||
GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress,
|
||||
hkTableSize) {
|
||||
hkTableSize, &p60dockHkTableDataset), p60dockHkTableDataset(this) {
|
||||
}
|
||||
|
||||
P60DockHandler::~P60DockHandler() {
|
||||
|
@ -2,6 +2,7 @@
|
||||
#define MISSION_DEVICES_P60DOCKHANDLER_H_
|
||||
|
||||
#include "GomspaceDeviceHandler.h"
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
|
||||
|
||||
/**
|
||||
@ -16,6 +17,9 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override;
|
||||
|
||||
private:
|
||||
P60Dock::HkTableDataset p60dockHkTableDataset;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_P60DOCKHANDLER_H_ */
|
||||
|
@ -87,24 +87,23 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
|
||||
if (sid == sid_t(objects::PCDU_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) {
|
||||
HousekeepingPacketUpdate packetUpdate(reinterpret_cast<uint8_t*>(&timeStamp),
|
||||
sizeof(timeStamp), &pdu2HkTableDataset);
|
||||
const uint8_t** packet_ptr = NULL;
|
||||
const uint8_t* packet_ptr = NULL;
|
||||
size_t size;
|
||||
result = IPCStore->getData(storeId, packet_ptr, &size);
|
||||
result = IPCStore->getData(storeId, &packet_ptr, &size);
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "PCDUHandler::handleChangedDataset: Failed to get data from IPCStore."
|
||||
<< std::endl;
|
||||
//TODO: Is it necessary to trigger an Event here?
|
||||
}
|
||||
result = packetUpdate.deSerialize(&packet_ptr, &size, SerializeIF::Endianness::BIG);
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "PCDUHandler::handleChangedDataset: Failed to deserialize packet in "
|
||||
<< "pdu2HkTableDataset" << std::endl;
|
||||
}
|
||||
result = IPCStore->deleteData(storeId);
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "PCDUHandler::handleChangedDataset: Failed to delete data in IPCStore"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
result = packetUpdate.deSerialize(packet_ptr, &size, SerializeIF::Endianness::BIG);
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "PCDUHandler::handleChangedDataset: Failed to deserialize packet in "
|
||||
<< "pdu2HkTableDataset" << std::endl;
|
||||
}
|
||||
updatePdu2SwitchStates();
|
||||
}
|
||||
else {
|
||||
@ -113,6 +112,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
|
||||
}
|
||||
|
||||
void PCDUHandler::updatePdu2SwitchStates() {
|
||||
//TODO: pool read helper
|
||||
if (pdu2HkTableDataset.read() != RETURN_OK) {
|
||||
switchStates[pcduSwitches::Q7S] = pdu2HkTableDataset.outEnabledQ7S.value;
|
||||
switchStates[pcduSwitches::PAYLOAD_PCDU_CH1] = pdu2HkTableDataset.outEnabledPlPCDUCh1.value;
|
||||
@ -224,95 +224,95 @@ object_id_t PCDUHandler::getObjectId() const {
|
||||
ReturnValue_t PCDUHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B,
|
||||
new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_Q7S }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH1 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_RW }));
|
||||
#if TE0720 == 1
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
|
||||
#else
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( {pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN}));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( {pcduSwitches::INIT_STATE_TCS_BOARD_8V_HEATER_IN}));
|
||||
#endif
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_SUS_REDUNDANT }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_DEPLOYMENT_MECHANISM }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_PAYLOAD_PCDU_CH6 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_ACS_BOARD_SIDE_B }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( {
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( {
|
||||
pcduSwitches::INIT_STATE_PAYLOAD_CAMERA }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
|
||||
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) :
|
||||
GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress,
|
||||
hkTableSize), hkTableDataset(this) {
|
||||
hkTableSize, &pdu1HkTableDataset), pdu1HkTableDataset(this) {
|
||||
}
|
||||
|
||||
PDU1Handler::~PDU1Handler() {
|
||||
@ -19,8 +19,8 @@ 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;
|
||||
hkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
|
||||
FullTableReply fullTableReply(id, HK_TABLE_ID, &hkTableDataset);
|
||||
pdu1HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
|
||||
FullTableReply fullTableReply(id, HK_TABLE_ID, &pdu1HkTableDataset);
|
||||
handleDeviceTM(&fullTableReply, id, true);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ protected:
|
||||
|
||||
private:
|
||||
/** Dataset for the housekeeping table of the PDU1 */
|
||||
PDU1::PDU1HkTableDataset hkTableDataset;
|
||||
PDU1::PDU1HkTableDataset pdu1HkTableDataset;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_PDU1Handler_H_ */
|
||||
|
@ -2,10 +2,10 @@
|
||||
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
|
||||
#include <fsfwconfig/OBSWConfig.h>
|
||||
|
||||
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
|
||||
uint16_t hkTableSize) : GomspaceDeviceHandler(objectId, comIF,
|
||||
comCookie, maxConfigTableAddress, maxHkTableAddress, hkTableSize), hkTableDataset(this) {
|
||||
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie,
|
||||
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableSize) :
|
||||
GomspaceDeviceHandler(objectId, comIF, comCookie, maxConfigTableAddress, maxHkTableAddress,
|
||||
hkTableSize, &pdu2HkTableDataset), pdu2HkTableDataset(this) {
|
||||
}
|
||||
|
||||
PDU2Handler::~PDU2Handler() {
|
||||
@ -18,88 +18,95 @@ ReturnValue_t PDU2Handler::buildNormalDeviceCommand(
|
||||
}
|
||||
|
||||
void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
/* Pointer points to beginning of payload data */
|
||||
const uint8_t* payloadPtr = packet + GOMSPACE::GS_HDR_LENGTH;
|
||||
size_t size = (size_t)hkTableSize;
|
||||
hkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
|
||||
FullTableReply fullTableReply(id, HK_TABLE_ID, &hkTableDataset);
|
||||
pdu2HkTableDataset.deSerialize(&payloadPtr, &size, SerializeIF::Endianness::BIG);
|
||||
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();
|
||||
#endif
|
||||
}
|
||||
|
||||
ReturnValue_t PDU2Handler::initializeLocalDataPool(
|
||||
localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) {
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_Q7S, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_RW, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, new PoolEntry<int16_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VCC, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_VBAT, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_TEMPERATURE, new PoolEntry<int16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_CONV_EN, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_Q7S, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_RW, new PoolEntry<uint8_t>( { 0 }));
|
||||
#if TE0720 == 1
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 1 }));
|
||||
#else
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, new PoolEntry<uint8_t>( { 0 }));
|
||||
#endif
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_SUS_REDUNDANT, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BOOTCAUSE, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BOOTCNT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_UPTIME, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_RESETCAUSE, new PoolEntry<uint16_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_BATT_MODE, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_0_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_1_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_2_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_3_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_4_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_5_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_6_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_DEVICE_7_STATUS, new PoolEntry<uint8_t>( { 0 }));
|
||||
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(PDU::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_GND, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_I2C, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CAN, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CNT_CSP, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_GND_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_I2C_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CAN_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
localDataPoolMap.emplace(P60System::PDU2_WDT_CSP_LEFT, new PoolEntry<uint32_t>( { 0 }));
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ protected:
|
||||
|
||||
private:
|
||||
/** Dataset for the housekeeping table of the PDU2 */
|
||||
PDU2::PDU2HkTableDataset hkTableDataset;
|
||||
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_PDU2HANDLER_H_ */
|
||||
|
@ -35,31 +35,83 @@ namespace GOMSPACE{
|
||||
static const DeviceCommandId_t REQUEST_HK_TABLE = 0x10; //!< [EXPORT] : [COMMAND]
|
||||
}
|
||||
|
||||
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,
|
||||
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,
|
||||
|
||||
namespace P60Dock {
|
||||
/* The maximum size of a reply from the P60 dock. Maximum size is reached
|
||||
* when retrieving the full parameter configuration table. 412 bytes of
|
||||
* payload data and 12 bytes of CSP header data. */
|
||||
static const uint16_t MAX_REPLY_LENGTH = 424;
|
||||
P60DOCK_OUTPUT_ENABLE_STATES,
|
||||
P60DOCK_TEMPERATURE,
|
||||
P60DOCK_BOOT_CAUSE,
|
||||
P60DOCK_BOOT_CNT,
|
||||
P60DOCK_UPTIME,
|
||||
P60DOCK_RESETCAUSE,
|
||||
P60DOCK_BATT_MODE,
|
||||
P60DOCK_HEATER_ON,
|
||||
P60DOCK_CONV_5V_ENABLE_STATUS,
|
||||
P60DOCK_LATCHUP_GROUP,
|
||||
P60DOCK_VBAT_VALUE,
|
||||
P60DOCK_VCC_CURRENT_VALUE,
|
||||
P60DOCK_BATTERY_CURRENT,
|
||||
P60DOCK_BATTERY_VOLTAGE,
|
||||
P60DOCK_BATTERY_TEMPERATURES,
|
||||
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,
|
||||
|
||||
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408;
|
||||
static const uint16_t MAX_HKTABLE_ADDRESS = 187;
|
||||
static const uint16_t HK_TABLE_SIZE = 188;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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 = 140;
|
||||
static const uint16_t HK_TABLE_SIZE = 145;
|
||||
static const uint8_t HK_TABLE_ENTRIES = 60;
|
||||
|
||||
enum PDUPoolIds: lp_id_t {
|
||||
PDU1_CURRENT_OUT_TCS_BOARD_3V3,
|
||||
PDU1_CURRENT_OUT_SYRLINKS,
|
||||
PDU1_CURRENT_OUT_STAR_TRACKER,
|
||||
@ -182,11 +234,228 @@ namespace PDU{
|
||||
PDU2_WDT_GND_LEFT,
|
||||
PDU2_WDT_I2C_LEFT,
|
||||
PDU2_WDT_CAN_LEFT,
|
||||
PDU2_WDT_CSP_LEFT
|
||||
PDU2_WDT_CSP_LEFT,
|
||||
|
||||
ACU_CURRENT_IN_GROUP,
|
||||
ACU_VOLTAGE_IN_GROUP,
|
||||
ACU_VCC,
|
||||
ACU_VBAT,
|
||||
ACU_TEMPERATURE_GROUP,
|
||||
ACU_MPPT_MODE,
|
||||
ACU_VBOOST_GROUP,
|
||||
ACU_POWER_GROUP,
|
||||
ACU_DAC_EN_GROUP,
|
||||
ACU_DAC_VAL_GROUP,
|
||||
ACU_BOOTCAUSE,
|
||||
ACU_BOOTCNT,
|
||||
ACU_UPTIME,
|
||||
ACU_RESET_CAUSE,
|
||||
ACU_MPPT_TIME,
|
||||
ACU_MPPT_PERIOD,
|
||||
ACU_DEVICE_TYPE_GROUP,
|
||||
ACU_DEVICE_STATUS_GROUP,
|
||||
ACU_WDT_CNT_GND,
|
||||
ACU_WDT_GND_LEFT
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace P60Dock {
|
||||
/* The maximum size of a reply from the P60 dock. Maximum size is reached
|
||||
* when retrieving the full parameter configuration table. 412 bytes of
|
||||
* payload data and 12 bytes of CSP header data. */
|
||||
static const uint16_t MAX_REPLY_LENGTH = 424;
|
||||
|
||||
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 = 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;
|
||||
|
||||
/**
|
||||
* @brief This class defines a dataset for the hk table of the P60 Dock.
|
||||
*/
|
||||
class HkTableDataset:
|
||||
public StaticLocalDataSet<HK_TABLE_ENTRIES> {
|
||||
public:
|
||||
|
||||
HkTableDataset(HasLocalDataPoolIF* owner):
|
||||
StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {
|
||||
}
|
||||
|
||||
HkTableDataset(object_id_t objectId):
|
||||
StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {
|
||||
}
|
||||
|
||||
lp_var_t<CurrentOut_t> currentsOut = lp_var_t<CurrentOut_t>(sid.objectId,
|
||||
P60System::P60DOCK_CURRENTS_OUT, this);
|
||||
lp_var_t<VoltageOut_t> voltagesOut = lp_var_t<VoltageOut_t>(sid.objectId,
|
||||
P60System::P60DOCK_VOLTAGES_OUT, this);
|
||||
lp_var_t<OuputEnableState_t> outputEnableStates = lp_var_t<OuputEnableState_t>(sid.objectId,
|
||||
P60System::P60DOCK_OUTPUT_ENABLE_STATES, this);
|
||||
lp_var_t<Temperature_t> temperatures = lp_var_t<Temperature_t>(sid.objectId,
|
||||
P60System::P60DOCK_TEMPERATURE, this);
|
||||
lp_var_t<uint32_t> bootcause = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_BOOT_CAUSE, this);
|
||||
lp_var_t<uint32_t> bootCount = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_BOOT_CNT, this);
|
||||
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_UPTIME, this);
|
||||
lp_var_t<uint16_t> resetcause = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::P60DOCK_RESETCAUSE, this);
|
||||
lp_var_t<uint8_t> battMode = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATT_MODE, this);
|
||||
/** Battery heater control only possible on BP4 packs */
|
||||
lp_var_t<uint8_t> heaterOn = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_HEATER_ON, this);
|
||||
lp_var_t<uint8_t> converter5VStatus = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_CONV_5V_ENABLE_STATUS, this);
|
||||
lp_var_t<LatchupGroup_t> latchupGroup = lp_var_t<LatchupGroup_t>(sid.objectId,
|
||||
P60System::P60DOCK_LATCHUP_GROUP, this);
|
||||
lp_var_t<uint16_t> vbatVoltageValue = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::P60DOCK_VBAT_VALUE, this);
|
||||
lp_var_t<int16_t> vccCurrent = lp_var_t<int16_t>(sid.objectId,
|
||||
P60System::P60DOCK_VCC_CURRENT_VALUE, this);
|
||||
lp_var_t<int16_t> batteryCurrent = lp_var_t<int16_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATTERY_CURRENT, this);
|
||||
lp_var_t<uint16_t> batteryVoltage = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATTERY_VOLTAGE, this);
|
||||
lp_var_t<BatteryPackTemperature_t> batteryTemperatures = lp_var_t<BatteryPackTemperature_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATTERY_TEMPERATURES, this);
|
||||
lp_var_t<DeviceTypeGroup_t> deviceTypeGroup = lp_var_t<DeviceTypeGroup_t>(sid.objectId,
|
||||
P60System::P60DOCK_DEVICE_TYPE_GROUP, this);
|
||||
lp_var_t<DeviceStatusGroup_t> deviceStatusGroup = lp_var_t<DeviceStatusGroup_t>(sid.objectId,
|
||||
P60System::P60DOCK_DEVICE_STATUS_GROUP, this);
|
||||
lp_var_t<uint8_t> dearmSatus = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_DEARM_STATUS, this);
|
||||
lp_var_t<uint32_t> wdtCntGnd = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CNT_GND, this);
|
||||
lp_var_t<uint32_t> wdtCntI2c = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CNT_I2C, this);
|
||||
lp_var_t<uint32_t> wdtCntCan = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CNT_CAN, this);
|
||||
lp_var_t<uint32_t> wdtCntCsp1 = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CNT_CSP_1, this);
|
||||
lp_var_t<uint32_t> wdtCntCsp2 = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CNT_CSP_2, this);
|
||||
lp_var_t<uint32_t> wdtGndLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_GND_LEFT, this);
|
||||
lp_var_t<uint32_t> wdtI2cLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_I2C_LEFT, this);
|
||||
lp_var_t<uint32_t> wdtCanLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CAN_LEFT, this);
|
||||
lp_var_t<uint8_t> wdtCspLeft1 = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CSP_LEFT_1, this);
|
||||
lp_var_t<uint8_t> wdtCspLeft2 = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::P60DOCK_WDT_CSP_LEFT_2, this);
|
||||
lp_var_t<int16_t> batteryChargeCurrent = lp_var_t<int16_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATT_CHARGE_CURRENT, this);
|
||||
lp_var_t<int16_t> batteryDishargeCurrent = lp_var_t<int16_t>(sid.objectId,
|
||||
P60System::P60DOCK_BATT_DISCHARGE_CURRENT, this);
|
||||
lp_var_t<int8_t> ant6Depl = lp_var_t<int8_t>(sid.objectId,
|
||||
P60System::P60DOCK_ANT6_DEPL, this);
|
||||
lp_var_t<int8_t> ar6Depl = lp_var_t<int8_t>(sid.objectId,
|
||||
P60System::P60DOCK_AR6_DEPL, this);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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 = 140;
|
||||
static const uint16_t HK_TABLE_SIZE = 145;
|
||||
static const uint8_t HK_TABLE_ENTRIES = 60;
|
||||
}
|
||||
|
||||
|
||||
namespace PDU1 {
|
||||
static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4
|
||||
/**
|
||||
@ -220,146 +489,146 @@ namespace PDU1 {
|
||||
|
||||
/** Measured output currents */
|
||||
lp_var_t<int16_t> currentOutTCSBoard3V3 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this);
|
||||
P60System::PDU1_CURRENT_OUT_TCS_BOARD_3V3, this);
|
||||
lp_var_t<int16_t> currentOutSyrlinks = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_SYRLINKS, this);
|
||||
P60System::PDU1_CURRENT_OUT_SYRLINKS, this);
|
||||
lp_var_t<int16_t> currentOutStarTracker = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_STAR_TRACKER, this);
|
||||
P60System::PDU1_CURRENT_OUT_STAR_TRACKER, this);
|
||||
lp_var_t<int16_t> currentOutMGT = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_MGT, this);
|
||||
P60System::PDU1_CURRENT_OUT_MGT, this);
|
||||
lp_var_t<int16_t> currentOutSUSNominal = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_SUS_NOMINAL, this);
|
||||
P60System::PDU1_CURRENT_OUT_SUS_NOMINAL, this);
|
||||
lp_var_t<int16_t> currentOutSolarCellExp = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this);
|
||||
P60System::PDU1_CURRENT_OUT_SOLAR_CELL_EXP, this);
|
||||
lp_var_t<int16_t> currentOutPLOC = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_PLOC, this);
|
||||
P60System::PDU1_CURRENT_OUT_PLOC, this);
|
||||
lp_var_t<int16_t> currentOutACSBoardSideA = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this);
|
||||
P60System::PDU1_CURRENT_OUT_ACS_BOARD_SIDE_A, this);
|
||||
lp_var_t<int16_t> currentOutChannel8 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_CURRENT_OUT_CHANNEL8, this);
|
||||
P60System::PDU1_CURRENT_OUT_CHANNEL8, this);
|
||||
/** Measured voltage of output channels */
|
||||
lp_var_t<int16_t> voltageOutTCSBoard3V3 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_TCS_BOARD_3V3, this);
|
||||
lp_var_t<int16_t> voltageOutSyrlinks = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_SYRLINKS, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_SYRLINKS, this);
|
||||
lp_var_t<int16_t> voltageOutStarTracker = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_STAR_TRACKER, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_STAR_TRACKER, this);
|
||||
lp_var_t<int16_t> voltageOutMGT = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_MGT, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_MGT, this);
|
||||
lp_var_t<int16_t> voltageOutSUSNominal = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_SUS_NOMINAL, this);
|
||||
lp_var_t<int16_t> voltageOutSolarCellExp = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_SOLAR_CELL_EXP, this);
|
||||
lp_var_t<int16_t> voltageOutPLOC = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_PLOC, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_PLOC, this);
|
||||
lp_var_t<int16_t> voltageOutACSBoardSideA = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_ACS_BOARD_SIDE_A, this);
|
||||
lp_var_t<int16_t> voltageOutChannel8 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VOLTAGE_OUT_CHANNEL8, this);
|
||||
P60System::PDU1_VOLTAGE_OUT_CHANNEL8, this);
|
||||
/** Measured VCC */
|
||||
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VCC, this);
|
||||
P60System::PDU1_VCC, this);
|
||||
/** Measured VBAT */
|
||||
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_VBAT, this);
|
||||
P60System::PDU1_VBAT, this);
|
||||
lp_var_t<int16_t> temperature = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU1_TEMPERATURE, this);
|
||||
P60System::PDU1_TEMPERATURE, this);
|
||||
/** Output converter enable status */
|
||||
lp_var_t<uint8_t> converterEnable = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_CONV_EN, this);
|
||||
P60System::PDU1_CONV_EN, this);
|
||||
/** Output channels enable status */
|
||||
lp_var_t<uint8_t> outEnabledTCSBoard3V3 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_TCS_BOARD_3V3, this);
|
||||
P60System::PDU1_OUT_EN_TCS_BOARD_3V3, this);
|
||||
lp_var_t<uint8_t> outEnabledSyrlinks = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_SYRLINKS, this);
|
||||
P60System::PDU1_OUT_EN_SYRLINKS, this);
|
||||
lp_var_t<uint8_t> outEnabledStarTracker = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_STAR_TRACKER, this);
|
||||
P60System::PDU1_OUT_EN_STAR_TRACKER, this);
|
||||
lp_var_t<uint8_t> outEnabledMGT = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_MGT, this);
|
||||
P60System::PDU1_OUT_EN_MGT, this);
|
||||
lp_var_t<uint8_t> outEnabledSUSNominal = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_SUS_NOMINAL, this);
|
||||
P60System::PDU1_OUT_EN_SUS_NOMINAL, this);
|
||||
lp_var_t<uint8_t> outEnabledSolarCellExp = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_SOLAR_CELL_EXP, this);
|
||||
P60System::PDU1_OUT_EN_SOLAR_CELL_EXP, this);
|
||||
lp_var_t<uint8_t> outEnabledPLOC = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_PLOC, this);
|
||||
P60System::PDU1_OUT_EN_PLOC, this);
|
||||
lp_var_t<uint8_t> outEnabledAcsBoardSideA = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this);
|
||||
P60System::PDU1_OUT_EN_ACS_BOARD_SIDE_A, this);
|
||||
lp_var_t<uint8_t> outEnabledChannel8 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_OUT_EN_CHANNEL8, this);
|
||||
P60System::PDU1_OUT_EN_CHANNEL8, this);
|
||||
lp_var_t<uint32_t> bootcause = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_BOOTCAUSE, this);
|
||||
P60System::PDU1_BOOTCAUSE, this);
|
||||
/** Number of reboots */
|
||||
lp_var_t<uint32_t> bootcount = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_BOOTCNT, this);
|
||||
P60System::PDU1_BOOTCNT, this);
|
||||
/** Uptime in seconds */
|
||||
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_UPTIME, this);
|
||||
P60System::PDU1_UPTIME, this);
|
||||
lp_var_t<uint16_t> resetcause = lp_var_t<uint16_t>(sid.objectId,
|
||||
PDU::PDU1_RESETCAUSE, this);
|
||||
P60System::PDU1_RESETCAUSE, this);
|
||||
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
|
||||
lp_var_t<uint8_t> battMode = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_BATT_MODE, this);
|
||||
P60System::PDU1_BATT_MODE, this);
|
||||
/**
|
||||
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
|
||||
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
|
||||
*/
|
||||
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_0, this);
|
||||
P60System::PDU1_DEVICE_0, this);
|
||||
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_1, this);
|
||||
P60System::PDU1_DEVICE_1, this);
|
||||
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_2, this);
|
||||
P60System::PDU1_DEVICE_2, this);
|
||||
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_3, this);
|
||||
P60System::PDU1_DEVICE_3, this);
|
||||
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_4, this);
|
||||
P60System::PDU1_DEVICE_4, this);
|
||||
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_5, this);
|
||||
P60System::PDU1_DEVICE_5, this);
|
||||
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_6, this);
|
||||
P60System::PDU1_DEVICE_6, this);
|
||||
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_7, this);
|
||||
P60System::PDU1_DEVICE_7, this);
|
||||
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
|
||||
lp_var_t<uint8_t> device0Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_0_STATUS, this);
|
||||
P60System::PDU1_DEVICE_0_STATUS, this);
|
||||
lp_var_t<uint8_t> device1Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_1_STATUS, this);
|
||||
P60System::PDU1_DEVICE_1_STATUS, this);
|
||||
lp_var_t<uint8_t> device2Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_2_STATUS, this);
|
||||
P60System::PDU1_DEVICE_2_STATUS, this);
|
||||
lp_var_t<uint8_t> device3Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_3_STATUS, this);
|
||||
P60System::PDU1_DEVICE_3_STATUS, this);
|
||||
lp_var_t<uint8_t> device4Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_4_STATUS, this);
|
||||
P60System::PDU1_DEVICE_4_STATUS, this);
|
||||
lp_var_t<uint8_t> device5Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_5_STATUS, this);
|
||||
P60System::PDU1_DEVICE_5_STATUS, this);
|
||||
lp_var_t<uint8_t> device6Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_6_STATUS, this);
|
||||
P60System::PDU1_DEVICE_6_STATUS, this);
|
||||
lp_var_t<uint8_t> device7Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU1_DEVICE_7_STATUS, this);
|
||||
P60System::PDU1_DEVICE_7_STATUS, this);
|
||||
/** Number of reboots triggered by the ground watchdog */
|
||||
lp_var_t<uint32_t> gndWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CNT_GND, this);
|
||||
P60System::PDU1_WDT_CNT_GND, this);
|
||||
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
|
||||
lp_var_t<uint32_t> i2cWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CNT_I2C, this);
|
||||
P60System::PDU1_WDT_CNT_I2C, this);
|
||||
/** Number of reboots triggered through the CAN watchdog */
|
||||
lp_var_t<uint32_t> canWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CNT_CAN, this);
|
||||
P60System::PDU1_WDT_CNT_CAN, this);
|
||||
/** Number of reboots triggered through the CSP watchdog */
|
||||
lp_var_t<uint32_t> cspWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CNT_CSP, this);
|
||||
P60System::PDU1_WDT_CNT_CSP, this);
|
||||
/** Ground watchdog remaining seconds before rebooting */
|
||||
lp_var_t<uint32_t> groundWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_GND_LEFT, this);
|
||||
P60System::PDU1_WDT_GND_LEFT, this);
|
||||
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
|
||||
lp_var_t<uint32_t> i2cWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_I2C_LEFT, this);
|
||||
P60System::PDU1_WDT_I2C_LEFT, this);
|
||||
/** CAN watchdog remaining seconds before rebooting. */
|
||||
lp_var_t<uint32_t> canWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CAN_LEFT, this);
|
||||
P60System::PDU1_WDT_CAN_LEFT, this);
|
||||
/** CSP watchdog remaining seconds before rebooting. */
|
||||
lp_var_t<uint32_t> cspWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU1_WDT_CSP_LEFT, this);
|
||||
P60System::PDU1_WDT_CSP_LEFT, this);
|
||||
};
|
||||
}
|
||||
|
||||
@ -397,156 +666,299 @@ namespace PDU2 {
|
||||
|
||||
/** Measured output currents */
|
||||
lp_var_t<int16_t> currentOutQ7S = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_Q7S, this);
|
||||
P60System::PDU2_CURRENT_OUT_Q7S, this);
|
||||
lp_var_t<int16_t> currentOutPayloadPCDUCh1 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this);
|
||||
P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH1, this);
|
||||
lp_var_t<int16_t> currentOutReactionWheels = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_RW, this);
|
||||
P60System::PDU2_CURRENT_OUT_RW, this);
|
||||
lp_var_t<int16_t> currentOutTCSBoardHeaterIn = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this);
|
||||
P60System::PDU2_CURRENT_OUT_TCS_BOARD_HEATER_IN, this);
|
||||
lp_var_t<int16_t> currentOutSUSRedundant = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_SUS_REDUNDANT, this);
|
||||
P60System::PDU2_CURRENT_OUT_SUS_REDUNDANT, this);
|
||||
lp_var_t<int16_t> currentOutDeplMechanism = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this);
|
||||
P60System::PDU2_CURRENT_OUT_DEPLOYMENT_MECHANISM, this);
|
||||
lp_var_t<int16_t> currentOutPayloadPCDUCh6 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this);
|
||||
P60System::PDU2_CURRENT_OUT_PAYLOAD_PCDU_CH6, this);
|
||||
lp_var_t<int16_t> currentOutACSBoard = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this);
|
||||
P60System::PDU2_CURRENT_OUT_ACS_BOARD_SIDE_B, this);
|
||||
lp_var_t<int16_t> currentOutPayloadCamera = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this);
|
||||
P60System::PDU2_CURRENT_OUT_PAYLOAD_CAMERA, this);
|
||||
/** Measured voltage of output channels */
|
||||
lp_var_t<int16_t> voltageOutQ7S = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_Q7S, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_Q7S, this);
|
||||
lp_var_t<int16_t> voltageOutPayloadPCDUCh1 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH1, this);
|
||||
lp_var_t<int16_t> voltageOutReactionWheels = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_RW, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_RW, this);
|
||||
lp_var_t<int16_t> voltageOutTCSBoardHeaterIn = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_TCS_BOARD_HEATER_IN, this);
|
||||
lp_var_t<int16_t> voltageOutSUS = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_SUS_REDUNDANT, this);
|
||||
lp_var_t<int16_t> voltageOutDeplMechanism = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_DEPLOYMENT_MECHANISM, this);
|
||||
lp_var_t<int16_t> voltageOutPayloadPCDUCh6 = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_PAYLOAD_PCDU_CH6, this);
|
||||
lp_var_t<int16_t> voltageOutACSBoard = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_ACS_BOARD_SIDE_B, this);
|
||||
lp_var_t<int16_t> voltageOutPayloadCamera = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this);
|
||||
P60System::PDU2_VOLTAGE_OUT_PAYLOAD_CAMERA, this);
|
||||
/** Measured VCC */
|
||||
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VCC, this);
|
||||
P60System::PDU2_VCC, this);
|
||||
/** Measured VBAT */
|
||||
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_VBAT, this);
|
||||
P60System::PDU2_VBAT, this);
|
||||
lp_var_t<int16_t> temperature = lp_var_t<int16_t>(sid.objectId,
|
||||
PDU::PDU2_TEMPERATURE, this);
|
||||
P60System::PDU2_TEMPERATURE, this);
|
||||
/** Output converter enable status */
|
||||
lp_var_t<uint8_t> converterEnable = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_CONV_EN, this);
|
||||
P60System::PDU2_CONV_EN, this);
|
||||
/** Output channels enable status */
|
||||
lp_var_t<uint8_t> outEnabledQ7S = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_Q7S, this);
|
||||
P60System::PDU2_OUT_EN_Q7S, this);
|
||||
lp_var_t<uint8_t> outEnabledPlPCDUCh1 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this);
|
||||
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH1, this);
|
||||
lp_var_t<uint8_t> outEnabledReactionWheels = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_RW, this);
|
||||
P60System::PDU2_OUT_EN_RW, this);
|
||||
lp_var_t<uint8_t> outEnabledTCSBoardHeaterIn = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this);
|
||||
P60System::PDU2_OUT_EN_TCS_BOARD_HEATER_IN, this);
|
||||
lp_var_t<uint8_t> outEnabledSUS = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_SUS_REDUNDANT, this);
|
||||
P60System::PDU2_OUT_EN_SUS_REDUNDANT, this);
|
||||
lp_var_t<uint8_t> outEnabledDeplMechanism = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this);
|
||||
P60System::PDU2_OUT_EN_DEPLOYMENT_MECHANISM, this);
|
||||
lp_var_t<uint8_t> outEnabledPlPCDUCh6 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this);
|
||||
P60System::PDU2_OUT_EN_PAYLOAD_PCDU_CH6, this);
|
||||
lp_var_t<uint8_t> outEnabledAcsBoard = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this);
|
||||
P60System::PDU2_OUT_EN_ACS_BOARD_SIDE_B, this);
|
||||
lp_var_t<uint8_t> outEnabledPayloadCamera = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_OUT_EN_PAYLOAD_CAMERA, this);
|
||||
P60System::PDU2_OUT_EN_PAYLOAD_CAMERA, this);
|
||||
lp_var_t<uint32_t> bootcause = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_BOOTCAUSE, this);
|
||||
P60System::PDU2_BOOTCAUSE, this);
|
||||
/** Number of reboots */
|
||||
lp_var_t<uint32_t> bootcount = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_BOOTCNT, this);
|
||||
P60System::PDU2_BOOTCNT, this);
|
||||
/** Uptime in seconds */
|
||||
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_UPTIME, this);
|
||||
P60System::PDU2_UPTIME, this);
|
||||
lp_var_t<uint16_t> resetcause = lp_var_t<uint16_t>(sid.objectId,
|
||||
PDU::PDU2_RESETCAUSE, this);
|
||||
P60System::PDU2_RESETCAUSE, this);
|
||||
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
|
||||
lp_var_t<uint8_t> battMode = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_BATT_MODE, this);
|
||||
P60System::PDU2_BATT_MODE, this);
|
||||
/**
|
||||
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
|
||||
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
|
||||
*/
|
||||
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_0, this);
|
||||
P60System::PDU2_DEVICE_0, this);
|
||||
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_1, this);
|
||||
P60System::PDU2_DEVICE_1, this);
|
||||
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_2, this);
|
||||
P60System::PDU2_DEVICE_2, this);
|
||||
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_3, this);
|
||||
P60System::PDU2_DEVICE_3, this);
|
||||
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_4, this);
|
||||
P60System::PDU2_DEVICE_4, this);
|
||||
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_5, this);
|
||||
P60System::PDU2_DEVICE_5, this);
|
||||
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_6, this);
|
||||
P60System::PDU2_DEVICE_6, this);
|
||||
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_7, this);
|
||||
P60System::PDU2_DEVICE_7, this);
|
||||
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
|
||||
lp_var_t<uint8_t> device0Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_0_STATUS, this);
|
||||
P60System::PDU2_DEVICE_0_STATUS, this);
|
||||
lp_var_t<uint8_t> device1Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_1_STATUS, this);
|
||||
P60System::PDU2_DEVICE_1_STATUS, this);
|
||||
lp_var_t<uint8_t> device2Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_2_STATUS, this);
|
||||
P60System::PDU2_DEVICE_2_STATUS, this);
|
||||
lp_var_t<uint8_t> device3Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_3_STATUS, this);
|
||||
P60System::PDU2_DEVICE_3_STATUS, this);
|
||||
lp_var_t<uint8_t> device4Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_4_STATUS, this);
|
||||
P60System::PDU2_DEVICE_4_STATUS, this);
|
||||
lp_var_t<uint8_t> device5Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_5_STATUS, this);
|
||||
P60System::PDU2_DEVICE_5_STATUS, this);
|
||||
lp_var_t<uint8_t> device6Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_6_STATUS, this);
|
||||
P60System::PDU2_DEVICE_6_STATUS, this);
|
||||
lp_var_t<uint8_t> device7Status = lp_var_t<uint8_t>(sid.objectId,
|
||||
PDU::PDU2_DEVICE_7_STATUS, this);
|
||||
P60System::PDU2_DEVICE_7_STATUS, this);
|
||||
/** Number of reboots triggered by the ground watchdog */
|
||||
lp_var_t<uint32_t> gndWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CNT_GND, this);
|
||||
P60System::PDU2_WDT_CNT_GND, this);
|
||||
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
|
||||
lp_var_t<uint32_t> i2cWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CNT_I2C, this);
|
||||
P60System::PDU2_WDT_CNT_I2C, this);
|
||||
/** Number of reboots triggered through the CAN watchdog */
|
||||
lp_var_t<uint32_t> canWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CNT_CAN, this);
|
||||
P60System::PDU2_WDT_CNT_CAN, this);
|
||||
/** Number of reboots triggered through the CSP watchdog */
|
||||
lp_var_t<uint32_t> cspWdtReboots = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CNT_CSP, this);
|
||||
P60System::PDU2_WDT_CNT_CSP, this);
|
||||
/** Ground watchdog remaining seconds before rebooting */
|
||||
lp_var_t<uint32_t> groundWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_GND_LEFT, this);
|
||||
P60System::PDU2_WDT_GND_LEFT, this);
|
||||
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
|
||||
lp_var_t<uint32_t> i2cWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_I2C_LEFT, this);
|
||||
P60System::PDU2_WDT_I2C_LEFT, this);
|
||||
/** CAN watchdog remaining seconds before rebooting. */
|
||||
lp_var_t<uint32_t> canWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CAN_LEFT, this);
|
||||
P60System::PDU2_WDT_CAN_LEFT, this);
|
||||
/** CSP watchdog remaining seconds before rebooting. */
|
||||
lp_var_t<uint32_t> cspWatchdogSecondsLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
PDU::PDU2_WDT_CSP_LEFT, this);
|
||||
P60System::PDU2_WDT_CSP_LEFT, this);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
namespace ACU {
|
||||
|
||||
static const uint32_t HK_TABLE_DATA_SET_ID = 0x2;
|
||||
|
||||
/* 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;
|
||||
|
||||
/**
|
||||
* @brief This class defines a dataset for the hk table of the ACU.
|
||||
*/
|
||||
class HkTableDataset:
|
||||
public StaticLocalDataSet<HK_TABLE_ENTRIES> {
|
||||
public:
|
||||
|
||||
HkTableDataset(HasLocalDataPoolIF* owner):
|
||||
StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {
|
||||
}
|
||||
|
||||
HkTableDataset(object_id_t objectId):
|
||||
StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {
|
||||
}
|
||||
|
||||
lp_var_t<CurrentInGroup_t> currentInGroup = lp_var_t<CurrentInGroup_t>(sid.objectId,
|
||||
P60System::ACU_CURRENT_IN_GROUP, this);
|
||||
lp_var_t<VoltageInGroup_t> voltageInGroup = lp_var_t<VoltageInGroup_t>(sid.objectId,
|
||||
P60System::ACU_VOLTAGE_IN_GROUP, this);
|
||||
lp_var_t<uint16_t> vcc = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::ACU_VCC, this);
|
||||
lp_var_t<uint16_t> vbat = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::ACU_VBAT, this);
|
||||
lp_var_t<TemperatureGroup_t> temperatureGroup = lp_var_t<TemperatureGroup_t>(sid.objectId,
|
||||
P60System::ACU_TEMPERATURE_GROUP, this);
|
||||
lp_var_t<uint8_t> mpptMode = lp_var_t<uint8_t>(sid.objectId,
|
||||
P60System::ACU_MPPT_MODE, this);
|
||||
lp_var_t<VboostGroup_t> vboostGroup = lp_var_t<VboostGroup_t>(sid.objectId,
|
||||
P60System::ACU_VBOOST_GROUP, this);
|
||||
lp_var_t<PowerGroup_t> powerGroup = lp_var_t<PowerGroup_t>(sid.objectId,
|
||||
P60System::ACU_POWER_GROUP, this);
|
||||
lp_var_t<DacEnablestatus_t> dacEnableStatusGroup = lp_var_t<DacEnablestatus_t>(sid.objectId,
|
||||
P60System::ACU_DAC_EN_GROUP, this);
|
||||
lp_var_t<DacRawChannelValues_t> dacRawChannelValues = lp_var_t<DacRawChannelValues_t>(sid.objectId,
|
||||
P60System::ACU_DAC_VAL_GROUP, this);
|
||||
lp_var_t<uint32_t> bootCause = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_BOOTCAUSE, this);
|
||||
lp_var_t<uint32_t> bootcause = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_BOOTCAUSE, this);
|
||||
lp_var_t<uint32_t> bootcnt = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_BOOTCNT, this);
|
||||
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_UPTIME, this);
|
||||
lp_var_t<uint16_t> resetCause = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::ACU_RESET_CAUSE, this);
|
||||
lp_var_t<uint16_t> mpptTime = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::ACU_MPPT_TIME, this);
|
||||
lp_var_t<uint16_t> mpptPeriod = lp_var_t<uint16_t>(sid.objectId,
|
||||
P60System::ACU_MPPT_PERIOD, this);
|
||||
lp_var_t<DeviceTypeGroup_t> deviceTypeGroup = lp_var_t<DeviceTypeGroup_t>(sid.objectId,
|
||||
P60System::ACU_DEVICE_TYPE_GROUP, this);
|
||||
lp_var_t<DeviceStatusGroup_t> deviceStatusGroup = lp_var_t<DeviceStatusGroup_t>(sid.objectId,
|
||||
P60System::ACU_DEVICE_STATUS_GROUP, this);
|
||||
lp_var_t<uint32_t> wdtCntGnd = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_WDT_CNT_GND, this);
|
||||
lp_var_t<uint32_t> wdtGndLeft = lp_var_t<uint32_t>(sid.objectId,
|
||||
P60System::ACU_WDT_GND_LEFT, this);
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user