v1.10.0 #220
@ -43,10 +43,10 @@
|
|||||||
#include "linux/boardtest/SpiTestClass.h"
|
#include "linux/boardtest/SpiTestClass.h"
|
||||||
#include "linux/csp/CspComIF.h"
|
#include "linux/csp/CspComIF.h"
|
||||||
#include "linux/csp/CspCookie.h"
|
#include "linux/csp/CspCookie.h"
|
||||||
|
#include "linux/devices/PayloadPcduHandler.h"
|
||||||
#include "linux/devices/SolarArrayDeploymentHandler.h"
|
#include "linux/devices/SolarArrayDeploymentHandler.h"
|
||||||
#include "linux/devices/SusHandler.h"
|
#include "linux/devices/SusHandler.h"
|
||||||
#include "linux/devices/devicedefinitions/SusDefinitions.h"
|
#include "linux/devices/devicedefinitions/SusDefinitions.h"
|
||||||
#include "linux/devices/PayloadPcduHandler.h"
|
|
||||||
#include "linux/devices/devicedefinitions/payloadPcduDefinitions.h"
|
#include "linux/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||||
#include "mission/core/GenericFactory.h"
|
#include "mission/core/GenericFactory.h"
|
||||||
#include "mission/devices/ACUHandler.h"
|
#include "mission/devices/ACUHandler.h"
|
||||||
@ -1079,11 +1079,11 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF*
|
|||||||
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
||||||
gpioComIF->addGpios(plPcduGpios);
|
gpioComIF->addGpios(plPcduGpios);
|
||||||
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS,
|
SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS,
|
||||||
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE, spi::DEFAULT_MAX_1227_MODE,
|
q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE,
|
||||||
spi::DEFAULT_MAX_1227_SPEED);
|
spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED);
|
||||||
// Create device handler components
|
// Create device handler components
|
||||||
auto plPcduHandler = PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie,
|
auto plPcduHandler =
|
||||||
gpioComIF);
|
PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||||
|
@ -3,33 +3,33 @@
|
|||||||
#include "devices/gpioIds.h"
|
#include "devices/gpioIds.h"
|
||||||
|
|
||||||
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)
|
GpioIF* gpioIF)
|
||||||
: DeviceHandlerBase(objectId, comIF, cookie), state(States::ADC_OFF_PL_OFF), gpioIF(gpioIF) {}
|
: DeviceHandlerBase(objectId, comIF, cookie), state(States::ADC_OFF_PL_OFF), gpioIF(gpioIF) {}
|
||||||
|
|
||||||
void PayloadPcduHandler::doStartUp() {
|
void PayloadPcduHandler::doStartUp() {
|
||||||
switch(state) {
|
switch (state) {
|
||||||
case(States::ADC_OFF_PL_OFF): {
|
case (States::ADC_OFF_PL_OFF): {
|
||||||
// Switch on relays here
|
// Switch on relays here
|
||||||
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
|
||||||
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1);
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1);
|
||||||
state = States::SWITCH_ON_RELAY_TRANSITION;
|
state = States::SWITCH_ON_RELAY_TRANSITION;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(States::SWITCH_ON_RELAY_TRANSITION): {
|
case (States::SWITCH_ON_RELAY_TRANSITION): {
|
||||||
// If necessary, check whether a certain amount of time has elapsed
|
// If necessary, check whether a certain amount of time has elapsed
|
||||||
state = States::ADC_OFF_PL_OFF;
|
state = States::ADC_OFF_PL_OFF;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// Config error
|
// Config error
|
||||||
sif::error << "PayloadPcduHandler::doStartUp: Invalid state" << std::endl;
|
sif::error << "PayloadPcduHandler::doStartUp: Invalid state" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||||
if(mode == _MODE_TO_NORMAL) {
|
if (mode == _MODE_TO_NORMAL) {
|
||||||
switch(state) {
|
switch (state) {
|
||||||
case(States::ADC_OFF_PL_OFF): {
|
case (States::ADC_OFF_PL_OFF): {
|
||||||
// Switch on HPA here
|
// Switch on HPA here
|
||||||
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_DRO);
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_DRO);
|
||||||
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_MPA);
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_MPA);
|
||||||
@ -39,7 +39,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
state = States::SWITCH_ON_HPA_TRANSITION;
|
state = States::SWITCH_ON_HPA_TRANSITION;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(States::SWITCH_ON_HPA_TRANSITION): {
|
case (States::SWITCH_ON_HPA_TRANSITION): {
|
||||||
// If necessary, check whether a certain amount of time has elapsed
|
// If necessary, check whether a certain amount of time has elapsed
|
||||||
state = States::ADC_ON_PL_ON;
|
state = States::ADC_ON_PL_ON;
|
||||||
setMode(MODE_NORMAL);
|
setMode(MODE_NORMAL);
|
||||||
@ -48,7 +48,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
default:
|
default:
|
||||||
// Config error
|
// Config error
|
||||||
sif::error << "PayloadPcduHandler::doTransition: Invalid state" << std::endl;
|
sif::error << "PayloadPcduHandler::doTransition: Invalid state" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,8 +82,6 @@ ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|||||||
|
|
||||||
uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; }
|
uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 10000; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) {
|
LocalDataPoolManager& poolManager) {
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define LINUX_DEVICES_PLPCDUHANDLER_H_
|
#define LINUX_DEVICES_PLPCDUHANDLER_H_
|
||||||
|
|
||||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
|
|
||||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||||
|
|
||||||
class PayloadPcduHandler : DeviceHandlerBase {
|
class PayloadPcduHandler : DeviceHandlerBase {
|
||||||
|
Loading…
Reference in New Issue
Block a user