Update to v1.8.0 #100

Merged
muellerr merged 125 commits from develop into main 2021-09-24 10:17:43 +02:00
16 changed files with 1293 additions and 1146 deletions
Showing only changes of commit f7c6f16777 - Show all commits

View File

@ -12,6 +12,6 @@ else()
add_subdirectory(gpio) add_subdirectory(gpio)
add_subdirectory(core) add_subdirectory(core)
add_subdirectory(memory) add_subdirectory(memory)
add_subdirectory(spiCallbacks) add_subdirectory(callbacks)
add_subdirectory(devices) add_subdirectory(devices)
endif() endif()

View File

@ -1,3 +1,4 @@
target_sources(${TARGET_NAME} PRIVATE target_sources(${TARGET_NAME} PRIVATE
rwSpiCallback.cpp rwSpiCallback.cpp
gnssCallback.cpp
) )

View File

@ -0,0 +1,26 @@
#include "gnssCallback.h"
#include "devices/gpioIds.h"
#include "fsfw/tasks/TaskFactory.h"
ReturnValue_t gps::triggerGpioResetPin(void *args) {
ResetArgs* resetArgs = reinterpret_cast<ResetArgs*>(args);
if(args == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
if (resetArgs->gpioComIF == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
gpioId_t gpioId;
if(resetArgs->gnss1) {
gpioId = gpioIds::GNSS_1_NRESET;
}
else {
gpioId = gpioIds::GNSS_0_NRESET;
}
resetArgs->gpioComIF->pullLow(gpioId);
TaskFactory::delayTask(resetArgs->waitPeriodMs);
resetArgs->gpioComIF->pullHigh(gpioId);
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -0,0 +1,19 @@
#ifndef BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
#define BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
struct ResetArgs {
bool gnss1 = false;
LinuxLibgpioIF* gpioComIF = nullptr;
uint32_t waitPeriodMs = 100;
};
namespace gps {
ReturnValue_t triggerGpioResetPin(void* args);
}
#endif /* BSP_Q7S_CALLBACKS_GNSSCALLBACK_H_ */

View File

@ -1,9 +1,10 @@
#include <bsp_q7s/spiCallbacks/rwSpiCallback.h> #include "rwSpiCallback.h"
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <mission/devices/RwHandler.h>
#include <fsfw_hal/linux/spi/SpiCookie.h>
#include <fsfw_hal/linux/UnixFileGuard.h>
#include "devices/gpioIds.h" #include "devices/gpioIds.h"
#include "mission/devices/RwHandler.h"
#include "fsfw_hal/linux/spi/SpiCookie.h"
#include "fsfw_hal/linux/UnixFileGuard.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
namespace rwSpiCallback { namespace rwSpiCallback {

View File

@ -1,9 +1,9 @@
#ifndef BSP_Q7S_RW_SPI_CALLBACK_H_ #ifndef BSP_Q7S_RW_SPI_CALLBACK_H_
#define BSP_Q7S_RW_SPI_CALLBACK_H_ #define BSP_Q7S_RW_SPI_CALLBACK_H_
#include <fsfw/returnvalues/HasReturnvaluesIF.h> #include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include <fsfw_hal/linux/spi/SpiComIF.h> #include "fsfw_hal/linux/spi/SpiComIF.h"
#include <fsfw_hal/common/gpio/GpioCookie.h> #include "fsfw_hal/common/gpio/GpioCookie.h"
namespace rwSpiCallback { namespace rwSpiCallback {

View File

@ -9,12 +9,13 @@
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "bsp_q7s/gpio/gpioCallbacks.h" #include "bsp_q7s/gpio/gpioCallbacks.h"
#include "bsp_q7s/core/CoreController.h" #include "bsp_q7s/core/CoreController.h"
#include "bsp_q7s/spiCallbacks/rwSpiCallback.h"
#include "bsp_q7s/boardtest/Q7STestTask.h" #include "bsp_q7s/boardtest/Q7STestTask.h"
#include "bsp_q7s/memory/FileSystemHandler.h" #include "bsp_q7s/memory/FileSystemHandler.h"
#include "bsp_q7s/devices/PlocSupervisorHandler.h" #include "bsp_q7s/devices/PlocSupervisorHandler.h"
#include "bsp_q7s/devices/PlocUpdater.h" #include "bsp_q7s/devices/PlocUpdater.h"
#include "bsp_q7s/devices/PlocMemoryDumper.h" #include "bsp_q7s/devices/PlocMemoryDumper.h"
#include "bsp_q7s/callbacks/rwSpiCallback.h"
#include "bsp_q7s/callbacks/gnssCallback.h"
#include "linux/devices/HeaterHandler.h" #include "linux/devices/HeaterHandler.h"
#include "linux/devices/SolarArrayDeploymentHandler.h" #include "linux/devices/SolarArrayDeploymentHandler.h"
@ -82,6 +83,9 @@
#include "linux/boardtest/LibgpiodTest.h" #include "linux/boardtest/LibgpiodTest.h"
#endif #endif
ResetArgs resetArgsGnss0;
ResetArgs resetArgsGnss1;
void ObjectFactory::setStatics() { void ObjectFactory::setStatics() {
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
} }
@ -427,6 +431,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
"GNSS_1_NRESET", gpio::OUT, gpio::HIGH); "GNSS_1_NRESET", gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio); gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_NRESET, gpio);
// GNSS enable pins must be pulled high // GNSS enable pins must be pulled high
gpioComIF->addGpios(gpioCookieAcsBoard); gpioComIF->addGpios(gpioCookieAcsBoard);
@ -485,6 +491,12 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
objects::SPI_COM_IF, spiCookie); objects::SPI_COM_IF, spiCookie);
gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setStartUpImmediately();
resetArgsGnss1.gnss1 = true;
resetArgsGnss1.gpioComIF = gpioComIF;
resetArgsGnss1.waitPeriodMs = 100;
resetArgsGnss0.gnss1 = false;
resetArgsGnss0.gpioComIF = gpioComIF;
resetArgsGnss0.waitPeriodMs = 100;
auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV, auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV,
UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER); UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER);
uartCookieGps0->setToFlushInput(true); uartCookieGps0->setToFlushInput(true);
@ -495,9 +507,11 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
uartCookieGps1->setReadCycles(6); uartCookieGps1->setReadCycles(6);
auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF,
uartCookieGps0, true); uartCookieGps0, true);
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
gpsHandler0->setStartUpImmediately(); gpsHandler0->setStartUpImmediately();
auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF,
uartCookieGps1, true); uartCookieGps1, true);
gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1);
gpsHandler1->setStartUpImmediately(); gpsHandler1->setStartUpImmediately();
} }

