v1.10.0 #220

Merged
meierj merged 592 commits from develop into main 2022-04-22 07:42:20 +02:00
6 changed files with 43 additions and 33 deletions
Showing only changes of commit ce41b3316c - Show all commits

View File

@ -354,58 +354,69 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI
SusHandler* susHandler0 =
new SusHandler(objects::SUS_0, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_0);
spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler1 =
new SusHandler(objects::SUS_1, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_1);
spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler2 =
new SusHandler(objects::SUS_2, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_2);
spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler3 =
new SusHandler(objects::SUS_3, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_3);
spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler4 =
new SusHandler(objects::SUS_4, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_4);
spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, std::string(q7s::SPI_DEFAULT_DEV),
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler5 =
new SusHandler(objects::SUS_5, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_5);
spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler6 =
new SusHandler(objects::SUS_6, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_6);
spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler7 =
new SusHandler(objects::SUS_7, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_7);
spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler8 =
new SusHandler(objects::SUS_8, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_8);
spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler9 =
new SusHandler(objects::SUS_9, objects::SPI_COM_IF, spiCookie, gpioComIF, gpioIds::CS_SUS_9);
spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler10 = new SusHandler(objects::SUS_10, objects::SPI_COM_IF, spiCookie,
gpioComIF, gpioIds::CS_SUS_10);
spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, q7s::SPI_DEFAULT_DEV,
SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
spiCookie =
new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE,
spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ);
SusHandler* susHandler11 = new SusHandler(objects::SUS_11, objects::SPI_COM_IF, spiCookie,
gpioComIF, gpioIds::CS_SUS_11);
static_cast<void>(susHandler0);

View File

@ -1,7 +1,6 @@
#include "simple.h"
#include "iostream"
#include "q7sConfig.h"
#if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1

2
fsfw

@ -1 +1 @@
Subproject commit 81f5b0c3bf3e602f5cc459dc39bc1e8885c932a7
Subproject commit 0d6d44f72fb28ba480482f5d8b2eee6f78d664ce

View File

@ -1,10 +1,11 @@
#include "SusHandler.h"
#include "OBSWConfig.h"
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/globalfunctions/arrayprinter.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
#include "OBSWConfig.h"
SusHandler::SusHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
LinuxLibgpioIF *gpioComIF, gpioId_t chipSelectId)
: DeviceHandlerBase(objectId, comIF, comCookie), divider(5), dataset(this) {}
@ -69,7 +70,7 @@ ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
}
case (ComStates::EXT_CLOCKED_TEMP): {
*id = SUS::READ_EXT_TIMED_TEMPS;
return buildCommandFromCommand(*id , nullptr, 0);
return buildCommandFromCommand(*id, nullptr, 0);
}
}
return NOTHING_TO_SEND;
@ -139,9 +140,9 @@ void SusHandler::fillCommandAndReplyMap() {
insertInCommandAndReplyMap(SUS::WRITE_SETUP, 1);
insertInCommandAndReplyMap(SUS::START_INT_TIMED_CONVERSIONS, 1);
insertInCommandAndReplyMap(SUS::READ_INT_TIMED_CONVERSIONS, 1, &dataset,
SUS::SIZE_READ_INT_CONVERSIONS);
SUS::SIZE_READ_INT_CONVERSIONS);
insertInCommandAndReplyMap(SUS::READ_EXT_TIMED_CONVERSIONS, 1, &dataset,
SUS::SIZE_READ_EXT_CONVERSIONS);
SUS::SIZE_READ_EXT_CONVERSIONS);
insertInCommandAndReplyMap(SUS::READ_EXT_TIMED_TEMPS, 1);
}
@ -184,7 +185,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8
dataset.ain4 = (packet[9] << 8) | packet[10];
dataset.ain5 = (packet[11] << 8) | packet[12];
// Read temperature in next read cycle
if(clkMode == ClkModes::EXT_CLOCKED_WITH_TEMP) {
if (clkMode == ClkModes::EXT_CLOCKED_WITH_TEMP) {
comState = ComStates::EXT_CLOCKED_TEMP;
}
printDataset();

View File

@ -5,8 +5,8 @@
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
#include "devicedefinitions/SusDefinitions.h"
#include "mission/devices/max1227.h"
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
#include "mission/devices/max1227.h"
/**
* @brief This is the device handler class for the SUS sensor based on the MAX1227 ADC.
@ -63,7 +63,7 @@ class SusHandler : public DeviceHandlerBase {
IDLE,
WRITE_SETUP,
EXT_CLOCKED_CONVERSIONS,
EXT_CLOCKED_TEMP,
EXT_CLOCKED_TEMP,
START_INT_CLOCKED_CONVERSIONS,
READ_INT_CLOCKED_CONVERSIONS
};

View File

@ -12,9 +12,8 @@ enum ScanModes : uint8_t {
N_ONCE = 0b11
};
uint8_t buildConvByte(ScanModes scanMode, uint8_t channel, bool readTemp);
}
} // namespace max1227
#endif /* MISSION_DEVICES_MAX1227_H_ */