Merge remote-tracking branch 'origin/develop' into heater_handling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2023-01-20 14:25:44 +01:00
26 changed files with 534 additions and 385 deletions

View File

@ -28,7 +28,8 @@
#include "mission/system/tree/payloadModeTree.h"
void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher, std::string spiDev) {
PowerSwitchIF* pwrSwitcher, std::string spiDev,
bool swap0And6) {
using namespace gpio;
GpioCookie* gpioCookieSus = new GpioCookie();
GpioCallback* susgpio = nullptr;
@ -75,7 +76,11 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
#if OBSW_ADD_SUN_SENSORS == 1
SusFdir* fdir = nullptr;
std::array<SusHandler*, 12> susHandlers = {};
SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, SUS::MAX_CMD_SIZE,
gpioId_t gpioId = gpioIds::CS_SUS_0;
if (swap0And6) {
gpioId = gpioIds::CS_SUS_6;
}
SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioId, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
susHandlers[0] =
new SusHandler(objects::SUS_0_N_LOC_XFYFZM_PT_XF, 0, objects::SPI_MAIN_COM_IF, spiCookie);
@ -117,8 +122,12 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo
fdir = new SusFdir(objects::SUS_5_N_LOC_XFYMZB_PT_ZB);
susHandlers[5]->setCustomFdir(fdir);
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, SUS::MAX_CMD_SIZE,
spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
gpioId = gpioIds::CS_SUS_6;
if (swap0And6) {
gpioId = gpioIds::CS_SUS_0;
}
spiCookie = new SpiCookie(addresses::SUS_6, gpioId, SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE,
spi::SUS_MAX1227_SPI_FREQ);
susHandlers[6] =
new SusHandler(objects::SUS_6_R_LOC_XFYBZM_PT_XF, 6, objects::SPI_MAIN_COM_IF, spiCookie);
fdir = new SusFdir(objects::SUS_6_R_LOC_XFYBZM_PT_XF);

View File

@ -21,7 +21,7 @@ class AcsController;
namespace ObjectFactory {
void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher,
std::string spiDev);
std::string spiDev, bool swap0And6);
void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher,
SpiComIF* comIF);

View File

@ -143,7 +143,7 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() {
auto result = returnvalue::OK;
MutexGuard mg(readerMutex);
if (mg.getLockResult() != returnvalue::OK) {
sif::warning << "Max31865RtdReader::periodicReadReqHandling: Mutex lock failed" << std::endl;
sif::warning << "Max31865RtdReader::periodicReadHandling: Mutex lock failed" << std::endl;
return returnvalue::FAILED;
}
// Now read the RTD values
@ -154,6 +154,10 @@ ReturnValue_t Max31865RtdReader::periodicReadHandling() {
if (rtdIsActive(rtd->idx)) {
uint16_t rtdVal = 0;
bool faultBitSet = false;
result = writeCfgReg(rtd->spiCookie, BASE_CFG);
if (result != returnvalue::OK) {
handleSpiError(rtd, result, "writeCfgReg");
}
result = readRtdVal(rtd->spiCookie, rtdVal, faultBitSet);
if (result != returnvalue::OK) {
handleSpiError(rtd, result, "readRtdVal");
@ -282,7 +286,13 @@ ReturnValue_t Max31865RtdReader::sendMessage(CookieIF* cookie, const uint8_t* se
}
break;
}
case (EiveMax31855::RtdCommands::CFG):
case (EiveMax31855::RtdCommands::CFG): {
ReturnValue_t result = writeCfgReg(rtdCookie->spiCookie, BASE_CFG);
if (result != returnvalue::OK) {
handleSpiError(rtdCookie, result, "writeCfgReg");
}
break;
}
default: {
// TODO: Only implement if needed
break;

View File

@ -1,7 +1,7 @@
/**
* @brief Auto-generated event translation file. Contains 239 translations.
* @brief Auto-generated event translation file. Contains 240 translations.
* @details
* Generated on: 2022-12-01 17:07:27
* Generated on: 2023-01-18 16:08:56
*/
#include "translateEvents.h"
@ -89,6 +89,7 @@ const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER";
const char *STORE_ERROR_STRING = "STORE_ERROR";
const char *MSG_QUEUE_ERROR_STRING = "MSG_QUEUE_ERROR";
const char *SERIALIZATION_ERROR_STRING = "SERIALIZATION_ERROR";
const char *SAFE_RATE_VIOLATION_STRING = "SAFE_RATE_VIOLATION";
const char *SWITCH_CMD_SENT_STRING = "SWITCH_CMD_SENT";
const char *SWITCH_HAS_CHANGED_STRING = "SWITCH_HAS_CHANGED";
const char *SWITCHING_Q7S_DENIED_STRING = "SWITCHING_Q7S_DENIED";
@ -411,6 +412,8 @@ const char *translateEvents(Event event) {
return MSG_QUEUE_ERROR_STRING;
case (10802):
return SERIALIZATION_ERROR_STRING;
case (11200):
return SAFE_RATE_VIOLATION_STRING;
case (11300):
return SWITCH_CMD_SENT_STRING;
case (11301):

View File

@ -1,8 +1,8 @@
/**
* @brief Auto-generated object translation file.
* @details
* Contains 148 translations.
* Generated on: 2022-12-01 17:07:27
* Contains 150 translations.
* Generated on: 2023-01-18 16:08:56
*/
#include "translateObjects.h"
@ -92,8 +92,10 @@ const char *I2C_COM_IF_STRING = "I2C_COM_IF";
const char *CSP_COM_IF_STRING = "CSP_COM_IF";
const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR";
const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR";
const char *TMTC_BRIDGE_STRING = "TMTC_BRIDGE";
const char *TMTC_POLLING_TASK_STRING = "TMTC_POLLING_TASK";
const char *TCP_TMTC_SERVER_STRING = "TCP_TMTC_SERVER";
const char *UDP_TMTC_SERVER_STRING = "UDP_TMTC_SERVER";
const char *TCP_TMTC_POLLING_TASK_STRING = "TCP_TMTC_POLLING_TASK";
const char *UDP_TMTC_POLLING_TASK_STRING = "UDP_TMTC_POLLING_TASK";
const char *FILE_SYSTEM_HANDLER_STRING = "FILE_SYSTEM_HANDLER";
const char *SDC_MANAGER_STRING = "SDC_MANAGER";
const char *PTME_STRING = "PTME";
@ -330,9 +332,13 @@ const char *translateObject(object_id_t object) {
case 0x50000200:
return PUS_PACKET_DISTRIBUTOR_STRING;
case 0x50000300:
return TMTC_BRIDGE_STRING;
return TCP_TMTC_SERVER_STRING;
case 0x50000301:
return UDP_TMTC_SERVER_STRING;
case 0x50000400:
return TMTC_POLLING_TASK_STRING;
return TCP_TMTC_POLLING_TASK_STRING;
case 0x50000401:
return UDP_TMTC_POLLING_TASK_STRING;
case 0x50000500:
return FILE_SYSTEM_HANDLER_STRING;
case 0x50000550:

View File

@ -9,8 +9,12 @@ PdecConfig::~PdecConfig() {}
void PdecConfig::initialize() {
uint32_t word = 0;
word |= (VERSION_ID << 30);
// Setting the bypass flag and the control command flag should not have any
// implication on the operation of the PDEC IP Core
word |= (BYPASS_FLAG << 29);
word |= (CONTROL_COMMAND_FLAG << 28);
word |= (RESERVED_FIELD_A << 26);
word |= (SPACECRAFT_ID << 16);
word |= (VIRTUAL_CHANNEL << 10);