move Switches enum
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
Robin Müller 2023-03-16 18:47:51 +01:00
parent eda1f7e212
commit b1d2f73b01
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
15 changed files with 101 additions and 90 deletions

View File

@ -585,7 +585,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc
} }
new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, gpioIF, pwrSwitcher, new SolarArrayDeploymentHandler(objects::SOLAR_ARRAY_DEPL_HANDLER, gpioIF, pwrSwitcher,
pcdu::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, power::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
gpioIds::DEPLSA1, gpioIds::DEPLSA2, *SdCardManager::instance()); gpioIds::DEPLSA1, gpioIds::DEPLSA2, *SdCardManager::instance());
} }
@ -600,7 +600,7 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER); auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER);
auto syrlinksHandler = auto syrlinksHandler =
new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie, new SyrlinksHandler(objects::SYRLINKS_HANDLER, objects::UART_COM_IF, syrlinksUartCookie,
pcdu::PDU1_CH1_SYRLINKS_12V, syrlinksFdir); power::PDU1_CH1_SYRLINKS_12V, syrlinksFdir);
syrlinksHandler->setPowerSwitcher(pwrSwitcher); syrlinksHandler->setPowerSwitcher(pwrSwitcher);
syrlinksHandler->connectModeTreeParent(*syrlinksAssy); syrlinksHandler->connectModeTreeParent(*syrlinksAssy);
#if OBSW_DEBUG_SYRLINKS == 1 #if OBSW_DEBUG_SYRLINKS == 1
@ -612,7 +612,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
using namespace gpio; using namespace gpio;
std::stringstream consumer; std::stringstream consumer;
auto* camSwitcher = auto* camSwitcher =
new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, pcdu::PDU2_CH8_PAYLOAD_CAMERA); new CamSwitcher(objects::CAM_SWITCHER, pwrSwitch, power::PDU2_CH8_PAYLOAD_CAMERA);
camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM); camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
#if OBSW_ADD_PLOC_MPSOC == 1 #if OBSW_ADD_PLOC_MPSOC == 1
consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER; consumer << "0x" << std::hex << objects::PLOC_MPSOC_HANDLER;
@ -943,7 +943,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
auto strFdir = new StrFdir(objects::STAR_TRACKER); auto strFdir = new StrFdir(objects::STAR_TRACKER);
auto starTracker = auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
paramJsonFile, strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); paramJsonFile, strHelper, power::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher); starTracker->setPowerSwitcher(pwrSwitcher);
starTracker->connectModeTreeParent(*strAssy); starTracker->connectModeTreeParent(*strAssy);
starTracker->setCustomFdir(strFdir); starTracker->setCustomFdir(strFdir);
@ -956,7 +956,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) {
new ImtqPollingTask(objects::IMTQ_POLLING); new ImtqPollingTask(objects::IMTQ_POLLING);
I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, imtq::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE); I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, imtq::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE);
auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::IMTQ_POLLING, imtqI2cCookie, auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::IMTQ_POLLING, imtqI2cCookie,
pcdu::Switches::PDU1_CH3_MGT_5V); power::Switches::PDU1_CH3_MGT_5V);
imtqHandler->enableThermalModule(ThermalStateCfg()); imtqHandler->enableThermalModule(ThermalStateCfg());
imtqHandler->setPowerSwitcher(pwrSwitcher); imtqHandler->setPowerSwitcher(pwrSwitcher);
imtqHandler->connectModeTreeParent(*imtqAssy); imtqHandler->connectModeTreeParent(*imtqAssy);

View File

