diff --git a/bsp_q7s/fmObjectFactory.cpp b/bsp_q7s/fmObjectFactory.cpp index 561786e8..06c41e49 100644 --- a/bsp_q7s/fmObjectFactory.cpp +++ b/bsp_q7s/fmObjectFactory.cpp @@ -37,7 +37,7 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_SYRLINKS == 1 createSyrlinksComponents(pwrSwitcher); #endif /* OBSW_ADD_SYRLINKS == 1 */ - createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher); + createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 diff --git a/linux/ObjectFactory.cpp b/linux/ObjectFactory.cpp index 3e760c1f..0e24b5fc 100644 --- a/linux/ObjectFactory.cpp +++ b/linux/ObjectFactory.cpp @@ -191,7 +191,7 @@ void ObjectFactory::createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiCo } void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, - PowerSwitchIF* pwrSwitcher) { + PowerSwitchIF* pwrSwitcher, SpiComIF* comIF) { using namespace gpio; GpioCookie* rtdGpioCookie = new GpioCookie; @@ -288,6 +288,10 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, std::array rtds = {}; RtdFdir* rtdFdir = nullptr; bool useDirectHandler = false; + if (not useDirectHandler) { + // Create special low level reader communication interface + new Max31865RtdReader(objects::SPI_RTD_COM_IF, comIF); + } auto directRtdsCreator = [&](uint8_t idx) { auto typedHandler = new Max31865PT1000Handler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdCookies[idx]); @@ -298,7 +302,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF, Max31865ReaderCookie* rtdLowLevelCookie = new Max31865ReaderCookie(rtdInfos[idx].first, idx, rtdInfos[idx].second, rtdCookies[idx]); auto typedHandler = - new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_MAIN_COM_IF, rtdLowLevelCookie); + new Max31865EiveHandler(rtdInfos[idx].first, objects::SPI_RTD_COM_IF, rtdLowLevelCookie); rtds[idx] = typedHandler; typedHandler->setDeviceInfo(idx, rtdInfos[idx].second); }; diff --git a/linux/ObjectFactory.h b/linux/ObjectFactory.h index 0ba78360..a5642729 100644 --- a/linux/ObjectFactory.h +++ b/linux/ObjectFactory.h @@ -12,7 +12,8 @@ namespace ObjectFactory { void createSunSensorComponents(GpioIF* gpioComIF, SpiComIF* spiComIF, PowerSwitchIF* pwrSwitcher, std::string spiDev); -void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); +void createRtdComponents(std::string spiDev, GpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher, + SpiComIF* comIF); void gpioChecker(ReturnValue_t result, std::string output); diff --git a/linux/devices/Max31865RtdLowlevelHandler.cpp b/linux/devices/Max31865RtdLowlevelHandler.cpp index 32a700b7..75503a94 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.cpp +++ b/linux/devices/Max31865RtdLowlevelHandler.cpp @@ -2,8 +2,8 @@ #include -Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* comIF) - : SystemObject(objectId), rtds(EiveMax31855::NUM_RTDS), comIF(comIF) { +Max31865RtdReader::Max31865RtdReader(object_id_t objectId, SpiComIF* lowLevelComIF) + : SystemObject(objectId), rtds(EiveMax31855::NUM_RTDS), comIF(lowLevelComIF) { readerMutex = MutexFactory::instance()->createMutex(); } diff --git a/linux/devices/Max31865RtdLowlevelHandler.h b/linux/devices/Max31865RtdLowlevelHandler.h index 8194b1a8..0afc25c7 100644 --- a/linux/devices/Max31865RtdLowlevelHandler.h +++ b/linux/devices/Max31865RtdLowlevelHandler.h @@ -38,7 +38,7 @@ class Max31865RtdReader : public SystemObject, public ExecutableObjectIF, public DeviceCommunicationIF { public: - Max31865RtdReader(object_id_t objectId, SpiComIF* comIF); + Max31865RtdReader(object_id_t objectId, SpiComIF* lowLevelComIF); [[noreturn]] ReturnValue_t performOperation(uint8_t operationCode) override; diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 22527c3e..05d45620 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -50,6 +50,7 @@ enum sourceObjects : uint32_t { SPI_MAIN_COM_IF = 0x49020004, GPIO_IF = 0x49010005, SPI_RW_COM_IF = 0x49020005, + SPI_RTD_COM_IF = 0x49020006, /* Custom device handler */ PCDU_HANDLER = 0x442000A1,