View File

@ -6,6 +6,11 @@
#include "lwgps/lwgps.h" #include "lwgps/lwgps.h"
#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1
#include <filesystem>
#include <fstream>
#endif
GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication, GPSHyperionHandler::GPSHyperionHandler(object_id_t objectId, object_id_t deviceCommunication,
CookieIF *comCookie, bool debugHyperionGps): CookieIF *comCookie, bool debugHyperionGps):
DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this), DeviceHandlerBase(objectId, deviceCommunication, comCookie), gpsSet(this),
@ -47,6 +52,19 @@ ReturnValue_t GPSHyperionHandler::buildNormalDeviceCommand(DeviceCommandId_t *id
ReturnValue_t GPSHyperionHandler::buildCommandFromCommand( ReturnValue_t GPSHyperionHandler::buildCommandFromCommand(
DeviceCommandId_t deviceCommand, const uint8_t *commandData, DeviceCommandId_t deviceCommand, const uint8_t *commandData,
size_t commandDataLen) { size_t commandDataLen) {
switch(deviceCommand) {
case(GpsHyperion::TRIGGER_RESET_PIN): {
if(resetPinTrigger != nullptr) {
PoolReadGuard pg(&gpsSet);
// Set HK entries invalid
gpsSet.setValidity(false, true);
// The user needs to implement this. Don't touch states for now, the device should
// quickly reboot and send valid strings again.
return resetPinTrigger(resetPinTriggerArgs);
}
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
}
}
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -54,9 +72,9 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
DeviceCommandId_t *foundId, size_t *foundLen) { DeviceCommandId_t *foundId, size_t *foundLen) {
// Pass data to GPS library // Pass data to GPS library
if(len > 0) { if(len > 0) {
sif::info << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl; sif::debug << "GPSHandler::scanForReply: Received " << len << " bytes" << std::endl;
if (internalState == InternalStates::WAIT_FIRST_MESSAGE) { if (internalState == InternalStates::WAIT_FIRST_MESSAGE) {
// TODO: Check whether data is valid by chcking whether NMEA start string is valid // TODO: Check whether data is valid by checking whether NMEA start string is valid?
commandExecuted = true; commandExecuted = true;
} }
int result = lwgps_process(&gpsData, start, len); int result = lwgps_process(&gpsData, start, len);
@ -110,6 +128,13 @@ ReturnValue_t GPSHyperionHandler::scanForReply(const uint8_t *start, size_t len,
printf("Altitude: %f meters\n", gpsData.altitude); printf("Altitude: %f meters\n", gpsData.altitude);
} }
#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1 #if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1
std::string filename = "/mnt/sd0/gps_log_070921.txt";
std::ofstream gpsFile;
if(not std::filesystem::exists(filename)) {
gpsFile.open(filename, std::ofstream::out);
}
gpsFile.open(filename, std::ofstream::out | std::ofstream::app);
gpsFile.write(reinterpret_cast<const char*>(start), len);
#endif #endif
} }
*foundLen = len; *foundLen = len;
@ -155,6 +180,12 @@ void GPSHyperionHandler::modeChanged() {
internalState = InternalStates::NONE; internalState = InternalStates::NONE;
} }
void GPSHyperionHandler::setResetPinTriggerFunction(ReturnValue_t (*function)(void *args),
void *args) {
resetPinTrigger = function;
resetPinTriggerArgs = args;
}
void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId, void GPSHyperionHandler::debugInterface(uint8_t positionTracker, object_id_t objectId,
uint32_t parameter) { uint32_t parameter) {
} }