@ -2,6 +2,8 @@
#include <fsfw/devicehandlers/DeviceHandlerBase.h> #include <fsfw/devicehandlers/DeviceHandlerBase.h>
#include "mission/powerDefs.h"
class PlocMpsocDummy : public DeviceHandlerBase { class PlocMpsocDummy : public DeviceHandlerBase {
public: public:
static const DeviceCommandId_t SIMPLE_COMMAND = 1; static const DeviceCommandId_t SIMPLE_COMMAND = 1;

View File

@ -56,7 +56,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy); rws[1] = new RwDummy(objects::RW2, objects::DUMMY_COM_IF, comCookieDummy);
rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy); rws[2] = new RwDummy(objects::RW3, objects::DUMMY_COM_IF, comCookieDummy);
rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy); rws[3] = new RwDummy(objects::RW4, objects::DUMMY_COM_IF, comCookieDummy);
ObjectFactory::createRwAssy(pwrSwitcher, pcdu::Switches::PDU2_CH2_RW_5V, rws, rwIds); ObjectFactory::createRwAssy(pwrSwitcher, power::Switches::PDU2_CH2_RW_5V, rws, rwIds);
new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER); new SaDeplDummy(objects::SOLAR_ARRAY_DEPL_HANDLER);
auto* strAssy = new StrAssembly(objects::STR_ASSY); auto* strAssy = new StrAssembly(objects::STR_ASSY);
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
@ -210,7 +210,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
} }
} }
auto* camSwitcher = auto* camSwitcher =
new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, pcdu::Switches::PDU2_CH8_PAYLOAD_CAMERA); new CamSwitcher(objects::CAM_SWITCHER, pwrSwitcher, power::Switches::PDU2_CH8_PAYLOAD_CAMERA);
camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM); camSwitcher->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy); auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy);
scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM); scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);

View File

@ -296,7 +296,7 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF&
{new HealthDevice(objects::HEATER_7_SYRLINKS, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7}, {new HealthDevice(objects::HEATER_7_SYRLINKS, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7},
}}); }});
heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher, heaterHandler = new HeaterHandler(objects::HEATER_HANDLER, &gpioIF, helper, &pwrSwitcher,
pcdu::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V); power::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V);
heaterHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); heaterHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM);
} }
@ -365,7 +365,7 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher,
TcsBoardAssembly* ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) { TcsBoardAssembly* ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {
TcsBoardHelper helper(RTD_INFOS); TcsBoardHelper helper(RTD_INFOS);
auto* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, &pwrSwitcher, auto* tcsBoardAss = new TcsBoardAssembly(objects::TCS_BOARD_ASS, &pwrSwitcher,
pcdu::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); power::Switches::PDU1_CH0_TCS_BOARD_3V3, helper);
tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); tcsBoardAss->connectModeTreeParent(satsystem::tcs::SUBSYSTEM);
return tcsBoardAss; return tcsBoardAss;
} }

View File

