From 482b77ff051a395210d2bd14a9f901b6222215c8 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Tue, 20 Oct 2020 17:38:41 +0200 Subject: [PATCH] added defaultcfg config folder --- defaultcfg/FSFWConfig.h | 41 +++ defaultcfg/README.md | 6 + defaultcfg/config.mk | 17 ++ defaultcfg/config/FSFWConfig.h | 41 +++ defaultcfg/config/OBSWConfig.h | 14 + .../config/devices/logicalAddresses.cpp | 5 + defaultcfg/config/devices/logicalAddresses.h | 18 ++ .../config/devices/powerSwitcherList.cpp | 4 + defaultcfg/config/devices/powerSwitcherList.h | 12 + defaultcfg/config/events/subsystemIdRanges.h | 18 ++ defaultcfg/config/ipc/missionMessageTypes.cpp | 11 + defaultcfg/config/ipc/missionMessageTypes.h | 21 ++ defaultcfg/config/objects/Factory.cpp | 57 ++++ defaultcfg/config/objects/Factory.h | 20 ++ defaultcfg/config/objects/systemObjectList.h | 138 +++++++++ .../config/objects/translateObjects.cpp | 271 ++++++++++++++++++ defaultcfg/config/objects/translateObjects.h | 9 + .../PollingSequenceFactory.cpp | 23 ++ .../pollingsequence/PollingSequenceFactory.h | 32 +++ defaultcfg/config/returnvalues/classIds.h | 16 ++ defaultcfg/config/tmtc/apid.h | 18 ++ defaultcfg/config/tmtc/pusIds.h | 23 ++ defaultcfg/config/version.h | 9 + defaultcfg/version.h | 11 + 24 files changed, 835 insertions(+) create mode 100644 defaultcfg/FSFWConfig.h create mode 100644 defaultcfg/README.md create mode 100644 defaultcfg/config.mk create mode 100644 defaultcfg/config/FSFWConfig.h create mode 100644 defaultcfg/config/OBSWConfig.h create mode 100644 defaultcfg/config/devices/logicalAddresses.cpp create mode 100644 defaultcfg/config/devices/logicalAddresses.h create mode 100644 defaultcfg/config/devices/powerSwitcherList.cpp create mode 100644 defaultcfg/config/devices/powerSwitcherList.h create mode 100644 defaultcfg/config/events/subsystemIdRanges.h create mode 100644 defaultcfg/config/ipc/missionMessageTypes.cpp create mode 100644 defaultcfg/config/ipc/missionMessageTypes.h create mode 100644 defaultcfg/config/objects/Factory.cpp create mode 100644 defaultcfg/config/objects/Factory.h create mode 100644 defaultcfg/config/objects/systemObjectList.h create mode 100644 defaultcfg/config/objects/translateObjects.cpp create mode 100644 defaultcfg/config/objects/translateObjects.h create mode 100644 defaultcfg/config/pollingsequence/PollingSequenceFactory.cpp create mode 100644 defaultcfg/config/pollingsequence/PollingSequenceFactory.h create mode 100644 defaultcfg/config/returnvalues/classIds.h create mode 100644 defaultcfg/config/tmtc/apid.h create mode 100644 defaultcfg/config/tmtc/pusIds.h create mode 100644 defaultcfg/config/version.h create mode 100644 defaultcfg/version.h diff --git a/defaultcfg/FSFWConfig.h b/defaultcfg/FSFWConfig.h new file mode 100644 index 000000000..2001f3062 --- /dev/null +++ b/defaultcfg/FSFWConfig.h @@ -0,0 +1,41 @@ +#ifndef CONFIG_FSFWCONFIG_H_ +#define CONFIG_FSFWCONFIG_H_ + +#include "version.h" + +//! Used to determine whether C++ ostreams are used +//! Those can lead to code bloat. +#define FSFW_CPP_OSTREAM_ENABLED 1 + +//! Reduced printout to further decrese code size +//! Be careful, this also turns off most diagnostic prinouts! +#define FSFW_REDUCED_PRINTOUT 0 + +//! Can be used to enable debugging printouts for developing the FSFW +#define FSFW_DEBUGGING 0 + +//! Defines the FIFO depth of each commanding service base which +//! also determines how many commands a CSB service can handle in one cycle +//! simulataneously. This will increase the required RAM for +//! each CSB service ! +#define FSFW_CSB_FIFO_DEPTH 6 + +//! If -DDEBUG is supplied in the build defines, there will be +//! additional output which requires the translation files translateObjects +//! and translateEvents (and their compiles source files) +#ifdef DEBUG +#define FSFW_DEBUG_OUTPUT 1 +//! Specify whether info events are printed too. +#define FSFW_DEBUG_INFO 1 +#include +#include +#else +#define FSFW_DEBUG_OUTPUT 0 +#endif + +//! When using the newlib nano library, C99 support for stdio facilities +//! will not be provided. This define should be set to 1 if this is the case. +#define FSFW_NO_C99_IO 1 + + +#endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/defaultcfg/README.md b/defaultcfg/README.md new file mode 100644 index 000000000..8446cda44 --- /dev/null +++ b/defaultcfg/README.md @@ -0,0 +1,6 @@ +# How to setup configuration folder for FSFW + +It is recommended to copy the content of the defaultcfg folder +into a config folder which is in the same directory as the Flight +Software Framework submodule. After that, the config.mk folder should be +included by the primary Makefile with CURRENTPATH set correctly. diff --git a/defaultcfg/config.mk b/defaultcfg/config.mk new file mode 100644 index 000000000..fcf3b7992 --- /dev/null +++ b/defaultcfg/config.mk @@ -0,0 +1,17 @@ +CXXSRC += $(wildcard $(CURRENTPATH)/config/ipc/*.cpp) +CXXSRC += $(wildcard $(CURRENTPATH)/config/objects/*.cpp) +CXXSRC += $(wildcard $(CURRENTPATH)/config/pollingsequence/*.cpp) +CXXSRC += $(wildcard $(CURRENTPATH)/config/events/*.cpp) +CXXSRC += $(wildcard $(CURRENTPATH)/config/tmtc/*.cpp) +CXXSRC += $(wildcard $(CURRENTPATH)/config/devices/*.cpp) + +INCLUDES += $(CURRENTPATH) +INCLUDES += $(CURRENTPATH)/config/ +INCLUDES += $(CURRENTPATH)/config/objects +INCLUDES += $(CURRENTPATH)/config/returnvalues +INCLUDES += $(CURRENTPATH)/config/tmtc +INCLUDES += $(CURRENTPATH)/config/events +INCLUDES += $(CURRENTPATH)/config/devices +INCLUDES += $(CURRENTPATH)/config/pollingsequence +INCLUDES += $(CURRENTPATH)/config/ipc +INCLUDES += $(CURRENTPATH)/config/ diff --git a/defaultcfg/config/FSFWConfig.h b/defaultcfg/config/FSFWConfig.h new file mode 100644 index 000000000..2001f3062 --- /dev/null +++ b/defaultcfg/config/FSFWConfig.h @@ -0,0 +1,41 @@ +#ifndef CONFIG_FSFWCONFIG_H_ +#define CONFIG_FSFWCONFIG_H_ + +#include "version.h" + +//! Used to determine whether C++ ostreams are used +//! Those can lead to code bloat. +#define FSFW_CPP_OSTREAM_ENABLED 1 + +//! Reduced printout to further decrese code size +//! Be careful, this also turns off most diagnostic prinouts! +#define FSFW_REDUCED_PRINTOUT 0 + +//! Can be used to enable debugging printouts for developing the FSFW +#define FSFW_DEBUGGING 0 + +//! Defines the FIFO depth of each commanding service base which +//! also determines how many commands a CSB service can handle in one cycle +//! simulataneously. This will increase the required RAM for +//! each CSB service ! +#define FSFW_CSB_FIFO_DEPTH 6 + +//! If -DDEBUG is supplied in the build defines, there will be +//! additional output which requires the translation files translateObjects +//! and translateEvents (and their compiles source files) +#ifdef DEBUG +#define FSFW_DEBUG_OUTPUT 1 +//! Specify whether info events are printed too. +#define FSFW_DEBUG_INFO 1 +#include +#include +#else +#define FSFW_DEBUG_OUTPUT 0 +#endif + +//! When using the newlib nano library, C99 support for stdio facilities +//! will not be provided. This define should be set to 1 if this is the case. +#define FSFW_NO_C99_IO 1 + + +#endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/defaultcfg/config/OBSWConfig.h b/defaultcfg/config/OBSWConfig.h new file mode 100644 index 000000000..d186da7da --- /dev/null +++ b/defaultcfg/config/OBSWConfig.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_OBSWCONFIG_H_ +#define CONFIG_OBSWCONFIG_H_ + +#ifdef __cplusplus +namespace config { +#endif + +/* Add mission configuration flags here */ + +#ifdef __cplusplus +} +#endif + +#endif /* CONFIG_OBSWCONFIG_H_ */ diff --git a/defaultcfg/config/devices/logicalAddresses.cpp b/defaultcfg/config/devices/logicalAddresses.cpp new file mode 100644 index 000000000..c7ce314d1 --- /dev/null +++ b/defaultcfg/config/devices/logicalAddresses.cpp @@ -0,0 +1,5 @@ +#include "logicalAddresses.h" + + + + diff --git a/defaultcfg/config/devices/logicalAddresses.h b/defaultcfg/config/devices/logicalAddresses.h new file mode 100644 index 000000000..174fa788b --- /dev/null +++ b/defaultcfg/config/devices/logicalAddresses.h @@ -0,0 +1,18 @@ +#ifndef CONFIG_DEVICES_LOGICALADDRESSES_H_ +#define CONFIG_DEVICES_LOGICALADDRESSES_H_ + +#include +#include +#include + +/** + * Can be used for addresses for physical devices like I2C adresses. + */ +namespace addresses { + /* Logical addresses have uint32_t datatype */ + enum logicalAddresses: address_t { + }; +} + + +#endif /* CONFIG_DEVICES_LOGICALADDRESSES_H_ */ diff --git a/defaultcfg/config/devices/powerSwitcherList.cpp b/defaultcfg/config/devices/powerSwitcherList.cpp new file mode 100644 index 000000000..343f78d04 --- /dev/null +++ b/defaultcfg/config/devices/powerSwitcherList.cpp @@ -0,0 +1,4 @@ +#include "powerSwitcherList.h" + + + diff --git a/defaultcfg/config/devices/powerSwitcherList.h b/defaultcfg/config/devices/powerSwitcherList.h new file mode 100644 index 000000000..86ddea570 --- /dev/null +++ b/defaultcfg/config/devices/powerSwitcherList.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_DEVICES_POWERSWITCHERLIST_H_ +#define CONFIG_DEVICES_POWERSWITCHERLIST_H_ + +namespace switches { + /* Switches are uint8_t datatype and go from 0 to 255 */ + enum switcherList { + }; + +} + + +#endif /* CONFIG_DEVICES_POWERSWITCHERLIST_H_ */ diff --git a/defaultcfg/config/events/subsystemIdRanges.h b/defaultcfg/config/events/subsystemIdRanges.h new file mode 100644 index 000000000..24eee819f --- /dev/null +++ b/defaultcfg/config/events/subsystemIdRanges.h @@ -0,0 +1,18 @@ +#ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ +#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ + +#include +#include + +/** + * @brief Custom subsystem IDs can be added here + * @details + * Subsystem IDs are used to create unique events. + */ +namespace SUBSYSTEM_ID { +enum: uint8_t { + SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, +}; +} + +#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */ diff --git a/defaultcfg/config/ipc/missionMessageTypes.cpp b/defaultcfg/config/ipc/missionMessageTypes.cpp new file mode 100644 index 000000000..e2edbf9c5 --- /dev/null +++ b/defaultcfg/config/ipc/missionMessageTypes.cpp @@ -0,0 +1,11 @@ +#include +#include + +void messagetypes::clearMissionMessage(CommandMessage* message) { + switch(message->getMessageType()) { + default: + break; + } +} + + diff --git a/defaultcfg/config/ipc/missionMessageTypes.h b/defaultcfg/config/ipc/missionMessageTypes.h new file mode 100644 index 000000000..8b2e2fcce --- /dev/null +++ b/defaultcfg/config/ipc/missionMessageTypes.h @@ -0,0 +1,21 @@ +#ifndef CONFIG_IPC_MISSIONMESSAGETYPES_H_ +#define CONFIG_IPC_MISSIONMESSAGETYPES_H_ + +#include +#include + +/** + * Custom command messages are specified here. + * Most messages needed to use FSFW are already located in + * + * @param message Generic Command Message + */ +namespace messagetypes { +enum CustomMessageTypes { + MISSION_MESSAGE_TYPE_START = FW_MESSAGES_COUNT +}; + +void clearMissionMessage(CommandMessage* message); +} + +#endif /* CONFIG_IPC_MISSIONMESSAGETYPES_H_ */ diff --git a/defaultcfg/config/objects/Factory.cpp b/defaultcfg/config/objects/Factory.cpp new file mode 100644 index 000000000..ea187a5ea --- /dev/null +++ b/defaultcfg/config/objects/Factory.cpp @@ -0,0 +1,57 @@ +#include "Factory.h" + +/* Config */ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + + +#include + + +/** + * Build tasks by using SystemObject Interface (Interface). + * Header files of all tasks must be included + * Please note that an object has to implement the system object interface + * if the nterface validity is checked or retrieved later by using the + * get(object_id) function from the ObjectManagerIF. + * + * Framework objects are created first. + * + * @ingroup init + */ +void Factory::produce(void) { + setStaticFrameworkObjectIds(); + new EventManager(objects::EVENT_MANAGER); + new HealthTable(objects::HEALTH_TABLE); + //new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER); +} + +void Factory::setStaticFrameworkObjectIds() { + PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR; + PusServiceBase::packetDestination = objects::TM_FUNNEL; + + CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; + CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; + + VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; + + DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; + DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2_DEVICE_ACCESS; + + DeviceHandlerFailureIsolation::powerConfirmationId = objects::NO_OBJECT; + + TmPacketStored::timeStamperId = objects::PUS_TIME; + TmFunnel::downlinkDestination = objects::NO_OBJECT; +} + diff --git a/defaultcfg/config/objects/Factory.h b/defaultcfg/config/objects/Factory.h new file mode 100644 index 000000000..8b99ae996 --- /dev/null +++ b/defaultcfg/config/objects/Factory.h @@ -0,0 +1,20 @@ +#ifndef FACTORY_H_ +#define FACTORY_H_ + +#include +#include + +namespace Factory { + size_t calculateStorage(uint8_t numberOfPools, uint16_t* numberOfElements, + uint16_t* sizeOfElements); + /** + * @brief Creates all SystemObject elements which are persistent + * during execution. + */ + void produce(); + void setStaticFrameworkObjectIds(); + +} + + +#endif /* FACTORY_H_ */ diff --git a/defaultcfg/config/objects/systemObjectList.h b/defaultcfg/config/objects/systemObjectList.h new file mode 100644 index 000000000..2448efbd1 --- /dev/null +++ b/defaultcfg/config/objects/systemObjectList.h @@ -0,0 +1,138 @@ +#ifndef CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ +#define CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ + +#include + +// The objects will be instantiated in the ID order +namespace objects { + enum sourceObjects: uint32_t { + /* First Byte 0x50-0x52 reserved for PUS Services **/ + CCSDS_PACKET_DISTRIBUTOR = 0x50000100, + PUS_PACKET_DISTRIBUTOR = 0x50000200, + /* UDP ID must come after CCSDS Distributor **/ + UDP_TMTC_BRIDGE = 0x50000300, + EMAC_POLLING_TASK = 0x50000400, + SERIAL_TMTC_BRIDGE = 0x50000500, + SERIAL_RING_BUFFER = 0x50000550, + SERIAL_POLLING_TASK = 0x50000600, + + PUS_SERVICE_6_MEM_MGMT = 0x51000500, + PUS_SERVICE_20_PARAM_MGMT = 0x51002000, + PUS_SERVICE_23_FILE_MGMT = 0x51002300, + PUS_SERVICE_201_HEALTH = 0x51020100, + + PUS_TIME = 0x52000001, + TM_FUNNEL = 0x52000002, + FREERTOS_TASK_MONITOR = 0x53000003, + + CORE_CONTROLLER = 0x40001000, + SYSTEM_STATE_TASK = 0x40001005, + THERMAL_CONTROLLER = 0x40002000, + RS485_CONTROLLER = 0x40005000, + + /* 0x44 ('D') for Device Handlers **/ + /* Second Byte: ComIF -> 0x00: UART,0x10 SPI,0x20: I2C,30: GPIO,40: PWM */ + /* Third Byte: Device ID */ + PCDU_HANDLER = 0x44003200, + GPS0_HANDLER = 0x44101F00, + GPS1_HANDLER = 0x44202000, + + DLR_PVCH = 0x44104000, + GYRO1 = 0x44105000, + DLR_IRAS = 0x44106000, + + /* fourth byte decoder output ID */ + + // Devices connected to decoder 1 + SPI_Test_PT1000 = 0x44115400, + SPI_Test_Gyro = 0x44115500, + PT1000_Syrlinks_DEC1_O1 = 0x44115401, + PT1000_Camera_DEC1_O2 = 0x44115402, + PT1000_SuS1_DEC1_O3 = 0x44115404, + PT1000_SuS2_DEC1_O4 = 0x44115405, + PT1000_SuS3_DEC1_O5 = 0x44115406, + PT1000_PVHC_DEC1_O6 = 0x44115407, + + // Devices connected to decoder 2 + PT1000_CCSDS1_DEC2 = 0x44125401, + PT1000_MGT1_DEC2 = 0x44125403, + PT1000_SuS4_DEC2 = 0x44125404, + PT1000_SuS5_DEC2 = 0x44125405, + PT1000_SuS6_DEC2 = 0x44125406, + PT1000_PVCH_DEC2 = 0x44125407, + SuS_ADC1_DEC2 = 0x44020108, + + // Devices connected to decoder 3 + PT1000_Iridium_DEC3 = 0x44130301, + PT1000_CCSDS2_DEC3 = 0x44130302, + PT1000_SuS7_DEC3 = 0x44130305, + PT1000_SuS8_DEC3 = 0x44130306, + PT1000_PVCH_DEC3 = 0x44130307, + GYRO2 = 0x44130308, + + // Devices connected to decoder 4 + PT1000_PLOC_DEC4 = 0x44145401, + PT1000_SuS9_DEC4 = 0x44145404, + PT1000_SuS10_DEC4 = 0x44145405, + PT1000_PVHC_DEC4 = 0x44145406, + SuS_ADC_DEC4 = 0x44145407, + + /* 0x49 ('I') for Communication Interfaces **/ + DUMMY_ECHO_COM_IF = 0x4900AFFE, + DUMMY_GPS_COM_IF = 0x49001F00, + RS232_DEVICE_COM_IF = 0x49005200, + I2C_DEVICE_COM_IF = 0x49005300, + GPIO_DEVICE_COM_IF = 0x49005400, + SPI_DEVICE_COM_IF = 0x49005600, + //SPI_POLLING_TASK = 0x49005410, + + /* 0x4d ('M') for Memory Handlers **/ + SD_CARD_HANDLER = 0x4D0073AD, + FRAM_HANDLER = 0x4D008000, + SOFTWARE_IMAGE_HANDLER = 0x4D009000, + + /* Board Specific */ + AT91_I2C_TEST_TASK = 0x12345678, + AT91_UART0_TEST_TASK = 0x87654321, + AT91_UART2_TEST_TASK = 0x000123336, + AT91_SPI_TEST_TASK = 0x66666666, + STM32_TEST_TASK = 0x77777777, + LED_TASK = 0x12345777, + + /* Test Task */ + ARDUINO_0 = 0x01010100, + ARDUINO_1 = 0x01010101, + ARDUINO_2 = 0x01010102, + ARDUINO_3 = 0x01010103, + ARDUINO_4 = 0x01010104, + TEST_TASK = 0x42694269, + DUMMY_HANDLER = 0x4400AFFE, + TC_INJECTOR = 0x99000001 + }; +} + +#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */ + + +/** + ▄ ▄ + ▌▒█ ▄▀▒▌ + ▌▒▒█ ▄▀▒▒▒▐ + ▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐ + ▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐ + ▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌ + ▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌ + ▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐ + ▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌ + ▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌ + ▌▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐ + ▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ + ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐ + ▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌ + ▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐ + ▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌ + ▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀ + ▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀ + ▒▒▒▒▒▒▒▒▒▒▀▀ +*/ + diff --git a/defaultcfg/config/objects/translateObjects.cpp b/defaultcfg/config/objects/translateObjects.cpp new file mode 100644 index 000000000..73cd02bfe --- /dev/null +++ b/defaultcfg/config/objects/translateObjects.cpp @@ -0,0 +1,271 @@ +/** + * @brief Auto-generated object translation file. Contains 86 translations. + * Generated on: 2020-08-25 00:57:14 + **/ +#include "translateObjects.h" + +const char *AT91_UART2_TEST_TASK_STRING = "AT91_UART2_TEST_TASK"; +const char *ARDUINO_0_STRING = "ARDUINO_0"; +const char *ARDUINO_1_STRING = "ARDUINO_1"; +const char *ARDUINO_2_STRING = "ARDUINO_2"; +const char *ARDUINO_3_STRING = "ARDUINO_3"; +const char *ARDUINO_4_STRING = "ARDUINO_4"; +const char *AT91_I2C_TEST_TASK_STRING = "AT91_I2C_TEST_TASK"; +const char *LED_TASK_STRING = "LED_TASK"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *SuS_ADC1_DEC2_STRING = "SuS_ADC1_DEC2"; +const char *GPS0_HANDLER_STRING = "GPS0_HANDLER"; +const char *DLR_PVCH_STRING = "DLR_PVCH"; +const char *GYRO1_STRING = "GYRO1"; +const char *DLR_IRAS_STRING = "DLR_IRAS"; +const char *SPI_Test_PT1000_STRING = "SPI_Test_PT1000"; +const char *PT1000_Syrlinks_DEC1_O1_STRING = "PT1000_Syrlinks_DEC1_O1"; +const char *PT1000_Camera_DEC1_O2_STRING = "PT1000_Camera_DEC1_O2"; +const char *PT1000_SuS1_DEC1_O3_STRING = "PT1000_SuS1_DEC1_O3"; +const char *PT1000_SuS2_DEC1_O4_STRING = "PT1000_SuS2_DEC1_O4"; +const char *PT1000_SuS3_DEC1_O5_STRING = "PT1000_SuS3_DEC1_O5"; +const char *PT1000_PVHC_DEC1_O6_STRING = "PT1000_PVHC_DEC1_O6"; +const char *SPI_Test_Gyro_STRING = "SPI_Test_Gyro"; +const char *PT1000_CCSDS1_DEC2_STRING = "PT1000_CCSDS1_DEC2"; +const char *PT1000_MGT1_DEC2_STRING = "PT1000_MGT1_DEC2"; +const char *PT1000_SuS4_DEC2_STRING = "PT1000_SuS4_DEC2"; +const char *PT1000_SuS5_DEC2_STRING = "PT1000_SuS5_DEC2"; +const char *PT1000_SuS6_DEC2_STRING = "PT1000_SuS6_DEC2"; +const char *PT1000_PVCH_DEC2_STRING = "PT1000_PVCH_DEC2"; +const char *PT1000_Iridium_DEC3_STRING = "PT1000_Iridium_DEC3"; +const char *PT1000_CCSDS2_DEC3_STRING = "PT1000_CCSDS2_DEC3"; +const char *PT1000_SuS7_DEC3_STRING = "PT1000_SuS7_DEC3"; +const char *PT1000_SuS8_DEC3_STRING = "PT1000_SuS8_DEC3"; +const char *PT1000_PVCH_DEC3_STRING = "PT1000_PVCH_DEC3"; +const char *GYRO2_STRING = "GYRO2"; +const char *PT1000_PLOC_DEC4_STRING = "PT1000_PLOC_DEC4"; +const char *PT1000_SuS9_DEC4_STRING = "PT1000_SuS9_DEC4"; +const char *PT1000_SuS10_DEC4_STRING = "PT1000_SuS10_DEC4"; +const char *PT1000_PVHC_DEC4_STRING = "PT1000_PVHC_DEC4"; +const char *SuS_ADC_DEC4_STRING = "SuS_ADC_DEC4"; +const char *GPS1_HANDLER_STRING = "GPS1_HANDLER"; +const char *DUMMY_GPS_COM_IF_STRING = "DUMMY_GPS_COM_IF"; +const char *RS232_DEVICE_COM_IF_STRING = "RS232_DEVICE_COM_IF"; +const char *I2C_DEVICE_COM_IF_STRING = "I2C_DEVICE_COM_IF"; +const char *GPIO_DEVICE_COM_IF_STRING = "GPIO_DEVICE_COM_IF"; +const char *SPI_POLLING_TASK_STRING = "SPI_POLLING_TASK"; +const char *SPI_DEVICE_COM_IF_STRING = "SPI_DEVICE_COM_IF"; +const char *DUMMY_ECHO_COM_IF_STRING = "DUMMY_ECHO_COM_IF"; +const char *SD_CARD_HANDLER_STRING = "SD_CARD_HANDLER"; +const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR"; +const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR"; +const char *UDP_TMTC_BRIDGE_STRING = "UDP_TMTC_BRIDGE"; +const char *EMAC_POLLING_TASK_STRING = "EMAC_POLLING_TASK"; +const char *SERIAL_TMTC_BRIDGE_STRING = "SERIAL_TMTC_BRIDGE"; +const char *SERIAL_RING_BUFFER_STRING = "SERIAL_RING_BUFFER"; +const char *SERIAL_POLLING_TASK_STRING = "SERIAL_POLLING_TASK"; +const char *PUS_SERVICE_1_STRING = "PUS_SERVICE_1"; +const char *PUS_SERVICE_2_STRING = "PUS_SERVICE_2"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +const char *PUS_SERVICE_3_PSB_STRING = "PUS_SERVICE_3_PSB"; +const char *PUS_SERVICE_5_STRING = "PUS_SERVICE_5"; +const char *PUS_SERVICE_6_STRING = "PUS_SERVICE_6"; +const char *PUS_SERVICE_8_STRING = "PUS_SERVICE_8"; +const char *PUS_SERVICE_9_STRING = "PUS_SERVICE_9"; +const char *PUS_SERVICE_17_STRING = "PUS_SERVICE_17"; +const char *PUS_SERVICE_20_STRING = "PUS_SERVICE_20"; +const char *PUS_SERVICE_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_200_STRING = "PUS_SERVICE_200"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *PUS_TIME_STRING = "PUS_TIME"; +const char *PUS_FUNNEL_STRING = "PUS_FUNNEL"; +const char *FREERTOS_TASK_MONITOR_STRING = "FREERTOS_TASK_MONITOR"; +const char *HEALTH_TABLE_STRING = "HEALTH_TABLE"; +const char *MODE_STORE_STRING = "MODE_STORE"; +const char *EVENT_MANAGER_STRING = "EVENT_MANAGER"; +const char *INTERNAL_ERROR_REPORTER_STRING = "INTERNAL_ERROR_REPORTER"; +const char *TC_STORE_STRING = "TC_STORE"; +const char *TM_STORE_STRING = "TM_STORE"; +const char *IPC_STORE_STRING = "IPC_STORE"; +const char *AT91_SPI_TEST_TASK_STRING = "AT91_SPI_TEST_TASK"; +const char *STM32_TEST_TASK_STRING = "STM32_TEST_TASK"; +const char *AT91_UART0_TEST_TASK_STRING = "AT91_UART0_TEST_TASK"; +const char *TC_INJECTOR_STRING = "TC_INJECTOR"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object){ + switch((object&0xFFFFFFFF)){ + case 0x000123336: + return AT91_UART2_TEST_TASK_STRING; + case 0x01010100: + return ARDUINO_0_STRING; + case 0x01010101: + return ARDUINO_1_STRING; + case 0x01010102: + return ARDUINO_2_STRING; + case 0x01010103: + return ARDUINO_3_STRING; + case 0x01010104: + return ARDUINO_4_STRING; + case 0x12345678: + return AT91_I2C_TEST_TASK_STRING; + case 0x12345777: + return LED_TASK_STRING; + case 0x42694269: + return TEST_TASK_STRING; + case 0x44003200: + return PCDU_HANDLER_STRING; + case 0x4400AFFE: + return DUMMY_HANDLER_STRING; + case 0x44020108: + return SuS_ADC1_DEC2_STRING; + case 0x44101F00: + return GPS0_HANDLER_STRING; + case 0x44104000: + return DLR_PVCH_STRING; + case 0x44105000: + return GYRO1_STRING; + case 0x44106000: + return DLR_IRAS_STRING; + case 0x44115400: + return SPI_Test_PT1000_STRING; + case 0x44115401: + return PT1000_Syrlinks_DEC1_O1_STRING; + case 0x44115402: + return PT1000_Camera_DEC1_O2_STRING; + case 0x44115404: + return PT1000_SuS1_DEC1_O3_STRING; + case 0x44115405: + return PT1000_SuS2_DEC1_O4_STRING; + case 0x44115406: + return PT1000_SuS3_DEC1_O5_STRING; + case 0x44115407: + return PT1000_PVHC_DEC1_O6_STRING; + case 0x44115500: + return SPI_Test_Gyro_STRING; + case 0x44125401: + return PT1000_CCSDS1_DEC2_STRING; + case 0x44125403: + return PT1000_MGT1_DEC2_STRING; + case 0x44125404: + return PT1000_SuS4_DEC2_STRING; + case 0x44125405: + return PT1000_SuS5_DEC2_STRING; + case 0x44125406: + return PT1000_SuS6_DEC2_STRING; + case 0x44125407: + return PT1000_PVCH_DEC2_STRING; + case 0x44130301: + return PT1000_Iridium_DEC3_STRING; + case 0x44130302: + return PT1000_CCSDS2_DEC3_STRING; + case 0x44130305: + return PT1000_SuS7_DEC3_STRING; + case 0x44130306: + return PT1000_SuS8_DEC3_STRING; + case 0x44130307: + return PT1000_PVCH_DEC3_STRING; + case 0x44130308: + return GYRO2_STRING; + case 0x44145401: + return PT1000_PLOC_DEC4_STRING; + case 0x44145404: + return PT1000_SuS9_DEC4_STRING; + case 0x44145405: + return PT1000_SuS10_DEC4_STRING; + case 0x44145406: + return PT1000_PVHC_DEC4_STRING; + case 0x44145407: + return SuS_ADC_DEC4_STRING; + case 0x44202000: + return GPS1_HANDLER_STRING; + case 0x49001F00: + return DUMMY_GPS_COM_IF_STRING; + case 0x49005200: + return RS232_DEVICE_COM_IF_STRING; + case 0x49005300: + return I2C_DEVICE_COM_IF_STRING; + case 0x49005400: + return GPIO_DEVICE_COM_IF_STRING; + case 0x49005410: + return SPI_POLLING_TASK_STRING; + case 0x49005600: + return SPI_DEVICE_COM_IF_STRING; + case 0x4900AFFE: + return DUMMY_ECHO_COM_IF_STRING; + case 0x4D0073AD: + return SD_CARD_HANDLER_STRING; + case 0x50000100: + return CCSDS_PACKET_DISTRIBUTOR_STRING; + case 0x50000200: + return PUS_PACKET_DISTRIBUTOR_STRING; + case 0x50000300: + return UDP_TMTC_BRIDGE_STRING; + case 0x50000400: + return EMAC_POLLING_TASK_STRING; + case 0x50000500: + return SERIAL_TMTC_BRIDGE_STRING; + case 0x50000550: + return SERIAL_RING_BUFFER_STRING; + case 0x50000600: + return SERIAL_POLLING_TASK_STRING; + case 0x51000100: + return PUS_SERVICE_1_STRING; + case 0x51000200: + return PUS_SERVICE_2_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000310: + return PUS_SERVICE_3_PSB_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51000900: + return PUS_SERVICE_9_STRING; + case 0x51001700: + return PUS_SERVICE_17_STRING; + case 0x51002000: + return PUS_SERVICE_20_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020000: + return PUS_SERVICE_200_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000001: + return PUS_TIME_STRING; + case 0x52000002: + return PUS_FUNNEL_STRING; + case 0x53000000: + return PUS_SERVICE_1_STRING; + case 0x53000003: + return FREERTOS_TASK_MONITOR_STRING; + case 0x53010000: + return HEALTH_TABLE_STRING; + case 0x53010100: + return MODE_STORE_STRING; + case 0x53030000: + return EVENT_MANAGER_STRING; + case 0x53040000: + return INTERNAL_ERROR_REPORTER_STRING; + case 0x534f0100: + return TC_STORE_STRING; + case 0x534f0200: + return TM_STORE_STRING; + case 0x534f0300: + return IPC_STORE_STRING; + case 0x66666666: + return AT91_SPI_TEST_TASK_STRING; + case 0x77777777: + return STM32_TEST_TASK_STRING; + case 0x87654321: + return AT91_UART0_TEST_TASK_STRING; + case 0x99000001: + return TC_INJECTOR_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/defaultcfg/config/objects/translateObjects.h b/defaultcfg/config/objects/translateObjects.h new file mode 100644 index 000000000..5b6569408 --- /dev/null +++ b/defaultcfg/config/objects/translateObjects.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_OBJECTS_TRANSLATEOBJECTS_H_ +#define CONFIG_OBJECTS_TRANSLATEOBJECTS_H_ + +#include + +const char* translateObject(object_id_t object); + + +#endif /* CONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/defaultcfg/config/pollingsequence/PollingSequenceFactory.cpp b/defaultcfg/config/pollingsequence/PollingSequenceFactory.cpp new file mode 100644 index 000000000..f836a7462 --- /dev/null +++ b/defaultcfg/config/pollingsequence/PollingSequenceFactory.cpp @@ -0,0 +1,23 @@ +#include "PollingSequenceFactory.h" + +#include +#include +#include + +ReturnValue_t pst::pollingSequenceInitDefault( + FixedTimeslotTaskIF *thisSequence) { + /* Length of a communication cycle */ + uint32_t length = thisSequence->getPeriodMs(); + + /* Add polling sequence table here */ + + if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { + return HasReturnvaluesIF::RETURN_OK; + } + else { + sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" + << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } +} + diff --git a/defaultcfg/config/pollingsequence/PollingSequenceFactory.h b/defaultcfg/config/pollingsequence/PollingSequenceFactory.h new file mode 100644 index 000000000..c5d41b7d8 --- /dev/null +++ b/defaultcfg/config/pollingsequence/PollingSequenceFactory.h @@ -0,0 +1,32 @@ +#ifndef POLLINGSEQUENCEFACTORY_H_ +#define POLLINGSEQUENCEFACTORY_H_ + +#include + +class FixedTimeslotTaskIF; + +/** + * All device handlers are scheduled by adding them into Polling Sequence Tables (PST) + * to satisfy stricter timing requirements of device communication, + * A device handler has four different communication steps: + * 1. DeviceHandlerIF::SEND_WRITE -> Send write via interface + * 2. DeviceHandlerIF::GET_WRITE -> Get confirmation for write + * 3. DeviceHandlerIF::SEND_READ -> Send read request + * 4. DeviceHandlerIF::GET_READ -> Read from interface + * The PST specifies precisely when the respective ComIF functions are called + * during the communication cycle time. + * The task is created using the FixedTimeslotTaskIF, + * which utilises the underlying Operating System Abstraction Layer (OSAL) + * + * @param thisSequence FixedTimeslotTaskIF * object is passed inside the Factory class when creating the PST + * @return + */ +namespace pst { + +/* Default PST */ +ReturnValue_t pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence); + + +} + +#endif /* POLLINGSEQUENCEINIT_H_ */ diff --git a/defaultcfg/config/returnvalues/classIds.h b/defaultcfg/config/returnvalues/classIds.h new file mode 100644 index 000000000..606cc60b2 --- /dev/null +++ b/defaultcfg/config/returnvalues/classIds.h @@ -0,0 +1,16 @@ +#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_ +#define CONFIG_RETURNVALUES_CLASSIDS_H_ + +#include + +/** + * @brief CLASS_ID defintions which are required for custom returnvalues. + */ +namespace CLASS_ID { +enum { + MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, +}; +} + + +#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */ diff --git a/defaultcfg/config/tmtc/apid.h b/defaultcfg/config/tmtc/apid.h new file mode 100644 index 000000000..c0231bca8 --- /dev/null +++ b/defaultcfg/config/tmtc/apid.h @@ -0,0 +1,18 @@ +#ifndef CONFIG_TMTC_APID_H_ +#define CONFIG_TMTC_APID_H_ + +#include + +/** + * Application Process Definition: entity, uniquely identified by an + * application process ID (APID), capable of generating telemetry source + * packets and receiving telecommand packets. + * + * Chose APID(s) for mission and define it here. + */ +namespace apid { + static const uint16_t DEFAULT_APID = 0x00; +} + + +#endif /* CONFIG_TMTC_APID_H_ */ diff --git a/defaultcfg/config/tmtc/pusIds.h b/defaultcfg/config/tmtc/pusIds.h new file mode 100644 index 000000000..cc0db9f02 --- /dev/null +++ b/defaultcfg/config/tmtc/pusIds.h @@ -0,0 +1,23 @@ +#ifndef CONFIG_TMTC_PUSIDS_HPP_ +#define CONFIG_TMTC_PUSIDS_HPP_ + +namespace pus { +enum Ids: uint8_t { + PUS_SERVICE_1 = 1, + PUS_SERVICE_2 = 2, + PUS_SERVICE_3 = 3, + PUS_SERVICE_5 = 5, + PUS_SERVICE_6 = 6, + PUS_SERVICE_8 = 8, + PUS_SERVICE_9 = 9, + PUS_SERVICE_11 = 11, + PUS_SERVICE_17 = 17, + PUS_SERVICE_19 = 19, + PUS_SERVICE_20 = 20, + PUS_SERVICE_23 = 23, + PUS_SERVICE_200 = 200, + PUS_SERVICE_201 = 201, +}; +}; + +#endif /* CONFIG_TMTC_PUSIDS_HPP_ */ diff --git a/defaultcfg/config/version.h b/defaultcfg/config/version.h new file mode 100644 index 000000000..3c60317c4 --- /dev/null +++ b/defaultcfg/config/version.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_VERSION_H_ +#define CONFIG_VERSION_H_ + +/* OBSW versioning can be specified in this file */ + +#define OBSW_VERSION 0 +#define OBSW_SUBVERSION 0 + +#endif /* CONFIG_VERSION_H_ */ diff --git a/defaultcfg/version.h b/defaultcfg/version.h new file mode 100644 index 000000000..b3ef83189 --- /dev/null +++ b/defaultcfg/version.h @@ -0,0 +1,11 @@ +#ifndef FSFW_DEFAULTCFG_VERSION_H_ +#define FSFW_DEFAULTCFG_VERSION_H_ + +static const char* FSFW_VERSION_NAME = "fsfw"; + +#define FSFW_VERSION 0 +#define FSFW_SUBVERSION 0 + + + +#endif /* FSFW_DEFAULTCFG_VERSION_H_ */