v1.10.0 #220
@ -29,6 +29,7 @@ static const int PTME_CONFIG = 4;
|
|||||||
} // namespace uiomapids
|
} // namespace uiomapids
|
||||||
|
|
||||||
namespace gpioNames {
|
namespace gpioNames {
|
||||||
|
|
||||||
static constexpr char GYRO_0_ADIS_CS[] = "gyro_0_adis_chip_select";
|
static constexpr char GYRO_0_ADIS_CS[] = "gyro_0_adis_chip_select";
|
||||||
static constexpr char GYRO_1_L3G_CS[] = "gyro_1_l3g_chip_select";
|
static constexpr char GYRO_1_L3G_CS[] = "gyro_1_l3g_chip_select";
|
||||||
static constexpr char GYRO_2_ADIS_CS[] = "gyro_2_adis_chip_select";
|
static constexpr char GYRO_2_ADIS_CS[] = "gyro_2_adis_chip_select";
|
||||||
@ -44,6 +45,8 @@ static constexpr char GNSS_1_ENABLE[] = "enable_gnss_1";
|
|||||||
static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0";
|
static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0";
|
||||||
static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2";
|
static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2";
|
||||||
static constexpr char GNSS_SELECT[] = "gnss_mux_select";
|
static constexpr char GNSS_SELECT[] = "gnss_mux_select";
|
||||||
|
static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select";
|
||||||
|
|
||||||
static constexpr char HEATER_0[] = "heater0";
|
static constexpr char HEATER_0[] = "heater0";
|
||||||
static constexpr char HEATER_1[] = "heater1";
|
static constexpr char HEATER_1[] = "heater1";
|
||||||
static constexpr char HEATER_2[] = "heater2";
|
static constexpr char HEATER_2[] = "heater2";
|
||||||
@ -65,7 +68,7 @@ static constexpr char EN_RW_1[] = "enable_rw_1";
|
|||||||
static constexpr char EN_RW_2[] = "enable_rw_2";
|
static constexpr char EN_RW_2[] = "enable_rw_2";
|
||||||
static constexpr char EN_RW_3[] = "enable_rw_3";
|
static constexpr char EN_RW_3[] = "enable_rw_3";
|
||||||
static constexpr char EN_RW_4[] = "enable_rw_4";
|
static constexpr char EN_RW_4[] = "enable_rw_4";
|
||||||
static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select";
|
|
||||||
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
||||||
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
|
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
|
||||||
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
|
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
|
||||||
@ -80,6 +83,16 @@ static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872";
|
|||||||
static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872";
|
static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872";
|
||||||
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
|
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
|
||||||
static constexpr char PDEC_RESET[] = "pdec_reset";
|
static constexpr char PDEC_RESET[] = "pdec_reset";
|
||||||
|
|
||||||
|
static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_DRO[] = "enable_plpcdu_dro";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_X8[] = "enable_plpcdu_x8";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_TX[] = "enable_plpcdu_tx";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_HPA[] = "enable_plpcdu_hpa";
|
||||||
|
static constexpr char PL_PCDU_ENABLE_MPA[] = "enable_plpcdu_mpa";
|
||||||
|
static constexpr char PL_PCDU_ADC_CS[] = "plpcdu_adc_chip_select";
|
||||||
|
|
||||||
} // namespace gpioNames
|
} // namespace gpioNames
|
||||||
} // namespace q7s
|
} // namespace q7s
|
||||||
|
|
||||||
|
@ -43,9 +43,11 @@
|
|||||||
#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/devicedefinitions/payloadPcduDefinitions.h"
|
||||||
#include "mission/core/GenericFactory.h"
|
#include "mission/core/GenericFactory.h"
|
||||||
#include "mission/devices/ACUHandler.h"
|
#include "mission/devices/ACUHandler.h"
|
||||||
#include "mission/devices/BpxBatteryHandler.h"
|
#include "mission/devices/BpxBatteryHandler.h"
|
||||||
@ -1072,6 +1074,56 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#endif /* BOARD_TE0720 == 0 */
|
#endif /* BOARD_TE0720 == 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF) {
|
||||||
|
// Create all GPIO components first
|
||||||
|
GpioCookie* plPcduGpios = new GpioCookie;
|
||||||
|
GpiodRegularByLineName* gpio = nullptr;
|
||||||
|
std::string consumer;
|
||||||
|
// Switch pins are active high
|
||||||
|
consumer = "PLPCDU_ENB_VBAT_0";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT0, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT0, gpio);
|
||||||
|
consumer = "PLPCDU_ENB_VBAT_1";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_VBAT0, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_VBAT1, gpio);
|
||||||
|
consumer = "PLPCDU_ENB_DRO";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_DRO, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_DRO, gpio);
|
||||||
|
consumer = "PLPCDU_ENB_HPA";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_HPA, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_HPA, gpio);
|
||||||
|
consumer = "PLPCDU_ENB_MPA";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_MPA, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_MPA, gpio);
|
||||||
|
|
||||||
|
consumer = "PLPCDU_ENB_X8";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_X8, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_X8, gpio);
|
||||||
|
consumer = "PLPCDU_ENB_TX";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_TX, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::LOW);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_TX, gpio);
|
||||||
|
|
||||||
|
// Chip select pin is active low
|
||||||
|
consumer = "PLPCDU_ADC_CS";
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ADC_CS, consumer, gpio::DIR_OUT,
|
||||||
|
gpio::Levels::HIGH);
|
||||||
|
plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio);
|
||||||
|
gpioComIF->addGpios(plPcduGpios);
|
||||||
|
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, spi::DEFAULT_MAX_1227_SPEED);
|
||||||
|
// Create device handler components
|
||||||
|
auto plPcduHandler =
|
||||||
|
PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF);
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||||
#if BOARD_TE0720 == 0
|
#if BOARD_TE0720 == 0
|
||||||
new Q7STestTask(objects::TEST_TASK);
|
new Q7STestTask(objects::TEST_TASK);
|
||||||
|
@ -13,6 +13,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 createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF);
|
||||||
void createTmpComponents();
|
void createTmpComponents();
|
||||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF);
|
void createPcduComponents(LinuxLibgpioIF* gpioComIF);
|
||||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||||
|
@ -36,6 +36,7 @@ enum commonObjects: uint32_t {
|
|||||||
GYRO_1_L3G_HANDLER = 0x44120111,
|
GYRO_1_L3G_HANDLER = 0x44120111,
|
||||||
GYRO_2_ADIS_HANDLER = 0x44120212,
|
GYRO_2_ADIS_HANDLER = 0x44120212,
|
||||||
GYRO_3_L3G_HANDLER = 0x44120313,
|
GYRO_3_L3G_HANDLER = 0x44120313,
|
||||||
|
PLPCDU_HANDLER = 0x44300000,
|
||||||
|
|
||||||
IMTQ_HANDLER = 0x44140014,
|
IMTQ_HANDLER = 0x44140014,
|
||||||
PLOC_MPSOC_HANDLER = 0x44330015,
|
PLOC_MPSOC_HANDLER = 0x44330015,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
target_sources(${TARGET_NAME} PRIVATE
|
target_sources(${TARGET_NAME} PRIVATE
|
||||||
SolarArrayDeploymentHandler.cpp
|
SolarArrayDeploymentHandler.cpp
|
||||||
|
PayloadPcduHandler.cpp
|
||||||
SusHandler.cpp
|
SusHandler.cpp
|
||||||
)
|
)
|
||||||
|
161
linux/devices/PayloadPcduHandler.cpp
Normal file
161
linux/devices/PayloadPcduHandler.cpp
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
#include "PayloadPcduHandler.h"
|
||||||
|
|
||||||
|
#include "devices/gpioIds.h"
|
||||||
|
|
||||||
|
PayloadPcduHandler::PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie,
|
||||||
|
GpioIF* gpioIF)
|
||||||
|
: DeviceHandlerBase(objectId, comIF, cookie), gpioIF(gpioIF) {}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::doStartUp() {
|
||||||
|
if ((state != States::PCDU_OFF) and (state != States::ON_TRANS_SSR)) {
|
||||||
|
// Config error
|
||||||
|
sif::error << "PayloadPcduHandler::doStartUp: Invalid state" << std::endl;
|
||||||
|
}
|
||||||
|
if (state == States::PCDU_OFF) {
|
||||||
|
// Switch on relays here
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1);
|
||||||
|
state = States::ON_TRANS_SSR;
|
||||||
|
transitionOk = true;
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_SSR) {
|
||||||
|
// If necessary, check whether a certain amount of time has elapsed
|
||||||
|
if (transitionOk) {
|
||||||
|
transitionOk = false;
|
||||||
|
// We are now in ON mode
|
||||||
|
setMode(MODE_ON);
|
||||||
|
// The ADC can now be read. If the values are not close to zero, we should not allow
|
||||||
|
// transition
|
||||||
|
monMode = MonitoringMode::CLOSE_TO_ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||||
|
if (mode == _MODE_TO_NORMAL) {
|
||||||
|
if (state == States::ON_TRANS_ADC_CLOSE_ZERO) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::ON_TRANS_DRO;
|
||||||
|
// Now start monitoring for negative voltages instead
|
||||||
|
monMode = MonitoringMode::NEGATIVE;
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_DRO) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
// Switch on DRO and start monitoring for negative voltagea
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_DRO);
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::ON_TRANS_X8;
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_X8) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
// Switch on X8
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_X8);
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::ON_TRANS_TX;
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_TX) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
// Switch on TX
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_TX);
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::ON_TRANS_MPA;
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_MPA) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
// Switch on MPA
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_MPA);
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::ON_TRANS_HPA;
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state == States::ON_TRANS_HPA) {
|
||||||
|
if (not commandExecuted) {
|
||||||
|
// Switch on HPA
|
||||||
|
gpioIF->pullHigh(gpioIds::PLPCDU_ENB_HPA);
|
||||||
|
commandExecuted = true;
|
||||||
|
}
|
||||||
|
// ADC values are ok, 5 seconds have elapsed
|
||||||
|
if (transitionOk and countdown.hasTimedOut()) {
|
||||||
|
state = States::PCDU_ON;
|
||||||
|
setMode(MODE_NORMAL);
|
||||||
|
countdown.resetTimer();
|
||||||
|
commandExecuted = false;
|
||||||
|
transitionOk = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::doShutDown() {}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PayloadPcduHandler::fillCommandAndReplyMap() {}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||||
|
const uint8_t* commandData,
|
||||||
|
size_t commandDataLen) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::scanForReply(const uint8_t* start, size_t remainingSize,
|
||||||
|
DeviceCommandId_t* foundId, size_t* foundLen) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||||
|
const uint8_t* packet) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t PayloadPcduHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||||
|
// 20 minutes transition delay is allowed
|
||||||
|
return 20 * 60 * 60;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PayloadPcduHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
|
LocalDataPoolManager& poolManager) {
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
74
linux/devices/PayloadPcduHandler.h
Normal file
74
linux/devices/PayloadPcduHandler.h
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
#ifndef LINUX_DEVICES_PLPCDUHANDLER_H_
|
||||||
|
#define LINUX_DEVICES_PLPCDUHANDLER_H_
|
||||||
|
|
||||||
|
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||||
|
#include <fsfw/timemanager/Countdown.h>
|
||||||
|
|
||||||
|
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Device handler for the EIVE Payload PCDU
|
||||||
|
* @details
|
||||||
|
* Documentation:
|
||||||
|
* https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/412_PayloaPCDUDocumentation/release/EIVE-D-421-001_PLPCDU_Documentation.pdf
|
||||||
|
*
|
||||||
|
* Important components:
|
||||||
|
* - SSR - Solid State Relay: Decouples voltages from battery
|
||||||
|
* - DRO - Dielectric Resonsant Oscillator: Generates modulation signal
|
||||||
|
* - X8: Frequency X8 Multiplicator
|
||||||
|
* - TX: Transmitter/Sender module. Modulates data onto carrier signal
|
||||||
|
* - MPA - Medium Power Amplifier
|
||||||
|
* - HPA - High Power Amplifier
|
||||||
|
*/
|
||||||
|
class PayloadPcduHandler : DeviceHandlerBase {
|
||||||
|
public:
|
||||||
|
PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF);
|
||||||
|
|
||||||
|
private:
|
||||||
|
enum class States {
|
||||||
|
PCDU_OFF,
|
||||||
|
// Solid State Relay, enable battery voltages VBAT0 and VBAT1. This will also switch on
|
||||||
|
// the ADC
|
||||||
|
ON_TRANS_SSR,
|
||||||
|
ON_TRANS_ADC_CLOSE_ZERO,
|
||||||
|
// Enable Dielectric Resonant Oscillator and start monitoring voltages as
|
||||||
|
// soon as DRO voltage reaches 6V
|
||||||
|
ON_TRANS_DRO,
|
||||||
|
// Switch on X8 compoennt and monitor voltages for 5 seconds
|
||||||
|
ON_TRANS_X8,
|
||||||
|
// Switch on TX component and monitor voltages for 5 seconds
|
||||||
|
ON_TRANS_TX,
|
||||||
|
// Switch on MPA component and monitor voltages for 5 seconds
|
||||||
|
ON_TRANS_MPA,
|
||||||
|
// Switch on HPA component and monitor voltages for 5 seconds
|
||||||
|
ON_TRANS_HPA,
|
||||||
|
// All components of the experiment are on
|
||||||
|
PCDU_ON,
|
||||||
|
} state = States::PCDU_OFF;
|
||||||
|
|
||||||
|
enum class MonitoringMode { NONE, CLOSE_TO_ZERO, NEGATIVE } monMode = MonitoringMode::NONE;
|
||||||
|
|
||||||
|
// This variable is tied to DRO +6 V voltage. Voltages, currents are monitored and the experiment
|
||||||
|
// is shut down immediately if there is a negative voltage.
|
||||||
|
bool transitionOk = false;
|
||||||
|
bool commandExecuted = false;
|
||||||
|
Countdown countdown = Countdown(5000);
|
||||||
|
GpioIF* gpioIF;
|
||||||
|
|
||||||
|
void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
|
||||||
|
void doStartUp() override;
|
||||||
|
void doShutDown() override;
|
||||||
|
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
|
||||||
|
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
|
||||||
|
void fillCommandAndReplyMap() override;
|
||||||
|
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData,
|
||||||
|
size_t commandDataLen) override;
|
||||||
|
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
|
||||||
|
size_t* foundLen) override;
|
||||||
|
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
|
||||||
|
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||||
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
|
LocalDataPoolManager& poolManager) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* LINUX_DEVICES_PLPCDUHANDLER_H_ */
|
@ -8,11 +8,12 @@
|
|||||||
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the device handler class for the SUS sensor. The sensor is
|
* @brief This is the device handler class for the SUS sensor based on the MAX1227 ADC.
|
||||||
* based on the MAX1227 ADC. Details about the SUS electronic can be found at
|
|
||||||
* https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release
|
|
||||||
*
|
*
|
||||||
* @details Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf
|
* @details
|
||||||
|
* Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf
|
||||||
|
* Details about the SUS electronic can be found at
|
||||||
|
* https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release
|
||||||
*
|
*
|
||||||
* @note When adding a SusHandler to the polling sequence table make sure to add a slot with
|
* @note When adding a SusHandler to the polling sequence table make sure to add a slot with
|
||||||
* the executionStep FIRST_WRITE. Otherwise the communication sequence will never be
|
* the executionStep FIRST_WRITE. Otherwise the communication sequence will never be
|
||||||
|
12
linux/devices/devicedefinitions/payloadPcduDefinitions.h
Normal file
12
linux/devices/devicedefinitions/payloadPcduDefinitions.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef LINUX_DEVICES_DEVICEDEFINITIONS_PAYLOADPCDUDEFINITIONS_H_
|
||||||
|
#define LINUX_DEVICES_DEVICEDEFINITIONS_PAYLOADPCDUDEFINITIONS_H_
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
namespace plpcdu {
|
||||||
|
|
||||||
|
static constexpr size_t MAX_ADC_REPLY_SIZE = 32;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* LINUX_DEVICES_DEVICEDEFINITIONS_PAYLOADPCDUDEFINITIONS_H_ */
|
@ -52,6 +52,7 @@ debugging. */
|
|||||||
#define OBSW_ADD_RTD_DEVICES 0
|
#define OBSW_ADD_RTD_DEVICES 0
|
||||||
#define OBSW_ADD_TMP_DEVICES 0
|
#define OBSW_ADD_TMP_DEVICES 0
|
||||||
#define OBSW_ADD_RAD_SENSORS 0
|
#define OBSW_ADD_RAD_SENSORS 0
|
||||||
|
#define OBSW_ADD_PL_PCDU 0
|
||||||
#define OBSW_ADD_SYRLINKS 0
|
#define OBSW_ADD_SYRLINKS 0
|
||||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||||
|
@ -70,7 +70,8 @@ enum spiAddresses : address_t {
|
|||||||
RW1,
|
RW1,
|
||||||
RW2,
|
RW2,
|
||||||
RW3,
|
RW3,
|
||||||
RW4
|
RW4,
|
||||||
|
PLPCDU_ADC
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Addresses of devices supporting the CSP protocol */
|
/* Addresses of devices supporting the CSP protocol */
|
||||||
|
@ -109,7 +109,16 @@ enum gpioId_t {
|
|||||||
RS485_EN_RX_DATA,
|
RS485_EN_RX_DATA,
|
||||||
RS485_EN_RX_CLOCK,
|
RS485_EN_RX_CLOCK,
|
||||||
|
|
||||||
BIT_RATE_SEL
|
BIT_RATE_SEL,
|
||||||
|
|
||||||
|
PLPCDU_ENB_VBAT0,
|
||||||
|
PLPCDU_ENB_VBAT1,
|
||||||
|
PLPCDU_ENB_DRO,
|
||||||
|
PLPCDU_ENB_X8,
|
||||||
|
PLPCDU_ENB_TX,
|
||||||
|
PLPCDU_ENB_HPA,
|
||||||
|
PLPCDU_ENB_MPA,
|
||||||
|
PLPCDU_ADC_CS
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,13 @@ ReturnValue_t pst::pstGpio(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||||
uint32_t length = thisSequence->getPeriodMs();
|
uint32_t length = thisSequence->getPeriodMs();
|
||||||
static_cast<void>(length);
|
static_cast<void>(length);
|
||||||
|
#if OBSW_ADD_PL_PCDU == 1
|
||||||
|
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
|
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
|
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||||
|
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
|
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
|
#endif
|
||||||
#if OBSW_ADD_TMP_DEVICES == 1
|
#if OBSW_ADD_TMP_DEVICES == 1
|
||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
|
@ -16,6 +16,7 @@ target_sources(${TARGET_NAME} PUBLIC
|
|||||||
RadiationSensorHandler.cpp
|
RadiationSensorHandler.cpp
|
||||||
GyroADIS1650XHandler.cpp
|
GyroADIS1650XHandler.cpp
|
||||||
RwHandler.cpp
|
RwHandler.cpp
|
||||||
|
max1227.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
1
mission/devices/max1227.cpp
Normal file
1
mission/devices/max1227.cpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "max1227.h"
|
8
mission/devices/max1227.h
Normal file
8
mission/devices/max1227.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef MISSION_DEVICES_MAX1227_H_
|
||||||
|
#define MISSION_DEVICES_MAX1227_H_
|
||||||
|
|
||||||
|
namespace max1227 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* MISSION_DEVICES_MAX1227_H_ */
|
Loading…
Reference in New Issue
Block a user