diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 7f8453c9..e6e399cb 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -6,7 +6,7 @@ namespace q7s { static constexpr char SPI_DEFAULT_DEV[] = "/dev/spidev2.0"; static constexpr char SPI_RW_DEV[] = "/dev/spidev3.0"; -static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-1"; +static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-0"; static constexpr char UART_GNSS_DEV[] = "/dev/ttyUL0"; static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ttyUL2"; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index bf6bb2ca..bceb303d 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -254,6 +254,7 @@ void initmission::createPstTasks(TaskFactory& factory, if (result != HasReturnvaluesIF::RETURN_OK) { sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; } + taskVec.push_back(i2cPst); FixedTimeslotTaskIF* gomSpacePstTask = factory.createFixedTimeslotTask( "GS_PST_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 49c5f209..c7e039f9 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -142,9 +142,15 @@ void ObjectFactory::produce(void* args) { createRtdComponents(gpioComIF); #endif /* OBSW_ADD_RTD_DEVICES == 1 */ +#if OBSW_ADD_MGT == 1 I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV); - new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); + auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); +#if OBSW_DEBUG_IMTQ == 1 + imtqHandler->setToGoToNormal(true); + imtqHandler->setStartUpImmediately(); +#endif +#endif createReactionWheelComponents(gpioComIF); #if OBSW_ADD_PLOC_MPSOC == 1 diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index f52b2f9a..00d2d9fd 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -40,6 +40,7 @@ debugging. */ #define OBSW_TC_FROM_PDEC 1 #define OBSW_ENABLE_TIMERS 1 +#define OBSW_ADD_MGT 1 #define OBSW_ADD_STAR_TRACKER 0 #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 @@ -53,22 +54,6 @@ debugging. */ #define OBSW_ADD_SYRLINKS 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 -#elif defined RASPBERRY_PI - -#define OBSW_ENABLE_TIMERS 1 -#define OBSW_ADD_STAR_TRACKER 0 -#define OBSW_ADD_PLOC_SUPERVISOR 0 -#define OBSW_ADD_PLOC_MPSOC 0 -#define OBSW_ADD_SUN_SENSORS 0 -#define OBSW_ADD_ACS_BOARD 0 -#define OBSW_ADD_GPS_0 0 -#define OBSW_ADD_GPS_1 0 -#define OBSW_ADD_RW 0 -#define OBSW_ADD_RTD_DEVICES 0 -#define OBSW_ADD_TMP_DEVICES 0 -#define OBSW_ADD_RAD_SENSORS 0 -#define OBSW_ADD_SYRLINKS 0 - #endif /*******************************************************************/ @@ -100,7 +85,7 @@ debugging. */ #define OBSW_DEBUG_GPS 0 #define OBSW_DEBUG_ACU 0 #define OBSW_DEBUG_SYRLINKS 0 -#define OBSW_DEBUG_IMQT 0 +#define OBSW_DEBUG_IMTQ 0 #define OBSW_DEBUG_RAD_SENSOR 0 #define OBSW_DEBUG_SUS 0 #define OBSW_DEBUG_RTD 0 @@ -110,6 +95,24 @@ debugging. */ #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 +#ifdef RASPBERRY_PI + +#define OBSW_ENABLE_TIMERS 1 +#define OBSW_ADD_STAR_TRACKER 0 +#define OBSW_ADD_PLOC_SUPERVISOR 0 +#define OBSW_ADD_PLOC_MPSOC 0 +#define OBSW_ADD_SUN_SENSORS 0 +#define OBSW_ADD_ACS_BOARD 0 +#define OBSW_ADD_GPS_0 0 +#define OBSW_ADD_GPS_1 0 +#define OBSW_ADD_RW 0 +#define OBSW_ADD_RTD_DEVICES 0 +#define OBSW_ADD_TMP_DEVICES 0 +#define OBSW_ADD_RAD_SENSORS 0 +#define OBSW_ADD_SYRLINKS 0 + +#endif + /*******************************************************************/ /** Hardcoded */ /*******************************************************************/ diff --git a/linux/fsfwconfig/devices/addresses.h b/linux/fsfwconfig/devices/addresses.h index 5ef82788..a69cdaf9 100644 --- a/linux/fsfwconfig/devices/addresses.h +++ b/linux/fsfwconfig/devices/addresses.h @@ -45,9 +45,10 @@ enum logicalAddresses : address_t { }; enum i2cAddresses : address_t { - IMTQ = 16, - TMP1075_TCS_1 = 72, - TMP1075_TCS_2 = 73, + BPX_BATTERY = 0x07, + IMTQ = 0x10, + TMP1075_TCS_1 = 0x48, + TMP1075_TCS_2 = 0x49, }; enum spiAddresses : address_t { diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 0675cf0d..70119272 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -519,11 +519,13 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) { // Length of a communication cycle uint32_t length = thisSequence->getPeriodMs(); +#if OBSW_ADD_MGT == 1 thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); +#endif if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { sif::error << "I2C PST initialization failed" << std::endl; return HasReturnvaluesIF::RETURN_FAILED; diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 3bab5367..e2984ed8 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -19,10 +19,12 @@ - + @@ -31,6 +33,8 @@ @@ -38,6 +42,8 @@ @@ -79,6 +85,8 @@ @@ -87,6 +95,8 @@ @@ -94,6 +104,8 @@ @@ -137,6 +149,8 @@