PL PCDU switch states like mode bitmask now
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:
@ -441,6 +441,9 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local
|
||||
localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
|
||||
localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
|
||||
|
||||
#if OBSW_ENABLE_PERIODIC_HK == 1
|
||||
poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.8, true);
|
||||
#endif
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||
|
||||
ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||
using namespace plpcdu;
|
||||
if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON) {
|
||||
if (((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == 1) {
|
||||
if (state == States::PL_PCDU_OFF) {
|
||||
sif::error << "PayloadPcduHandler::stateMachineToNormal: Unexpected state PL_PCDU_OFF"
|
||||
<< "detected" << std::endl;
|
||||
@ -116,7 +116,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
||||
}
|
||||
}
|
||||
|
||||
if (submode == NormalSubmodes::DRO_ON) {
|
||||
if (((submode >> DRO_ON) & 1) == 1) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Enabling PL PCDU DRO module" << std::endl;
|
||||
#endif
|
||||
@ -127,7 +127,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
||||
setMode(MODE_NORMAL, submode);
|
||||
}
|
||||
|
||||
if (submode == NormalSubmodes::X8_ON) {
|
||||
if (((submode >> X8_ON) & 1) == 1) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Enabling PL PCDU X8 module" << std::endl;
|
||||
#endif
|
||||
@ -138,7 +138,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
||||
setMode(MODE_NORMAL, submode);
|
||||
}
|
||||
|
||||
if (submode == NormalSubmodes::TX_ON) {
|
||||
if (((submode >> TX_ON) & 1) == 1) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Enabling PL PCDU TX module" << std::endl;
|
||||
#endif
|
||||
@ -149,7 +149,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
||||
setMode(MODE_NORMAL, submode);
|
||||
}
|
||||
|
||||
if (submode == NormalSubmodes::MPA_ON) {
|
||||
if (((submode >> MPA_ON) & 1) == 1) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Enabling PL PCDU MPA module" << std::endl;
|
||||
#endif
|
||||
@ -160,7 +160,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
||||
setMode(MODE_NORMAL, submode);
|
||||
}
|
||||
|
||||
if (submode == NormalSubmodes::HPA_ON) {
|
||||
if (((submode >> HPA_ON) & 1) == 1) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Enabling PL PCDU HPA module" << std::endl;
|
||||
#endif
|
||||
@ -549,24 +549,30 @@ ReturnValue_t PayloadPcduHandler::isModeCombinationValid(Mode_t mode, Submode_t
|
||||
using namespace plpcdu;
|
||||
if (mode == MODE_NORMAL) {
|
||||
// Also deals with the case where the mode is MODE_ON, submode should be 0 here
|
||||
if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON and
|
||||
(this->mode == MODE_NORMAL and this->submode != NormalSubmodes::ALL_OFF)) {
|
||||
if ((((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == SOLID_STATE_RELAYS_ADC_ON) and
|
||||
(this->mode == MODE_NORMAL and this->submode != ALL_OFF_SUBMODE)) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
if ((submode == NormalSubmodes::DRO_ON and
|
||||
this->submode != NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON)) {
|
||||
if (((((submode >> DRO_ON) & 1) == 1) and
|
||||
(this->submode != (1 << SOLID_STATE_RELAYS_ADC_ON)))) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
if ((submode == NormalSubmodes::X8_ON and this->submode != NormalSubmodes::DRO_ON)) {
|
||||
if ((((submode >> X8_ON) & 1) == 1) and
|
||||
(this->submode != ((1 << SOLID_STATE_RELAYS_ADC_ON) | (1 << DRO_ON)))) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
if ((submode == NormalSubmodes::TX_ON and this->submode != NormalSubmodes::X8_ON)) {
|
||||
if (((((submode >> TX_ON) & 1) == 1) and
|
||||
(this->submode != ((1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
if ((submode == NormalSubmodes::MPA_ON and this->submode != NormalSubmodes::TX_ON)) {
|
||||
if ((((submode >> MPA_ON) & 1) == 1 and
|
||||
(this->submode !=
|
||||
((1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
if ((submode == NormalSubmodes::HPA_ON and this->submode != NormalSubmodes::MPA_ON)) {
|
||||
if ((((submode >> HPA_ON) & 1) == 1 and
|
||||
(this->submode != ((1 << MPA_ON) | (1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) |
|
||||
(1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
|
@ -92,15 +92,15 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t
|
||||
return RETURN_OK;
|
||||
}
|
||||
case RAD_SENSOR::ENABLE_DEBUG_OUTPUT: {
|
||||
printPeriodicData = true;
|
||||
rawPacketLen = 0;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: {
|
||||
rawPacketLen = 0;
|
||||
printPeriodicData = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
printPeriodicData = true;
|
||||
rawPacketLen = 0;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case RAD_SENSOR::DISABLE_DEBUG_OUTPUT: {
|
||||
rawPacketLen = 0;
|
||||
printPeriodicData = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
default:
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
@ -123,7 +123,7 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t
|
||||
switch (*foundId) {
|
||||
case RAD_SENSOR::START_CONVERSION:
|
||||
case RAD_SENSOR::WRITE_SETUP:
|
||||
*foundLen = remainingSize;
|
||||
*foundLen = remainingSize;
|
||||
return IGNORE_REPLY_DATA;
|
||||
case RAD_SENSOR::READ_CONVERSIONS: {
|
||||
ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET);
|
||||
@ -138,8 +138,8 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t
|
||||
}
|
||||
case RAD_SENSOR::ENABLE_DEBUG_OUTPUT:
|
||||
case RAD_SENSOR::DISABLE_DEBUG_OUTPUT:
|
||||
sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl;
|
||||
break;
|
||||
sif::info << "RadiationSensorHandler::scanForReply: " << remainingSize << std::endl;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
||||
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueHighByte.size(), 0);
|
||||
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
readTxAgcValueHighByte.size(), 0);
|
||||
rawPacketLen = readTxAgcValueHighByte.size();
|
||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): {
|
||||
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueLowByte.size(), 0);
|
||||
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
readTxAgcValueLowByte.size(), 0);
|
||||
rawPacketLen = readTxAgcValueLowByte.size();
|
||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
||||
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardHighByte.size(),
|
||||
0);
|
||||
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempPowerAmpBoardHighByte.size(), 0);
|
||||
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
||||
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardLowByte.size(),
|
||||
0);
|
||||
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempPowerAmpBoardLowByte.size(), 0);
|
||||
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
||||
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardHighByte.size(),
|
||||
0);
|
||||
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempBasebandBoardHighByte.size(), 0);
|
||||
rawPacketLen = tempBasebandBoardHighByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
||||
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardLowByte.size(), 0);
|
||||
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempBasebandBoardLowByte.size(), 0);
|
||||
rawPacketLen = tempBasebandBoardLowByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
@ -352,8 +355,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
rawTempBasebandBoard |= convertHexStringToUint8(
|
||||
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
|
||||
tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
|
||||
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
||||
<< std::endl;
|
||||
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
|
||||
<< std::endl;
|
||||
break;
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
||||
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
||||
@ -364,8 +367,8 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
}
|
||||
rawTempPowerAmplifier = 0;
|
||||
rawTempPowerAmplifier = convertHexStringToUint8(reinterpret_cast<const char*>(
|
||||
packet + SYRLINKS::MESSAGE_HEADER_SIZE))
|
||||
<< 8;
|
||||
packet + SYRLINKS::MESSAGE_HEADER_SIZE))
|
||||
<< 8;
|
||||
break;
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
||||
result = verifyReply(packet, SYRLINKS::READ_ONE_REGISTER_REPLY_SIE);
|
||||
@ -378,7 +381,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
reinterpret_cast<const char*>(packet + SYRLINKS::MESSAGE_HEADER_SIZE));
|
||||
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
|
||||
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
|
||||
<< std::endl;
|
||||
<< std::endl;
|
||||
break;
|
||||
default: {
|
||||
sif::debug << "SyrlinksHkHandler::interpretDeviceReply: Unknown device reply id" << std::endl;
|
||||
|
@ -1,10 +1,11 @@
|
||||
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "devices/powerSwitcherList.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
||||
|
@ -91,16 +91,17 @@ static constexpr DeviceCommandId_t SETUP_CMD = 1;
|
||||
static constexpr DeviceCommandId_t READ_TEMP_EXT = 2;
|
||||
static constexpr DeviceCommandId_t READ_WITH_TEMP_EXT = 3;
|
||||
|
||||
enum NormalSubmodes {
|
||||
ALL_OFF = 0,
|
||||
SOLID_STATE_RELAYS_ADC_ON = 1,
|
||||
DRO_ON = 2,
|
||||
X8_ON = 3,
|
||||
TX_ON = 4,
|
||||
MPA_ON = 5,
|
||||
HPA_ON = 6
|
||||
enum NormalSubmodeBits {
|
||||
SOLID_STATE_RELAYS_ADC_ON = 0,
|
||||
DRO_ON = 1,
|
||||
X8_ON = 2,
|
||||
TX_ON = 3,
|
||||
MPA_ON = 4,
|
||||
HPA_ON = 5
|
||||
};
|
||||
|
||||
static constexpr Submode_t ALL_OFF_SUBMODE = 0;
|
||||
|
||||
// 12 ADC values * 2 + trailing zero
|
||||
static constexpr size_t ADC_REPLY_SIZE = 25;
|
||||
// Conversion byte + 24 * zero
|
||||
|
@ -143,13 +143,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
||||
cmdSeq(helper.mgm1Rm3100IdSideA, helper.mgm1SideAMode, ModeTableIdx::MGM_1_A);
|
||||
if (gpsUsable) {
|
||||
gpioHandler(gpioIds::GNSS_0_NRESET, true,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 high (used GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 high (used GNSS)");
|
||||
gpioHandler(gpioIds::GNSS_1_NRESET, false,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 low (unused GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 low (unused GNSS)");
|
||||
gpioHandler(gpioIds::GNSS_SELECT, false,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select low");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -168,13 +168,13 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
||||
cmdSeq(helper.mgm3Rm3100IdSideB, helper.mgm3SideBMode, ModeTableIdx::MGM_3_B);
|
||||
if (gpsUsable) {
|
||||
gpioHandler(gpioIds::GNSS_0_NRESET, false,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 low (unused GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 low (unused GNSS)");
|
||||
gpioHandler(gpioIds::GNSS_1_NRESET, true,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 high (used GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 high (used GNSS)");
|
||||
gpioHandler(gpioIds::GNSS_SELECT, true,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull GNSS select high");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -191,11 +191,11 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
||||
ReturnValue_t status = RETURN_OK;
|
||||
if (gpsUsable) {
|
||||
gpioHandler(gpioIds::GNSS_0_NRESET, true,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 high (used GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 0 high (used GNSS)");
|
||||
gpioHandler(gpioIds::GNSS_1_NRESET, true,
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 high (used GNSS)");
|
||||
"AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
|
||||
"of GNSS 1 high (used GNSS)");
|
||||
if (defaultSubmode == Submodes::A_SIDE) {
|
||||
status = gpioIF->pullLow(gpioIds::GNSS_SELECT);
|
||||
} else {
|
||||
@ -245,7 +245,7 @@ void AcsBoardAssembly::selectGpsInDualMode(duallane::Submodes side) {
|
||||
|
||||
void AcsBoardAssembly::gpioHandler(gpioId_t gpio, bool high, std::string error) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
if(high) {
|
||||
if (high) {
|
||||
result = gpioIF->pullHigh(gpio);
|
||||
} else {
|
||||
result = gpioIF->pullLow(gpio);
|
||||
|
Reference in New Issue
Block a user