View File

@ -19,8 +19,12 @@ public:
CookieIF* comCookie, bool debugHyperionGps = false); CookieIF* comCookie, bool debugHyperionGps = false);
virtual ~GPSHyperionHandler(); virtual ~GPSHyperionHandler();
void setResetPinTriggerFunction(ReturnValue_t (*function) (void*args), void*args);
protected: protected:
ReturnValue_t (*resetPinTrigger) (void* args) = nullptr;
void* resetPinTriggerArgs = nullptr;
enum class InternalStates { enum class InternalStates {
NONE, NONE,
WAIT_FIRST_MESSAGE, WAIT_FIRST_MESSAGE,

View File

@ -75,6 +75,10 @@ ReturnValue_t GomspaceDeviceHandler::buildCommandFromCommand(
} }
break; break;
} }
case(GOMSPACE::PRINT_OUT_ENB_STATUS): {
result = printStatus(deviceCommand);
break;
}
case(GOMSPACE::REQUEST_HK_TABLE): { case(GOMSPACE::REQUEST_HK_TABLE): {
result = generateRequestFullHkTableCmd(hkTableReplySize); result = generateRequestFullHkTableCmd(hkTableReplySize);
if(result != HasReturnvaluesIF::RETURN_OK){ if(result != HasReturnvaluesIF::RETURN_OK){
@ -396,3 +400,8 @@ LocalPoolDataSetBase* GomspaceDeviceHandler::getDataSetHandle(sid_t sid) {
void GomspaceDeviceHandler::setModeNormal() { void GomspaceDeviceHandler::setModeNormal() {
mode = MODE_NORMAL; mode = MODE_NORMAL;
} }
ReturnValue_t GomspaceDeviceHandler::printStatus(DeviceCommandId_t cmd) {
sif::info << "No printHkTable implementation given.." << std::endl;
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -88,6 +88,13 @@ protected:
*/ */
virtual ReturnValue_t generateRequestFullHkTableCmd(uint16_t hkTableSize); virtual ReturnValue_t generateRequestFullHkTableCmd(uint16_t hkTableSize);
/**
* This command handles printing the HK table to the console. This is useful for debugging
* purposes
* @return
*/
virtual ReturnValue_t printStatus(DeviceCommandId_t cmd);
/** /**
* @brief Because housekeeping tables are device specific the handling of the reply is * @brief Because housekeeping tables are device specific the handling of the reply is
* given to the child class. * given to the child class.

View File

@ -1,11 +1,12 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include "PDU1Handler.h" #include "PDU1Handler.h"
#include <mission/devices/devicedefinitions/GomSpacePackets.h> #include <mission/devices/devicedefinitions/GomSpacePackets.h>
#include <OBSWConfig.h> #include <OBSWConfig.h>
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) : PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) :
GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS, GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu1HkTableDataset), pdu1HkTableDataset( PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu1HkTableDataset),
this) { pdu1HkTableDataset(this) {
} }
PDU1Handler::~PDU1Handler() { PDU1Handler::~PDU1Handler() {
@ -55,25 +56,9 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
<< std::endl; << std::endl;
sif::info << "PDU1 channel 8 current: " << pdu1HkTableDataset.currentOutChannel8 sif::info << "PDU1 channel 8 current: " << pdu1HkTableDataset.currentOutChannel8
<< std::endl; << std::endl;
sif::info << "PDU1 TCS Board switch: " printOutputSwitchStates();
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << std::endl; sif::info << "PDU1 battery mode: " <<
sif::info << "PDU1 Syrlinks switch: " static_cast<unsigned int>(pdu1HkTableDataset.battMode.value) << std::endl;
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSyrlinks.value) << std::endl;
sif::info << "PDU1 star tracker switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledStarTracker.value) << std::endl;
sif::info << "PDU1 MGT switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledMGT.value) << std::endl;
sif::info << "PDU1 SUS nominal switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSUSNominal.value) << std::endl;
sif::info << "PDU1 solar cell experiment switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSolarCellExp.value) << std::endl;
sif::info << "PDU1 PLOC switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledPLOC.value) << std::endl;
sif::info << "PDU1 ACS Side A switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << std::endl;
sif::info << "PDU1 channel 8 switch: "
<< static_cast<unsigned int>(pdu1HkTableDataset.outEnabledChannel8.value) << std::endl;
sif::info << "PDU1 battery mode: " << static_cast<unsigned int>(pdu1HkTableDataset.battMode.value) << std::endl;
sif::info << "PDU1 VCC: " << pdu1HkTableDataset.vcc << " mV" << std::endl; sif::info << "PDU1 VCC: " << pdu1HkTableDataset.vcc << " mV" << std::endl;
float vbat = pdu1HkTableDataset.vbat.value * 0.001; float vbat = pdu1HkTableDataset.vbat.value * 0.001;
sif::info << "PDU1 VBAT: " << vbat << "V" << std::endl; sif::info << "PDU1 VBAT: " << vbat << "V" << std::endl;
@ -87,9 +72,35 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
#endif #endif
} }
void PDU1Handler::printOutputSwitchStates() {
sif::info << "PDU1 TCS Board switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledTCSBoard3V3.value) << std::endl;
sif::info << "PDU1 Syrlinks switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSyrlinks.value) << std::endl;
sif::info << "PDU1 star tracker switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledStarTracker.value) << std::endl;
sif::info << "PDU1 MGT switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledMGT.value) << std::endl;
sif::info << "PDU1 SUS nominal switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSUSNominal.value) << std::endl;
sif::info << "PDU1 solar cell experiment switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledSolarCellExp.value) << std::endl;
sif::info << "PDU1 PLOC switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledPLOC.value) << std::endl;
sif::info << "PDU1 ACS Side A switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledAcsBoardSideA.value) << std::endl;
sif::info << "PDU1 channel 8 switch: " <<
static_cast<unsigned int>(pdu1HkTableDataset.outEnabledChannel8.value) << std::endl;
}
void PDU1Handler::parseHkTableReply(const uint8_t *packet) { void PDU1Handler::parseHkTableReply(const uint8_t *packet) {
uint16_t dataOffset = 0; uint16_t dataOffset = 0;
pdu1HkTableDataset.read(); PoolReadGuard pg(&pdu1HkTableDataset);
ReturnValue_t readResult = pg.getReadResult();
if(readResult != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Reading PDU1 HK table failed!" << std::endl;
return;
}
/* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table /* Fist 10 bytes contain the gomspace header. Each variable is preceded by the 16-bit table
* address. */ * address. */
dataOffset += 12; dataOffset += 12;
@ -249,8 +260,10 @@ void PDU1Handler::parseHkTableReply(const uint8_t *packet) {
dataOffset += 3; dataOffset += 3;
pdu1HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset); pdu1HkTableDataset.csp2WatchdogPingsLeft = *(packet + dataOffset);
pdu1HkTableDataset.commit();
pdu1HkTableDataset.setChanged(true); pdu1HkTableDataset.setChanged(true);
if(not pdu1HkTableDataset.isValid()) {
pdu1HkTableDataset.setValidity(true, true);
}
} }
ReturnValue_t PDU1Handler::initializeLocalDataPool( ReturnValue_t PDU1Handler::initializeLocalDataPool(
@ -341,3 +354,20 @@ ReturnValue_t PDU1Handler::initializeLocalDataPool(
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
ReturnValue_t PDU1Handler::printStatus(DeviceCommandId_t cmd) {
switch(cmd) {
case(GOMSPACE::PRINT_OUT_ENB_STATUS): {
PoolReadGuard pg(&pdu1HkTableDataset);
ReturnValue_t readResult = pg.getReadResult();
if(readResult != HasReturnvaluesIF::RETURN_OK) {
sif::warning << "Reading PDU1 HK table failed!" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
}
printOutputSwitchStates();
return HasReturnvaluesIF::RETURN_OK;
}
default: {
return HasReturnvaluesIF::RETURN_FAILED;
}
}
}

View File

@ -32,11 +32,13 @@ protected:
*/ */
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override;
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override; virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override;
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
private: private:
/** Dataset for the housekeeping table of the PDU1 */ /** Dataset for the housekeeping table of the PDU1 */
PDU1::PDU1HkTableDataset pdu1HkTableDataset; PDU1::PDU1HkTableDataset pdu1HkTableDataset;
void printOutputSwitchStates();
void parseHkTableReply(const uint8_t *packet); void parseHkTableReply(const uint8_t *packet);
}; };

View File

@ -7,6 +7,7 @@
namespace GpsHyperion { namespace GpsHyperion {
static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t GPS_REPLY = 0;
static constexpr DeviceCommandId_t TRIGGER_RESET_PIN = 5;
static constexpr uint32_t DATASET_ID = 0; static constexpr uint32_t DATASET_ID = 0;

View File

@ -15,28 +15,30 @@
#include <fsfw/datapoollocal/LocalPoolVariable.h> #include <fsfw/datapoollocal/LocalPoolVariable.h>
namespace GOMSPACE{ namespace GOMSPACE{
static const uint16_t IGNORE_CHECKSUM = 0xbb0; static const uint16_t IGNORE_CHECKSUM = 0xbb0;
/** The size of the header of a gomspace CSP packet. */ /** The size of the header of a gomspace CSP packet. */
static const uint8_t GS_HDR_LENGTH = 12; static const uint8_t GS_HDR_LENGTH = 12;
/** CSP port to ping gomspace devices. */ /** CSP port to ping gomspace devices. */
static const uint8_t PING_PORT = 1; static const uint8_t PING_PORT = 1;
static const uint8_t REBOOT_PORT = 4; static const uint8_t REBOOT_PORT = 4;
/** CSP port of gomspace devices to request or set parameters */ /** CSP port of gomspace devices to request or set parameters */
static const uint8_t PARAM_PORT = 7; static const uint8_t PARAM_PORT = 7;
static const uint8_t P60_PORT_GNDWDT_RESET = 9; static const uint8_t P60_PORT_GNDWDT_RESET = 9;
/* Device commands are derived from the rparam.h of the gomspace lib */
static const DeviceCommandId_t PING = 1; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t NONE = 2; // Set when no command is pending
static const DeviceCommandId_t REBOOT = 4; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t GNDWDT_RESET = 9; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PRINT_OUT_ENB_STATUS = 17; //!< [EXPORT] : [COMMAND]
/* Device commands are derived from the rparam.h of the gomspace lib */
static const DeviceCommandId_t PING = 0x1; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t NONE = 0x2; // Set when no command is pending
static const DeviceCommandId_t REBOOT = 0x4; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t GNDWDT_RESET = 0x9; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_GET = 0x00; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_SET = 0xFF; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t REQUEST_HK_TABLE = 0x10; //!< [EXPORT] : [COMMAND]
} }
namespace P60System { namespace P60System {
enum P60SytemPoolIds: lp_id_t { enum P60SytemPoolIds: lp_id_t {
P60DOCK_CURRENT_ACU_VCC, P60DOCK_CURRENT_ACU_VCC,
P60DOCK_CURRENT_PDU1_VCC, P60DOCK_CURRENT_PDU1_VCC,
P60DOCK_CURRENT_X3_IDLE_VCC, P60DOCK_CURRENT_X3_IDLE_VCC,
@ -351,32 +353,32 @@ namespace P60System {
ACU_DEVICE_7_STATUS, ACU_DEVICE_7_STATUS,
ACU_WDT_CNT_GND, ACU_WDT_CNT_GND,
ACU_WDT_GND_LEFT ACU_WDT_GND_LEFT
}; };
} }
namespace P60Dock { namespace P60Dock {
/** Max reply size reached when requesting full hk table */ /** Max reply size reached when requesting full hk table */
static const uint16_t MAX_REPLY_LENGTH = 407; static const uint16_t MAX_REPLY_LENGTH = 407;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408;
static const uint16_t MAX_HKTABLE_ADDRESS = 187; static const uint16_t MAX_HKTABLE_ADDRESS = 187;
static const uint16_t HK_TABLE_SIZE = 188; static const uint16_t HK_TABLE_SIZE = 188;
static const uint8_t HK_TABLE_DATA_SET_ID = 0x3; static const uint8_t HK_TABLE_DATA_SET_ID = 0x3;
static const uint8_t HK_TABLE_ENTRIES = 100; static const uint8_t HK_TABLE_ENTRIES = 100;
/** /**
* Requesting the full housekeeping table from the P60 dock will generate a reply comprising * Requesting the full housekeeping table from the P60 dock will generate a reply comprising
* 402 bytes of data. * 402 bytes of data.
*/ */
static const uint16_t HK_TABLE_REPLY_SIZE = 407; static const uint16_t HK_TABLE_REPLY_SIZE = 407;
/** /**
* @brief This class defines a dataset for the hk table of the P60 Dock. * @brief This class defines a dataset for the hk table of the P60 Dock.
*/ */
class HkTableDataset: class HkTableDataset:
public StaticLocalDataSet<HK_TABLE_ENTRIES> { public StaticLocalDataSet<HK_TABLE_ENTRIES> {
public: public:
@ -602,7 +604,7 @@ namespace P60Dock {
P60System::P60DOCK_ANT6_DEPL, this); P60System::P60DOCK_ANT6_DEPL, this);
lp_var_t<int8_t> ar6Depl = lp_var_t<int8_t>(sid.objectId, lp_var_t<int8_t> ar6Depl = lp_var_t<int8_t>(sid.objectId,
P60System::P60DOCK_AR6_DEPL, this); P60System::P60DOCK_AR6_DEPL, this);
}; };
} }
@ -610,36 +612,36 @@ namespace P60Dock {
* @brief Constants common for both PDU1 and PDU2. * @brief Constants common for both PDU1 and PDU2.
*/ */
namespace PDU{ namespace PDU{
/** When retrieving full configuration parameter table */ /** When retrieving full configuration parameter table */
static const uint16_t MAX_REPLY_LENGTH = 318; static const uint16_t MAX_REPLY_LENGTH = 318;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316;
static const uint16_t MAX_HKTABLE_ADDRESS = 141; static const uint16_t MAX_HKTABLE_ADDRESS = 141;
/** The size of the csp reply containing the housekeeping table data */ /** The size of the csp reply containing the housekeeping table data */
static const uint16_t HK_TABLE_REPLY_SIZE = 303; static const uint16_t HK_TABLE_REPLY_SIZE = 303;
static const uint8_t HK_TABLE_ENTRIES = 73; static const uint8_t HK_TABLE_ENTRIES = 73;
} }
namespace PDU1 { namespace PDU1 {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4 static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4
/** /**
* Addresses within configuration table to enable or disable output channels. Refer also to * Addresses within configuration table to enable or disable output channels. Refer also to
* gs-man-nanopower-p60-pdu-200.pdf on page 16. * gs-man-nanopower-p60-pdu-200.pdf on page 16.
*/ */
static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3 = 0x48; static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3 = 0x48;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SYRLINKS = 0x49; static const uint16_t CONFIG_ADDRESS_OUT_EN_SYRLINKS = 0x49;
static const uint16_t CONFIG_ADDRESS_OUT_EN_STAR_TRACKER = 0x50; static const uint16_t CONFIG_ADDRESS_OUT_EN_STAR_TRACKER = 0x50;
static const uint16_t CONFIG_ADDRESS_OUT_EN_MGT = 0x51; static const uint16_t CONFIG_ADDRESS_OUT_EN_MGT = 0x51;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL = 0x52; static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL = 0x52;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP = 0x53; static const uint16_t CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP = 0x53;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x54; static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x54;
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x55; static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x55;
static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x56; static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x56;
/** /**
* @brief This class defines a dataset for the hk table of the PDU1. * @brief This class defines a dataset for the hk table of the PDU1.
*/ */
class PDU1HkTableDataset : class PDU1HkTableDataset :
public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> { public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
public: public:
@ -824,30 +826,30 @@ namespace PDU1 {
P60System::PDU1_WDT_CSP_LEFT1, this); P60System::PDU1_WDT_CSP_LEFT1, this);
lp_var_t<uint8_t> csp1WatchdogPingsLeft = lp_var_t<uint8_t>(sid.objectId, lp_var_t<uint8_t> csp1WatchdogPingsLeft = lp_var_t<uint8_t>(sid.objectId,
P60System::PDU1_WDT_CSP_LEFT2, this); P60System::PDU1_WDT_CSP_LEFT2, this);
}; };
} }
namespace PDU2 { namespace PDU2 {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x2; static const uint32_t HK_TABLE_DATA_SET_ID = 0x2;
/** /**
* Addresses within configuration table to enable or disable output channels. Refer also to * Addresses within configuration table to enable or disable output channels. Refer also to
* gs-man-nanopower-p60-pdu-200.pdf on page 16. * gs-man-nanopower-p60-pdu-200.pdf on page 16.
*/ */
static const uint16_t CONFIG_ADDRESS_OUT_EN_Q7S = 0x48; static const uint16_t CONFIG_ADDRESS_OUT_EN_Q7S = 0x48;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1 = 0x49; static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1 = 0x49;
static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A; static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A;
static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B; static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C; static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C;
static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D; static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC = 0x4E; static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6PLOC = 0x4E;
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F; static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50; static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50;
/** /**
* @brief This class defines a dataset for the hk table of the PDU2. * @brief This class defines a dataset for the hk table of the PDU2.
*/ */
class PDU2HkTableDataset: class PDU2HkTableDataset:
public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> { public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
public: public:
@ -1032,25 +1034,25 @@ namespace PDU2 {
P60System::PDU2_WDT_CSP_LEFT1, this); P60System::PDU2_WDT_CSP_LEFT1, this);
lp_var_t<uint8_t> csp2WatchdogPingsLeft = lp_var_t<uint8_t>(sid.objectId, lp_var_t<uint8_t> csp2WatchdogPingsLeft = lp_var_t<uint8_t>(sid.objectId,
P60System::PDU2_WDT_CSP_LEFT2, this); P60System::PDU2_WDT_CSP_LEFT2, this);
}; };
} }
namespace ACU { namespace ACU {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x4; static const uint32_t HK_TABLE_DATA_SET_ID = 0x4;
/* When receiving full housekeeping (telemetry) table */ /* When receiving full housekeeping (telemetry) table */
static const uint16_t MAX_REPLY_LENGTH = 262; static const uint16_t MAX_REPLY_LENGTH = 262;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26; static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26;
static const uint16_t MAX_HKTABLE_ADDRESS = 120; static const uint16_t MAX_HKTABLE_ADDRESS = 120;
static const uint8_t HK_TABLE_ENTRIES = 64; static const uint8_t HK_TABLE_ENTRIES = 64;
static const uint16_t HK_TABLE_REPLY_SIZE = 262; static const uint16_t HK_TABLE_REPLY_SIZE = 262;
/** /**
* @brief This class defines a dataset for the hk table of the ACU. * @brief This class defines a dataset for the hk table of the ACU.
*/ */
class HkTableDataset: class HkTableDataset:
public StaticLocalDataSet<HK_TABLE_ENTRIES> { public StaticLocalDataSet<HK_TABLE_ENTRIES> {
public: public:
@ -1200,7 +1202,7 @@ namespace ACU {
P60System::ACU_WDT_CNT_GND, this); P60System::ACU_WDT_CNT_GND, this);
lp_var_t<uint32_t> wdtGndLeft = lp_var_t<uint32_t>(sid.objectId, lp_var_t<uint32_t> wdtGndLeft = lp_var_t<uint32_t>(sid.objectId,
P60System::ACU_WDT_GND_LEFT, this); P60System::ACU_WDT_GND_LEFT, this);
}; };
} }
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */ #endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */

2
tmtc

@ -1 +1 @@
Subproject commit 90b42e7de172fee8e6b41d21ee3de13334ec9e53 Subproject commit eb8d52607b49b091764940f7d909b7e525238d1c