move Switches enum
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
parent
eda1f7e212
commit
b1d2f73b01
@ -585,7 +585,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
@ -600,7 +600,7 @@ void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HANDLER);
|
||||
auto syrlinksHandler =
|
||||
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->connectModeTreeParent(*syrlinksAssy);
|
||||
#if OBSW_DEBUG_SYRLINKS == 1
|
||||
@ -612,7 +612,7 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
|
||||
using namespace gpio;
|
||||
std::stringstream consumer;
|
||||
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);
|
||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||
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 starTracker =
|
||||
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->connectModeTreeParent(*strAssy);
|
||||
starTracker->setCustomFdir(strFdir);
|
||||
@ -956,7 +956,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
new ImtqPollingTask(objects::IMTQ_POLLING);
|
||||
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,
|
||||
pcdu::Switches::PDU1_CH3_MGT_5V);
|
||||
power::Switches::PDU1_CH3_MGT_5V);
|
||||
imtqHandler->enableThermalModule(ThermalStateCfg());
|
||||
imtqHandler->setPowerSwitcher(pwrSwitcher);
|
||||
imtqHandler->connectModeTreeParent(*imtqAssy);
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
|
||||
#include "mission/powerDefs.h"
|
||||
|
||||
class PlocMpsocDummy : public DeviceHandlerBase {
|
||||
public:
|
||||
static const DeviceCommandId_t SIMPLE_COMMAND = 1;
|
||||
|
@ -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[2] = new RwDummy(objects::RW3, 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);
|
||||
auto* strAssy = new StrAssembly(objects::STR_ASSY);
|
||||
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
|
||||
@ -210,7 +210,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio
|
||||
}
|
||||
}
|
||||
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);
|
||||
auto* scexDummy = new ScexDummy(objects::SCEX, objects::DUMMY_COM_IF, comCookieDummy);
|
||||
scexDummy->connectModeTreeParent(satsystem::payload::SUBSYSTEM);
|
||||
|
@ -296,7 +296,7 @@ void ObjectFactory::createGenericHeaterComponents(GpioIF& gpioIF, PowerSwitchIF&
|
||||
{new HealthDevice(objects::HEATER_7_SYRLINKS, MessageQueueIF::NO_QUEUE), gpioIds::HEATER_7},
|
||||
}});
|
||||
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);
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ void ObjectFactory::createAcsBoardAssy(PowerSwitchIF& pwrSwitcher,
|
||||
TcsBoardAssembly* ObjectFactory::createTcsBoardAssy(PowerSwitchIF& pwrSwitcher) {
|
||||
TcsBoardHelper helper(RTD_INFOS);
|
||||
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);
|
||||
return tcsBoardAss;
|
||||
}
|
||||
|
@ -40,9 +40,9 @@ ReturnValue_t PCDUHandler::performOperation(uint8_t counter) {
|
||||
PoolReadGuard pg(&switcherSet.p60Dock5VStack);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
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);
|
||||
switchStates[pcdu::P60_DOCK_5V_STACK] = switchState;
|
||||
switchStates[power::P60_DOCK_5V_STACK] = switchState;
|
||||
}
|
||||
switcherSet.p60Dock5VStack.setValid(true);
|
||||
switcherSet.p60Dock5VStack.value = switchState;
|
||||
@ -102,7 +102,7 @@ ReturnValue_t PCDUHandler::initialize() {
|
||||
void PCDUHandler::initializeSwitchStates() {
|
||||
using namespace pcdu;
|
||||
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) {
|
||||
switchStates[idx] = INIT_SWITCHES_PDU1.at(idx);
|
||||
} else if (idx < PDU::CHANNELS_LEN * 2) {
|
||||
@ -180,22 +180,23 @@ void PCDUHandler::updatePdu2SwitchStates() {
|
||||
}
|
||||
switcherSet.pdu2Switches.setValid(true);
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH2_RW_5V, pdu2CoreHk.outputEnables[Channels::RW]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH2_RW_5V,
|
||||
pdu2CoreHk.outputEnables[Channels::RW]);
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
|
||||
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]);
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU2_CH8_PAYLOAD_CAMERA,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU2_CH8_PAYLOAD_CAMERA,
|
||||
pdu2CoreHk.outputEnables[Channels::PAYLOAD_CAMERA]);
|
||||
if (firstSwitchInfoPdu2) {
|
||||
firstSwitchInfoPdu2 = false;
|
||||
@ -217,23 +218,23 @@ void PCDUHandler::updatePdu1SwitchStates() {
|
||||
}
|
||||
switcherSet.pdu1Switches.setValid(true);
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH1_SYRLINKS_12V,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH1_SYRLINKS_12V,
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH3_MGT_5V,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH3_MGT_5V,
|
||||
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]);
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH6_PLOC_12V,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH6_PLOC_12V,
|
||||
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]);
|
||||
checkAndUpdatePduSwitch(pdu, Switches::PDU1_CH8_UNOCCUPIED,
|
||||
checkAndUpdatePduSwitch(pdu, power::Switches::PDU1_CH8_UNOCCUPIED,
|
||||
pdu1CoreHk.outputEnables[Channels::UNUSED]);
|
||||
if (firstSwitchInfoPdu1) {
|
||||
firstSwitchInfoPdu1 = false;
|
||||
@ -254,99 +255,99 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
|
||||
GomspaceDeviceHandler* module = nullptr;
|
||||
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH1_SYRLINKS_12V: {
|
||||
case power::PDU1_CH1_SYRLINKS_12V: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SYRLINKS;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH2_STAR_TRACKER_5V: {
|
||||
case power::PDU1_CH2_STAR_TRACKER_5V: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_STAR_TRACKER;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH3_MGT_5V: {
|
||||
case power::PDU1_CH3_MGT_5V: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_MGT;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH4_SUS_NOMINAL_3V3: {
|
||||
case power::PDU1_CH4_SUS_NOMINAL_3V3: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH6_PLOC_12V: {
|
||||
case power::PDU1_CH6_PLOC_12V: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_PLOC;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU1_CH8_UNOCCUPIED: {
|
||||
case power::PDU1_CH8_UNOCCUPIED: {
|
||||
memoryAddress = PDU1::CONFIG_ADDRESS_OUT_EN_CHANNEL8;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU1_HANDLER);
|
||||
break;
|
||||
}
|
||||
// This is a dangerous command. Reject/Igore it for now
|
||||
case pcdu::PDU2_CH0_Q7S: {
|
||||
case power::PDU2_CH0_Q7S: {
|
||||
return returnvalue::FAILED;
|
||||
// memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_Q7S;
|
||||
// pdu = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
// 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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU2_CH2_RW_5V: {
|
||||
case power::PDU2_CH2_RW_5V: {
|
||||
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_RW;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU2_CH4_SUS_REDUNDANT_3V3: {
|
||||
case power::PDU2_CH4_SUS_REDUNDANT_3V3: {
|
||||
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: {
|
||||
case power::PDU2_CH5_DEPLOYMENT_MECHANISM_8V: {
|
||||
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
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;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::PDU2_CH8_PAYLOAD_CAMERA: {
|
||||
case power::PDU2_CH8_PAYLOAD_CAMERA: {
|
||||
memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::PDU2_HANDLER);
|
||||
break;
|
||||
}
|
||||
case pcdu::P60_DOCK_5V_STACK: {
|
||||
case power::P60_DOCK_5V_STACK: {
|
||||
memoryAddress = P60Dock::CONFIG_ADDRESS_OUT_EN_5V_STACK;
|
||||
module = ObjectManager::instance()->get<GomspaceDeviceHandler>(objects::P60DOCK_HANDLER);
|
||||
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::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;
|
||||
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) {
|
||||
using namespace pcdu;
|
||||
if (switchStates[switchIdx] != setValue) {
|
||||
|
@ -84,7 +84,7 @@ class PCDUHandler : public PowerSwitchIF,
|
||||
/** The timeStamp of the current pdu1HkTableDataset */
|
||||
CCSDSTime::CDS_short timeStampPdu1HkDataset;
|
||||
|
||||
uint8_t switchStates[pcdu::NUMBER_OF_SWITCHES];
|
||||
uint8_t switchStates[power::NUMBER_OF_SWITCHES];
|
||||
/**
|
||||
* Pointer to the IPCStore.
|
||||
* 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,
|
||||
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_ */
|
||||
|
@ -18,7 +18,7 @@ static constexpr bool DEBUG_MODE = true;
|
||||
SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_,
|
||||
GpioIF& gpioInterface,
|
||||
PowerSwitchIF& mainLineSwitcher_,
|
||||
pcdu::Switches mainLineSwitch_,
|
||||
power::Switches mainLineSwitch_,
|
||||
gpioId_t deplSA1, gpioId_t deplSA2,
|
||||
SdCardMountedIF& sdcMountedIF)
|
||||
: SystemObject(setObjectId_),
|
||||
|
@ -107,7 +107,7 @@ class SolarArrayDeploymentHandler : public ExecutableObjectIF,
|
||||
* @param burnTimeMs Time duration the power will be applied to the burn wires.
|
||||
*/
|
||||
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);
|
||||
|
||||
virtual ~SolarArrayDeploymentHandler();
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "devices/powerSwitcherList.h"
|
||||
#include "fsfw/platform.h"
|
||||
#include "gomspaceDefines.h"
|
||||
#include "mission/powerDefs.h"
|
||||
|
||||
namespace GOMSPACE {
|
||||
|
||||
@ -715,32 +716,6 @@ namespace pcdu {
|
||||
|
||||
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 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;
|
||||
|
||||
class SwitcherStates : public StaticLocalDataSet<NUMBER_OF_SWITCHES> {
|
||||
class SwitcherStates : public StaticLocalDataSet<power::NUMBER_OF_SWITCHES> {
|
||||
public:
|
||||
SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {}
|
||||
|
||||
|
33
mission/powerDefs.h
Normal file
33
mission/powerDefs.h
Normal 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
|
@ -105,8 +105,8 @@ class AcsBoardAssembly : public DualLaneAssemblyBase {
|
||||
void selectGpsInDualMode(duallane::Submodes side);
|
||||
|
||||
private:
|
||||
static constexpr pcdu::Switches SWITCH_A = pcdu::Switches::PDU1_CH7_ACS_A_SIDE_3V3;
|
||||
static constexpr pcdu::Switches SWITCH_B = pcdu::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3;
|
||||
static constexpr power::Switches SWITCH_A = power::Switches::PDU1_CH7_ACS_A_SIDE_3V3;
|
||||
static constexpr power::Switches SWITCH_B = power::Switches::PDU2_CH7_ACS_BOARD_SIDE_B_3V3;
|
||||
|
||||
AcsBoardHelper helper;
|
||||
GpioIF* gpioIF = nullptr;
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
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 transitionOtherSideFailedEvent)
|
||||
: AssemblyBase(objectId, 20),
|
||||
|
@ -18,8 +18,8 @@ class DualLaneAssemblyBase : public AssemblyBase, public ConfirmsFailuresIF {
|
||||
static constexpr UniqueEventId_t POWER_STATE_MACHINE_TIMEOUT_ID = 2;
|
||||
static constexpr UniqueEventId_t SIDE_SWITCH_TRANSITION_NOT_ALLOWED_ID = 3;
|
||||
|
||||
DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, pcdu::Switches switch1,
|
||||
pcdu::Switches switch2, Event pwrSwitchTimeoutEvent,
|
||||
DualLaneAssemblyBase(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switches switch1,
|
||||
power::Switches switch2, Event pwrSwitchTimeoutEvent,
|
||||
Event sideSwitchNotAllowedEvent, Event transitionOtherSideFailedEvent);
|
||||
|
||||
protected:
|
||||
|
@ -32,7 +32,7 @@ class Stack5VHandler {
|
||||
HandlerState handlerState = HandlerState::IDLE;
|
||||
bool radSensorIsOn = false;
|
||||
bool plPcduIsOn = false;
|
||||
pcdu::Switches stackSwitch = pcdu::Switches::P60_DOCK_5V_STACK;
|
||||
power::Switches stackSwitch = power::Switches::P60_DOCK_5V_STACK;
|
||||
|
||||
bool updateInternalStates();
|
||||
};
|
||||
|
@ -44,8 +44,8 @@ class SusAssembly : public DualLaneAssemblyBase {
|
||||
|
||||
private:
|
||||
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 pcdu::Switches SWITCH_RED = pcdu::Switches::PDU2_CH4_SUS_REDUNDANT_3V3;
|
||||
static constexpr power::Switches SWITCH_NOM = power::Switches::PDU1_CH4_SUS_NOMINAL_3V3;
|
||||
static constexpr power::Switches SWITCH_RED = power::Switches::PDU2_CH4_SUS_REDUNDANT_3V3;
|
||||
FixedArrayList<ModeListEntry, NUMBER_SUN_SENSORS> modeTable;
|
||||
|
||||
SusAssHelper helper;
|
||||
|
Loading…
Reference in New Issue
Block a user