Merge pull request 'Make OBSW compatible to prospective FW v5.0.0' (#734) from tmp-devs-to-q7-i2c into main
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #734
This commit is contained in:
Robin Müller 2023-07-10 11:19:35 +02:00
commit 3f4a34d616
6 changed files with 18 additions and 15 deletions

View File

@ -24,6 +24,8 @@ will consitute of a breaking change warranting a new major release:
runtime now. This makes it possible to check the firmware version earlier.
- The TCS controller will now always command heaters OFF when being blind for thermal
components (no sensors available), irrespective of current switch state.
- Make OBSW compatible to prospective FW version v5.0.0, where the Q7 I2C devices were
moved to a PL I2C block and the TMP sensor devices were moved to the PS I2C0.
## Fixed

View File

@ -12,6 +12,9 @@ static constexpr char SPI_RW_DEV[] = "/dev/spi_rw";
static constexpr char I2C_PL_EIVE[] = "/dev/i2c_pl";
//! I2C bus using the I2C peripheral of the ARM processing system (PS)
static constexpr char I2C_PS_EIVE[] = "/dev/i2c_ps";
//! I2C bus using the first I2C peripheral of the ARM processing system (PS).
//! Named like this because it is used by default for the Q7 devices.
static constexpr char I2C_Q7_EIVE[] = "/dev/i2c_q7";
static constexpr char UART_GNSS_DEV[] = "/dev/gps0";
static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul_plmpsoc";

View File

@ -68,11 +68,7 @@ void ObjectFactory::produce(void* args) {
{objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
}};
const char* tmpI2cDev = q7s::I2C_PS_EIVE;
if (core::FW_VERSION_MAJOR >= 4) {
tmpI2cDev = q7s::I2C_PL_EIVE;
}
createTmpComponents(tmpDevsToAdd, tmpI2cDev);
createTmpComponents(tmpDevsToAdd);
dummy::Tmp1075Cfg tmpCfg{};
tmpCfg.addTcsBrd0 = true;
tmpCfg.addTcsBrd1 = true;

View File

@ -77,11 +77,8 @@ void ObjectFactory::produce(void* args) {
// {objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
}};
const char* tmpI2cDev = q7s::I2C_PS_EIVE;
if (core::FW_VERSION_MAJOR >= 4) {
tmpI2cDev = q7s::I2C_PL_EIVE;
}
createTmpComponents(tmpDevsToAdd, tmpI2cDev);
createTmpComponents(tmpDevsToAdd);
#endif
createSolarArrayDeploymentComponents(*pwrSwitcher, *gpioComIF);
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher, *stackHandler);

View File

@ -161,13 +161,19 @@ void Factory::setStaticFrameworkObjectIds() {
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
void ObjectFactory::createTmpComponents(std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd,
const char* i2cDev) {
void ObjectFactory::createTmpComponents(
std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd) {
const char* tmpI2cDev = q7s::I2C_PS_EIVE;
if (core::FW_VERSION_MAJOR == 4) {
tmpI2cDev = q7s::I2C_PL_EIVE;
} else if (core::FW_VERSION_MAJOR >= 5) {
tmpI2cDev = q7s::I2C_Q7_EIVE;
}
std::vector<I2cCookie*> tmpDevCookies;
for (size_t idx = 0; idx < tmpDevsToAdd.size(); idx++) {
tmpDevCookies.push_back(
new I2cCookie(tmpDevsToAdd[idx].second, TMP1075::MAX_REPLY_LENGTH, i2cDev));
new I2cCookie(tmpDevsToAdd[idx].second, TMP1075::MAX_REPLY_LENGTH, tmpI2cDev));
auto* tmpDevHandler =
new Tmp1075Handler(tmpDevsToAdd[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]);
tmpDevHandler->setCustomFdir(new TmpDevFdir(tmpDevsToAdd[idx].first));

View File

@ -58,8 +58,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher
bool enableHkSets);
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler);
void createTmpComponents(std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd,
const char* i2cDev);
void createTmpComponents(std::vector<std::pair<object_id_t, address_t>> tmpDevsToAdd);
void createRadSensorChipSelect(LinuxLibgpioIF* gpioIF);
ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler);
void createAcsBoardGpios(GpioCookie& cookie);