@ -40,9 +40,9 @@ ReturnValue_t PCDUHandler::performOperation(uint8_t counter) {
PoolReadGuard pg(&switcherSet.p60Dock5VStack); PoolReadGuard pg(&switcherSet.p60Dock5VStack);
if (pg.getReadResult() == returnvalue::OK) { if (pg.getReadResult() == returnvalue::OK) {
if (switcherSet.p60Dock5VStack.value != switchState) { if (switcherSet.p60Dock5VStack.value != switchState) {
triggerEvent(power::SWITCH_HAS_CHANGED, switchState, pcdu::Switches::P60_DOCK_5V_STACK); triggerEvent(power::SWITCH_HAS_CHANGED, switchState, power::Switches::P60_DOCK_5V_STACK);
MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
switchStates[pcdu::P60_DOCK_5V_STACK] = switchState; switchStates[power::P60_DOCK_5V_STACK] = switchState;
} }
switcherSet.p60Dock5VStack.setValid(true); switcherSet.p60Dock5VStack.setValid(true);
switcherSet.p60Dock5VStack.value = switchState; switcherSet.p60Dock5VStack.value = switchState;
@ -102,7 +102,7 @@ ReturnValue_t PCDUHandler::initialize() {
void PCDUHandler::initializeSwitchStates() { void PCDUHandler::initializeSwitchStates() {
using namespace pcdu; using namespace pcdu;
try { try {
for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { for (uint8_t idx = 0; idx < power::NUMBER_OF_SWITCHES; idx++) {
if (idx < PDU::CHANNELS_LEN) { if (idx < PDU::CHANNELS_LEN) {
switchStates[idx] = INIT_SWITCHES_PDU1.at(idx); switchStates[idx] = INIT_SWITCHES_PDU1.at(idx);
} else if (idx < PDU::CHANNELS_LEN * 2) { } else if (idx < PDU::CHANNELS_LEN * 2) {
@ -180,22 +180,23 @@ void PCDUHandler::updatePdu2SwitchStates() {
} }
switcherSet.pdu2Switches.setValid(true); switcherSet.pdu2Switches.setValid(true);
MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH0_Q7S, pdu2CoreHk.outputEnables[Channels::Q7S]); checkAndUpdatePduSwitch(pdu, power::PDU2_CH0_Q7S, pdu2CoreHk.outputEnables[Channels::Q7S]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH1]); pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH1]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH2_RW_5V, pdu2CoreHk.outputEnables[Channels::RW]); checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH2_RW_5V,
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V, pdu2CoreHk.outputEnables[Channels::RW]);
checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
pdu2CoreHk.outputEnables[Channels::TCS_HEATER_IN]); pdu2CoreHk.outputEnables[Channels::TCS_HEATER_IN]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH4_SUS_REDUNDANT_3V3, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH4_SUS_REDUNDANT_3V3,
pdu2CoreHk.outputEnables[Channels::SUS_REDUNDANT]); pdu2CoreHk.outputEnables[Channels::SUS_REDUNDANT]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
pdu2CoreHk.outputEnables[Channels::DEPY_MECHANISM]); pdu2CoreHk.outputEnables[Channels::DEPY_MECHANISM]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8,
pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH6]); pdu2CoreHk.outputEnables[Channels::PAYLOAD_PCDU_CH6]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
pdu2CoreHk.outputEnables[Channels::ACS_B_SIDE]); pdu2CoreHk.outputEnables[Channels::ACS_B_SIDE]);
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH8_PAYLOAD_CAMERA, checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH8_PAYLOAD_CAMERA,
pdu2CoreHk.outputEnables[Channels::PAYLOAD_CAMERA]); pdu2CoreHk.outputEnables[Channels::PAYLOAD_CAMERA]);
if (firstSwitchInfoPdu2) { if (firstSwitchInfoPdu2) {
firstSwitchInfoPdu2 = false; firstSwitchInfoPdu2 = false;
@ -217,23 +218,23 @@ void PCDUHandler::updatePdu1SwitchStates() {
} }
switcherSet.pdu1Switches.setValid(true); switcherSet.pdu1Switches.setValid(true);
MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); MutexGuard mg(pwrLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH0_TCS_BOARD_3V3, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH0_TCS_BOARD_3V3,
pdu1CoreHk.outputEnables[Channels::TCS_BOARD_3V3]); pdu1CoreHk.outputEnables[Channels::TCS_BOARD_3V3]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH1_SYRLINKS_12V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH1_SYRLINKS_12V,
pdu1CoreHk.outputEnables[Channels::SYRLINKS]); pdu1CoreHk.outputEnables[Channels::SYRLINKS]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH2_STAR_TRACKER_5V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH2_STAR_TRACKER_5V,
pdu1CoreHk.outputEnables[Channels::STR]); pdu1CoreHk.outputEnables[Channels::STR]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH3_MGT_5V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH3_MGT_5V,
pdu1CoreHk.outputEnables[Channels::MGT]); pdu1CoreHk.outputEnables[Channels::MGT]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH4_SUS_NOMINAL_3V3, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH4_SUS_NOMINAL_3V3,
pdu1CoreHk.outputEnables[Channels::SUS_NOMINAL]); pdu1CoreHk.outputEnables[Channels::SUS_NOMINAL]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH5_SOLAR_CELL_EXP_5V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH5_SOLAR_CELL_EXP_5V,
pdu1CoreHk.outputEnables[Channels::SOL_CELL_EXPERIMENT]); pdu1CoreHk.outputEnables[Channels::SOL_CELL_EXPERIMENT]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH6_PLOC_12V, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH6_PLOC_12V,
pdu1CoreHk.outputEnables[Channels::PLOC]); pdu1CoreHk.outputEnables[Channels::PLOC]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH7_ACS_A_SIDE_3V3, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH7_ACS_A_SIDE_3V3,
pdu1CoreHk.outputEnables[Channels::ACS_A_SIDE]); pdu1CoreHk.outputEnables[Channels::ACS_A_SIDE]);
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH8_UNOCCUPIED, checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH8_UNOCCUPIED,
pdu1CoreHk.outputEnables[Channels::UNUSED]); pdu1CoreHk.outputEnables[Channels::UNUSED]);
if (firstSwitchInfoPdu1) { if (firstSwitchInfoPdu1) {
firstSwitchInfoPdu1 = false; firstSwitchInfoPdu1 = false;
@ -254,99 +255,99 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
GomspaceDeviceHandler* module = nullptr; GomspaceDeviceHandler* module = nullptr;
switch (switchNr) { switch (switchNr) {
case pcdu::PDU1_CH0_TCS_BOARD_3V3: { case power::PDU1_CH0_TCS_BOARD_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH1_SYRLINKS_12V: { case power::PDU1_CH1_SYRLINKS_12V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SYRLINKS; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SYRLINKS;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH2_STAR_TRACKER_5V: { case power::PDU1_CH2_STAR_TRACKER_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_STAR_TRACKER; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_STAR_TRACKER;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH3_MGT_5V: { case power::PDU1_CH3_MGT_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_MGT; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_MGT;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH4_SUS_NOMINAL_3V3: { case power::PDU1_CH4_SUS_NOMINAL_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH5_SOLAR_CELL_EXP_5V: { case power::PDU1_CH5_SOLAR_CELL_EXP_5V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH6_PLOC_12V: { case power::PDU1_CH6_PLOC_12V: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH7_ACS_A_SIDE_3V3: { case power::PDU1_CH7_ACS_A_SIDE_3V3: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
case pcdu::PDU1_CH8_UNOCCUPIED: { case power::PDU1_CH8_UNOCCUPIED: {
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8; memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
break; break;
} }
// This is a dangerous command. Reject/Igore it for now // This is a dangerous command. Reject/Igore it for now
case pcdu::PDU2_CH0_Q7S: { case power::PDU2_CH0_Q7S: {
return returnvalue::FAILED; return returnvalue::FAILED;
// memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S; // memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S;
// pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); // pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
// break; // break;
} }
case pcdu::PDU2_CH1_PL_PCDU_BATT_0_14V8: { case power::PDU2_CH1_PL_PCDU_BATT_0_14V8: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH2_RW_5V: { case power::PDU2_CH2_RW_5V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: { case power::PDU2_CH3_TCS_BOARD_HEATER_IN_8V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH4_SUS_REDUNDANT_3V3: { case power::PDU2_CH4_SUS_REDUNDANT_3V3: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: { case power::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH6_PL_PCDU_BATT_1_14V8: { case power::PDU2_CH6_PL_PCDU_BATT_1_14V8: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: { case power::PDU2_CH7_ACS_BOARD_SIDE_B_3V3: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::PDU2_CH8_PAYLOAD_CAMERA: { case power::PDU2_CH8_PAYLOAD_CAMERA: {
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA; memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
break; break;
} }
case pcdu::P60_DOCK_5V_STACK: { case power::P60_DOCK_5V_STACK: {
memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_5V_STACK; memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_5V_STACK;
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER); module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER);
break; break;
@ -398,7 +399,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return returnvalue::OK; } ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return returnvalue::OK; }
ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const { ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const {
if (switchNr >= pcdu::NUMBER_OF_SWITCHES) { if (switchNr >= power::NUMBER_OF_SWITCHES) {
sif::debug << "PCDUHandler::getSwitchState: Invalid switch number" << std::endl; sif::debug << "PCDUHandler::getSwitchState: Invalid switch number" << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
@ -455,7 +456,7 @@ LocalPoolDataSetBase* PCDUHandler::getDataSetHandle(sid_t sid) {
} }
} }
void PCDUHandler::checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx, void PCDUHandler::checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, power::Switches switchIdx,
uint8_t setValue) { uint8_t setValue) {
using namespace pcdu; using namespace pcdu;
if (switchStates[switchIdx] != setValue) { if (switchStates[switchIdx] != setValue) {

View File

@ -84,7 +84,7 @@ class PCDUHandler : public PowerSwitchIF,
/** The timeStamp of the current pdu1HkTableDataset */ /** The timeStamp of the current pdu1HkTableDataset */
CCSDSTime::CDS_short timeStampPdu1HkDataset; CCSDSTime::CDS_short timeStampPdu1HkDataset;
uint8_t switchStates[pcdu::NUMBER_OF_SWITCHES]; uint8_t switchStates[power::NUMBER_OF_SWITCHES];
/** /**
* Pointer to the IPCStore. * Pointer to the IPCStore.
* This caches the pointer received from the objectManager in the constructor. * This caches the pointer received from the objectManager in the constructor.
@ -133,7 +133,7 @@ class PCDUHandler : public PowerSwitchIF,
*/ */
void updateHkTableDataset(store_address_t storeId, LocalPoolDataSetBase* dataset, void updateHkTableDataset(store_address_t storeId, LocalPoolDataSetBase* dataset,
CCSDSTime::CDS_short* datasetTimeStamp); CCSDSTime::CDS_short* datasetTimeStamp);
void checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, pcdu::Switches switchIdx, uint8_t setValue); void checkAndUpdatePduSwitch(GOMSPACE::Pdu pdu, power::Switches switchIdx, uint8_t setValue);
}; };
#endif /* MISSION_DEVICES_PCDUHANDLER_H_ */ #endif /* MISSION_DEVICES_PCDUHANDLER_H_ */

View File

@ -18,7 +18,7 @@ static constexpr bool DEBUG_MODE = true;
SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_,
GpioIF& gpioInterface, GpioIF& gpioInterface,
PowerSwitchIF& mainLineSwitcher_, PowerSwitchIF& mainLineSwitcher_,
pcdu::Switches mainLineSwitch_, power::Switches mainLineSwitch_,
gpioId_t deplSA1, gpioId_t deplSA2, gpioId_t deplSA1, gpioId_t deplSA2,
SdCardMountedIF& sdcMountedIF) SdCardMountedIF& sdcMountedIF)
: SystemObject(setObjectId_), : SystemObject(setObjectId_),

View File

@ -107,7 +107,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
* @param burnTimeMs Time duration the power will be applied to the burn wires. * @param burnTimeMs Time duration the power will be applied to the burn wires.
*/ */
SolarArrayDeploymentHandler(object_id_t setObjectId, GpioIF& gpio, SolarArrayDeploymentHandler(object_id_t setObjectId, GpioIF& gpio,
PowerSwitchIF& mainLineSwitcher, pcdu::Switches mainLineSwitch, PowerSwitchIF& mainLineSwitcher, power::Switches mainLineSwitch,
gpioId_t deplSA1, gpioId_t deplSA2, SdCardMountedIF& sdcMountedIF); gpioId_t deplSA1, gpioId_t deplSA2, SdCardMountedIF& sdcMountedIF);
virtual ~SolarArrayDeploymentHandler(); virtual ~SolarArrayDeploymentHandler();

View File

@ -11,6 +11,7 @@
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "fsfw/platform.h" #include "fsfw/platform.h"
#include "gomspaceDefines.h" #include "gomspaceDefines.h"
#include "mission/powerDefs.h"
namespace GOMSPACE { namespace GOMSPACE {
@ -715,32 +716,6 @@ namespace pcdu {
enum PoolIds : uint32_t { PDU1_SWITCHES, PDU2_SWITCHES, P60DOCK_SWITCHES }; enum PoolIds : uint32_t { PDU1_SWITCHES, PDU2_SWITCHES, P60DOCK_SWITCHES };
/* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches : power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V,
PDU1_CH3_MGT_5V,
PDU1_CH4_SUS_NOMINAL_3V3,
PDU1_CH5_SOLAR_CELL_EXP_5V,
PDU1_CH6_PLOC_12V,
PDU1_CH7_ACS_A_SIDE_3V3,
PDU1_CH8_UNOCCUPIED,
PDU2_CH0_Q7S,
PDU2_CH1_PL_PCDU_BATT_0_14V8,
PDU2_CH2_RW_5V,
PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
PDU2_CH4_SUS_REDUNDANT_3V3,
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
PDU2_CH6_PL_PCDU_BATT_1_14V8,
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
PDU2_CH8_PAYLOAD_CAMERA,
P60_DOCK_5V_STACK,
NUMBER_OF_SWITCHES
};
static const uint8_t ON = 1; static const uint8_t ON = 1;
static const uint8_t OFF = 0; static const uint8_t OFF = 0;
@ -760,7 +735,7 @@ const std::array<uint8_t, PDU::CHANNELS_LEN> INIT_SWITCHES_PDU2 = {ON, OFF, OFF
static constexpr uint32_t SWITCHER_SET_ID = 0; static constexpr uint32_t SWITCHER_SET_ID = 0;
class SwitcherStates : public StaticLocalDataSet<NUMBER_OF_SWITCHES> { class SwitcherStates : public StaticLocalDataSet<power::NUMBER_OF_SWITCHES> {
public: public:
SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {} SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {}

33
mission/powerDefs.h Normal file
View File

@ -0,0 +1,33 @@
#pragma once
#include <fsfw/power/definitions.h>
namespace power {
/* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches : power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V,
PDU1_CH3_MGT_5V,
PDU1_CH4_SUS_NOMINAL_3V3,
PDU1_CH5_SOLAR_CELL_EXP_5V,
PDU1_CH6_PLOC_12V,
PDU1_CH7_ACS_A_SIDE_3V3,
PDU1_CH8_UNOCCUPIED,
PDU2_CH0_Q7S,
PDU2_CH1_PL_PCDU_BATT_0_14V8,
PDU2_CH2_RW_5V,
PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
PDU2_CH4_SUS_REDUNDANT_3V3,
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
PDU2_CH6_PL_PCDU_BATT_1_14V8,
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
PDU2_CH8_PAYLOAD_CAMERA,
P60_DOCK_5V_STACK,
NUMBER_OF_SWITCHES
};
} // namespace power

View File

@ -105,8 +105,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
void selectGpsInDualMode(duallane::Submodes side); void selectGpsInDualMode(duallane::Submodes side);
private: private:
static constexpr pcdu::Switches SWITCH_A = pcdu::Switches::PDU1_CH7_ACS_A_SIDE_3V3; static constexpr power::Switches SWITCH_A = power::Switches::PDU1_CH7_ACS_A_SIDE_3V3;
static constexpr pcdu::Switches SWITCH_B = pcdu::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3; static constexpr power::Switches SWITCH_B = power::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3;
AcsBoardHelper helper; AcsBoardHelper helper;
GpioIF* gpioIF = nullptr; GpioIF* gpioIF = nullptr;

View File

@ -5,7 +5,7 @@
#include "OBSWConfig.h" #include "OBSWConfig.h"
DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, DualLaneAssemblyBase::DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher,
pcdu::Switches switch1, pcdu::Switches switch2, power::Switches switch1, power::Switches switch2,
Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent, Event pwrTimeoutEvent, Event sideSwitchNotAllowedEvent,
Event transitionOtherSideFailedEvent) Event transitionOtherSideFailedEvent)
: AssemblyBase(objectId, 20), : AssemblyBase(objectId, 20),

View File

@ -18,8 +18,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2; static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2;
static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3; static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3;
DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1, DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switches switch1,
pcdu::Switches switch2, Event pwrSwitchTimeoutEvent, power::Switches switch2, Event pwrSwitchTimeoutEvent,
Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent); Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent);
protected: protected:

View File

@ -32,7 +32,7 @@ class Stack5VHandler {
HandlerState handlerState = HandlerState::IDLE; HandlerState handlerState = HandlerState::IDLE;
bool radSensorIsOn = false; bool radSensorIsOn = false;
bool plPcduIsOn = false; bool plPcduIsOn = false;
pcdu::Switches stackSwitch = pcdu::Switches::P60_DOCK_5V_STACK; power::Switches stackSwitch = power::Switches::P60_DOCK_5V_STACK;
bool updateInternalStates(); bool updateInternalStates();
}; };

View File

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