From 1a17770bbc827f9661e6c8fceb08de802bebb268 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 11 Nov 2022 18:52:12 +0100 Subject: [PATCH] all TMP1075 dev except the OBC IF board one working --- bsp_q7s/boardconfig/busConf.h | 3 +- bsp_q7s/core/ObjectFactory.cpp | 9 ++- .../pollingSequenceFactory.cpp | 70 +++++++++---------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 1db53d3e..7b50af4e 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -8,7 +8,8 @@ static constexpr uint32_t SPI_MAIN_BUS_LOCK_TIMEOUT = 50; static constexpr char SPI_RW_DEV[] = "/dev/spi_rw"; -static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c_eive"; +static constexpr char I2C_PL_EIVE[] = "/dev/i2c_eive"; +static constexpr char I2C_PS_EIVE[] = "/dev/i2c-2"; static constexpr char UART_GNSS_DEV[] = "/dev/gps0"; static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul_plmpsoc"; diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index f05dfc46..83d6d1c1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -135,7 +135,7 @@ void ObjectFactory::createTmpComponents() { for (size_t idx = 0; idx < tmpDevIds.size(); idx++) { tmpDevCookies.push_back( - new I2cCookie(tmpDevIds[idx].second, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV)); + new I2cCookie(tmpDevIds[idx].second, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_PS_EIVE)); auto* tmpDevHandler = new Tmp1075Handler(tmpDevIds[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]); // TODO: Remove this after TCS subsystem was added @@ -904,7 +904,7 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { new SpiTestClass(objects::SPI_TEST, gpioComIF); #endif #if OBSW_ADD_I2C_TEST_CODE == 1 - new I2cTestClass(objects::I2C_TEST, q7s::I2C_DEFAULT_DEV); + new I2cTestClass(objects::I2C_TEST, q7s::I2C_PL_EIVE); #endif #if OBSW_ADD_UART_TEST_CODE == 1 // auto* reader= new ScexUartReader(objects::SCEX_UART_READER); @@ -926,8 +926,7 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) { } void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { - I2cCookie* imtqI2cCookie = - new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); + I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_PL_EIVE); auto imtqHandler = new ImtqHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie, pcdu::Switches::PDU1_CH3_MGT_5V); imtqHandler->setPowerSwitcher(pwrSwitcher); @@ -943,7 +942,7 @@ void ObjectFactory::createImtqComponents(PowerSwitchIF* pwrSwitcher) { } void ObjectFactory::createBpxBatteryComponent() { - I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV); + I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_PL_EIVE); BpxBatteryHandler* bpxHandler = new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie); bpxHandler->setStartUpImmediately(); diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 47245acc..cb30ce5a 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -433,43 +433,43 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { #if OBSW_ADD_TMP_DEVICES == 1 thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_0, length * 0.4, DeviceHandlerIF::GET_READ); thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::GET_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_TCS_1, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_0, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_PLPCDU_1, length * 0.4, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_IF_BOARD, length * 0.4, DeviceHandlerIF::GET_READ); // thisSequence->addSlot(objects::TMP1075_HANDLER_OBC_IF_BOARD, length * 0.4, // DeviceHandlerIF::PERFORM_OPERATION); // thisSequence->addSlot(objects::TMP1075_HANDLER_OBC_IF_BOARD, length * 0.4,