add dual lane power switcher for PL PCDU
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
parent
0937697637
commit
74fa98d161
@ -148,7 +148,7 @@ void ObjectFactory::produce(void* args) {
|
|||||||
|
|
||||||
createHeaterComponents();
|
createHeaterComponents();
|
||||||
createSolarArrayDeploymentComponents();
|
createSolarArrayDeploymentComponents();
|
||||||
createPlPcduComponents(gpioComIF, spiComIF);
|
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
|
||||||
#if OBSW_ADD_SYRLINKS == 1
|
#if OBSW_ADD_SYRLINKS == 1
|
||||||
createSyrlinksComponents();
|
createSyrlinksComponents();
|
||||||
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
||||||
@ -1134,7 +1134,8 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#endif /* BOARD_TE0720 == 0 */
|
#endif /* BOARD_TE0720 == 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF) {
|
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
|
PowerSwitchIF* pwrSwitcher) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
// Create all GPIO components first
|
// Create all GPIO components first
|
||||||
GpioCookie* plPcduGpios = new GpioCookie;
|
GpioCookie* plPcduGpios = new GpioCookie;
|
||||||
@ -1180,9 +1181,10 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
|
|||||||
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
||||||
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
|
spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED);
|
||||||
// Create device handler components
|
// Create device handler components
|
||||||
auto plPcduHandler =
|
auto plPcduHandler = new PayloadPcduHandler(
|
||||||
new PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF,
|
objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, SdCardManager::instance(),
|
||||||
SdCardManager::instance(), false);
|
pwrSwitcher, pcduSwitches::Switches::PDU2_CH1_PL_PCDU_BATT_0_14V8,
|
||||||
|
pcduSwitches::Switches::PDU2_CH6_PL_PCDU_BATT_1_14V8, false);
|
||||||
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler);
|
||||||
static_cast<void>(plPcduHandler);
|
static_cast<void>(plPcduHandler);
|
||||||
#if OBSW_TEST_PL_PCDU == 1
|
#if OBSW_TEST_PL_PCDU == 1
|
||||||
|
@ -15,7 +15,8 @@ void produce(void* args);
|
|||||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
||||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
||||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF);
|
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
|
PowerSwitchIF* pwrSwitcher);
|
||||||
void createTmpComponents();
|
void createTmpComponents();
|
||||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||||
void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
|
|
||||||
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
||||||
GpioIF* gpioIF, SdCardMountedIF* sdcMan,
|
GpioIF* gpioIF, SdCardMountedIF* sdcMan,
|
||||||
bool periodicPrintout)
|
PowerSwitchIF* pwrSwitcher, pcduSwitches::Switches switchA,
|
||||||
|
pcduSwitches::Switches switchB, bool periodicPrintout)
|
||||||
: DeviceHandlerBase(objectId, comIF, cookie),
|
: DeviceHandlerBase(objectId, comIF, cookie),
|
||||||
adcSet(this),
|
adcSet(this),
|
||||||
periodicPrintout(periodicPrintout),
|
periodicPrintout(periodicPrintout),
|
||||||
gpioIF(gpioIF),
|
gpioIF(gpioIF),
|
||||||
sdcMan(sdcMan) {}
|
sdcMan(sdcMan),
|
||||||
|
pwrStateMachine(switchA, switchB, pwrSwitcher) {}
|
||||||
|
|
||||||
void PayloadPcduHandler::doStartUp() {
|
void PayloadPcduHandler::doStartUp() {
|
||||||
if ((state != States::PL_PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
if ((state != States::PL_PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
||||||
@ -34,8 +36,8 @@ void PayloadPcduHandler::doStartUp() {
|
|||||||
|
|
||||||
void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
|
void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||||
using namespace plpcdu;
|
using namespace plpcdu;
|
||||||
if(submode == plpcdu::NORMAL_ALL_ON or submode == plpcdu::NORMAL_ADC_ONLY) {
|
if (submode == plpcdu::NORMAL_ALL_ON or submode == plpcdu::NORMAL_ADC_ONLY) {
|
||||||
if(state == States::PL_PCDU_OFF) {
|
if (state == States::PL_PCDU_OFF) {
|
||||||
// TODO: Config error, emit error printout
|
// TODO: Config error, emit error printout
|
||||||
setMode(MODE_OFF);
|
setMode(MODE_OFF);
|
||||||
}
|
}
|
||||||
@ -59,7 +61,7 @@ void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subMode
|
|||||||
monMode = MonitoringMode::CLOSE_TO_ZERO;
|
monMode = MonitoringMode::CLOSE_TO_ZERO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(state == States::ON_TRANS_ADC_CLOSE_ZERO) {
|
if (state == States::ON_TRANS_ADC_CLOSE_ZERO) {
|
||||||
if (adcState == AdcStates::BOOT_DELAY) {
|
if (adcState == AdcStates::BOOT_DELAY) {
|
||||||
if (adcCountdown.hasTimedOut()) {
|
if (adcCountdown.hasTimedOut()) {
|
||||||
adcState = AdcStates::SEND_SETUP;
|
adcState = AdcStates::SEND_SETUP;
|
||||||
@ -69,7 +71,7 @@ void PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subMode
|
|||||||
if (adcState == AdcStates::SEND_SETUP) {
|
if (adcState == AdcStates::SEND_SETUP) {
|
||||||
if (adcCmdExecuted) {
|
if (adcCmdExecuted) {
|
||||||
adcState = AdcStates::NORMAL;
|
adcState = AdcStates::NORMAL;
|
||||||
if(submode == plpcdu::NORMAL_ADC_ONLY) {
|
if (submode == plpcdu::NORMAL_ADC_ONLY) {
|
||||||
setMode(MODE_NORMAL, NORMAL_ADC_ONLY);
|
setMode(MODE_NORMAL, NORMAL_ADC_ONLY);
|
||||||
}
|
}
|
||||||
adcCountdown.setTimeout(100);
|
adcCountdown.setTimeout(100);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||||
#include <fsfw/timemanager/Countdown.h>
|
#include <fsfw/timemanager/Countdown.h>
|
||||||
|
#include <mission/system/DualLanePowerStateMachine.h>
|
||||||
|
|
||||||
#include "events/subsystemIdRanges.h"
|
#include "events/subsystemIdRanges.h"
|
||||||
#include "fsfw/FSFW.h"
|
#include "fsfw/FSFW.h"
|
||||||
@ -60,7 +61,9 @@ class PayloadPcduHandler : public DeviceHandlerBase {
|
|||||||
static constexpr Event I_HPA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 11, severity::MEDIUM);
|
static constexpr Event I_HPA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 11, severity::MEDIUM);
|
||||||
|
|
||||||
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF,
|
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF,
|
||||||
SdCardMountedIF* sdcMan, bool periodicPrintout);
|
SdCardMountedIF* sdcMan, PowerSwitchIF* pwrSwitcher,
|
||||||
|
pcduSwitches::Switches switchA, pcduSwitches::Switches switchB,
|
||||||
|
bool periodicPrintout);
|
||||||
|
|
||||||
void setToGoToNormalModeImmediately(bool enable);
|
void setToGoToNormalModeImmediately(bool enable);
|
||||||
void enablePeriodicPrintout(bool enable, uint8_t divider);
|
void enablePeriodicPrintout(bool enable, uint8_t divider);
|
||||||
@ -133,6 +136,7 @@ class PayloadPcduHandler : public DeviceHandlerBase {
|
|||||||
PoolEntry<float> processedValues =
|
PoolEntry<float> processedValues =
|
||||||
PoolEntry<float>({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
|
PoolEntry<float>({0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
|
||||||
PoolEntry<float> tempC = PoolEntry<float>({0.0});
|
PoolEntry<float> tempC = PoolEntry<float>({0.0});
|
||||||
|
DualLanePowerStateMachine pwrStateMachine;
|
||||||
|
|
||||||
void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
|
void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
|
@ -14,8 +14,7 @@ struct TcsBoardHelper {
|
|||||||
class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
|
class TcsBoardAssembly : public AssemblyBase, public ConfirmsFailuresIF {
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS;
|
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::TCS_BOARD_ASS;
|
||||||
static constexpr Event CHILDREN_LOST_MODE =
|
static constexpr Event CHILDREN_LOST_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||||
event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
|
||||||
|
|
||||||
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
TcsBoardAssembly(object_id_t objectId, object_id_t parentId, PowerSwitchIF* pwrSwitcher,
|
||||||
power::Switch_t switcher, TcsBoardHelper helper);
|
power::Switch_t switcher, TcsBoardHelper helper);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user