Merge remote-tracking branch 'origin/develop' into mueller/tcs_subsystem
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
commit
0c681a06c7
@ -20,6 +20,8 @@ list yields a list of all related PRs for each release.
|
||||
- MAX3185 Low Level Handler and Device Handler: Simplifications and bugfixes to allow switching
|
||||
off without triggering unrequested replies
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/313
|
||||
- Add remaining missing TMP1075 device handlers.
|
||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/318
|
||||
|
||||
# [v1.15.0] 27.10.2022
|
||||
|
||||
|
16
README.md
16
README.md
@ -1108,11 +1108,19 @@ cat /proc/tty/driver
|
||||
|
||||
## I2C
|
||||
|
||||
Getting information about I2C device
|
||||
````
|
||||
Getting information about some I2C device
|
||||
|
||||
```sh
|
||||
ls /sys/class/i2c-dev/i2c-0/device/device/driver
|
||||
````
|
||||
This shows the memory mapping of /dev/i2c-0
|
||||
```
|
||||
This shows the memory mapping of `/dev/i2c-0`.
|
||||
|
||||
You can use the `i2cdetect` utility to scan for I2C devices.
|
||||
For example, to do this for bus 0 (`/dev/i2c-0`), you can use
|
||||
|
||||
```sh
|
||||
i2cdetect -r -y 0
|
||||
```
|
||||
|
||||
## CAN
|
||||
|
||||
|
@ -104,6 +104,7 @@
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_TMP1075 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
@ -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";
|
||||
|
@ -123,18 +123,25 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
||||
|
||||
void ObjectFactory::createTmpComponents() {
|
||||
I2cCookie* i2cCookieTmp1075tcs1 =
|
||||
new I2cCookie(addresses::TMP1075_TCS_1, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
|
||||
I2cCookie* i2cCookieTmp1075tcs2 =
|
||||
new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, q7s::I2C_DEFAULT_DEV);
|
||||
std::array<std::pair<object_id_t, address_t>, 5> tmpDevIds = {{
|
||||
{objects::TMP1075_HANDLER_TCS_0, addresses::TMP1075_TCS_0},
|
||||
{objects::TMP1075_HANDLER_TCS_1, addresses::TMP1075_TCS_1},
|
||||
{objects::TMP1075_HANDLER_PLPCDU_0, addresses::TMP1075_PLPCDU_0},
|
||||
{objects::TMP1075_HANDLER_PLPCDU_1, addresses::TMP1075_PLPCDU_1},
|
||||
{objects::TMP1075_HANDLER_IF_BOARD, addresses::TMP1075_IF_BOARD},
|
||||
}};
|
||||
std::vector<I2cCookie*> tmpDevCookies;
|
||||
|
||||
/* Temperature sensors */
|
||||
Tmp1075Handler* tmp1075Handler_1 =
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||
(void)tmp1075Handler_1;
|
||||
Tmp1075Handler* tmp1075Handler_2 =
|
||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||
(void)tmp1075Handler_2;
|
||||
for (size_t idx = 0; idx < tmpDevIds.size(); idx++) {
|
||||
tmpDevCookies.push_back(
|
||||
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
|
||||
// These devices are connected to the 3V3 stack and should be powered permanently. Therefore,
|
||||
// we set them to normal mode immediately here.
|
||||
tmpDevHandler->setModeNormal();
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF,
|
||||
@ -572,9 +579,9 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc
|
||||
}
|
||||
|
||||
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
UartCookie* syrlinksUartCookie =
|
||||
new UartCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
|
||||
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
auto* syrlinksUartCookie =
|
||||
new SerialCookie(objects::SYRLINKS_HK_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD,
|
||||
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
syrlinksUartCookie->setParityEven();
|
||||
|
||||
auto syrlinksFdir = new SyrlinksFdir(objects::SYRLINKS_HK_HANDLER);
|
||||
@ -602,8 +609,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
|
||||
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
|
||||
gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
|
||||
auto mpsocCookie =
|
||||
new UartCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
||||
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
new SerialCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD,
|
||||
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
|
||||
mpsocCookie->setNoFixedSizeReply();
|
||||
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
|
||||
auto* mpsocHandler = new PlocMPSoCHandler(
|
||||
@ -619,8 +626,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
|
||||
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
||||
gpioComIF->addGpios(supvGpioCookie);
|
||||
auto supervisorCookie =
|
||||
new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
|
||||
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
||||
new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV,
|
||||
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
|
||||
supervisorCookie->setNoFixedSizeReply();
|
||||
auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER);
|
||||
auto* supvHandler = new PlocSupervisorHandler(
|
||||
@ -896,7 +903,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);
|
||||
@ -905,9 +912,9 @@ void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
}
|
||||
|
||||
void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
|
||||
UartCookie* starTrackerCookie =
|
||||
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
|
||||
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
|
||||
auto* starTrackerCookie =
|
||||
new SerialCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
|
||||
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
|
||||
starTrackerCookie->setNoFixedSizeReply();
|
||||
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
||||
auto starTracker =
|
||||
@ -918,8 +925,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);
|
||||
@ -935,7 +941,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();
|
||||
|
@ -39,8 +39,12 @@ enum commonObjects : uint32_t {
|
||||
GPS_CONTROLLER = 0x44130045,
|
||||
|
||||
IMTQ_HANDLER = 0x44140014,
|
||||
TMP1075_HANDLER_1 = 0x44420004,
|
||||
TMP1075_HANDLER_2 = 0x44420005,
|
||||
TMP1075_HANDLER_TCS_0 = 0x44420004,
|
||||
TMP1075_HANDLER_TCS_1 = 0x44420005,
|
||||
TMP1075_HANDLER_PLPCDU_0 = 0x44420006,
|
||||
TMP1075_HANDLER_PLPCDU_1 = 0x44420007,
|
||||
TMP1075_HANDLER_IF_BOARD = 0x44420008,
|
||||
TMP1075_HANDLER_OBC_IF_BOARD = 0x44420009,
|
||||
PCDU_HANDLER = 0x442000A1,
|
||||
P60DOCK_HANDLER = 0x44250000,
|
||||
PDU1_HANDLER = 0x44250001,
|
||||
|
@ -23,8 +23,8 @@ TemperatureSensorsDummy::TemperatureSensorsDummy()
|
||||
ObjectManager::instance()->insert(objects::RTD_13_IC16_PLPCDU_HEATSPREADER, this);
|
||||
ObjectManager::instance()->insert(objects::RTD_14_IC17_TCS_BOARD, this);
|
||||
ObjectManager::instance()->insert(objects::RTD_15_IC18_IMTQ, this);
|
||||
ObjectManager::instance()->insert(objects::TMP1075_HANDLER_1, this);
|
||||
ObjectManager::instance()->insert(objects::TMP1075_HANDLER_2, this);
|
||||
ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_0, this);
|
||||
ObjectManager::instance()->insert(objects::TMP1075_HANDLER_TCS_1, this);
|
||||
}
|
||||
|
||||
ReturnValue_t TemperatureSensorsDummy::initialize() {
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 39946bff58db7c5ac9016ca3156abb059560d9cb
|
||||
Subproject commit e03e7f5260eb92d1903188c5ea14ea01616600ae
|
@ -326,7 +326,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
|
||||
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
|
||||
SdCardMountedIF& mountedIF, bool onImmediately,
|
||||
std::optional<power::Switch_t> switchId) {
|
||||
auto* cookie = new UartCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096);
|
||||
auto* cookie = new SerialCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096);
|
||||
cookie->setTwoStopBits();
|
||||
// cookie->setParityEven();
|
||||
auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER);
|
||||
|
@ -164,7 +164,7 @@ void UartTestClass::scexInit() {
|
||||
#else
|
||||
std::string devname = "/dev/ul-scex";
|
||||
#endif
|
||||
uartCookie = new UartCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096);
|
||||
uartCookie = new SerialCookie(this->getObjectId(), devname, UartBaudRate::RATE_57600, 4096);
|
||||
reader->setDebugMode(false);
|
||||
ReturnValue_t result = reader->initializeInterface(uartCookie);
|
||||
if (result != OK) {
|
||||
|
@ -57,7 +57,7 @@ class UartTestClass : public TestTask {
|
||||
scex::Cmds currCmd = scex::Cmds::PING;
|
||||
TestModes mode = TestModes::GPS;
|
||||
DleEncoder dleEncoder = DleEncoder();
|
||||
UartCookie* uartCookie = nullptr;
|
||||
SerialCookie* uartCookie = nullptr;
|
||||
size_t encodedLen = 0;
|
||||
lwgps_t gpsData = {};
|
||||
struct termios tty = {};
|
||||
|
@ -84,7 +84,7 @@ ReturnValue_t ScexUartReader::performOperation(uint8_t operationCode) {
|
||||
}
|
||||
|
||||
ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
|
||||
UartCookie *uartCookie = dynamic_cast<UartCookie *>(cookie);
|
||||
SerialCookie *uartCookie = dynamic_cast<SerialCookie *>(cookie);
|
||||
if (uartCookie == nullptr) {
|
||||
return FAILED;
|
||||
}
|
||||
|
@ -43,11 +43,14 @@ enum logicalAddresses : address_t {
|
||||
DUMMY_GPS1 = 131,
|
||||
};
|
||||
|
||||
enum i2cAddresses : address_t {
|
||||
enum I2cAddress : address_t {
|
||||
BPX_BATTERY = 0x07,
|
||||
IMTQ = 0x10,
|
||||
TMP1075_TCS_1 = 0x48,
|
||||
TMP1075_TCS_2 = 0x49,
|
||||
TMP1075_TCS_0 = 0x48,
|
||||
TMP1075_TCS_1 = 0x49,
|
||||
TMP1075_PLPCDU_0 = 0x4A,
|
||||
TMP1075_PLPCDU_1 = 0x4B,
|
||||
TMP1075_IF_BOARD = 0x4C,
|
||||
};
|
||||
|
||||
enum spiAddresses : address_t {
|
||||
|
@ -55,30 +55,6 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::PLPCDU_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_READ);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_TMP_DEVICES == 1
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_SUN_SENSORS == 1
|
||||
|
||||
@ -425,33 +401,78 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
return thisSequence->checkSequence();
|
||||
}
|
||||
|
||||
// I don't think this needs to be in a PST because linux takes care of bus serialization, but
|
||||
// keep it like this for now, it works
|
||||
ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
||||
// Length of a communication cycle
|
||||
uint32_t length = thisSequence->getPeriodMs();
|
||||
static_cast<void>(length);
|
||||
#if OBSW_ADD_MGT == 1
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.2, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.25, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.25, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
// These are actually part of another bus, but this works, so keep it like this for now
|
||||
#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_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);
|
||||
#endif
|
||||
static_cast<void>(length);
|
||||
return thisSequence->checkSequence();
|
||||
|
@ -38,8 +38,11 @@ ThermalController::ThermalController(object_id_t objectId)
|
||||
EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
||||
max31865Set14(objects::RTD_14_IC17_TCS_BOARD, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
||||
max31865Set15(objects::RTD_15_IC18_IMTQ, EiveMax31855::RtdCommands::EXCHANGE_SET_ID),
|
||||
tmp1075Set1(objects::TMP1075_HANDLER_1),
|
||||
tmp1075Set2(objects::TMP1075_HANDLER_2),
|
||||
tmp1075SetTcs0(objects::TMP1075_HANDLER_TCS_0),
|
||||
tmp1075SetTcs1(objects::TMP1075_HANDLER_TCS_1),
|
||||
tmp1075SetPlPcdu0(objects::TMP1075_HANDLER_PLPCDU_0),
|
||||
tmp1075SetPlPcdu1(objects::TMP1075_HANDLER_PLPCDU_1),
|
||||
tmp1075SetIfBoard(objects::TMP1075_HANDLER_IF_BOARD),
|
||||
susSet0(objects::SUS_0_N_LOC_XFYFZM_PT_XF),
|
||||
susSet1(objects::SUS_1_N_LOC_XBYFZM_PT_XB),
|
||||
susSet2(objects::SUS_2_N_LOC_XFYBZB_PT_YB),
|
||||
@ -128,10 +131,11 @@ ReturnValue_t ThermalController::initializeLocalDataPool(localpool::DataPool& lo
|
||||
new PoolEntry<float>({14.0}));
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_MAGNETTORQUER,
|
||||
new PoolEntry<float>({15.0}));
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_1,
|
||||
new PoolEntry<float>({15.0}));
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_2,
|
||||
new PoolEntry<float>({15.0}));
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_TCS_0, &tmp1075Tcs0);
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_TCS_1, &tmp1075Tcs1);
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_PLPCDU_0, &tmp1075PlPcdu0);
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_PLPCDU_1, &tmp1075PlPcdu1);
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SENSOR_TMP1075_IF_BOARD, &tmp1075IfBrd);
|
||||
|
||||
localDataPoolMap.emplace(thermalControllerDefinitions::SUS_0_N_LOC_XFYFZM_PT_XF,
|
||||
new PoolEntry<float>({0.0}));
|
||||
@ -415,23 +419,53 @@ void ThermalController::copySensors() {
|
||||
}
|
||||
|
||||
{
|
||||
PoolReadGuard pg111(&tmp1075Set1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg111.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.sensor_tmp1075_1.value = tmp1075Set1.temperatureCelcius.value;
|
||||
sensorTemperatures.sensor_tmp1075_1.setValid(tmp1075Set1.temperatureCelcius.isValid());
|
||||
if (not tmp1075Set1.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.sensor_tmp1075_1.value = INVALID_TEMPERATURE;
|
||||
PoolReadGuard pg(&tmp1075SetTcs0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.tmp1075Tcs0.value = tmp1075SetTcs0.temperatureCelcius.value;
|
||||
sensorTemperatures.tmp1075Tcs0.setValid(tmp1075SetTcs0.temperatureCelcius.isValid());
|
||||
if (not tmp1075SetTcs0.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.tmp1075Tcs0.value = INVALID_TEMPERATURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
PoolReadGuard pg112(&tmp1075Set2, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg112.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.sensor_tmp1075_2.value = tmp1075Set2.temperatureCelcius.value;
|
||||
sensorTemperatures.sensor_tmp1075_2.setValid(tmp1075Set2.temperatureCelcius.isValid());
|
||||
if (not tmp1075Set2.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.sensor_tmp1075_2.value = INVALID_TEMPERATURE;
|
||||
PoolReadGuard pg(&tmp1075SetTcs1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.tmp1075Tcs1.value = tmp1075SetTcs1.temperatureCelcius.value;
|
||||
sensorTemperatures.tmp1075Tcs1.setValid(tmp1075SetTcs1.temperatureCelcius.isValid());
|
||||
if (not tmp1075SetTcs1.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.tmp1075Tcs1.value = INVALID_TEMPERATURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
PoolReadGuard pg(&tmp1075SetPlPcdu0, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.tmp1075PlPcdu0.value = tmp1075SetPlPcdu0.temperatureCelcius.value;
|
||||
sensorTemperatures.tmp1075PlPcdu0.setValid(tmp1075SetPlPcdu0.temperatureCelcius.isValid());
|
||||
if (not tmp1075SetPlPcdu0.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.tmp1075PlPcdu0.value = INVALID_TEMPERATURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
PoolReadGuard pg(&tmp1075SetPlPcdu1, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.tmp1075PlPcdu1.value = tmp1075SetPlPcdu1.temperatureCelcius.value;
|
||||
sensorTemperatures.tmp1075PlPcdu1.setValid(tmp1075SetPlPcdu1.temperatureCelcius.isValid());
|
||||
if (not tmp1075SetPlPcdu1.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.tmp1075PlPcdu1.value = INVALID_TEMPERATURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
PoolReadGuard pg(&tmp1075SetIfBoard, MutexIF::TimeoutType::WAITING, MUTEX_TIMEOUT);
|
||||
if (pg.getReadResult() == returnvalue::OK) {
|
||||
sensorTemperatures.tmp1075IfBrd.value = tmp1075SetIfBoard.temperatureCelcius.value;
|
||||
sensorTemperatures.tmp1075IfBrd.setValid(tmp1075SetIfBoard.temperatureCelcius.isValid());
|
||||
if (not tmp1075SetIfBoard.temperatureCelcius.isValid()) {
|
||||
sensorTemperatures.tmp1075IfBrd.value = INVALID_TEMPERATURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -55,8 +55,11 @@ class ThermalController : public ExtendedControllerBase {
|
||||
MAX31865::Max31865Set max31865Set13;
|
||||
MAX31865::Max31865Set max31865Set14;
|
||||
MAX31865::Max31865Set max31865Set15;
|
||||
TMP1075::Tmp1075Dataset tmp1075Set1;
|
||||
TMP1075::Tmp1075Dataset tmp1075Set2;
|
||||
TMP1075::Tmp1075Dataset tmp1075SetTcs0;
|
||||
TMP1075::Tmp1075Dataset tmp1075SetTcs1;
|
||||
TMP1075::Tmp1075Dataset tmp1075SetPlPcdu0;
|
||||
TMP1075::Tmp1075Dataset tmp1075SetPlPcdu1;
|
||||
TMP1075::Tmp1075Dataset tmp1075SetIfBoard;
|
||||
|
||||
// SUS
|
||||
SUS::SusDataset susSet0;
|
||||
@ -75,6 +78,12 @@ class ThermalController : public ExtendedControllerBase {
|
||||
// Initial delay to make sure all pool variables have been initialized their owners
|
||||
Countdown initialCountdown = Countdown(DELAY);
|
||||
|
||||
PoolEntry<float> tmp1075Tcs0 = PoolEntry<float>(10.0);
|
||||
PoolEntry<float> tmp1075Tcs1 = PoolEntry<float>(10.0);
|
||||
PoolEntry<float> tmp1075PlPcdu0 = PoolEntry<float>(10.0);
|
||||
PoolEntry<float> tmp1075PlPcdu1 = PoolEntry<float>(10.0);
|
||||
PoolEntry<float> tmp1075IfBrd = PoolEntry<float>(10.0);
|
||||
|
||||
static constexpr dur_millis_t MUTEX_TIMEOUT = 50;
|
||||
void copySensors();
|
||||
void copySus();
|
||||
|
@ -30,8 +30,11 @@ enum PoolIds : lp_id_t {
|
||||
SENSOR_PLPCDU_HEATSPREADER,
|
||||
SENSOR_TCS_BOARD,
|
||||
SENSOR_MAGNETTORQUER,
|
||||
SENSOR_TMP1075_1,
|
||||
SENSOR_TMP1075_2,
|
||||
SENSOR_TMP1075_TCS_0,
|
||||
SENSOR_TMP1075_TCS_1,
|
||||
SENSOR_TMP1075_PLPCDU_0,
|
||||
SENSOR_TMP1075_PLPCDU_1,
|
||||
SENSOR_TMP1075_IF_BOARD,
|
||||
|
||||
SUS_0_N_LOC_XFYFZM_PT_XF,
|
||||
SUS_6_R_LOC_XFYBZM_PT_XF,
|
||||
@ -111,8 +114,14 @@ class SensorTemperatures : public StaticLocalDataSet<ENTRIES_SENSOR_TEMPERATURE_
|
||||
lp_var_t<float> sensor_tcs_board = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TCS_BOARD, this);
|
||||
lp_var_t<float> sensor_magnettorquer =
|
||||
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_MAGNETTORQUER, this);
|
||||
lp_var_t<float> sensor_tmp1075_1 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_1, this);
|
||||
lp_var_t<float> sensor_tmp1075_2 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_2, this);
|
||||
lp_var_t<float> tmp1075Tcs0 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_TCS_0, this);
|
||||
lp_var_t<float> tmp1075Tcs1 = lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_TCS_1, this);
|
||||
lp_var_t<float> tmp1075PlPcdu0 =
|
||||
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_PLPCDU_0, this);
|
||||
lp_var_t<float> tmp1075PlPcdu1 =
|
||||
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_PLPCDU_1, this);
|
||||
lp_var_t<float> tmp1075IfBrd =
|
||||
lp_var_t<float>(sid.objectId, PoolIds::SENSOR_TMP1075_IF_BOARD, this);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,7 @@ ReturnValue_t Tmp1075Handler::interpretDeviceReply(DeviceCommandId_t id, const u
|
||||
int16_t tempValueRaw = 0;
|
||||
tempValueRaw = packet[0] << 4 | packet[1] >> 4;
|
||||
float tempValue = ((static_cast<float>(tempValueRaw)) * 0.0625);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
#if OBSW_DEBUG_TMP1075 == 1
|
||||
sif::info << "Tmp1075 with object id: 0x" << std::hex << getObjectId()
|
||||
<< ": Temperature: " << tempValue << " °C" << std::endl;
|
||||
#endif
|
||||
@ -127,3 +127,5 @@ ReturnValue_t Tmp1075Handler::initializeLocalDataPool(localpool::DataPool &local
|
||||
subdp::RegularHkPeriodicParams(dataset.getSid(), false, 30.0));
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
void Tmp1075Handler::setModeNormal() { setMode(_MODE_TO_NORMAL); }
|
||||
|
@ -20,6 +20,8 @@ class Tmp1075Handler : public DeviceHandlerBase {
|
||||
Tmp1075Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie);
|
||||
virtual ~Tmp1075Handler();
|
||||
|
||||
void setModeNormal();
|
||||
|
||||
protected:
|
||||
void doStartUp() override;
|
||||
void doShutDown() override;
|
||||
|
Loading…
Reference in New Issue
Block a user