diff --git a/linux/obc/AxiPtmeConfig.h b/linux/obc/AxiPtmeConfig.h index c86bb429..9a048308 100644 --- a/linux/obc/AxiPtmeConfig.h +++ b/linux/obc/AxiPtmeConfig.h @@ -37,6 +37,8 @@ class AxiPtmeConfig : public SystemObject { * The default implementation of the PTME generates a clock where the high level is * only one bit clock period long. This might be too short to match the setup and hold * times of the S-and transceiver. + * Default: Enables TX clock manipulator + * */ ReturnValue_t enableTxclockManipulator(); ReturnValue_t disableTxclockManipulator(); @@ -47,6 +49,7 @@ class AxiPtmeConfig : public SystemObject { * Enable inversion will update data on falling edge (not the configuration required by the * syrlinks) * Disable clock inversion. Data updated on rising edge. + * Default: Inversion is disabled */ ReturnValue_t enableTxclockInversion(); ReturnValue_t disableTxclockInversion(); @@ -54,7 +57,7 @@ class AxiPtmeConfig : public SystemObject { private: // Address of register storing the bitrate configuration parameter static const uint32_t CADU_BITRATE_REG = 0x0; - // Address to register storing common configuration parameters + // Address of register storing common configuration parameters static const uint32_t COMMON_CONFIG_REG = 0x4; static const uint32_t ADRESS_DIVIDER = 4; diff --git a/mission/devices/SyrlinksHkHandler.cpp b/mission/devices/SyrlinksHkHandler.cpp index e8680a74..31549af5 100644 --- a/mission/devices/SyrlinksHkHandler.cpp +++ b/mission/devices/SyrlinksHkHandler.cpp @@ -5,13 +5,12 @@ #include "OBSWConfig.h" SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch, Gpio fault) + power::Switch_t powerSwitch) : DeviceHandlerBase(objectId, comIF, comCookie), rxDataset(this), txDataset(this), temperatureSet(this), - powerSwitch(powerSwitch), - fault(fault){ + powerSwitch(powerSwitch) { if (comCookie == NULL) { sif::warning << "SyrlinksHkHandler: Invalid com cookie" << std::endl; } @@ -20,18 +19,19 @@ SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, Co SyrlinksHkHandler::~SyrlinksHkHandler() {} void SyrlinksHkHandler::doStartUp() { - switch (startupState) { - case StartupState::OFF: { - startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; - break; - } - case StartupState::DONE: { - setMode(_MODE_TO_ON); - break; - } - default: - break; - } +// switch (startupState) { +// case StartupState::OFF: { +// startupState = StartupState::ENABLE_TEMPERATURE_PROTECTION; +// break; +// } +// case StartupState::DONE: { +// setMode(_MODE_TO_ON); +// break; +// } +// default: +// break; +// } + setMode(_MODE_TO_ON); } void SyrlinksHkHandler::doShutDown() { setMode(_MODE_POWER_DOWN); } @@ -202,6 +202,27 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic rememberCommandId = syrlinks::TEMP_BASEBAND_BOARD_LOW_BYTE; rawPacket = commandBuffer; return RETURN_OK; + case (syrlinks::SET_WAVEFORM_OQPSK): + setWaveformOQPSK.copy(reinterpret_cast(commandBuffer), + setWaveformOQPSK.size(), 0); + rawPacketLen = setWaveformOQPSK.size(); + rememberCommandId = syrlinks::SET_WAVEFORM_OQPSK; + rawPacket = commandBuffer; + return RETURN_OK; + case (syrlinks::SET_WAVEFORM_BPSK): + setWaveformBPSK.copy(reinterpret_cast(commandBuffer), + setWaveformBPSK.size(), 0); + rawPacketLen = setWaveformBPSK.size(); + rememberCommandId = syrlinks::SET_WAVEFORM_BPSK; + rawPacket = commandBuffer; + return RETURN_OK; + case (syrlinks::SET_SECOND_CONFIG): + setSecondConfiguration.copy(reinterpret_cast(commandBuffer), + setSecondConfiguration.size(), 0); + rawPacketLen = setSecondConfiguration.size(); + rememberCommandId = syrlinks::SET_SECOND_CONFIG; + rawPacket = commandBuffer; + return RETURN_OK; default: return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; } @@ -219,6 +240,12 @@ void SyrlinksHkHandler::fillCommandAndReplyMap() { true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::WRITE_LCL_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_OQPSK, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_WAVEFORM_BPSK, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); + this->insertInCommandAndReplyMap(syrlinks::SET_SECOND_CONFIG, 1, nullptr, syrlinks::ACK_SIZE, + false, true, syrlinks::ACK_REPLY); this->insertInCommandAndReplyMap(syrlinks::READ_LCL_CONFIG, 1, nullptr, syrlinks::READ_ONE_REGISTER_REPLY_SIE); this->insertInCommandAndReplyMap(syrlinks::READ_TX_STATUS, 1, &txDataset, @@ -622,7 +649,7 @@ void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) { void SyrlinksHkHandler::setNormalDatapoolEntriesInvalid() {} -uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 500; } +uint32_t SyrlinksHkHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 5000; } ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, LocalDataPoolManager& poolManager) { @@ -638,6 +665,8 @@ ReturnValue_t SyrlinksHkHandler::initializeLocalDataPool(localpool::DataPool& lo localDataPoolMap.emplace(syrlinks::TX_STATUS, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TX_WAVEFORM, new PoolEntry({0})); localDataPoolMap.emplace(syrlinks::TX_AGC_VALUE, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TEMP_BASEBAND_BOARD, new PoolEntry({0})); + localDataPoolMap.emplace(syrlinks::TEMP_POWER_AMPLIFIER, new PoolEntry({0})); return HasReturnvaluesIF::RETURN_OK; } diff --git a/mission/devices/SyrlinksHkHandler.h b/mission/devices/SyrlinksHkHandler.h index 9b8ac2c9..739db450 100644 --- a/mission/devices/SyrlinksHkHandler.h +++ b/mission/devices/SyrlinksHkHandler.h @@ -19,7 +19,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { public: SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, - power::Switch_t powerSwitch, Gpio fault); + power::Switch_t powerSwitch); virtual ~SyrlinksHkHandler(); /** @@ -67,8 +67,12 @@ class SyrlinksHkHandler : public DeviceHandlerBase { std::string setTxModeStandby = ""; /** W - write, 04 - 4 bytes in data field, 01 - value, 40 register to write value */ std::string setTxModeModulation = ""; +// std::string setSecondConfiguration = ""; + std::string setSecondConfiguration = ""; std::string setTxModeCw = ""; std::string writeLclConfig = ""; + std::string setWaveformOQPSK = ""; + std::string setWaveformBPSK = ""; std::string readTxStatus = ""; std::string readTxWaveform = ""; std::string readTxAgcValueHighByte = ""; @@ -91,8 +95,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase { const power::Switch_t powerSwitch = power::NO_SWITCH; - Gpio fault; - uint8_t agcValueHighByte = 0; uint16_t rawTempPowerAmplifier = 0; uint16_t rawTempBasebandBoard = 0; @@ -109,7 +111,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase { StartupState startupState = StartupState::OFF; - bool debug = false; + bool debug = true; /** * This object is used to store the id of the next command to execute. This controls the diff --git a/mission/devices/devicedefinitions/SyrlinksDefinitions.h b/mission/devices/devicedefinitions/SyrlinksDefinitions.h index e8973621..bf964063 100644 --- a/mission/devices/devicedefinitions/SyrlinksDefinitions.h +++ b/mission/devices/devicedefinitions/SyrlinksDefinitions.h @@ -24,6 +24,10 @@ static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_HIGH_BYTE = 13; static const DeviceCommandId_t TEMP_POWER_AMPLIFIER_LOW_BYTE = 14; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_HIGH_BYTE = 15; static const DeviceCommandId_t TEMP_BASEBAND_BOARD_LOW_BYTE = 16; +static const DeviceCommandId_t SET_WAVEFORM_OQPSK = 17; +static const DeviceCommandId_t SET_WAVEFORM_BPSK = 18; +static const DeviceCommandId_t SET_SECOND_CONFIG = 19; +static const DeviceCommandId_t ENABLE_DEBUG = 20; /** Size of a simple transmission success response */ static const uint8_t ACK_SIZE = 12; diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index a916361b..1c4fde09 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -91,9 +91,9 @@ class CCSDSHandler : public SystemObject, static const ActionId_t ARBITRARY_RATE = 4; static const ActionId_t ENABLE_TX_CLK_MANIPULATOR = 5; static const ActionId_t DISABLE_TX_CLK_MANIPULATOR = 6; - // Will update data with respect to tx clock signal of cadu bitsream on rising edge + // Will update data with respect to tx clock signal of cadu bitstream on rising edge static const ActionId_t UPDATE_ON_RISING_EDGE = 7; - // Will update data with respect to tx clock signal of cadu bitsream on falling edge + // Will update data with respect to tx clock signal of cadu bitstream on falling edge static const ActionId_t UPDATE_ON_FALLING_EDGE = 8; // Syrlinks supports two bitrates (200 kbps and 1000 kbps) diff --git a/tmtc b/tmtc index 5ac8912d..811aedce 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 5ac8912dd2b47f01f66093187f15a9f9824ffd66 +Subproject commit 811aedce9762daa87e268b8832f23b0d28f8a714