diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6dfa6b9a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +/build* +generators +misc +tmtc +doc + diff --git a/.gitignore b/.gitignore index 2ccfca61..564a96fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,9 @@ -_obj -_bin -_dep +/build* Debug Debug* Release Release* -MinSizeRel -MinSizeRel* -RelWithDebInfo -RelWithDebInfo* .settings .metadata @@ -17,6 +11,9 @@ RelWithDebInfo* .cproject __pycache__ +.idea + !misc/eclipse/**/.cproject !misc/eclipse/**/.project -/eive_obsw cmake debug/ + +generators/*.db diff --git a/.gitmodules b/.gitmodules index 6f538287..44a86d86 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://github.com/rmspacefish/lwgps.git [submodule "fsfw_hal"] path = fsfw_hal - url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw_hal.git -[submodule "generators/modgen"] - path = generators/modgen - url = https://git.ksat-stuttgart.de/source/modgen.git + url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-hal.git +[submodule "generators/fsfwgen"] + path = generators/fsfwgen + url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-generators.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e4eb527..33c6edfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,10 @@ if(NOT OS_FSFW) set(OS_FSFW host CACHE STRING "OS for the FSFW.") endif() +if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack") + option(LINUX_CROSS_COMPILE ON) +endif() + # Perform steps like loading toolchain files where applicable. include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() @@ -50,6 +54,7 @@ set(MISSION_PATH mission) set(TEST_PATH test/testtasks) set(LINUX_PATH linux) set(COMMON_PATH common) +set(COMMON_CONFIG_PATH ${COMMON_PATH}/config) set(FSFW_HAL_LIB_PATH fsfw_hal) set(CSP_LIB_PATH ${THIRD_PARTY_FOLDER}/libcsp) @@ -57,7 +62,7 @@ set(ETL_LIB_PATH ${THIRD_PARTY_FOLDER}/etl) set(LWGPS_LIB_PATH ${THIRD_PARTY_FOLDER}/lwgps) set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF) -set(ADD_LINUX_FILES TRUE) +set(ADD_LINUX_FILES False) # Analyse different OS and architecture/target options, determine BSP_PATH, # display information about compiler etc. @@ -65,9 +70,10 @@ include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake) pre_source_hw_os_config() if(TGT_BSP) - if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi") - set(ROOT_CONFIG_FOLDER TRUE) - set(FSFW_CONFIG_PATH "fsfwconfig") + if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi" + OR ${TGT_BSP} MATCHES "arm/beagleboneblack" + ) + set(FSFW_CONFIG_PATH "linux/fsfwconfig") set(ADD_LINUX_FILES TRUE) set(ADD_CSP_LIB TRUE) set(FSFW_HAL_ADD_LINUX ON) @@ -78,6 +84,10 @@ if(TGT_BSP) set(FSFW_HAL_ADD_RASPBERRY_PI ON) endif() + if(${TGT_BSP} MATCHES "arm/beagleboneblack") + add_definitions(-DBEAGLEBONEBLACK) + endif() + if(${TGT_BSP} MATCHES "arm/q7s") add_definitions(-DXIPHOS_Q7S) endif() @@ -85,6 +95,22 @@ else() # Required by FSFW library set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") endif() + +# Configuration files +configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h) +configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) +configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) +if(${TGT_BSP} MATCHES "arm/q7s") + configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) +elseif(${TGT_BSP} MATCHES "arm/raspberrypi") + configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) +endif() + +# Set common config path for FSFW +set(FSFW_ADDITIONAL_INC_PATHS + "${COMMON_PATH}/config" + ${CMAKE_CURRENT_BINARY_DIR} +) # Set for lwgps library set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") @@ -95,11 +121,6 @@ set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") # Add executable add_executable(${TARGET_NAME}) -# Add subdirectories -if(ROOT_CONFIG_FOLDER) - add_subdirectory(${FSFW_CONFIG_PATH}) -endif() - if(ADD_CSP_LIB) add_subdirectory(${CSP_LIB_PATH}) endif() @@ -150,6 +171,7 @@ endif() target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH} + ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/README.md b/README.md index 38df4443..ba18152d 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,7 @@ The CMake build system can be used to generate build systems as well (see helper ### Installing Vivado the the Xilinx development tools It's also possible to perform debugging with a normal Eclipse installation by installing -the TCF plugin. Still, it is necessary to install Vivado to get the toolchain for generating -C++ applications. Alternatively you can download the toolchain -[from the cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Arbeitsdaten/08_Used%20Components/Q7S/Toolchain&fileid=422486). +the TCF plugin and downloading the cross-compiler as specified in the section below. * Install Vivado 2018.2 and Xilinx SDK from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html. Install the Vivado Design Suite - HLx Editions - 2018.2 Full Product Installation instead of the updates. It is recommended to use the installer. @@ -53,6 +51,24 @@ C++ applications. Alternatively you can download the toolchain `\SDK\2018.2\gnu\aarch32\nt\gcc-arm-linux-gnueabi\bin` or set up path each time before debugging. +### Installing toolchain without Vivado + +You can download the toolchains for Windows and Linux +[from the EIVE cloud](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files?dir=/EIVE_IRS/Software/tools&fileid=831898). + +If `wget` is available (e.g. MinGW64), you can use the following command to download the +toolchain for Windows + +```sh +wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/rfoaistRd67yBbH/download/gcc-arm-linux-gnueabi-win.zip +``` + +or the following command for Linux (could be useful for CI/CD) + +```sh +wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/2Fp2ag6NGnbtAsK/download/gcc-arm-linux-gnueabi.tar.gz +``` + ### Installing CMake and MSYS2 on Windows 1. Install [MSYS2](https://www.msys2.org/) and [CMake](https://cmake.org/download/) first. @@ -89,7 +105,15 @@ C++ applications. Alternatively you can download the toolchain ## Getting the Q7S system root It is necessary to copy the Q7S system root to your local development machine for libraries -like `libgpio`. You can find the system root [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Arbeitsdaten/08_Used%20Components/Q7S/Toolchain&fileid=422486). Download it and unzip it somewhere in the Xilinx installation folder. +like `libgpio`. You can find the system root for the Q7S, the Raspberry Pi and the +Beagle Bone Black for download here +[here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849). +Download it and unzip it somewhere in the Xilinx installation folder. +You can use the following command if `wget` can be used or for CI/CD: + +``` +wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/agnJGYeRf6fw2ci/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz +``` Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path. @@ -116,18 +140,30 @@ When using Windows, run theses steps in MSYS2. or to set up the [PATH and the CROSS_COMPILE variable permanently](https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path) in the `.profile` file. -4. Run the CMake configuration to create the build system in a `Debug` folder. - Navigate into the `eive_obsw` folder first. - +4. Run the CMake configuration to create the build system in a `build-Debug-Q7S` folder. + Add `-G "MinGW Makefiles` in MinGW64 on Windows. + + ```sh + mkdir build-Debug-Q7S && cd build-Debug-Q7S + cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug -DOS_FSFW=linux .. + cmake --build . -j + ``` + + You can also use provided shell scripts to perform these commands + ```sh cd cmake/scripts/Q7S ./create_cmake_debug.sh cd ../../.. ``` - + This will invoke a Python script which in turn invokes CMake with the correct arguments to configure CMake for Q7S cross-compilation. + You can build the hosted variant of the OBSW by replacing `-DOS_FSFW=linux` with + `-DOS_FSFW=host`. There are also different values for `-DTGT_BSP` to build for the Raspberry Pi + or the Beagle Bone Black: `arm/raspberrypi` and `arm/beagleboneblack`. + 5. Build the software with ```sh cd Debug @@ -266,7 +302,7 @@ To transfer files from the local machine to the Q7S, use port forwarding ssh -L 1535:192.168.133.10:22 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5 ``` -Then you can copy an `example` file like this +An `example` file can be copied like this ```sh scp -P 1535 example root@localhost:/tmp @@ -277,7 +313,7 @@ Copying a file from Q7S to flatsat PC scp -P 22 root@192.168.133.10:/tmp/kernel-config /tmp ```` -From a windows machine files can be copied with putty tools +From a windows machine files can be copied with putty tools (note: use IPv4 address) ```` pscp -scp -P 22 eive@192.168.199.227:/example-file ```` @@ -529,6 +565,38 @@ GET out_en[0] = 1 * Local File Path: Path to eiveobsw-linux.elf (in _bin\linux\devel) * Remote File Path: /tmp/eive_obsw.elf +## Running cppcheck on the Software + +Static code analysis can be useful to find bugs. +`cppcheck` can be used for this purpose. On Windows you can use MinGW64 to do this. + +```sh +pacman -S mingw-w64-x86_64-cppcheck +``` + +On Ubuntu, install with + +```sh +sudo apt-get install cppcheck +``` + +You can use the Eclipse integration or you can perform the scanning manually from the command line. +CMake will be used for this. + +Run the CMake build generation commands specified above but supply +`-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` to the build generation. Invoking the build command will +generate a `compile_commands.json` file which can be used by cppcheck. + +```sh +cppcheck --project=compile_commands.json --xml 2> report.xml +``` + +Finally, you can convert the generated `.xml` file to HTML with the following command + +```sh +cppcheck-htmlreport --file=report.xml --report-dir=cppcheck --source-dir=.. +``` + ## Libgpiod Detect all gpio device files: @@ -579,4 +647,23 @@ to install the required GPIO libraries before cloning the system root folder. When using Eclipse, there are two special build variables in the project properties → C/C++ Build → Build Variables called `Q7S_SYSROOT` or `RPI_SYSROOT`. You can set the sysroot path in those variables to get any additional includes like `gpiod.h` in the -Eclipse indexer. \ No newline at end of file +Eclipse indexer. + +## Xilinx UARTLIE +Get info about ttyUL* devices +```` +cat /proc/tty/driver +```` + +## I2C +Getting information about I2C device +```` +ls /sys/class/i2c-dev/i2c-0/device/device/driver +```` +This shows the memory mapping of /dev/i2c-0 + +## Useful Q7S Linux Commands +Rebooting currently running image: +```` +xsc_boot_copy -r +```` diff --git a/bsp_hosted/Dockerfile b/bsp_hosted/Dockerfile new file mode 100644 index 00000000..c55ccc67 --- /dev/null +++ b/bsp_hosted/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:latest +# FROM alpine:latest + +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && apt-get install -y cmake g++ +# RUN apk add cmake make g++ + +WORKDIR /usr/src/app +COPY . . + +RUN set -ex; \ + rm -rf build-hosted; \ + mkdir build-hosted; \ + cd build-hosted; \ + cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=linux ..; + +ENTRYPOINT ["cmake", "--build", "build-hosted"] +CMD ["-j"] +# CMD ["bash"] diff --git a/bsp_hosted/InitMission.cpp b/bsp_hosted/InitMission.cpp index 06bc5646..2743aa36 100644 --- a/bsp_hosted/InitMission.cpp +++ b/bsp_hosted/InitMission.cpp @@ -32,9 +32,9 @@ ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index f3d7591d..acc0be37 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #if OBSW_ADD_TEST_CODE == 1 @@ -33,16 +33,14 @@ void Factory::setStaticFrameworkObjectIds(){ TmFunnel::storageDestination = objects::NO_OBJECT; VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketStored::timeStamperId = objects::TIME_STAMPER; + TmPacketBase::timeStamperId = objects::TIME_STAMPER; } -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); - new UdpTmTcBridge(objects::UDP_BRIDGE, - objects::CCSDS_PACKET_DISTRIBUTOR, - objects::TM_STORE, objects::TC_STORE); + new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); } diff --git a/bsp_hosted/ObjectFactory.h b/bsp_hosted/ObjectFactory.h index f7fa81ac..feaba70e 100644 --- a/bsp_hosted/ObjectFactory.h +++ b/bsp_hosted/ObjectFactory.h @@ -1,17 +1,10 @@ -/* - * ObjectFactory.h - * - * Created on: Sep 22, 2020 - * Author: steffen - */ - #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_hosted/fsfwconfig/CMakeLists.txt b/bsp_hosted/fsfwconfig/CMakeLists.txt index a906098f..fc961da8 100644 --- a/bsp_hosted/fsfwconfig/CMakeLists.txt +++ b/bsp_hosted/fsfwconfig/CMakeLists.txt @@ -6,5 +6,16 @@ target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) +# If a special translation file for object IDs exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + objects/translateObjects.cpp + ) +endif() - +# If a special translation file for events exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + events/translateEvents.cpp + ) +endif() diff --git a/bsp_hosted/fsfwconfig/FSFWConfig.h b/bsp_hosted/fsfwconfig/FSFWConfig.h.in similarity index 68% rename from bsp_hosted/fsfwconfig/FSFWConfig.h rename to bsp_hosted/fsfwconfig/FSFWConfig.h.in index e3def8fe..1eedac67 100644 --- a/bsp_hosted/fsfwconfig/FSFWConfig.h +++ b/bsp_hosted/fsfwconfig/FSFWConfig.h.in @@ -7,18 +7,18 @@ //! Used to determine whether C++ ostreams are used which can increase //! the binary size significantly. If this is disabled, //! the C stdio functions can be used alternatively -#define FSFW_CPP_OSTREAM_ENABLED 1 +#define FSFW_CPP_OSTREAM_ENABLED 1 //! More FSFW related printouts depending on level. Useful for development. -#define FSFW_VERBOSE_LEVEL 1 +#define FSFW_VERBOSE_LEVEL 1 //! Can be used to completely disable printouts, even the C stdio ones. #if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0 - #define FSFW_DISABLE_PRINTOUT 0 + #define FSFW_DISABLE_PRINTOUT 0 #endif -//! Can be used to disable the ANSI color sequences for C stdio. -#define FSFW_COLORED_OUTPUT 1 +#define FSFW_USE_PUS_C_TELEMETRY 1 +#define FSFW_USE_PUS_C_TELECOMMANDS 1 //! Can be used to disable the ANSI color sequences for C stdio. #define FSFW_COLORED_OUTPUT 1 @@ -26,7 +26,7 @@ //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiled source files) -#define FSFW_OBJ_EVENT_TRANSLATION 0 +#define FSFW_OBJ_EVENT_TRANSLATION 1 #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. @@ -43,10 +43,17 @@ //! Specify whether a special mode store is used for Subsystem components. #define FSFW_USE_MODESTORE 0 +//! Defines if the real time scheduler for linux should be used. +//! If set to 0, this will also disable priority settings for linux +//! as most systems will not allow to set nice values without privileges +//! For embedded linux system set this to 1. +//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run +#define FSFW_USE_REALTIME_FOR_LINUX 0 + namespace fsfwconfig { -//! Default timestamp size. The default timestamp will be an eight byte CDC -//! short timestamp. -static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8; + +//! Default timestamp size. The default timestamp will be an seven byte CDC short timestamp. +static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 7; //! Configure the allocated pool sizes for the event manager. static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240; @@ -55,11 +62,14 @@ static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; //! 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 +//! simultaneously. This will increase the required RAM for //! each CSB service ! static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6; static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124; + +static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048; + } #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h b/bsp_hosted/fsfwconfig/OBSWConfig.h.in similarity index 100% rename from bsp_hosted/fsfwconfig/OBSWConfig.h rename to bsp_hosted/fsfwconfig/OBSWConfig.h.in diff --git a/bsp_hosted/fsfwconfig/OBSWVersion.h b/bsp_hosted/fsfwconfig/OBSWVersion.h deleted file mode 100644 index 980b6965..00000000 --- a/bsp_hosted/fsfwconfig/OBSWVersion.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef FSFWCONFIG_OBSWVERSION_H_ -#define FSFWCONFIG_OBSWVERSION_H_ - -const char* const SW_NAME = "eive"; - -#define SW_VERSION 1 -#define SW_SUBVERSION 0 -#define SW_SUBSUBVERSION 0 - - - -#endif /* FSFWCONFIG_OBSWVERSION_H_ */ diff --git a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h index 51534f60..7335a804 100644 --- a/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h +++ b/bsp_hosted/fsfwconfig/events/subsystemIdRanges.h @@ -1,7 +1,7 @@ #ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include +#include #include /** @@ -10,17 +10,7 @@ */ namespace SUBSYSTEM_ID { enum: uint8_t { - SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, - PUS_SERVICE_2, - PUS_SERVICE_3, - PUS_SERVICE_5, - PUS_SERVICE_6, - PUS_SERVICE_8, - PUS_SERVICE_23, - MGM_LIS3MDL, - MGM_RM3100, - - DUMMY_DEVICE, + SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END }; } diff --git a/bsp_hosted/fsfwconfig/events/translateEvents.cpp b/bsp_hosted/fsfwconfig/events/translateEvents.cpp new file mode 100644 index 00000000..7b9ce4b5 --- /dev/null +++ b/bsp_hosted/fsfwconfig/events/translateEvents.cpp @@ -0,0 +1,264 @@ +/** + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-05-17 19:49:55 + */ +#include "translateEvents.h" + +const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; +const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; +const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; +const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; +const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; +const char *STORING_FAILED_STRING = "STORING_FAILED"; +const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; +const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; +const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; +const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; +const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; +const char *INIT_DONE_STRING = "INIT_DONE"; +const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; +const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; +const char *DELETION_FAILED_STRING = "DELETION_FAILED"; +const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; +const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; +const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; +const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; +const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; +const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; +const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; +const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; +const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; +const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; +const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; +const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; +const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; +const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; +const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; +const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; +const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; +const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; +const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; +const char *HEATER_ON_STRING = "HEATER_ON"; +const char *HEATER_OFF_STRING = "HEATER_OFF"; +const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; +const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; +const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; +const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; +const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; +const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; +const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; +const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; +const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; +const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; +const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; +const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; +const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; +const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; +const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; +const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; +const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; +const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; +const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; +const char *CHANGING_MODE_STRING = "CHANGING_MODE"; +const char *MODE_INFO_STRING = "MODE_INFO"; +const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; +const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; +const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; +const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; +const char *FORCING_MODE_STRING = "FORCING_MODE"; +const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; +const char *HEALTH_INFO_STRING = "HEALTH_INFO"; +const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; +const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; +const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; +const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; +const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; +const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; +const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; +const char *RF_LOST_STRING = "RF_LOST"; +const char *BIT_LOCK_STRING = "BIT_LOCK"; +const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; +const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; + +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; +} diff --git a/fsfwconfig/events/translateEvents.h b/bsp_hosted/fsfwconfig/events/translateEvents.h similarity index 72% rename from fsfwconfig/events/translateEvents.h rename to bsp_hosted/fsfwconfig/events/translateEvents.h index e7a88326..9034dcf2 100644 --- a/fsfwconfig/events/translateEvents.h +++ b/bsp_hosted/fsfwconfig/events/translateEvents.h @@ -1,10 +1,3 @@ -/* - * translateEvent.h - * - * Created on: 28 May 2019 - * Author: Robin - */ - #ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ #define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ @@ -12,5 +5,4 @@ const char * translateEvents(Event event); - #endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/bsp_hosted/fsfwconfig/objects/systemObjectList.h b/bsp_hosted/fsfwconfig/objects/systemObjectList.h index d7a1abd7..21a5f939 100644 --- a/bsp_hosted/fsfwconfig/objects/systemObjectList.h +++ b/bsp_hosted/fsfwconfig/objects/systemObjectList.h @@ -2,15 +2,11 @@ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #include +#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_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, PUS_SERVICE_3 = 0x51000300, PUS_SERVICE_5 = 0x51000400, @@ -27,21 +23,6 @@ namespace objects { DUMMY_INTERFACE = 0xCAFECAFE, DUMMY_HANDLER = 0x4400AFFE, - /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44000001, - PDU1_HANDLER = 0x44000002, - PDU2_HANDLER = 0x44000003, - ACU_HANDLER = 0x44000004, - TMP1075_HANDLER_1 = 0x44000005, - TMP1075_HANDLER_2 = 0x44000006, - MGM_0_LIS3_HANDLER = 0x4400007, - MGM_1_RM3100_HANDLER = 0x44000008, - MGM_2_LIS3_HANDLER = 0x44000009, - MGM_3_RM3100_HANDLER = 0x44000010, - GYRO_0_ADIS_HANDLER = 0x44000011, - GYRO_1_L3G_HANDLER = 0x44000012, - GYRO_2_L3G_HANDLER = 0x44000013, - /* 0x49 ('I') for Communication Interfaces **/ ARDUINO_COM_IF = 0x49000001 }; diff --git a/bsp_hosted/fsfwconfig/objects/translateObjects.cpp b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp new file mode 100644 index 00000000..9aac2b47 --- /dev/null +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.cpp @@ -0,0 +1,109 @@ +/** + * @brief Auto-generated object translation file. + * @details + * Contains 31 translations. + * Generated on: 2021-05-17 19:12:49 + */ +#include "translateObjects.h" + +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +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_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +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 *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x42694269: + return TEST_TASK_STRING; + case 0x4400AFFE: + return DUMMY_HANDLER_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_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 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0xCAFECAFE: + return DUMMY_INTERFACE_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/fsfwconfig/objects/translateObjects.h b/bsp_hosted/fsfwconfig/objects/translateObjects.h similarity index 60% rename from fsfwconfig/objects/translateObjects.h rename to bsp_hosted/fsfwconfig/objects/translateObjects.h index 2e5a8c40..dbf5b468 100644 --- a/fsfwconfig/objects/translateObjects.h +++ b/bsp_hosted/fsfwconfig/objects/translateObjects.h @@ -1,16 +1,8 @@ -/* - * translateObjects.h - * - * Created on: 28 May 2019 - * Author: Robin - */ - #ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ #define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ -#include +#include const char* translateObject(object_id_t object); - #endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/bsp_hosted/fsfwconfig/returnvalues/classIds.h b/bsp_hosted/fsfwconfig/returnvalues/classIds.h index 21371c15..cc159fec 100644 --- a/bsp_hosted/fsfwconfig/returnvalues/classIds.h +++ b/bsp_hosted/fsfwconfig/returnvalues/classIds.h @@ -1,6 +1,7 @@ #ifndef CONFIG_RETURNVALUES_CLASSIDS_H_ #define CONFIG_RETURNVALUES_CLASSIDS_H_ +#include "commonClassIds.h" #include /** @@ -10,9 +11,7 @@ */ namespace CLASS_ID { enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - MGM_LIS3MDL, - MGM_RM3100 + CLASS_ID_START = COMMON_CLASS_ID_END, }; } diff --git a/bsp_rpi/CMakeLists.txt b/bsp_linux_board/CMakeLists.txt similarity index 83% rename from bsp_rpi/CMakeLists.txt rename to bsp_linux_board/CMakeLists.txt index da35633d..5963d48c 100644 --- a/bsp_rpi/CMakeLists.txt +++ b/bsp_linux_board/CMakeLists.txt @@ -6,9 +6,3 @@ target_sources(${TARGET_NAME} PUBLIC add_subdirectory(boardconfig) add_subdirectory(boardtest) -add_subdirectory(gpio) - - - - - diff --git a/bsp_linux_board/Dockerfile b/bsp_linux_board/Dockerfile new file mode 100644 index 00000000..970b44db --- /dev/null +++ b/bsp_linux_board/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:latest +# FROM alpine:latest + +RUN apt-get update && apt-get install -y curl wget cmake g++ + +# Raspberry Pi rootfs +RUN mkdir -p /usr/rootfs; \ + curl https://eive-cloud.irs.uni-stuttgart.de/index.php/s/kJe3nCnGPRGKFCz/download/rpi-rootfs.tar.gz /usr/rootfs \ + | tar xvz -C /usr/rootfs +# Raspberry Pi toolchain +RUN mkdir -p /opt; \ + cd /opt; \ + wget https://github.com/Pro/raspi-toolchain/releases/latest/download/raspi-toolchain.tar.gz; \ + tar xfz raspi-toolchain.tar.gz --strip-components=1 -C .; \ + rm -rf raspi-toolchain.tar.gz + +# RUN apk add cmake make g++ + +# Required for cmake build +ENV RASPBERRY_VERSION="4" +ENV RASPBIAN_ROOTFS="/usr/rootfs/rootfs" +ENV PATH=$PATH:"/opt/cross-pi-gcc/bin" +ENV CROSS_COMPILE="arm-linux-gnueabihf" + +WORKDIR /usr/src/app +COPY . . + +RUN set -ex; \ + rm -rf build-rpi; \ + mkdir build-rpi; \ + cd build-rpi; \ + cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=linux -DTGT_BSP="arm/raspberrypi" ..; + +ENTRYPOINT ["cmake", "--build", "build-rpi"] +CMD ["-j"] +# CMD ["bash"] + diff --git a/bsp_rpi/InitMission.cpp b/bsp_linux_board/InitMission.cpp similarity index 85% rename from bsp_rpi/InitMission.cpp rename to bsp_linux_board/InitMission.cpp index 40c38e6c..16dab475 100644 --- a/bsp_rpi/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -1,9 +1,9 @@ #include "InitMission.h" #include "ObjectFactory.h" -#include -#include -#include +#include "objects/systemObjectList.h" +#include "OBSWConfig.h" +#include "pollingsequence/pollingSequenceFactory.h" #include #include @@ -26,9 +26,9 @@ ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); @@ -117,6 +117,10 @@ void initmission::initTasks() { if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS); } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING); + } PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask( "PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc); @@ -124,11 +128,16 @@ void initmission::initTasks() { if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST); } + result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("INT_ERR_RPRT", + objects::INTERNAL_ERROR_REPORTER); + } -#if RPI_TEST_ACS_BOARD == 1 - FixedTimeslotTaskIF* acsTask = factory->createFixedTimeslotTask( +#if OBSW_ADD_TEST_PST == 1 + FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask( "ACS_PST", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 2.0, missedDeadlineFunc); - result = pst::pollingSequenceAcsTest(acsTask); + result = pst::pollingSequenceTest(pstTestTask); if(result != HasReturnvaluesIF::RETURN_OK) { sif::warning << "initmission::initTasks: ACS PST initialization failed!" << std::endl; } @@ -154,6 +163,12 @@ void initmission::initTasks() { initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST); } #endif /* RPI_ADD_GPIO_TEST == 1 */ +#if RPI_ADD_UART_TEST == 1 + result = testTask->addComponent(objects::UART_TEST); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("UART_TEST", objects::UART_TEST); + } +#endif /* RPI_ADD_GPIO_TEST == 1 */ sif::info << "Starting tasks.." << std::endl; tmTcDistributor->startTask(); @@ -170,8 +185,8 @@ void initmission::initTasks() { testTask->startTask(); #endif /* OBSW_ADD_TEST_CODE == 1 */ -#if RPI_TEST_ACS_BOARD == 1 - acsTask->startTask(); +#if OBSW_ADD_TEST_PST == 1 + pstTestTask->startTask(); #endif /* RPI_TEST_ACS_BOARD == 1 */ sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_rpi/InitMission.h b/bsp_linux_board/InitMission.h similarity index 100% rename from bsp_rpi/InitMission.h rename to bsp_linux_board/InitMission.h diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp new file mode 100644 index 00000000..d6dfd623 --- /dev/null +++ b/bsp_linux_board/ObjectFactory.cpp @@ -0,0 +1,149 @@ +#include "ObjectFactory.h" + +#include "objects/systemObjectList.h" +#include "devices/addresses.h" +#include "devices/gpioIds.h" +#include "OBSWConfig.h" +#include "tmtc/apid.h" +#include "tmtc/pusIds.h" +#include "spiConf.h" + +#include "linux/boardtest/LibgpiodTest.h" +#include "linux/boardtest/SpiTestClass.h" +#include "linux/boardtest/UartTestClass.h" + +#include "mission/core/GenericFactory.h" +#include "mission/utility/TmFunnel.h" +#include "mission/devices/MGMHandlerLIS3MDL.h" +#include "mission/devices/MGMHandlerRM3100.h" +#include "mission/devices/GyroADIS16507Handler.h" + +#include "fsfw/datapoollocal/LocalDataPoolManager.h" +#include "fsfw/tmtcservices/CommandingServiceBase.h" +#include "fsfw/tmtcservices/PusServiceBase.h" +#include "fsfw/tmtcpacket/pus/tm.h" +#include "fsfw/tasks/TaskFactory.h" + +/* UDP server includes */ +#include "fsfw/osal/common/UdpTmTcBridge.h" +#include "fsfw/osal/common/UdpTcPollingTask.h" + +#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" +#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" +#include "fsfw_hal/linux/rpi/GpioRPi.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" +#include "fsfw_hal/linux/spi/SpiCookie.h" +#include "fsfw_hal/linux/spi/SpiComIF.h" + +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; + + TmFunnel::downlinkDestination = objects::UDP_BRIDGE; + // No storage object for now. + TmFunnel::storageDestination = objects::NO_OBJECT; + + VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; + TmPacketBase::timeStamperId = objects::TIME_STAMPER; +} + + + +void ObjectFactory::produce(void* args){ + Factory::setStaticFrameworkObjectIds(); + ObjectFactory::produceGenericObjects(); + + new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); + + GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF); + GpioCookie* gpioCookie = nullptr; + static_cast(gpioCookie); +#if RPI_ADD_SPI_TEST == 1 + new SpiTestClass(objects::SPI_TEST, gpioIF); +#endif + +#if RPI_ADD_UART_TEST == 1 + new UartTestClass(objects::UART_TEST); +#endif + +#if RPI_LOOPBACK_TEST_GPIO == 1 + GpioCookie* gpioCookieLoopback = new GpioCookie(); + /* Loopback pins. Adapt according to setup */ + gpioId_t gpioIdSender = gpioIds::TEST_ID_0; + int bcmPinSender = 26; + gpioId_t gpioIdReader = gpioIds::TEST_ID_1; + int bcmPinReader = 16; + gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdSender, bcmPinSender, "GPIO_LB_SENDER", + gpio::Direction::OUT, 0); + gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdReader, bcmPinReader, "GPIO_LB_READER", + gpio::Direction::IN, 0); + new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookieLoopback); +#endif /* RPI_LOOPBACK_TEST_GPIO == 1 */ + + new SpiComIF(objects::SPI_COM_IF, gpioIF); + + std::string spiDev; + SpiCookie* spiCookie = nullptr; + static_cast(spiCookie); + +#if RPI_TEST_ACS_BOARD == 1 + if(gpioCookie == nullptr) { + gpioCookie = new GpioCookie(); + } + gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, + "MGM_0_LIS3", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN, + "MGM_1_RM3100", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, + "MGM_2_LIS3", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN, + "MGM_3_RM3100", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN, + "GYRO_0_ADIS", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, + "GYRO_1_L3G", gpio::Direction::OUT, 1); + gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_2_L3G_CS, gpio::GYRO_2_BCM_PIN, + "GYRO_2_L3G", gpio::Direction::OUT, 1); + gpioIF->addGpios(gpioCookie); + + spiDev = "/dev/spidev0.0"; + spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, + MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); + auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER, + objects::SPI_COM_IF, spiCookie); + mgmLis3Handler->setStartUpImmediately(); + + spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, + RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); + auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER, + objects::SPI_COM_IF, spiCookie); + mgmRm3100Handler->setStartUpImmediately(); + + spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, + L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, + spiCookie); + gyroL3gHandler->setStartUpImmediately(); + +#endif /* RPI_TEST_ACS_BOARD == 1 */ + +#if RPI_TEST_ADIS16507 == 1 + if(gpioCookie == nullptr) { + gpioCookie = new GpioCookie(); + } + gpio::createRpiGpioConfig(gpioCookie, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN, + "GYRO_0_ADIS", gpio::Direction::OUT, 1); + gpioIF->addGpios(gpioCookie); + + spiDev = "/dev/spidev0.0"; + spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev, + ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE, spi::DEFAULT_ADIS16507_SPEED, + nullptr, nullptr); + auto adisGyroHandler = new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie); + adisGyroHandler->setStartUpImmediately(); +#endif /* RPI_TEST_ADIS16507 == 1 */ +} diff --git a/bsp_rpi/ObjectFactory.h b/bsp_linux_board/ObjectFactory.h similarity index 61% rename from bsp_rpi/ObjectFactory.h rename to bsp_linux_board/ObjectFactory.h index f7fa81ac..feaba70e 100644 --- a/bsp_rpi/ObjectFactory.h +++ b/bsp_linux_board/ObjectFactory.h @@ -1,17 +1,10 @@ -/* - * ObjectFactory.h - * - * Created on: Sep 22, 2020 - * Author: steffen - */ - #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_rpi/boardconfig/CMakeLists.txt b/bsp_linux_board/boardconfig/CMakeLists.txt similarity index 97% rename from bsp_rpi/boardconfig/CMakeLists.txt rename to bsp_linux_board/boardconfig/CMakeLists.txt index c32b326d..67fbaf88 100644 --- a/bsp_rpi/boardconfig/CMakeLists.txt +++ b/bsp_linux_board/boardconfig/CMakeLists.txt @@ -5,6 +5,3 @@ target_sources(${TARGET_NAME} PRIVATE target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) - - - diff --git a/bsp_rpi/boardconfig/etl_profile.h b/bsp_linux_board/boardconfig/etl_profile.h similarity index 100% rename from bsp_rpi/boardconfig/etl_profile.h rename to bsp_linux_board/boardconfig/etl_profile.h diff --git a/bsp_rpi/boardconfig/gcov.h b/bsp_linux_board/boardconfig/gcov.h similarity index 100% rename from bsp_rpi/boardconfig/gcov.h rename to bsp_linux_board/boardconfig/gcov.h diff --git a/bsp_rpi/boardconfig/print.c b/bsp_linux_board/boardconfig/print.c similarity index 100% rename from bsp_rpi/boardconfig/print.c rename to bsp_linux_board/boardconfig/print.c diff --git a/bsp_rpi/boardconfig/print.h b/bsp_linux_board/boardconfig/print.h similarity index 100% rename from bsp_rpi/boardconfig/print.h rename to bsp_linux_board/boardconfig/print.h diff --git a/bsp_rpi/boardconfig/rpi_config.h b/bsp_linux_board/boardconfig/rpiConfig.h.in similarity index 74% rename from bsp_rpi/boardconfig/rpi_config.h rename to bsp_linux_board/boardconfig/rpiConfig.h.in index a9f4fd9f..0094903c 100644 --- a/bsp_rpi/boardconfig/rpi_config.h +++ b/bsp_linux_board/boardconfig/rpiConfig.h.in @@ -6,9 +6,18 @@ #define RPI_ADD_GPIO_TEST 0 #define RPI_LOOPBACK_TEST_GPIO 0 -/* Only one of those 2 should be enabled! */ +#define RPI_TEST_ADIS16507 0 + +// Only one of those 2 should be enabled! #define RPI_ADD_SPI_TEST 0 +#if RPI_ADD_SPI_TEST == 0 #define RPI_TEST_ACS_BOARD 0 +#endif + +#define RPI_ADD_UART_TEST 1 +#if RPI_ADD_UART_TEST == 1 +#define RPI_TEST_GPS_DEVICE 0 +#endif /* Adapt these values accordingly */ namespace gpio { diff --git a/bsp_rpi/boardtest/CMakeLists.txt b/bsp_linux_board/boardtest/CMakeLists.txt similarity index 100% rename from bsp_rpi/boardtest/CMakeLists.txt rename to bsp_linux_board/boardtest/CMakeLists.txt diff --git a/bsp_rpi/main.cpp b/bsp_linux_board/main.cpp similarity index 66% rename from bsp_rpi/main.cpp rename to bsp_linux_board/main.cpp index 8eea768c..67801c4b 100644 --- a/bsp_rpi/main.cpp +++ b/bsp_linux_board/main.cpp @@ -5,6 +5,14 @@ #include +#ifdef RASPBERRY_PI +static const char* const BOARD_NAME = "Raspberry Pi"; +#elif defined(BEAGLEBONEBLACK) +static const char* const BOARD_NAME = "Beaglebone Black"; +#else +static const char* const BOARD_NAME = "Unknown Board"; +#endif + /** * @brief This is the main program and entry point for the Raspberry Pi. * @return @@ -12,7 +20,7 @@ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; - std::cout << "-- Compiled for Linux (Raspberry Pi) --" << std::endl; + std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl; std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index e567628e..ce790656 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -6,9 +6,6 @@ target_sources(${TARGET_NAME} PUBLIC add_subdirectory(boardconfig) add_subdirectory(comIF) -add_subdirectory(devices) add_subdirectory(boardtest) add_subdirectory(gpio) - - - +add_subdirectory(core) diff --git a/bsp_q7s/Dockerfile b/bsp_q7s/Dockerfile new file mode 100644 index 00000000..04184c4a --- /dev/null +++ b/bsp_q7s/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:latest +# FROM alpine:latest + +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update && apt-get install -y curl cmake g++ + +# Q7S root filesystem, required for cross-compilation. Use IPv6 for curl +RUN mkdir -p /usr/rootfs; \ + curl -6 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/dnfMy9kGpgynN6J/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \ + | tar xvz -C /usr/rootfs +# Q7S C++ cross-compiler. Use IPv6 for curl +RUN mkdir -p /usr/tools; \ + curl -6 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/RMsbHydJc6PSqcz/download/gcc-arm-linux-gnueabi.tar.gz \ + | tar xvz -C /usr/tools + +# RUN apk add cmake make g++ + +# Required for cmake build +ENV Q7S_SYSROOT="/usr/rootfs/cortexa9hf-neon-xiphos-linux-gnueabi" +ENV PATH=$PATH:"/usr/tools/gcc-arm-linux-gnueabi/bin" + +WORKDIR /usr/src/app +COPY . . + +RUN set -ex; \ + rm -rf build-q7s; \ + mkdir build-q7s; \ + cd build-q7s; \ + cmake -DCMAKE_BUILD_TYPE=Release -DOS_FSFW=linux -DTGT_BSP="arm/q7s" ..; + +ENTRYPOINT ["cmake", "--build", "build-q7s"] +CMD ["-j"] +# CMD ["bash"] diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/InitMission.cpp index 3fe0ba0c..9a475a11 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/InitMission.cpp @@ -1,6 +1,7 @@ #include "InitMission.h" #include "ObjectFactory.h" -#include +#include "OBSWConfig.h" +#include "pollingsequence/pollingSequenceFactory.h" #include @@ -11,7 +12,7 @@ #include #include #include -#include + #include /* This is configured for linux without CR */ @@ -30,11 +31,12 @@ ServiceInterfaceStream sif::error("ERROR", true, false, true); ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { + sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); @@ -83,6 +85,23 @@ void initmission::initTasks() { initmission::printAddObjectError("UDP_POLLING", objects::UDP_POLLING_TASK); } + /* UDP bridge */ + PeriodicTaskIF* errorReporterTestTask = factory->createPeriodicTask( + "ERROR_REPORTER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); + result = udpBridgeTask->addComponent(objects::INTERNAL_ERROR_REPORTER); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ERROR_REPORTER", objects::INTERNAL_ERROR_REPORTER); + } + +#if TEST_CCSDS_BRIDGE == 1 + PeriodicTaskIF* ptmeTestTask = factory->createPeriodicTask( + "PTME_TEST", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc); + result = ptmeTestTask->addComponent(objects::CCSDS_IP_CORE_BRIDGE); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PTME_TEST", objects::CCSDS_IP_CORE_BRIDGE); + } +#endif + /* PUS Services */ PeriodicTaskIF* pusVerification = factory->createPeriodicTask( "PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc); @@ -135,6 +154,8 @@ void initmission::initTasks() { initmission::printAddObjectError("PUS_17", objects::PUS_SERVICE_17_TEST); } +#if TE0720 == 0 + //TODO: Add handling of missed deadlines /* Polling Sequence Table Default */ #if Q7S_ADD_SPI_TEST == 0 @@ -147,14 +168,22 @@ void initmission::initTasks() { } #endif -#if TE0720 == 0 FixedTimeslotTaskIF* gomSpacePstTask = factory-> createFixedTimeslotTask("GS_PST_TASK", 50, - PeriodicTaskIF::MINIMUM_STACK_SIZE*8, 3.0, missedDeadlineFunc); + PeriodicTaskIF::MINIMUM_STACK_SIZE*8, 1.0, missedDeadlineFunc); result = pst::gomspacePstInit(gomSpacePstTask); if(result != HasReturnvaluesIF::RETURN_OK) { sif::error << "InitMission::initTasks: GomSpace PST initialization failed!" << std::endl; } + +#else + FixedTimeslotTaskIF * pollingSequenceTaskTE0720 = factory->createFixedTimeslotTask( + "PST_TASK_TE0720", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE * 8, 3.0, + missedDeadlineFunc); + result = pst::pollingSequenceTE0720(pollingSequenceTaskTE0720); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "InitMission::initTasks: Creating TE0720 PST failed!" << std::endl; + } #endif #if OBSW_ADD_TEST_CODE == 1 @@ -184,12 +213,11 @@ void initmission::initTasks() { udpBridgeTask->startTask(); udpPollingTask->startTask(); -#if TE0720 == 0 +#if TE0720 == 0 && Q7S_ADD_SPI_TEST == 0 gomSpacePstTask->startTask(); -#endif - -#if Q7S_ADD_SPI_TEST == 0 pollingSequenceTableTaskDefault->startTask(); +#elif TE0720 == 1 && Q7S_ADD_SPI_TEST == 0 + pollingSequenceTaskTE0720->startTask(); #endif pusVerification->startTask(); @@ -198,8 +226,14 @@ void initmission::initTasks() { pusMedPrio->startTask(); pusLowPrio->startTask(); + errorReporterTestTask->startTask(); + #if OBSW_ADD_TEST_CODE == 1 testTask->startTask(); #endif + +#if TEST_CCSDS_BRIDGE == 1 + ptmeTestTask->startTask(); +#endif sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 5519b84b..99ec65c2 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -1,15 +1,21 @@ #include "ObjectFactory.h" -#include -#include -#include -#include -#include -#include -#include +#include "OBSWConfig.h" +#include "tmtc/apid.h" +#include "devices/addresses.h" +#include "devices/gpioIds.h" +#include "tmtc/pusIds.h" +#include "devices/powerSwitcherList.h" +#include "spiConf.h" -#include -#include -#include +#include "bsp_q7s/gpio/gpioCallbacks.h" +#include "bsp_q7s/core/CoreController.h" + +#include +#include +#include +#include +#include +#include #include #include @@ -20,22 +26,22 @@ #include #include #include -#include #include #include #include -#include - +#include +#include #include #include +#include +#include +#include #include +#include -#include -#include - -#include -#include - +#include "fsfw_hal/linux/uart/UartComIF.h" +#include "fsfw_hal/linux/uart/UartCookie.h" +#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" #include #include #include @@ -46,7 +52,7 @@ #include #include #include -#include +#include /* UDP server includes */ #include @@ -76,9 +82,20 @@ void Factory::setStaticFrameworkObjectIds() { -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); + LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); + + /* Communication interfaces */ + new CspComIF(objects::CSP_COM_IF); + new I2cComIF(objects::I2C_COM_IF); + new UartComIF(objects::UART_COM_IF); +#if Q7S_ADD_SPI_TEST == 0 + new SpiComIF(objects::SPI_COM_IF, gpioComIF); +#endif /* Q7S_ADD_SPI_TEST == 0 */ + + new CoreController(objects::CORE_CONTROLLER); #if TE0720 == 1 I2cCookie* i2cCookieTmp1075tcs1 = new I2cCookie(addresses::TMP1075_TCS_1, @@ -91,27 +108,16 @@ void ObjectFactory::produce(){ I2cCookie* i2cCookieTmp1075tcs2 = new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-1")); #endif - LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); - - /* Communication interfaces */ - new CspComIF(objects::CSP_COM_IF); - new I2cComIF(objects::I2C_COM_IF); - new UartComIF(objects::UART_COM_IF); -#if Q7S_ADD_SPI_TEST == 0 - new SpiComIF(objects::SPI_COM_IF, gpioComIF); -#endif /* Temperature sensors */ Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler( objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1); - tmp1075Handler_1->setStartUpImmediately(); + (void) tmp1075Handler_1; Tmp1075Handler* tmp1075Handler_2 = new Tmp1075Handler( objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2); - tmp1075Handler_2->setStartUpImmediately(); - - GpioCookie* heaterGpiosCookie = new GpioCookie; + (void) tmp1075Handler_2; #if TE0720 == 0 CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH, @@ -147,16 +153,127 @@ void ObjectFactory::produce(){ (void) pdu2handler; (void) acuhandler; + /* Adding gpios for chip select decoding to the gpioComIf */ + gpioCallbacks::initSpiCsDecoder(gpioComIF); + + GpioCookie* gpioCookieRadSensor = new GpioCookie; + GpiodRegular* chipSelectRadSensor = new GpiodRegular(std::string("gpiochip5"), 19, + std::string("Chip Select Radiation Sensor"), gpio::OUT, 1); + gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, chipSelectRadSensor); + gpioComIF->addGpios(gpioCookieRadSensor); + + SpiCookie* spiCookieRadSensor = new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, + std::string("/dev/spidev2.0"), RAD_SENSOR::READ_SIZE, spi::DEFAULT_MAX_1227_MODE, + spi::DEFAULT_MAX_1227_SPEED); + new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor); + GpioCookie* gpioCookieSus = new GpioCookie(); + + GpioCallback* susgpio = new GpioCallback(std::string("Chip select SUS 1"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 2"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 3"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 4"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 5"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 6"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 7"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 8"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 9"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 10"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 11"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 12"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_12, susgpio); + susgpio = new GpioCallback(std::string("Chip select SUS 13"), gpio::OUT, 1, + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); + gpioCookieSus->addGpio(gpioIds::CS_SUS_13, susgpio); + + gpioComIF->addGpios(gpioCookieSus); + + SpiCookie* spiCookieSus1 = new SpiCookie(addresses::SUS_1, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus2 = new SpiCookie(addresses::SUS_2, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus3 = new SpiCookie(addresses::SUS_3, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus4 = new SpiCookie(addresses::SUS_4, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus5 = new SpiCookie(addresses::SUS_5, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus6 = new SpiCookie(addresses::SUS_6, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus7 = new SpiCookie(addresses::SUS_7, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus8 = new SpiCookie(addresses::SUS_8, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus9 = new SpiCookie(addresses::SUS_9, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus10 = new SpiCookie(addresses::SUS_10, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus11 = new SpiCookie(addresses::SUS_11, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus12 = new SpiCookie(addresses::SUS_12, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + SpiCookie* spiCookieSus13 = new SpiCookie(addresses::SUS_13, gpio::NO_GPIO, + std::string("/dev/spidev2.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + SUS::MAX1227_SPI_FREQ); + + new SusHandler(objects::SUS_1, objects::SPI_COM_IF, spiCookieSus1, gpioComIF, gpioIds::CS_SUS_1); + new SusHandler(objects::SUS_2, objects::SPI_COM_IF, spiCookieSus2, gpioComIF, gpioIds::CS_SUS_2); + new SusHandler(objects::SUS_3, objects::SPI_COM_IF, spiCookieSus3, gpioComIF, gpioIds::CS_SUS_3); + new SusHandler(objects::SUS_4, objects::SPI_COM_IF, spiCookieSus4, gpioComIF, gpioIds::CS_SUS_4); + new SusHandler(objects::SUS_5, objects::SPI_COM_IF, spiCookieSus5, gpioComIF, gpioIds::CS_SUS_5); + new SusHandler(objects::SUS_6, objects::SPI_COM_IF, spiCookieSus6, gpioComIF, gpioIds::CS_SUS_6); + new SusHandler(objects::SUS_7, objects::SPI_COM_IF, spiCookieSus7, gpioComIF, gpioIds::CS_SUS_7); + new SusHandler(objects::SUS_8, objects::SPI_COM_IF, spiCookieSus8, gpioComIF, gpioIds::CS_SUS_8); + new SusHandler(objects::SUS_9, objects::SPI_COM_IF, spiCookieSus9, gpioComIF, gpioIds::CS_SUS_9); + new SusHandler(objects::SUS_10, objects::SPI_COM_IF, spiCookieSus10, gpioComIF, gpioIds::CS_SUS_10); + new SusHandler(objects::SUS_11, objects::SPI_COM_IF, spiCookieSus11, gpioComIF, gpioIds::CS_SUS_11); + new SusHandler(objects::SUS_12, objects::SPI_COM_IF, spiCookieSus12, gpioComIF, gpioIds::CS_SUS_12); + new SusHandler(objects::SUS_13, objects::SPI_COM_IF, spiCookieSus13, gpioComIF, gpioIds::CS_SUS_13); + #if OBSW_ADD_ACS_BOARD == 1 GpioCookie* gpioCookieAcsBoard = new GpioCookie(); GpiodRegular* gpio = nullptr; - gpio = new GpiodRegular(std::string("gpiochip5"), 1, std::string("CS_GYRO_1_ADIS"), + gpio = new GpiodRegular(std::string("gpiochip5"), 1, std::string("CS_GYRO_0_ADIS"), gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); - gpio = new GpiodRegular(std::string("gpiochip5"), 7, std::string("CS_GYRO_2_L3G"), + gpio = new GpiodRegular(std::string("gpiochip5"), 7, std::string("CS_GYRO_1_L3G"), gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio); - gpio = new GpiodRegular(std::string("gpiochip5"), 3, std::string("CS_GYRO_3_L3G"), + gpio = new GpiodRegular(std::string("gpiochip5"), 3, std::string("CS_GYRO_2_L3G"), gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_L3G_CS, gpio); @@ -164,7 +281,7 @@ void ObjectFactory::produce(){ gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::MGM_0_LIS3_CS, gpio); - gpio = new GpiodRegular(std::string("gpiochip5"), 17, std::string("CS_MGM_1_RM3100_A"), + gpio = new GpiodRegular(std::string("gpiochip5"), 16, std::string("CS_MGM_1_RM3100_A"), gpio::OUT, gpio::HIGH); gpioCookieAcsBoard->addGpio(gpioIds::MGM_1_RM3100_CS, gpio); @@ -197,13 +314,31 @@ void ObjectFactory::produce(){ objects::SPI_COM_IF, spiCookie); mgmRm3100Handler->setStartUpImmediately(); + spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev, + RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); + mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_3_RM3100_HANDLER, + objects::SPI_COM_IF, spiCookie); + mgmRm3100Handler->setStartUpImmediately(); + + //TODO: Adis Gyro (Gyro 0 Side A) + + /* Gyro 1 Side A */ spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, spiCookie); gyroL3gHandler->setStartUpImmediately(); + + /* Gyro 2 Side B */ + spiCookie = new SpiCookie(addresses::GYRO_2_L3G, gpioIds::GYRO_2_L3G_CS, spiDev, + L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); + gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_2_L3G_HANDLER, objects::SPI_COM_IF, + spiCookie); + gyroL3gHandler->setStartUpImmediately(); #endif + GpioCookie* heaterGpiosCookie = new GpioCookie; + /* Pin H2-11 on stack connector */ GpiodRegular* gpioConfigHeater0 = new GpiodRegular(std::string("gpiochip7"), 6, std::string("Heater0"), gpio::OUT, 0); @@ -256,8 +391,8 @@ void ObjectFactory::produce(){ solarArrayDeplCookie, objects::PCDU_HANDLER, pcduSwitches::DEPLOYMENT_MECHANISM, gpioIds::DEPLSA1, gpioIds::DEPLSA2, 1000); - UartCookie* syrlinksUartCookie = new UartCookie( - std::string("/dev/ttyUL0"), 38400, SYRLINKS::MAX_REPLY_SIZE); + UartCookie* syrlinksUartCookie = new UartCookie(objects::SYRLINKS_HK_HANDLER, + std::string("/dev/ttyUL0"), UartModes::NON_CANONICAL, 38400, SYRLINKS::MAX_REPLY_SIZE); syrlinksUartCookie->setParityEven(); SyrlinksHkHandler* syrlinksHkHandler = new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, @@ -267,61 +402,60 @@ void ObjectFactory::produce(){ #if Q7S_ADD_RTD_DEVICES == 1 GpioCookie* rtdGpioCookie = new GpioCookie; - gpioCallbacks::initTcsBoardDecoder(gpioComIF); GpioCallback* gpioRtdIc3 = new GpioCallback(std::string("Chip select RTD IC3"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC3, gpioRtdIc3); GpioCallback* gpioRtdIc4 = new GpioCallback(std::string("Chip select RTD IC4"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC4, gpioRtdIc4); GpioCallback* gpioRtdIc5 = new GpioCallback(std::string("Chip select RTD IC5"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC5, gpioRtdIc5); GpioCallback* gpioRtdIc6 = new GpioCallback(std::string("Chip select RTD IC6"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC6, gpioRtdIc6); GpioCallback* gpioRtdIc7 = new GpioCallback(std::string("Chip select RTD IC7"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC7, gpioRtdIc7); GpioCallback* gpioRtdIc8 = new GpioCallback(std::string("Chip select RTD IC8"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC8, gpioRtdIc8); GpioCallback* gpioRtdIc9 = new GpioCallback(std::string("Chip select RTD IC9"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC9, gpioRtdIc9); GpioCallback* gpioRtdIc10 = new GpioCallback(std::string("Chip select RTD IC10"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC10, gpioRtdIc10); GpioCallback* gpioRtdIc11 = new GpioCallback(std::string("Chip select RTD IC11"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC11, gpioRtdIc11); GpioCallback* gpioRtdIc12 = new GpioCallback(std::string("Chip select RTD IC12"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC12, gpioRtdIc12); GpioCallback* gpioRtdIc13 = new GpioCallback(std::string("Chip select RTD IC13"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC13, gpioRtdIc13); GpioCallback* gpioRtdIc14 = new GpioCallback(std::string("Chip select RTD IC14"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC14, gpioRtdIc14); GpioCallback* gpioRtdIc15 = new GpioCallback(std::string("Chip select RTD IC15"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC15, gpioRtdIc15); GpioCallback* gpioRtdIc16 = new GpioCallback(std::string("Chip select RTD IC16"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC16, gpioRtdIc16); GpioCallback* gpioRtdIc17 = new GpioCallback(std::string("Chip select RTD IC17"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC17, gpioRtdIc17); GpioCallback* gpioRtdIc18 = new GpioCallback(std::string("Chip select RTD IC18"), gpio::OUT, 1, - &gpioCallbacks::tcsBoardDecoderCallback, gpioComIF); + &gpioCallbacks::spiCsDecoderCallback, gpioComIF); rtdGpioCookie->addGpio(gpioIds::RTD_IC18, gpioRtdIc18); gpioComIF->addGpios(rtdGpioCookie); SpiCookie* spiRtdIc3 = new SpiCookie(addresses::RTD_IC3, gpioIds::RTD_IC3, std::string("/dev/spidev2.0"), Max31865Definitions::MAX_REPLY_SIZE, - spi::SpiModes::MODE_1, 2000000); + spi::SpiModes::MODE_3, 2000000); SpiCookie* spiRtdIc4 = new SpiCookie(addresses::RTD_IC4, gpioIds::RTD_IC4, std::string("/dev/spidev2.0"), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); @@ -357,7 +491,7 @@ void ObjectFactory::produce(){ spi::SpiModes::MODE_1, 2000000); SpiCookie* spiRtdIc15 = new SpiCookie(addresses::RTD_IC15, gpioIds::RTD_IC15, std::string("/dev/spidev2.0"), Max31865Definitions::MAX_REPLY_SIZE, - spi::SpiModes::MODE_1, 2000000); + spi::SpiModes::MODE_1, 3900000); SpiCookie* spiRtdIc16 = new SpiCookie(addresses::RTD_IC16, gpioIds::RTD_IC16, std::string("/dev/spidev2.0"), Max31865Definitions::MAX_REPLY_SIZE, spi::SpiModes::MODE_1, 2000000); @@ -384,7 +518,7 @@ void ObjectFactory::produce(){ Max31865PT1000Handler* rtdIc16 = new Max31865PT1000Handler(objects::RTD_IC16, objects::SPI_COM_IF, spiRtdIc16, 0); Max31865PT1000Handler* rtdIc17 = new Max31865PT1000Handler(objects::RTD_IC17, objects::SPI_COM_IF, spiRtdIc17, 0); Max31865PT1000Handler* rtdIc18 = new Max31865PT1000Handler(objects::RTD_IC18, objects::SPI_COM_IF, spiRtdIc18, 0); -// rtdIc10->setStartUpImmediately(); + rtdIc17->setStartUpImmediately(); // rtdIc4->setStartUpImmediately(); (void) rtdIc3; @@ -401,21 +535,26 @@ void ObjectFactory::produce(){ (void) rtdIc14; (void) rtdIc15; (void) rtdIc16; - (void) rtdIc17; +// (void) rtdIc17; (void) rtdIc18; #endif /* Q7S_ADD_RTD_DEVICES == 1 */ -#endif /* TE0720 == 0 */ - - new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, objects::TM_STORE, - objects::TC_STORE); - new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); - I2cCookie* imtqI2cCookie = new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, std::string("/dev/i2c-0")); - IMTQHandler* imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); - imtqHandler->setStartUpImmediately(); + new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie); + + UartCookie* plocUartCookie = new UartCookie(objects::PLOC_HANDLER, std::string("/dev/ttyUL3"), + UartModes::NON_CANONICAL, 115200, PLOC::MAX_REPLY_SIZE); + PlocHandler* plocHandler = new PlocHandler(objects::PLOC_HANDLER, objects::UART_COM_IF, + plocUartCookie); +// plocHandler->setStartUpImmediately(); + (void) plocHandler; + +#endif /* TE0720 == 0 */ + + new UdpTmTcBridge(objects::UDP_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); + new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); #if TE0720 == 1 && TEST_LIBGPIOD == 1 /* Configure MIO0 as input */ @@ -424,13 +563,68 @@ void ObjectFactory::produce(){ GpioCookie* gpioCookie = new GpioCookie; gpioCookie->addGpio(gpioIds::TEST_ID_0, gpioConfigMio0); new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie); -#elif TE0720 == 1 +#endif + +#if TE0720 == 1 && TEST_SUS_HANDLER == 1 + GpioCookie* gpioCookieSus = new GpioCookie; + GpiodRegular* chipSelectSus = new GpiodRegular(std::string("gpiochip1"), 9, + std::string("Chip Select Sus Sensor"), gpio::OUT, 1); + gpioCookieSus->addGpio(gpioIds::CS_SUS_1, chipSelectSus); + gpioComIF->addGpios(gpioCookieSus); + + SpiCookie* spiCookieSus = new SpiCookie(addresses::SUS_1, std::string("/dev/spidev1.0"), + SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::DEFAULT_MAX_1227_SPEED); + + new SusHandler(objects::SUS_1, objects::SPI_COM_IF, spiCookieSus, gpioComIF, + gpioIds::CS_SUS_1); +#endif + +#if TE0720 == 1 && TEST_CCSDS_BRIDGE == 1 + GpioCookie* gpioCookieCcsdsIp = new GpioCookie; + GpiodRegular* papbBusyN = new GpiodRegular(std::string("gpiochip0"), 0, std::string("PAPBBusy_N")); + gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_BUSY_N, papbBusyN); + GpiodRegular* papbEmpty = new GpiodRegular(std::string("gpiochip0"), 1, + std::string("Chip Select Sus Sensor")); + gpioCookieCcsdsIp->addGpio(gpioIds::PAPB_EMPTY, papbEmpty); + gpioComIF->addGpios(gpioCookieCcsdsIp); + + new CCSDSIPCoreBridge(objects::CCSDS_IP_CORE_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR, + objects::TM_STORE, objects::TC_STORE, gpioComIF, std::string("/dev/uio0"), + gpioIds::PAPB_BUSY_N, gpioIds::PAPB_EMPTY); +#endif + +#if TE0720 == 1 && TEST_RADIATION_SENSOR_HANDLER == 1 + GpioCookie* gpioCookieRadSensor = new GpioCookie; + GpiodRegular* chipSelectRadSensor = new GpiodRegular(std::string("gpiochip1"), 0, + std::string("Chip select radiation sensor"), gpio::OUT, 1); + gpioCookieRadSensor->addGpio(gpioIds::CS_RAD_SENSOR, chipSelectRadSensor); + gpioComIF->addGpios(gpioCookieRadSensor); + + SpiCookie* spiCookieRadSensor = new SpiCookie(addresses::RAD_SENSOR, gpioIds::CS_RAD_SENSOR, + std::string("/dev/spidev1.0"), SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, + spi::DEFAULT_MAX_1227_SPEED); + + RadiationSensorHandler* radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, + objects::SPI_COM_IF, spiCookieRadSensor); + radSensor->setStartUpImmediately(); +#endif + +#if TE0720 == 1 && TEST_PLOC_HANDLER == 1 + UartCookie* plocUartCookie = new UartCookie(std::string("/dev/ttyPS1"), 115200, + PLOC::MAX_REPLY_SIZE); + /* Testing PlocHandler on TE0720-03-1CFA */ + PlocHandler* plocHandler = new PlocHandler(objects::PLOC_HANDLER, objects::UART_COM_IF, + plocUartCookie); + plocHandler->setStartUpImmediately(); +#endif + +#if TE0720 == 1 && TE0720_HEATER_TEST == 1 /* Configuration for MIO0 on TE0720-03-1CFA */ - GpiodRegular gpioConfigForDummyHeater(std::string("gpiochip0"), 0, - std::string("Heater0"), gpio::OUT, 0); - heaterGpiosCookie->addGpio(gpioIds::HEATER_0, gpioConfigForDummyHeater); - new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, heaterGpiosCookie, - objects::PCDU_HANDLER, pcduSwitches::TCS_BOARD_8V_HEATER_IN); + GpiodRegular* heaterGpio = new GpiodRegular(std::string("gpiochip0"), 0, std::string("MIO0"), gpio::IN, 0); + GpioCookie* gpioCookie = new GpioCookie; + gpioCookie->addGpio(gpioIds::HEATER_0, heaterGpio); + new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER, + pcduSwitches::TCS_BOARD_8V_HEATER_IN); #endif #if Q7S_ADD_SPI_TEST == 1 diff --git a/bsp_q7s/ObjectFactory.h b/bsp_q7s/ObjectFactory.h index 38ec0e9e..536af52d 100644 --- a/bsp_q7s/ObjectFactory.h +++ b/bsp_q7s/ObjectFactory.h @@ -3,7 +3,7 @@ namespace ObjectFactory { void setStatics(); -void produce(); +void produce(void* args); }; #endif /* BSP_Q7S_OBJECTFACTORY_H_ */ diff --git a/bsp_q7s/boardconfig/CMakeLists.txt b/bsp_q7s/boardconfig/CMakeLists.txt index c32b326d..67fbaf88 100644 --- a/bsp_q7s/boardconfig/CMakeLists.txt +++ b/bsp_q7s/boardconfig/CMakeLists.txt @@ -5,6 +5,3 @@ target_sources(${TARGET_NAME} PRIVATE target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) - - - diff --git a/bsp_q7s/boardconfig/q7s_config.h b/bsp_q7s/boardconfig/q7sConfig.h.in similarity index 100% rename from bsp_q7s/boardconfig/q7s_config.h rename to bsp_q7s/boardconfig/q7sConfig.h.in diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt new file mode 100644 index 00000000..4b2364c1 --- /dev/null +++ b/bsp_q7s/core/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${TARGET_NAME} PRIVATE + CoreController.cpp +) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp new file mode 100644 index 00000000..253efd91 --- /dev/null +++ b/bsp_q7s/core/CoreController.cpp @@ -0,0 +1,26 @@ +#include "CoreController.h" + +CoreController::CoreController(object_id_t objectId): + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5) { +} + +ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { + return HasReturnvaluesIF::RETURN_OK; +} + +void CoreController::performControlOperation() { +} + +ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} + +LocalPoolDataSetBase* CoreController::getDataSetHandle(sid_t sid) { + return nullptr; +} + +ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode) { + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h new file mode 100644 index 00000000..bc8a1581 --- /dev/null +++ b/bsp_q7s/core/CoreController.h @@ -0,0 +1,22 @@ +#ifndef BSP_Q7S_CORE_CORECONTROLLER_H_ +#define BSP_Q7S_CORE_CORECONTROLLER_H_ + +#include "fsfw/controller/ExtendedControllerBase.h" + +class CoreController: public ExtendedControllerBase { +public: + CoreController(object_id_t objectId); + + ReturnValue_t handleCommandMessage(CommandMessage *message) override; + void performControlOperation() override; +private: + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode); +}; + + + +#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/bsp_q7s/gpio/gpioCallbacks.cpp b/bsp_q7s/gpio/gpioCallbacks.cpp index 086e6469..2f59cb0e 100644 --- a/bsp_q7s/gpio/gpioCallbacks.cpp +++ b/bsp_q7s/gpio/gpioCallbacks.cpp @@ -10,31 +10,32 @@ namespace gpioCallbacks { GpioIF* gpioComInterface; -void initTcsBoardDecoder(GpioIF* gpioComIF) { +void initSpiCsDecoder(GpioIF* gpioComIF) { ReturnValue_t result; if (gpioComIF == nullptr) { - sif::debug << "initTcsBoardDecoder: Invalid gpioComIF" << std::endl; + sif::debug << "initSpiCsDecoder: Invalid gpioComIF" << std::endl; return; } gpioComInterface = gpioComIF; GpioCookie* spiMuxGpios = new GpioCookie; - /** - * Initial values of the spi mux gpios can all be set to an arbitrary value expect for spi mux - * bit 1. Setting spi mux bit 1 to high will pull all decoder outputs to high voltage level. - */ + + /** Setting mux bit 1 to low will disable IC21 on the interface board */ GpiodRegular* spiMuxBit1 = new GpiodRegular(std::string("gpiochip7"), 13, - std::string("SPI Mux Bit 1"), gpio::OUT, 1); + std::string("SPI Mux Bit 1"), gpio::OUT, 0); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit1); + /** Setting mux bit 2 to low disables IC1 on the TCS board */ GpiodRegular* spiMuxBit2 = new GpiodRegular(std::string("gpiochip7"), 14, std::string("SPI Mux Bit 2"), gpio::OUT, 0); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit2); + /** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */ GpiodRegular* spiMuxBit3 = new GpiodRegular(std::string("gpiochip7"), 15, std::string("SPI Mux Bit 3"), gpio::OUT, 0); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit3); + /** The following gpios can take arbitrary initial values */ GpiodRegular* spiMuxBit4 = new GpiodRegular(std::string("gpiochip7"), 16, std::string("SPI Mux Bit 4"), gpio::OUT, 0); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit4); @@ -47,175 +48,261 @@ void initTcsBoardDecoder(GpioIF* gpioComIF) { result = gpioComInterface->addGpios(spiMuxGpios); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "initTcsBoardDecoder: Failed to add mux bit gpios to gpioComIF" + sif::error << "initSpiCsDecoder: Failed to add mux bit gpios to gpioComIF" << std::endl; return; } } -void tcsBoardDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, +void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args) { if (gpioComInterface == nullptr) { - sif::debug << "tcsBoardDecoderCallback: No gpioComIF specified. Call initTcsBoardDecoder " + sif::debug << "spiCsDecoderCallback: No gpioComIF specified. Call initSpiCsDecoder " << "to specify gpioComIF" << std::endl; return; } - /* Read is not supported by the callback function */ + /* Reading is not supported by the callback function */ if (gpioOp == gpio::GpioOperation::READ) { return; } if (value == 1) { - /* This will pull all 16 decoder outputs to high */ - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1); + disableAllDecoder(); } else if (value == 0) { switch (gpioId) { case(gpioIds::RTD_IC3): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY7(); break; } case(gpioIds::RTD_IC4): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY6(); break; } case(gpioIds::RTD_IC5): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY5(); break; } case(gpioIds::RTD_IC6): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY4(); break; } case(gpioIds::RTD_IC7): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY3(); break; } case(gpioIds::RTD_IC8): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY2(); break; } case(gpioIds::RTD_IC9): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY1(); break; } case(gpioIds::RTD_IC10): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc1(); + selectY0(); break; } case(gpioIds::RTD_IC11): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY7(); break; } case(gpioIds::RTD_IC12): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY6(); break; } case(gpioIds::RTD_IC13): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY5(); break; } case(gpioIds::RTD_IC14): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY4(); break; } case(gpioIds::RTD_IC15): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY3(); break; } case(gpioIds::RTD_IC16): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY2(); break; } case(gpioIds::RTD_IC17): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY1(); break; } case(gpioIds::RTD_IC18): { - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); - gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); - gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); + enableDecoderTcsIc2(); + selectY0(); + break; + } + case(gpioIds::CS_SUS_1): { + enableDecoderInterfaceBoardIc1(); + selectY0(); + break; + } + case(gpioIds::CS_SUS_2): { + enableDecoderInterfaceBoardIc1(); + selectY1(); + break; + } + case(gpioIds::CS_SUS_3): { + enableDecoderInterfaceBoardIc2(); + selectY0(); + break; + } + case(gpioIds::CS_SUS_4): { + enableDecoderInterfaceBoardIc2(); + selectY1(); + break; + } + case(gpioIds::CS_SUS_5): { + enableDecoderInterfaceBoardIc2(); + selectY2(); + break; + } + case(gpioIds::CS_SUS_6): { + enableDecoderInterfaceBoardIc1(); + selectY2(); + break; + } + case(gpioIds::CS_SUS_7): { + enableDecoderInterfaceBoardIc1(); + selectY3(); + break; + } + case(gpioIds::CS_SUS_8): { + enableDecoderInterfaceBoardIc2(); + selectY3(); + break; + } + case(gpioIds::CS_SUS_9): { + enableDecoderInterfaceBoardIc1(); + selectY4(); + break; + } + case(gpioIds::CS_SUS_10): { + enableDecoderInterfaceBoardIc1(); + selectY5(); + break; + } + case(gpioIds::CS_SUS_11): { + enableDecoderInterfaceBoardIc2(); + selectY4(); + break; + } + case(gpioIds::CS_SUS_12): { + enableDecoderInterfaceBoardIc2(); + selectY5(); + break; + } + case(gpioIds::CS_SUS_13): { + enableDecoderInterfaceBoardIc1(); + selectY6(); break; } default: - sif::debug << "tcsBoardDecoderCallback: Invalid gpioid " << gpioId << std::endl; + sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl; } } else { - sif::debug << "tcsBoardDecoderCallback: Invalid value. Must be 0 or 1" << std::endl; + sif::debug << "spiCsDecoderCallback: Invalid value. Must be 0 or 1" << std::endl; } } +void enableDecoderTcsIc1() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); +} + +void enableDecoderTcsIc2() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); +} + +void enableDecoderInterfaceBoardIc1() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); +} + +void enableDecoderInterfaceBoardIc2() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3); +} + +void selectY0() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); +} + +void selectY1() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); +} + +void selectY2() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); +} + +void selectY3() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6); +} + +void selectY4() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); +} + +void selectY5() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); +} + +void selectY6() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); +} + +void selectY7() { + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5); + gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6); +} + +void disableAllDecoder() { + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2); + gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3); +} + } diff --git a/bsp_q7s/gpio/gpioCallbacks.h b/bsp_q7s/gpio/gpioCallbacks.h index 845127fb..4a0c73cb 100644 --- a/bsp_q7s/gpio/gpioCallbacks.h +++ b/bsp_q7s/gpio/gpioCallbacks.h @@ -9,15 +9,54 @@ namespace gpioCallbacks { /** * @brief This function initializes the GPIOs used to control the SN74LVC138APWR decoders on - * the TCS Board. + * the TCS Board and the interface board. */ - void initTcsBoardDecoder(GpioIF* gpioComIF); + void initSpiCsDecoder(GpioIF* gpioComIF); /** - * @brief This function implements the decoding to multiply gpios by using the two decoder - * chips SN74LVC138APWR on the TCS board. + * @brief This function implements the decoding to multiply gpios by using the decoder + * chips SN74LVC138APWR on the TCS board and the interface board. */ - void tcsBoardDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args); + void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args); + + /** + * @brief This function sets mux bits 1-3 to a state which will only enable the decoder + * on the TCS board which is named to IC1 in the schematic. + */ + void enableDecoderTcsIc1(); + + /** + * @brief This function sets mux bits 1-3 to a state which will only enable the decoder + * on the TCS board which is named to IC2 in the schematic. + */ + void enableDecoderTcsIc2(); + + /** + * @brief This function sets mux bits 1-3 to a state which will only enable the decoder + * on the inteface board board which is named to IC21 in the schematic. + */ + void enableDecoderInterfaceBoardIc1(); + + /** + * @brief This function sets mux bits 1-3 to a state which will only enable the decoder + * on the inteface board board which is named to IC22 in the schematic. + */ + void enableDecoderInterfaceBoardIc2(); + + /** + * @brief This function disables all decoder. + */ + void disableAllDecoder(); + + /** The following functions enable the appropriate channel of the currently enabled decoder */ + void selectY0(); + void selectY1(); + void selectY2(); + void selectY3(); + void selectY4(); + void selectY5(); + void selectY6(); + void selectY7(); } #endif /* LINUX_GPIO_GPIOCALLBACKS_H_ */ diff --git a/bsp_q7s/main.cpp b/bsp_q7s/main.cpp index b087e315..06f454c2 100644 --- a/bsp_q7s/main.cpp +++ b/bsp_q7s/main.cpp @@ -1,6 +1,7 @@ #include "InitMission.h" #include #include +#include "OBSWConfig.h" #include @@ -13,7 +14,11 @@ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; +#if TE0720 == 0 std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; +#else + std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; +#endif std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; diff --git a/bsp_q7s/memory/CMakeLists.txt b/bsp_q7s/memory/CMakeLists.txt new file mode 100644 index 00000000..2ccdc7e2 --- /dev/null +++ b/bsp_q7s/memory/CMakeLists.txt @@ -0,0 +1,4 @@ +target_sources(${TARGET_NAME} PRIVATE + FileSystemManager.cpp + SdCardAccess.cpp +) \ No newline at end of file diff --git a/bsp_q7s/memory/FileSystemManager.cpp b/bsp_q7s/memory/FileSystemManager.cpp new file mode 100644 index 00000000..40c8e58a --- /dev/null +++ b/bsp_q7s/memory/FileSystemManager.cpp @@ -0,0 +1,7 @@ +#include "FileSystemManager.h" + +class FileSystemManager { +public: + +private: +}; diff --git a/bsp_q7s/memory/FileSystemManager.h b/bsp_q7s/memory/FileSystemManager.h new file mode 100644 index 00000000..4fc8dc52 --- /dev/null +++ b/bsp_q7s/memory/FileSystemManager.h @@ -0,0 +1,8 @@ +#ifndef BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ +#define BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ + + + + + +#endif /* BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ */ diff --git a/bsp_q7s/memory/SdCardAccess.cpp b/bsp_q7s/memory/SdCardAccess.cpp new file mode 100644 index 00000000..3d5f12b9 --- /dev/null +++ b/bsp_q7s/memory/SdCardAccess.cpp @@ -0,0 +1,4 @@ +#include "SdCardAccess.h" + +SdCardAccess::SdCardAccess() { +} diff --git a/bsp_q7s/memory/SdCardAccess.h b/bsp_q7s/memory/SdCardAccess.h new file mode 100644 index 00000000..ba273d09 --- /dev/null +++ b/bsp_q7s/memory/SdCardAccess.h @@ -0,0 +1,11 @@ +#ifndef BSP_Q7S_MEMORY_SDCARDACCESS_H_ +#define BSP_Q7S_MEMORY_SDCARDACCESS_H_ + +class SdCardAccess { +public: + SdCardAccess(); +private: +}; + + +#endif /* BSP_Q7S_MEMORY_SDCARDACCESS_H_ */ diff --git a/bsp_rpi/ObjectFactory.cpp b/bsp_rpi/ObjectFactory.cpp deleted file mode 100644 index 960abfe6..00000000 --- a/bsp_rpi/ObjectFactory.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "ObjectFactory.h" - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* UDP server includes */ -#include -#include - -#include -#include -#include -#include -#include - -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; - - TmFunnel::downlinkDestination = objects::UDP_BRIDGE; - // No storage object for now. - TmFunnel::storageDestination = objects::NO_OBJECT; - - LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT; - - VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; - TmPacketStored::timeStamperId = objects::TIME_STAMPER; -} - - - -void ObjectFactory::produce(){ - Factory::setStaticFrameworkObjectIds(); - ObjectFactory::produceGenericObjects(); - - new UdpTmTcBridge(objects::UDP_BRIDGE, - objects::CCSDS_PACKET_DISTRIBUTOR, - objects::TM_STORE, objects::TC_STORE); - new UdpTcPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); - - GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF); - -#if RPI_ADD_SPI_TEST == 1 - new SpiTestClass(objects::SPI_TEST, gpioIF); -#endif - -#if RPI_LOOPBACK_TEST_GPIO == 1 - GpioCookie* gpioCookieLoopback = new GpioCookie(); - /* Loopback pins. Adapt according to setup */ - gpioId_t gpioIdSender = gpioIds::TEST_ID_0; - int bcmPinSender = 26; - gpioId_t gpioIdReader = gpioIds::TEST_ID_1; - int bcmPinReader = 16; - gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdSender, bcmPinSender, "GPIO_LB_SENDER", - gpio::Direction::OUT, 0); - gpio::createRpiGpioConfig(gpioCookieLoopback, gpioIdReader, bcmPinReader, "GPIO_LB_READER", - gpio::Direction::IN, 0); - new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookieLoopback); -#endif /* RPI_LOOPBACK_TEST_GPIO == 1 */ - - new SpiComIF(objects::SPI_COM_IF, gpioIF); - -#if RPI_TEST_ACS_BOARD == 1 - - GpioCookie* gpioCookieAcsBoard = new GpioCookie(); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::MGM_0_LIS3_CS, gpio::MGM_0_BCM_PIN, - "MGM_0_LIS3", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::MGM_1_RM3100_CS, gpio::MGM_1_BCM_PIN, - "MGM_1_RM3100", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::MGM_2_LIS3_CS, gpio::MGM_2_BCM_PIN, - "MGM_2_LIS3", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::MGM_3_RM3100_CS, gpio::MGM_3_BCM_PIN, - "MGM_3_RM3100", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::GYRO_0_ADIS_CS, gpio::GYRO_0_BCM_PIN, - "GYRO_0_ADIS", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::GYRO_1_L3G_CS, gpio::GYRO_1_BCM_PIN, - "GYRO_1_L3G", gpio::Direction::OUT, 1); - gpio::createRpiGpioConfig(gpioCookieAcsBoard, gpioIds::GYRO_2_L3G_CS, gpio::GYRO_2_BCM_PIN, - "GYRO_2_L3G", gpio::Direction::OUT, 1); - gpioIF->addGpios(gpioCookieAcsBoard); - - std::string spiDev = "/dev/spidev0.0"; - SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, spiDev, - MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); - auto mgmLis3Handler = new MGMHandlerLIS3MDL(objects::MGM_0_LIS3_HANDLER, - objects::SPI_COM_IF, spiCookie); - mgmLis3Handler->setStartUpImmediately(); - - spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev, - RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); - auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER, - objects::SPI_COM_IF, spiCookie); - mgmRm3100Handler->setStartUpImmediately(); - - spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev, - L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); - auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF, - spiCookie); - gyroL3gHandler->setStartUpImmediately(); - -#endif /* RPI_TEST_ACS_BOARD == 1 */ -} diff --git a/cmake/BBBCrossCompileConfig.cmake b/cmake/BBBCrossCompileConfig.cmake new file mode 100644 index 00000000..e1a669db --- /dev/null +++ b/cmake/BBBCrossCompileConfig.cmake @@ -0,0 +1,98 @@ +# BBB_ROOTFS should point to the local directory which contains all the +# libraries and includes from the target raspi. +# The following command can be used to do this, replace and the +# local accordingly: +# rsync -vR --progress -rl --delete-after --safe-links pi@:/{lib,usr,opt/vc/lib} +# RASPBIAN_ROOTFS needs to be passed to the CMake command or defined in the +# application CMakeLists.txt before loading the toolchain file. + +# CROSS_COMPILE also needs to be set accordingly or passed to the CMake command + +if(NOT DEFINED ENV{BBB_ROOTFS}) + message(FATAL_ERROR + "Define the BBB_ROOTFS variable to point to the Beagle Bone Black rootfs." + ) +else() + set(SYSROOT_PATH "$ENV{BBB_ROOTFS}" CACHE FILEPATH "BBB root filesystem path") + message(STATUS "Beagle Bone Black sysroot: ${SYSROOT_PATH}") +endif() + +if(NOT DEFINED ENV{CROSS_COMPILE}) + set(CROSS_COMPILE "arm-linux-gnueabihf") + message(STATUS + "No CROSS_COMPILE environmental variable set, using default ARM linux " + "cross compiler name ${CROSS_COMPILE}" + ) +else() + set(CROSS_COMPILE "$ENV{CROSS_COMPILE}") + message(STATUS + "Using environmental variable CROSS_COMPILE as cross-compiler: " + "$ENV{CROSS_COMPILE}" + ) +endif() + +message(STATUS "Using sysroot path: ${SYSROOT_PATH}") + +set(CROSS_COMPILE_CC "${CROSS_COMPILE}-gcc") +set(CROSS_COMPILE_CXX "${CROSS_COMPILE}-g++") +set(CROSS_COMPILE_LD "${CROSS_COMPILE}-ld") +set(CROSS_COMPILE_AR "${CROSS_COMPILE}-ar") +set(CROSS_COMPILE_RANLIB "${CROSS_COMPILE}-ranlib") +set(CROSS_COMPILE_STRIP "${CROSS_COMPILE}-strip") +set(CROSS_COMPILE_NM "${CROSS_COMPILE}-nm") +set(CROSS_COMPILE_OBJCOPY "${CROSS_COMPILE}-objcopy") +set(CROSS_COMPILE_SIZE "${CROSS_COMPILE}-size") + +# At the very least, cross compile gcc and g++ have to be set! +find_program (CROSS_COMPILE_CC_FOUND ${CROSS_COMPILE_CC} REQUIRED) +find_program (CROSS_COMPILE_CXX_FOUND ${CROSS_COMPILE_CXX} REQUIRED) + +set(CMAKE_CROSSCOMPILING TRUE) +set(CMAKE_SYSROOT "${SYSROOT_PATH}") + +# Define name of the target system +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_PROCESSOR "arm") + +# Define the compiler +set(CMAKE_C_COMPILER ${CROSS_COMPILE_CC}) +set(CMAKE_CXX_COMPILER ${CROSS_COMPILE_CXX}) + +# List of library dirs where LD has to look. Pass them directly through gcc. +# LD_LIBRARY_PATH is not evaluated by arm-*-ld +set(LIB_DIRS + "${SYSROOT_PATH}/lib/${CROSS_COMPILE}" + "${SYSROOT_PATH}/usr/local/lib" + "${SYSROOT_PATH}/usr/lib/${CROSS_COMPILE}" + "${SYSROOT_PATH}/usr/lib" +) +# You can additionally check the linker paths if you add the +# flags ' -Xlinker --verbose' +set(COMMON_FLAGS "-I${SYSROOT_PATH}/usr/include") +foreach(LIB ${LIB_DIRS}) + set(COMMON_FLAGS "${COMMON_FLAGS} -L${LIB} -Wl,-rpath-link,${LIB}") +endforeach() + +set(CMAKE_PREFIX_PATH + "${CMAKE_PREFIX_PATH}" + "${SYSROOT_PATH}/usr/lib/${CROSS_COMPILE}" +) + +set(CMAKE_C_FLAGS + "-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=hard ${COMMON_FLAGS}" + CACHE STRING "Flags for Beagle Bone Black" +) +set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" + CACHE STRING "Flags for Beagle Bone Black" +) + +set(CMAKE_FIND_ROOT_PATH + "${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH};${CMAKE_SYSROOT}" +) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/cmake/HardwareOsPreConfig.cmake b/cmake/HardwareOsPreConfig.cmake index ab5c16fd..38248fce 100644 --- a/cmake/HardwareOsPreConfig.cmake +++ b/cmake/HardwareOsPreConfig.cmake @@ -53,8 +53,8 @@ endif() if(TGT_BSP) - if (${TGT_BSP} MATCHES "arm/raspberrypi") - set(BSP_PATH "bsp_rpi") + if (${TGT_BSP} MATCHES "arm/raspberrypi" OR ${TGT_BSP} MATCHES "arm/beagleboneblack") + set(BSP_PATH "bsp_linux_board") elseif(${TGT_BSP} MATCHES "arm/q7s") set(BSP_PATH "bsp_q7s") else() diff --git a/cmake/PreProjectConfig.cmake b/cmake/PreProjectConfig.cmake index f54da048..8a013d83 100644 --- a/cmake/PreProjectConfig.cmake +++ b/cmake/PreProjectConfig.cmake @@ -11,7 +11,6 @@ endif() # Disable compiler checks for cross-compiling. if(${OS_FSFW} STREQUAL linux AND TGT_BSP) - if(${TGT_BSP} MATCHES "arm/q7s") set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake" @@ -38,7 +37,7 @@ if(${OS_FSFW} STREQUAL linux AND TGT_BSP) else() message(STATUS "Setting RASPBERRY_VERSION to ${RASPBERRY_VERSION}") set(RASPBERRY_VERSION ${RASPBERRY_VERSION} CACHE STRING "Raspberry Pi version") - set(ENV{RASPBERRY_VERSION} ${RASPBERRY_VERSION}) + set(ENV{RASPBERRY_VERSION} ${RASPBERRY_VERSION}) endif() else() message(STATUS @@ -51,7 +50,14 @@ if(${OS_FSFW} STREQUAL linux AND TGT_BSP) "${CMAKE_SCRIPT_PATH}/RPiCrossCompileConfig.cmake" PARENT_SCOPE ) - else() + elseif(${TGT_BSP} MATCHES "arm/beagleboneblack") + if(LINUX_CROSS_COMPILE) + set(CMAKE_TOOLCHAIN_FILE + "${CMAKE_SCRIPT_PATH}/BBBCrossCompileConfig.cmake" + PARENT_SCOPE + ) + endif() + else() message(WARNING "Target BSP (TGT_BSP) ${TGT_BSP} unknown!") endif() endif() diff --git a/cmake/Q7SCrossCompileConfig.cmake b/cmake/Q7SCrossCompileConfig.cmake index 2c5bd4e9..bc95a909 100644 --- a/cmake/Q7SCrossCompileConfig.cmake +++ b/cmake/Q7SCrossCompileConfig.cmake @@ -6,7 +6,7 @@ if(NOT DEFINED ENV{Q7S_SYSROOT}) # "point to the raspbian rootfs." # ) else() - set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}") + set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}" CACHE PATH "Q7S root filesystem path") endif() if(NOT DEFINED ENV{CROSS_COMPILE}) diff --git a/cmake/RPiCrossCompileConfig.cmake b/cmake/RPiCrossCompileConfig.cmake index e1b4cce3..1f246443 100644 --- a/cmake/RPiCrossCompileConfig.cmake +++ b/cmake/RPiCrossCompileConfig.cmake @@ -25,7 +25,7 @@ if(NOT DEFINED ENV{RASPBIAN_ROOTFS}) "point to the raspbian rootfs." ) else() - set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}") + set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}" CACHE FILEPATH "RPi root filesystem path") endif() if(NOT DEFINED ENV{CROSS_COMPILE}) diff --git a/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml b/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2da..00000000 --- a/cmake/scripts/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/misc.xml b/cmake/scripts/.idea/misc.xml deleted file mode 100644 index d56657ad..00000000 --- a/cmake/scripts/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/modules.xml b/cmake/scripts/.idea/modules.xml deleted file mode 100644 index bb83e262..00000000 --- a/cmake/scripts/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/scripts.iml b/cmake/scripts/.idea/scripts.iml deleted file mode 100644 index d0876a78..00000000 --- a/cmake/scripts/.idea/scripts.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/vcs.xml b/cmake/scripts/.idea/vcs.xml deleted file mode 100644 index c2365ab1..00000000 --- a/cmake/scripts/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/cmake/scripts/.idea/workspace.xml b/cmake/scripts/.idea/workspace.xml deleted file mode 100644 index 70a189f3..00000000 --- a/cmake/scripts/.idea/workspace.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1609084345199 - - - - - - - - - - - - \ No newline at end of file diff --git a/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh b/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh new file mode 100644 index 00000000..cfa71d02 --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/create_cmake_debug_cfg.sh @@ -0,0 +1,30 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/beagleboneblack" +build_generator="" +builddir="build-Debug-BBB" +defines="LINUX_CROSS_COMPILE=OFF" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh new file mode 100644 index 00000000..340713e1 --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/bbb_path_helper.sh @@ -0,0 +1,3 @@ +export PATH=$PATH:"$HOME/beaglebone//bin" +export CROSS_COMPILE="arm-linux-gnueabihf" +export BBB_ROOTFS="${HOME}/raspberrypi/rootfs" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh new file mode 100644 index 00000000..b413d07f --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_debug_cfg.sh @@ -0,0 +1,30 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/beagleboneblack" +build_generator="" +builddir="build-Debug-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh new file mode 100644 index 00000000..81e3322d --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_release_cfg.sh @@ -0,0 +1,30 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/beagleboneblack" +build_generator="" +builddir="build-Release-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh new file mode 100644 index 00000000..81e3322d --- /dev/null +++ b/cmake/scripts/BeagleBoneBlack/crosscompile/create_cmake_relwithdeb_cfg.sh @@ -0,0 +1,30 @@ +#!/bin/sh +counter=0 +while [ ${counter} -lt 5 ] +do + cd .. + if [ -f "cmake_build_config.py" ];then + break + fi + counter=$((counter=counter + 1)) +done + +if [ "${counter}" -ge 5 ];then + echo "cmake_build_config.py not found in upper directories!" + exit 1 +fi + +os_fsfw="linux" +tgt_bsp="arm/beagleboneblack" +build_generator="" +builddir="build-Release-BBB" +defines="LINUX_CROSS_COMPILE=ON" +if [ "${OS}" = "Windows_NT" ]; then + build_generator="MinGW Makefiles" +# Could be other OS but this works for now. +else + build_generator="Unix Makefiles" +fi + +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l "${builddir}" -d "${defines}" diff --git a/cmake/scripts/Host/create_cmake_debug_cfg.sh b/cmake/scripts/Host/create_cmake_debug_cfg.sh old mode 100644 new mode 100755 index 23c74de0..24be2099 --- a/cmake/scripts/Host/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Host/create_cmake_debug_cfg.sh @@ -15,7 +15,7 @@ if [ "${counter}" -ge 5 ];then fi build_generator="" -build_dir="Debug-Host" +build_dir="build-Debug-Host" os_fsfw="host" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" diff --git a/cmake/scripts/Linux/create_cmake_debug_cfg.sh b/cmake/scripts/Linux/create_cmake_debug_cfg.sh index 1f75c12a..1207884e 100755 --- a/cmake/scripts/Linux/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_debug_cfg.sh @@ -16,7 +16,7 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" -builddir="Debug-Linux" +builddir="build-Debug-Host" echo "Running command (without the leading +):" set -x # Print command diff --git a/cmake/scripts/Linux/create_cmake_release_cfg.sh b/cmake/scripts/Linux/create_cmake_release_cfg.sh index ffd85ae7..4412e671 100755 --- a/cmake/scripts/Linux/create_cmake_release_cfg.sh +++ b/cmake/scripts/Linux/create_cmake_release_cfg.sh @@ -16,7 +16,7 @@ fi build_generator="Unix Makefiles" os_fsfw="linux" -builddir="Release-Linux" +builddir="build-Release-Host" echo "Running command (without the leading +):" set -x # Print command diff --git a/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh deleted file mode 100755 index 31376322..00000000 --- a/cmake/scripts/Linux/create_cmake_relwithdeb_cfg.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -counter=0 -while [ ${counter} -lt 5 ] -do - cd .. - if [ -f "cmake_build_config.py" ];then - break - fi - counter=$((counter=counter + 1)) -done - -if [ "${counter}" -ge 5 ];then - echo "create_cmake_cfg.sh not found in upper directories!" - exit 1 -fi - -build_generator="Unix Makefiles" -os_fsfw="linux" -builddir="RelWithDeb-Linux" - -echo "Running command (without the leading +):" -set -x # Print command -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -l "${builddir}" -# Use this if commands are added which should not be printed -# set +x diff --git a/cmake/scripts/Linux/create_cmake_size_cfg.sh b/cmake/scripts/Linux/create_cmake_size_cfg.sh deleted file mode 100755 index d4500d6d..00000000 --- a/cmake/scripts/Linux/create_cmake_size_cfg.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -counter=0 -while [ ${counter} -lt 5 ] -do - cd .. - if [ -f "cmake_build_config.py" ];then - break - fi - counter=$((counter=counter + 1)) -done - -if [ "${counter}" -ge 5 ];then - echo "create_cmake_cfg.sh not found in upper directories!" - exit 1 -fi - -build_generator="Unix Makefiles" -os_fsfw="linux" - -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "size" diff --git a/cmake/scripts/Q7S/create_cmake_debug_cfg.sh b/cmake/scripts/Q7S/create_cmake_debug_cfg.sh index 7f6753ac..4875c59a 100755 --- a/cmake/scripts/Q7S/create_cmake_debug_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_debug_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Debug-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/Q7S/create_cmake_release_cfg.sh b/cmake/scripts/Q7S/create_cmake_release_cfg.sh index 6048a1c6..0e2c543c 100755 --- a/cmake/scripts/Q7S/create_cmake_release_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_release_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Release-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh b/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh index 346067cd..121f2d7e 100755 --- a/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh +++ b/cmake/scripts/Q7S/create_cmake_relwithdeb_cfg.sh @@ -16,6 +16,7 @@ fi os_fsfw="linux" tgt_bsp="arm/q7s" +build_dir="build-Release-Q7S" build_generator="" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" @@ -24,4 +25,5 @@ else build_generator="Unix Makefiles" fi -python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" +python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" \ + -l"${build_dir}" diff --git a/cmake/scripts/RPi/create_cmake_debug_cfg.sh b/cmake/scripts/RPi/create_cmake_debug_cfg.sh index d0ec5d76..57561846 100755 --- a/cmake/scripts/RPi/create_cmake_debug_cfg.sh +++ b/cmake/scripts/RPi/create_cmake_debug_cfg.sh @@ -17,7 +17,7 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -build_dir="Debug-RPi" +build_dir="build-Debug-RPi" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" # Could be other OS but this works for now. diff --git a/cmake/scripts/RPi/create_cmake_release_cfg.sh b/cmake/scripts/RPi/create_cmake_release_cfg.sh index 4eb9b38a..10e4b777 100755 --- a/cmake/scripts/RPi/create_cmake_release_cfg.sh +++ b/cmake/scripts/RPi/create_cmake_release_cfg.sh @@ -17,7 +17,7 @@ fi os_fsfw="linux" tgt_bsp="arm/raspberrypi" build_generator="" -build_dir="Release-RPi" +build_dir="build-Release-RPi" if [ "${OS}" = "Windows_NT" ]; then build_generator="MinGW Makefiles" # Could be other OS but this works for now. diff --git a/cmake/scripts/cmake_build_config.py b/cmake/scripts/cmake_build_config.py index 32b560f6..67f175d9 100644 --- a/cmake/scripts/cmake_build_config.py +++ b/cmake/scripts/cmake_build_config.py @@ -18,18 +18,26 @@ def main(): print("-- Python CMake build configurator utility --") print("Parsing command line arguments..") - parser = argparse.ArgumentParser(description="Processing arguments for CMake build configuration.") + parser = argparse.ArgumentParser( + description="Processing arguments for CMake build configuration." + ) parser.add_argument("-o", "--osal", type=str, choices=["freertos", "linux", "rtems", "host"], help="FSFW OSAL. Valid arguments: host, linux, rtems, freertos") - parser.add_argument("-b", "--buildtype", type=str, choices=["debug", "release", "size", "reldeb"], - help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug " - "Information)", default="debug") + parser.add_argument( + "-b", "--buildtype", type=str, choices=["debug", "release", "size", "reldeb"], + help="CMake build type. Valid arguments: debug, release, size, reldeb (Release with Debug " + "Information)", default="debug" + ) parser.add_argument("-l", "--builddir", type=str, help="Specify build directory.") parser.add_argument("-g", "--generator", type=str, help="CMake Generator") - parser.add_argument("-d", "--defines", - help="Additional custom defines passed to CMake (supply without -D prefix!)", - nargs="*", type=str) - parser.add_argument("-t", "--target-bsp", type=str, help="Target BSP, combination of architecture and machine") + parser.add_argument( + "-d", "--defines", + help="Additional custom defines passed to CMake (supply without -D prefix!)", + nargs="*", type=str + ) + parser.add_argument( + "-t", "--target-bsp", type=str, help="Target BSP, combination of architecture and machine" + ) args = parser.parse_args() @@ -64,6 +72,12 @@ def main(): else: cmake_target_cfg_cmd = "" + define_string = "" + if args.defines is not None: + define_list = args.defines[0].split() + for define in define_list: + define_string += f"-D{define} " + build_folder = cmake_build_type if args.builddir is not None: build_folder = args.builddir @@ -85,7 +99,8 @@ def main(): os.chdir(build_folder) cmake_command = f"cmake {generator_cmake_arg} -DOS_FSFW=\"{osal}\" " \ - f"-DCMAKE_BUILD_TYPE=\"{cmake_build_type}\" {cmake_target_cfg_cmd} {source_location}" + f"-DCMAKE_BUILD_TYPE=\"{cmake_build_type}\" {cmake_target_cfg_cmd} " \ + f"{define_string} {source_location}" # Remove redundant spaces cmake_command = ' '.join(cmake_command.split()) print("Running CMake command: ") diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h index 548363f2..7ac812e6 100644 --- a/common/config/OBSWVersion.h +++ b/common/config/OBSWVersion.h @@ -4,7 +4,7 @@ const char* const SW_NAME = "eive"; #define SW_VERSION 1 -#define SW_SUBVERSION 1 +#define SW_SUBVERSION 2 #define SW_SUBSUBVERSION 0 #endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/common/config/commonClassIds.h b/common/config/commonClassIds.h new file mode 100644 index 00000000..7a53bdf0 --- /dev/null +++ b/common/config/commonClassIds.h @@ -0,0 +1,24 @@ +#ifndef COMMON_CONFIG_COMMONCLASSIDS_H_ +#define COMMON_CONFIG_COMMONCLASSIDS_H_ + +#include +#include + +namespace CLASS_ID { +enum commonClassIds: uint8_t { + COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, + MGM_LIS3MDL, //MGMLIS3 + MGM_RM3100, //MGMRM3100 + PCDU_HANDLER, //PCDU + HEATER_HANDLER, //HEATER + SYRLINKS_HANDLER, //SYRLINKS + IMTQ_HANDLER, //IMTQ + PLOC_HANDLER, //PLOC + SUS_HANDLER, //SUSS + CCSDS_IP_CORE_BRIDGE, // IP Core interface + COMMON_CLASS_ID_END // [EXPORT] : [END] +}; + +} + +#endif /* COMMON_CONFIG_COMMONCLASSIDS_H_ */ diff --git a/common/config/commonConfig.h b/common/config/commonConfig.h.in similarity index 100% rename from common/config/commonConfig.h rename to common/config/commonConfig.h.in diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h new file mode 100644 index 00000000..3baf58b0 --- /dev/null +++ b/common/config/commonObjects.h @@ -0,0 +1,55 @@ +#ifndef COMMON_CONFIG_COMMONOBJECTS_H_ +#define COMMON_CONFIG_COMMONOBJECTS_H_ + +#include + +namespace objects { +enum commonObjects: uint32_t { + /* First Byte 0x50-0x52 reserved for PUS Services **/ + CCSDS_PACKET_DISTRIBUTOR = 0x50000100, + PUS_PACKET_DISTRIBUTOR = 0x50000200, + UDP_BRIDGE = 0x50000300, + UDP_POLLING_TASK = 0x50000400, + + /* 0x43 ('C') for Controllers */ + THERMAL_CONTROLLER = 0x43001000, + ATTITUDE_CONTROLLER = 0x43002000, + ACS_CONTROLLER = 0x43003000, + CORE_CONTROLLER = 0x43004000, + + /* 0x44 ('D') for device handlers */ + P60DOCK_HANDLER = 0x44000001, + PDU1_HANDLER = 0x44000002, + PDU2_HANDLER = 0x44000003, + ACU_HANDLER = 0x44000004, + TMP1075_HANDLER_1 = 0x44000005, + TMP1075_HANDLER_2 = 0x44000006, + MGM_0_LIS3_HANDLER = 0x44000007, + MGM_1_RM3100_HANDLER = 0x44000008, + MGM_2_LIS3_HANDLER = 0x44000009, + MGM_3_RM3100_HANDLER = 0x44000010, + GYRO_0_ADIS_HANDLER = 0x44000011, + GYRO_1_L3G_HANDLER = 0x44000012, + GYRO_2_L3G_HANDLER = 0x44000013, + + IMTQ_HANDLER = 0x44000014, + PLOC_HANDLER = 0x44000015, + + SUS_1 = 0x44000016, + SUS_2 = 0x44000017, + SUS_3 = 0x44000018, + SUS_4 = 0x44000019, + SUS_5 = 0x4400001A, + SUS_6 = 0x4400001B, + SUS_7 = 0x4400001C, + SUS_8 = 0x4400001D, + SUS_9 = 0x4400001E, + SUS_10 = 0x4400001F, + SUS_11 = 0x44000021, + SUS_12 = 0x44000022, + SUS_13 = 0x44000023, +}; +} + + +#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */ diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h new file mode 100644 index 00000000..0bc3e1dd --- /dev/null +++ b/common/config/commonSubsystemIds.h @@ -0,0 +1,21 @@ +#ifndef COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ +#define COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ + +#include + +namespace SUBSYSTEM_ID { +enum: uint8_t { + COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, + MGM_LIS3MDL = 106, + MGM_RM3100 = 107, + PCDU_HANDLER = 108, + HEATER_HANDLER = 109, + SA_DEPL_HANDLER = 110, + PLOC_HANDLER = 111, + IMTQ_HANDLER = 112, + COMMON_SUBSYSTEM_ID_END +}; +} + + +#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */ diff --git a/fsfwconfig/devices/spi.h b/common/config/spiConf.h similarity index 63% rename from fsfwconfig/devices/spi.h rename to common/config/spiConf.h index 55271a40..2632924d 100644 --- a/fsfwconfig/devices/spi.h +++ b/common/config/spiConf.h @@ -1,5 +1,5 @@ -#ifndef FSFWCONFIG_DEVICES_SPI_H_ -#define FSFWCONFIG_DEVICES_SPI_H_ +#ifndef COMMON_CONFIG_SPICONF_H_ +#define COMMON_CONFIG_SPICONF_H_ #include #include @@ -20,8 +20,12 @@ static constexpr spi::SpiModes DEFAULT_RM3100_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t DEFAULT_L3G_SPEED = 3'900'000; static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3; +static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 3'900'000; +static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3; + +static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000; +static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3; + } - - -#endif /* FSFWCONFIG_DEVICES_SPI_H_ */ +#endif /* COMMON_CONFIG_SPICONF_H_ */ diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..48acea6c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3.3" + +services: + build-host: + build: + context: . + dockerfile: bsp_hosted/Dockerfile + + build-obsw: + build: + context: . + dockerfile: bsp_q7s/Dockerfile + + build-rpi: + build: + context: . + dockerfile: bsp_linux_board/Dockerfile + diff --git a/fsfw b/fsfw index 5273ffa7..cae69d54 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 5273ffa721dd83634ebbcc37c4646752f0bea20f +Subproject commit cae69d540097acba46bffa47fd7afc6a8a19bd15 diff --git a/fsfw_hal b/fsfw_hal index 14fe3257..fce40ebf 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 14fe32572d62db9d19707dc1f9bb6fecb1993b73 +Subproject commit fce40ebf9a4a45bafedaee2fc87e5aa10e49fdcc diff --git a/fsfwconfig/CMakeLists.txt b/fsfwconfig/CMakeLists.txt deleted file mode 100644 index 87ddea03..00000000 --- a/fsfwconfig/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -target_sources(${TARGET_NAME} PRIVATE - ipc/MissionMessageTypes.cpp - pollingsequence/pollingSequenceFactory.cpp -) - -target_include_directories(${TARGET_NAME} PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) - - - diff --git a/fsfwconfig/OBSWConfig.h b/fsfwconfig/OBSWConfig.h deleted file mode 100644 index f3f7cda3..00000000 --- a/fsfwconfig/OBSWConfig.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @brief This file can be used to add preprocessor define for conditional - * code inclusion exclusion or various other project constants and - * properties in one place. - */ -#ifndef FSFWCONFIG_OBSWCONFIG_H_ -#define FSFWCONFIG_OBSWCONFIG_H_ - -#ifdef RASPBERRY_PI -#include -#elif defined(XIPHOS_Q7S) -#include -#endif -#include "commonConfig.h" -#include "OBSWVersion.h" - -/* These defines should be disabled for mission code but are useful for -debugging. */ -#define OBSW_VERBOSE_LEVEL 1 -#define OBSW_PRINT_MISSED_DEADLINES 1 -#define OBSW_ADD_TEST_CODE 1 -#define TEST_LIBGPIOD 0 - -#define TE0720 0 - -#define P60DOCK_DEBUG 0 -#define PDU1_DEBUG 0 -#define PDU2_DEBUG 0 -#define ACU_DEBUG 0 -#define SYRLINKS_DEBUG 0 -#define IMQT_DEBUG 1 - -#include "OBSWVersion.h" - -/* Can be used to switch device to NORMAL mode immediately */ -#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 - -#ifdef __cplusplus - -#include "objects/systemObjectList.h" -#include "events/subsystemIdRanges.h" -#include "returnvalues/classIds.h" - -namespace config { -#endif - -/* Add mission configuration flags here */ - -#ifdef __cplusplus -} -#endif - -#endif /* FSFWCONFIG_OBSWCONFIG_H_ */ diff --git a/fsfwconfig/events/translateEvents.cpp b/fsfwconfig/events/translateEvents.cpp deleted file mode 100644 index 49e1223a..00000000 --- a/fsfwconfig/events/translateEvents.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/** - * @brief Auto-generated event translation file. Contains 80 translations. - * Generated on: 2020-05-02 20:13:41 - */ -#include - -const char *GPS_STARTUP_FAILED_STRING = "GPS_STARTUP_FAILED"; -const char *GPS_FIX_STRING = "GPS_FIX"; -const char *GPS_LOST_FIX_STRING = "GPS_LOST_FIX"; -const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; -const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; -const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; -const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; -const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; -const char *STORING_FAILED_STRING = "STORING_FAILED"; -const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; -const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; -const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; -const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; -const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; -const char *INIT_DONE_STRING = "INIT_DONE"; -const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; -const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; -const char *DELETION_FAILED_STRING = "DELETION_FAILED"; -const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; -const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; -const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; -const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; -const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; -const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; -const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; -const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; -const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; -const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; -const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; -const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; -const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; -const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; -const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; -const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; -const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; -const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; -const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; -const char *HEATER_ON_STRING = "HEATER_ON"; -const char *HEATER_OFF_STRING = "HEATER_OFF"; -const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; -const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; -const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; -const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; -const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; -const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; -const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; -const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; -const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; -const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; -const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; -const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; -const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; -const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; -const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; -const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; -const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; -const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; -const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; -const char *CHANGING_MODE_STRING = "CHANGING_MODE"; -const char *MODE_INFO_STRING = "MODE_INFO"; -const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; -const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; -const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; -const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; -const char *FORCING_MODE_STRING = "FORCING_MODE"; -const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; -const char *HEALTH_INFO_STRING = "HEALTH_INFO"; -const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; -const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; -const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; -const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; -const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; -const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; -const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; -const char *RF_LOST_STRING = "RF_LOST"; -const char *BIT_LOCK_STRING = "BIT_LOCK"; -const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; -const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; -const char *TEST_EVENT_SERVICE_1_STRING = "TEST_EVENT_SERVICE_1"; -const char *TEST2_STRING = "TEST2"; - -const char * translateEvents(Event event){ - switch((event&0xFFFF)){ - case 1000: - return GPS_STARTUP_FAILED_STRING; - case 1001: - return GPS_FIX_STRING; - case 1002: - return GPS_LOST_FIX_STRING; - case 2200: - return STORE_SEND_WRITE_FAILED_STRING; - case 2201: - return STORE_WRITE_FAILED_STRING; - case 2202: - return STORE_SEND_READ_FAILED_STRING; - case 2203: - return STORE_READ_FAILED_STRING; - case 2204: - return UNEXPECTED_MSG_STRING; - case 2205: - return STORING_FAILED_STRING; - case 2206: - return TM_DUMP_FAILED_STRING; - case 2207: - return STORE_INIT_FAILED_STRING; - case 2208: - return STORE_INIT_EMPTY_STRING; - case 2209: - return STORE_CONTENT_CORRUPTED_STRING; - case 2210: - return STORE_INITIALIZE_STRING; - case 2211: - return INIT_DONE_STRING; - case 2212: - return DUMP_FINISHED_STRING; - case 2213: - return DELETION_FINISHED_STRING; - case 2214: - return DELETION_FAILED_STRING; - case 2215: - return AUTO_CATALOGS_SENDING_FAILED_STRING; - case 2600: - return GET_DATA_FAILED_STRING; - case 2601: - return STORE_DATA_FAILED_STRING; - case 2800: - return DEVICE_BUILDING_COMMAND_FAILED_STRING; - case 2801: - return DEVICE_SENDING_COMMAND_FAILED_STRING; - case 2802: - return DEVICE_REQUESTING_REPLY_FAILED_STRING; - case 2803: - return DEVICE_READING_REPLY_FAILED_STRING; - case 2804: - return DEVICE_INTERPRETING_REPLY_FAILED_STRING; - case 2805: - return DEVICE_MISSED_REPLY_STRING; - case 2806: - return DEVICE_UNKNOWN_REPLY_STRING; - case 2807: - return DEVICE_UNREQUESTED_REPLY_STRING; - case 2808: - return INVALID_DEVICE_COMMAND_STRING; - case 2809: - return MONITORING_LIMIT_EXCEEDED_STRING; - case 2810: - return MONITORING_AMBIGUOUS_STRING; - case 4201: - return FUSE_CURRENT_HIGH_STRING; - case 4202: - return FUSE_WENT_OFF_STRING; - case 4204: - return POWER_ABOVE_HIGH_LIMIT_STRING; - case 4205: - return POWER_BELOW_LOW_LIMIT_STRING; - case 4300: - return SWITCH_WENT_OFF_STRING; - case 5000: - return HEATER_ON_STRING; - case 5001: - return HEATER_OFF_STRING; - case 5002: - return HEATER_TIMEOUT_STRING; - case 5003: - return HEATER_STAYED_ON_STRING; - case 5004: - return HEATER_STAYED_OFF_STRING; - case 5200: - return TEMP_SENSOR_HIGH_STRING; - case 5201: - return TEMP_SENSOR_LOW_STRING; - case 5202: - return TEMP_SENSOR_GRADIENT_STRING; - case 5901: - return COMPONENT_TEMP_LOW_STRING; - case 5902: - return COMPONENT_TEMP_HIGH_STRING; - case 5903: - return COMPONENT_TEMP_OOL_LOW_STRING; - case 5904: - return COMPONENT_TEMP_OOL_HIGH_STRING; - case 5905: - return TEMP_NOT_IN_OP_RANGE_STRING; - case 7101: - return FDIR_CHANGED_STATE_STRING; - case 7102: - return FDIR_STARTS_RECOVERY_STRING; - case 7103: - return FDIR_TURNS_OFF_DEVICE_STRING; - case 7201: - return MONITOR_CHANGED_STATE_STRING; - case 7202: - return VALUE_BELOW_LOW_LIMIT_STRING; - case 7203: - return VALUE_ABOVE_HIGH_LIMIT_STRING; - case 7204: - return VALUE_OUT_OF_RANGE_STRING; - case 7301: - return SWITCHING_TM_FAILED_STRING; - case 7400: - return CHANGING_MODE_STRING; - case 7401: - return MODE_INFO_STRING; - case 7402: - return FALLBACK_FAILED_STRING; - case 7403: - return MODE_TRANSITION_FAILED_STRING; - case 7404: - return CANT_KEEP_MODE_STRING; - case 7405: - return OBJECT_IN_INVALID_MODE_STRING; - case 7406: - return FORCING_MODE_STRING; - case 7407: - return MODE_CMD_REJECTED_STRING; - case 7506: - return HEALTH_INFO_STRING; - case 7507: - return CHILD_CHANGED_HEALTH_STRING; - case 7508: - return CHILD_PROBLEMS_STRING; - case 7509: - return OVERWRITING_HEALTH_STRING; - case 7510: - return TRYING_RECOVERY_STRING; - case 7511: - return RECOVERY_STEP_STRING; - case 7512: - return RECOVERY_DONE_STRING; - case 7900: - return RF_AVAILABLE_STRING; - case 7901: - return RF_LOST_STRING; - case 7902: - return BIT_LOCK_STRING; - case 7903: - return BIT_LOCK_LOST_STRING; - case 7905: - return FRAME_PROCESSING_FAILED_STRING; - case 8000: - return TEST_EVENT_SERVICE_1_STRING; - case 9100: - return TEST2_STRING; - default: - return "UNKNOWN_EVENT"; - } - return 0; -} diff --git a/fsfwconfig/ipc/MissionMessageTypes.cpp b/fsfwconfig/ipc/MissionMessageTypes.cpp deleted file mode 100644 index 8536245f..00000000 --- a/fsfwconfig/ipc/MissionMessageTypes.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -void messagetypes::clearMissionMessage(CommandMessage* message) { -// switch(message->getMessageType()) { -// default: -// break; -// } -} - - diff --git a/fsfwconfig/objects/translateObjects.cpp b/fsfwconfig/objects/translateObjects.cpp deleted file mode 100644 index bfb8fb85..00000000 --- a/fsfwconfig/objects/translateObjects.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* Auto-generated event translation file. Contains 77 translations. */ -#include - -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 *TEST_TASK_STRING = "TEST_TASK"; -const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; -const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; -const char *S_ADC1_DEC2_STRING = "S_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 *_DEC1_O1_STRING = "_DEC1_O1"; -const char *_DEC1_O2_STRING = "_DEC1_O2"; -const char *S1_DEC1_O3_STRING = "S1_DEC1_O3"; -const char *S2_DEC1_O4_STRING = "S2_DEC1_O4"; -const char *S3_DEC1_O5_STRING = "S3_DEC1_O5"; -const char *PT1000_PVHC_DEC1_O6_STRING = "PT1000_PVHC_DEC1_O6"; -const char *PT1000_CCSDS1_DEC2_STRING = "PT1000_CCSDS1_DEC2"; -const char *PT1000_MGT1_DEC2_STRING = "PT1000_MGT1_DEC2"; -const char *S4_DEC2_STRING = "S4_DEC2"; -const char *S5_DEC2_STRING = "S5_DEC2"; -const char *S6_DEC2_STRING = "S6_DEC2"; -const char *PT1000_PVCH_DEC2_STRING = "PT1000_PVCH_DEC2"; -const char *_DEC3_STRING = "_DEC3"; -const char *PT1000_CCSDS2_DEC3_STRING = "PT1000_CCSDS2_DEC3"; -const char *S7_DEC3_STRING = "S7_DEC3"; -const char *S8_DEC3_STRING = "S8_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 *S9_DEC4_STRING = "S9_DEC4"; -const char *S10_DEC4_STRING = "S10_DEC4"; -const char *PT1000_PVHC_DEC4_STRING = "PT1000_PVHC_DEC4"; -const char *S_ADC_DEC4_STRING = "S_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_POLLING_TASK_STRING = "SERIAL_POLLING_TASK"; -const char *UART_TMTC_BRIDGE_STRING = "UART_TMTC_BRIDGE"; -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_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_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 *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 *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 0x42694269: - return TEST_TASK_STRING; - case 0x44003200: - return PCDU_HANDLER_STRING; - case 0x4400AFFE: - return DUMMY_HANDLER_STRING; - case 0x44020108: - return S_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 0x44115401: - return _DEC1_O1_STRING; - case 0x44115402: - return _DEC1_O2_STRING; - case 0x44115404: - return S1_DEC1_O3_STRING; - case 0x44115405: - return S2_DEC1_O4_STRING; - case 0x44115406: - return S3_DEC1_O5_STRING; - case 0x44115407: - return PT1000_PVHC_DEC1_O6_STRING; - case 0x44125401: - return PT1000_CCSDS1_DEC2_STRING; - case 0x44125403: - return PT1000_MGT1_DEC2_STRING; - case 0x44125404: - return S4_DEC2_STRING; - case 0x44125405: - return S5_DEC2_STRING; - case 0x44125406: - return S6_DEC2_STRING; - case 0x44125407: - return PT1000_PVCH_DEC2_STRING; - case 0x44130301: - return _DEC3_STRING; - case 0x44130302: - return PT1000_CCSDS2_DEC3_STRING; - case 0x44130305: - return S7_DEC3_STRING; - case 0x44130306: - return S8_DEC3_STRING; - case 0x44130307: - return PT1000_PVCH_DEC3_STRING; - case 0x44130308: - return GYRO2_STRING; - case 0x44145401: - return PT1000_PLOC_DEC4_STRING; - case 0x44145404: - return S9_DEC4_STRING; - case 0x44145405: - return S10_DEC4_STRING; - case 0x44145406: - return PT1000_PVHC_DEC4_STRING; - case 0x44145407: - return S_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 0x50000600: - return SERIAL_POLLING_TASK_STRING; - case 0x5000500: - return UART_TMTC_BRIDGE_STRING; - case 0x51000100: - return PUS_SERVICE_1_STRING; - case 0x51000200: - return PUS_SERVICE_2_STRING; - case 0x51000300: - return PUS_SERVICE_3_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 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 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 0xFFFFFFFF: - return NO_OBJECT_STRING; - default: - return "UNKNOWN_OBJECT"; - } - return 0; -} diff --git a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp deleted file mode 100644 index 02e6b625..00000000 --- a/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ /dev/null @@ -1,291 +0,0 @@ -#include "pollingSequenceFactory.h" -#include -#include -#include -#include -#include -#include - - -ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) -{ - /* Length of a communication cycle */ - uint32_t length = thisSequence->getPeriodMs(); - - thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::HEATER_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::SOLAR_ARRAY_DEPL_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - -#if Q7S_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC5, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC6, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC7, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC8, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC9, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC10, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC11, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC12, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC13, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC14, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC15, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC16, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC17, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::RTD_IC18, length * 0, DeviceHandlerIF::PERFORM_OPERATION); -#endif /* Q7S_ADD_RTD_DEVICES */ - - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_WRITE); - -#if Q7S_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC3, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC4, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC5, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC6, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC7, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC8, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC9, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC10, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC11, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC12, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC13, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC14, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC15, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC16, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC17, length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::RTD_IC18, length * 0.2, DeviceHandlerIF::SEND_WRITE); -#endif /* Q7S_ADD_RTD_DEVICES */ - - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.4, DeviceHandlerIF::GET_WRITE); - -#if Q7S_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC3, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC4, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC5, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC6, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC7, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC8, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC9, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC10, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC11, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC12, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC13, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC14, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC15, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC16, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC17, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::RTD_IC18, length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); -#endif /* Q7S_ADD_RTD_DEVICES */ - - thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.6, DeviceHandlerIF::SEND_READ); - -#if Q7S_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC3, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC4, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC5, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC6, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC7, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC8, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC9, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC10, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC11, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC12, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC13, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC14, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC15, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC16, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC17, length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::RTD_IC18, length * 0.6, DeviceHandlerIF::SEND_READ); -#endif /* Q7S_ADD_RTD_DEVICES */ - - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.8, DeviceHandlerIF::GET_READ); - -#if Q7S_ADD_RTD_DEVICES == 1 - thisSequence->addSlot(objects::RTD_IC3, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC4, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC5, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC6, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC7, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC8, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC9, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC10, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC11, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC12, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC13, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC14, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC15, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC16, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC17, length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::RTD_IC18, length * 0.8, DeviceHandlerIF::GET_READ); -#endif /* Q7S_ADD_RTD_DEVICES */ - - thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); - - if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_OK; - } - - sif::error << "PollingSequence::initialize has errors!" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; -} - -ReturnValue_t pst::gomspacePstInit(FixedTimeslotTaskIF *thisSequence){ - uint32_t length = thisSequence->getPeriodMs(); - - thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::P60DOCK_HANDLER, - length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PDU1_HANDLER, - length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PDU2_HANDLER, - length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::ACU_HANDLER, - length * 0, DeviceHandlerIF::PERFORM_OPERATION); - - thisSequence->addSlot(objects::P60DOCK_HANDLER, - length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::PDU1_HANDLER, - length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::PDU2_HANDLER, - length * 0.2, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::ACU_HANDLER, - length * 0.2, DeviceHandlerIF::SEND_WRITE); - - thisSequence->addSlot(objects::P60DOCK_HANDLER, - length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::PDU1_HANDLER, - length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::PDU2_HANDLER, - length * 0.4, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::ACU_HANDLER, - length * 0.4, DeviceHandlerIF::GET_WRITE); - - thisSequence->addSlot(objects::P60DOCK_HANDLER, - length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::PDU1_HANDLER, - length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::PDU2_HANDLER, - length * 0.6, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::ACU_HANDLER, - length * 0.6, DeviceHandlerIF::SEND_READ); - - thisSequence->addSlot(objects::P60DOCK_HANDLER, - length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::PDU1_HANDLER, - length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::PDU2_HANDLER, - length * 0.8, DeviceHandlerIF::GET_READ); - thisSequence->addSlot(objects::ACU_HANDLER, - length * 0.8, DeviceHandlerIF::GET_READ); - -#if OBSW_ADD_ACS_BOARD == 1 -// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.8, -// DeviceHandlerIF::GET_READ); -// -// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.2, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.8, -// DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.2, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.6, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.8, - DeviceHandlerIF::GET_READ); - -// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, -// DeviceHandlerIF::PERFORM_OPERATION); -// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2, -// DeviceHandlerIF::SEND_WRITE); -// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4, -// DeviceHandlerIF::GET_WRITE); -// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6, -// DeviceHandlerIF::SEND_READ); -// thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8, -// DeviceHandlerIF::GET_READ); -#endif - - if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Initialization of GomSpace PST failed" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; - } - return HasReturnvaluesIF::RETURN_OK; -} - -ReturnValue_t pst::pollingSequenceAcsTest(FixedTimeslotTaskIF *thisSequence) { - uint32_t length = thisSequence->getPeriodMs(); - - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.8, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.2, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.8, - DeviceHandlerIF::GET_READ); - - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, - DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2, - DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4, - DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6, - DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8, - DeviceHandlerIF::GET_READ); - if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Initialization of ACS Board PST failed" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; - } - return HasReturnvaluesIF::RETURN_OK; -} diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv new file mode 100644 index 00000000..81459869 --- /dev/null +++ b/generators/bsp_q7s_events.csv @@ -0,0 +1,83 @@ +2200;STORE_SEND_WRITE_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2201;STORE_WRITE_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2202;STORE_SEND_READ_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2203;STORE_READ_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2204;UNEXPECTED_MSG;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2205;STORING_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2206;TM_DUMP_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2207;STORE_INIT_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2208;STORE_INIT_EMPTY;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2209;STORE_CONTENT_CORRUPTED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2210;STORE_INITIALIZE;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2211;INIT_DONE;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2212;DUMP_FINISHED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2213;DELETION_FINISHED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2214;DELETION_FAILED;LOW; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2215;AUTO_CATALOGS_SENDING_FAILED;INFO; ;../../fsfw/tmstorage/TmStoreBackendIF.h +2600;GET_DATA_FAILED;LOW; ;../../fsfw/storagemanager/StorageManagerIF.h +2601;STORE_DATA_FAILED;LOW; ;../../fsfw/storagemanager/StorageManagerIF.h +2800;DEVICE_BUILDING_COMMAND_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2801;DEVICE_SENDING_COMMAND_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2802;DEVICE_REQUESTING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2803;DEVICE_READING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2805;DEVICE_MISSED_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2806;DEVICE_UNKNOWN_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2807;DEVICE_UNREQUESTED_REPLY;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2808;INVALID_DEVICE_COMMAND;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2809;MONITORING_LIMIT_EXCEEDED;LOW; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +2810;MONITORING_AMBIGUOUS;HIGH; ;../../fsfw/devicehandlers/DeviceHandlerIF.h +4201;FUSE_CURRENT_HIGH;LOW; ;../../fsfw/power/Fuse.h +4202;FUSE_WENT_OFF;LOW; ;../../fsfw/power/Fuse.h +4204;POWER_ABOVE_HIGH_LIMIT;LOW; ;../../fsfw/power/Fuse.h +4205;POWER_BELOW_LOW_LIMIT;LOW; ;../../fsfw/power/Fuse.h +4300;SWITCH_WENT_OFF;LOW; ;../../fsfw/power/PowerSwitchIF.h +5000;HEATER_ON;INFO; ;../../fsfw/thermal/Heater.h +5001;HEATER_OFF;INFO; ;../../fsfw/thermal/Heater.h +5002;HEATER_TIMEOUT;LOW; ;../../fsfw/thermal/Heater.h +5003;HEATER_STAYED_ON;LOW; ;../../fsfw/thermal/Heater.h +5004;HEATER_STAYED_OFF;LOW; ;../../fsfw/thermal/Heater.h +5200;TEMP_SENSOR_HIGH;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5201;TEMP_SENSOR_LOW;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5202;TEMP_SENSOR_GRADIENT;LOW; ;../../fsfw/thermal/AbstractTemperatureSensor.h +5901;COMPONENT_TEMP_LOW;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5902;COMPONENT_TEMP_HIGH;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5903;COMPONENT_TEMP_OOL_LOW;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5904;COMPONENT_TEMP_OOL_HIGH;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +5905;TEMP_NOT_IN_OP_RANGE;LOW; ;../../fsfw/thermal/ThermalComponentIF.h +7101;FDIR_CHANGED_STATE;INFO; ;../../fsfw/fdir/FailureIsolationBase.h +7102;FDIR_STARTS_RECOVERY;MEDIUM; ;../../fsfw/fdir/FailureIsolationBase.h +7103;FDIR_TURNS_OFF_DEVICE;MEDIUM; ;../../fsfw/fdir/FailureIsolationBase.h +7201;MONITOR_CHANGED_STATE;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7202;VALUE_BELOW_LOW_LIMIT;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7203;VALUE_ABOVE_HIGH_LIMIT;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7204;VALUE_OUT_OF_RANGE;LOW; ;../../fsfw/monitoring/MonitoringIF.h +7301;SWITCHING_TM_FAILED;LOW; ;../../fsfw/datapool/HkSwitchHelper.h +7400;CHANGING_MODE;INFO; ;../../fsfw/modes/HasModesIF.h +7401;MODE_INFO;INFO; ;../../fsfw/modes/HasModesIF.h +7402;FALLBACK_FAILED;HIGH; ;../../fsfw/modes/HasModesIF.h +7403;MODE_TRANSITION_FAILED;LOW; ;../../fsfw/modes/HasModesIF.h +7404;CANT_KEEP_MODE;HIGH; ;../../fsfw/modes/HasModesIF.h +7405;OBJECT_IN_INVALID_MODE;LOW; ;../../fsfw/modes/HasModesIF.h +7406;FORCING_MODE;MEDIUM; ;../../fsfw/modes/HasModesIF.h +7407;MODE_CMD_REJECTED;LOW; ;../../fsfw/modes/HasModesIF.h +7506;HEALTH_INFO;INFO; ;../../fsfw/health/HasHealthIF.h +7507;CHILD_CHANGED_HEALTH;INFO; ;../../fsfw/health/HasHealthIF.h +7508;CHILD_PROBLEMS;LOW; ;../../fsfw/health/HasHealthIF.h +7509;OVERWRITING_HEALTH;LOW; ;../../fsfw/health/HasHealthIF.h +7510;TRYING_RECOVERY;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7511;RECOVERY_STEP;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7512;RECOVERY_DONE;MEDIUM; ;../../fsfw/health/HasHealthIF.h +7900;RF_AVAILABLE;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7901;RF_LOST;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7902;BIT_LOCK;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7903;BIT_LOCK_LOST;INFO; ;../../fsfw/datalinklayer/DataLinkLayer.h +7905;FRAME_PROCESSING_FAILED;LOW; ;../../fsfw/datalinklayer/DataLinkLayer.h +8900;CLOCK_SET;INFO; ;../../fsfw/pus/Service9TimeManagement.h +8901;CLOCK_SET_FAILURE;LOW; ;../../fsfw/pus/Service9TimeManagement.h +9700;TEST;INFO; ;../../fsfw/pus/Service17Test.h +10600;CHANGE_OF_SETUP_PARAMETER;LOW; ;../../mission/devices/MGMHandlerLIS3MDL.h +11101;MEMORY_READ_RPT_CRC_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11102;ACK_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11103;EXE_FAILURE;LOW; ;../../mission/devices/PlocHandler.h +11104;CRC_FAILURE_EVENT;LOW; ;../../mission/devices/PlocHandler.h diff --git a/generators/bsp_q7s_objects.csv b/generators/bsp_q7s_objects.csv new file mode 100644 index 00000000..8df83d6a --- /dev/null +++ b/generators/bsp_q7s_objects.csv @@ -0,0 +1,93 @@ +0x00005060;P60DOCK_TEST_TASK +0x44000001;P60DOCK_HANDLER +0x44000002;PDU1_HANDLER +0x44000003;PDU2_HANDLER +0x44000004;ACU_HANDLER +0x44000005;TMP1075_HANDLER_1 +0x44000006;TMP1075_HANDLER_2 +0x44000007;MGM_0_LIS3_HANDLER +0x44000008;MGM_1_RM3100_HANDLER +0x44000009;MGM_2_LIS3_HANDLER +0x44000010;MGM_3_RM3100_HANDLER +0x44000011;GYRO_0_ADIS_HANDLER +0x44000012;GYRO_1_L3G_HANDLER +0x44000013;GYRO_2_L3G_HANDLER +0x44000014;IMTQ_HANDLER +0x44000015;PLOC_HANDLER +0x44000016;SUS_1 +0x44000017;SUS_2 +0x44000018;SUS_3 +0x44000019;SUS_4 +0x4400001A;SUS_5 +0x4400001B;SUS_6 +0x4400001C;SUS_7 +0x4400001D;SUS_8 +0x4400001E;SUS_9 +0x4400001F;SUS_10 +0x44000021;SUS_11 +0x44000022;SUS_12 +0x44000023;SUS_13 +0x44001000;PCDU_HANDLER +0x44001001;SOLAR_ARRAY_DEPL_HANDLER +0x44001002;SYRLINKS_HK_HANDLER +0x47000001;GPIO_IF +0x49000001;ARDUINO_COM_IF +0x49000002;CSP_COM_IF +0x49000003;I2C_COM_IF +0x49000004;UART_COM_IF +0x49000005;SPI_COM_IF +0x50000100;CCSDS_PACKET_DISTRIBUTOR +0x50000200;PUS_PACKET_DISTRIBUTOR +0x50000300;UDP_BRIDGE +0x50000400;UDP_POLLING_TASK +0x51000300;PUS_SERVICE_3 +0x51000400;PUS_SERVICE_5 +0x51000500;PUS_SERVICE_6 +0x51000800;PUS_SERVICE_8 +0x51002300;PUS_SERVICE_23 +0x51020100;PUS_SERVICE_201 +0x52000002;TM_FUNNEL +0x53000000;FSFW_OBJECTS_START +0x53000001;PUS_SERVICE_1_VERIFICATION +0x53000002;PUS_SERVICE_2_DEVICE_ACCESS +0x53000003;PUS_SERVICE_3_HOUSEKEEPING +0x53000005;PUS_SERVICE_5_EVENT_REPORTING +0x53000008;PUS_SERVICE_8_FUNCTION_MGMT +0x53000009;PUS_SERVICE_9_TIME_MGMT +0x53000017;PUS_SERVICE_17_TEST +0x53000020;PUS_SERVICE_20_PARAMETERS +0x53000200;PUS_SERVICE_200_MODE_MGMT +0x53000201;PUS_SERVICE_201_HEALTH +0x53010000;HEALTH_TABLE +0x53010100;MODE_STORE +0x53030000;EVENT_MANAGER +0x53040000;INTERNAL_ERROR_REPORTER +0x534f0100;TC_STORE +0x534f0200;TM_STORE +0x534f0300;IPC_STORE +0x53500010;TIME_STAMPER +0x53ffffff;FSFW_OBJECTS_END +0x54000003;HEATER_HANDLER +0x54000004;RTD_IC3 +0x54000005;RTD_IC4 +0x54000006;RTD_IC5 +0x54000007;RTD_IC6 +0x54000008;RTD_IC7 +0x54000009;RTD_IC8 +0x5400000A;RTD_IC9 +0x5400000B;RTD_IC10 +0x5400000C;RTD_IC11 +0x5400000D;RTD_IC12 +0x5400000E;RTD_IC13 +0x5400000F;RTD_IC14 +0x54000010;SPI_TEST +0x5400001F;RTD_IC15 +0x5400002F;RTD_IC16 +0x5400003F;RTD_IC17 +0x5400004F;RTD_IC18 +0x54000050;RAD_SENSOR +0x5400AFFE;DUMMY_HANDLER +0x5400CAFE;DUMMY_INTERFACE +0x54123456;LIBGPIOD_TEST +0x54694269;TEST_TASK +0xFFFFFFFF;NO_OBJECT diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv new file mode 100644 index 00000000..9cad2a74 --- /dev/null +++ b/generators/bsp_q7s_returnvalues.csv @@ -0,0 +1,407 @@ +0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF +0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF +0xe0;_PacketTooLong;;0xE0;../../mission/devices/GomspaceDeviceHandler.h; +0xe1;_InvalidTableId;;0xE1;../../mission/devices/GomspaceDeviceHandler.h; +0xe2;_InvalidAddress;;0xE2;../../mission/devices/GomspaceDeviceHandler.h; +0xe3;_InvalidParamSize;;0xE3;../../mission/devices/GomspaceDeviceHandler.h; +0xe4;_InvalidPayloadSize;;0xE4;../../mission/devices/GomspaceDeviceHandler.h; +0xe5;_UnknownReplyId;;0xE5;../../mission/devices/GomspaceDeviceHandler.h; +0x4da0;PLOC_CrcFailure;;0xA0;../../mission/devices/PlocHandler.h;PLOC_HANDLER +0x4da1;PLOC_ReceivedAckFailure;;0xA1;../../mission/devices/PlocHandler.h;PLOC_HANDLER +0x4da2;PLOC_ReceivedExeFailure;;0xA2;../../mission/devices/PlocHandler.h;PLOC_HANDLER +0x4da3;PLOC_InvalidApid;;0xA3;../../mission/devices/PlocHandler.h;PLOC_HANDLER +0x4ca0;IMTQ_InvalidCommandCode;;0xA0;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca1;IMTQ_ParameterMissing;;0xA1;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca2;IMTQ_ParameterInvalid;;0xA2;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca3;IMTQ_CcUnavailable;;0xA3;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca4;IMTQ_InternalProcessingError;;0xA4;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca5;IMTQ_RejectedWithoutReason;;0xA5;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ca6;IMTQ_CmdErrUnknown;;0xA6;../../mission/devices/IMTQHandler.h;IMTQ_HANDLER +0x4ba0;SYRLINKS_CrcFailure;;0xA0;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba2;SYRLINKS_BadCharacterAck;;0xA2;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba3;SYRLINKS_BadParameterValueAck;;0xA3;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba4;SYRLINKS_BadEndOfFrameAck;;0xA4;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba5;SYRLINKS_UnknownCommandIdAck;;0xA5;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba6;SYRLINKS_BadCrcAck;;0xA6;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba7;SYRLINKS_ReplyWrongSize;;0xA7;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x4ba8;SYRLINKS_MissingStartFrameCharacter;;0xA8;../../mission/devices/SyrlinksHkHandler.h;SYRLINKS_HANDLER +0x2b01;CCS_BcIsSetVrCommand;;0x01;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2b02;CCS_BcIsUnlockCommand;;0x02;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb0;CCS_BcIllegalCommand;;0xB0;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bb1;CCS_BoardReadingNotFinished;;0xB1;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf0;CCS_NsPositiveW;;0xF0;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf1;CCS_NsNegativeW;;0xF1;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf2;CCS_NsLockout;;0xF2;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf3;CCS_FarmInLockout;;0xF3;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bf4;CCS_FarmInWait;;0xF4;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be0;CCS_WrongSymbol;;0xE0;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be1;CCS_DoubleStart;;0xE1;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be2;CCS_StartSymbolMissed;;0xE2;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be3;CCS_EndWithoutStart;;0xE3;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be4;CCS_TooLarge;;0xE4;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be5;CCS_TooShort;;0xE5;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be6;CCS_WrongTfVersion;;0xE6;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be7;CCS_WrongSpacecraftId;;0xE7;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be8;CCS_NoValidFrameType;;0xE8;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2be9;CCS_CrcFailed;;0xE9;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bea;CCS_VcNotFound;;0xEA;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2beb;CCS_ForwardingFailed;;0xEB;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bec;CCS_ContentTooLarge;;0xEC;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bed;CCS_ResidualData;;0xED;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bee;CCS_DataCorrupted;;0xEE;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bef;CCS_IllegalSegmentationFlag;;0xEF;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd0;CCS_IllegalFlagCombination;;0xD0;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd1;CCS_ShorterThanHeader;;0xD1;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd2;CCS_TooShortBlockedPacket;;0xD2;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2bd3;CCS_TooShortMapExtraction;;0xD3;../../fsfw/datalinklayer/CCSDSReturnValuesIF.h;CCSDS_HANDLER_IF +0x2901;IEC_NoConfigurationTable;;0x01;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2902;IEC_NoCpuTable;;0x02;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2903;IEC_InvalidWorkspaceAddress;;0x03;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2904;IEC_TooLittleWorkspace;;0x04;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2905;IEC_WorkspaceAllocation;;0x05;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2906;IEC_InterruptStackTooSmall;;0x06;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2907;IEC_ThreadExitted;;0x07;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2908;IEC_InconsistentMpInformation;;0x08;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2909;IEC_InvalidNode;;0x09;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290a;IEC_NoMpci;;0x0a;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290b;IEC_BadPacket;;0x0b;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290c;IEC_OutOfPackets;;0x0c;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290d;IEC_OutOfGlobalObjects;;0x0d;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290e;IEC_OutOfProxies;;0x0e;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x290f;IEC_InvalidGlobalId;;0x0f;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2910;IEC_BadStackHook;;0x10;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2911;IEC_BadAttributes;;0x11;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2912;IEC_ImplementationKeyCreateInconsistency;;0x12;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2913;IEC_ImplementationBlockingOperationCancel;;0x13;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2914;IEC_MutexObtainFromBadState;;0x14;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0x2915;IEC_UnlimitedAndMaximumIs0;;0x15;../../fsfw/osal/InternalErrorCodes.h;INTERNAL_ERROR_CODES +0xe01;HM_InvalidMode;;0x01;../../fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe02;HM_TransNotAllowed;;0x02;../../fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe03;HM_InTransition;;0x03;../../fsfw/modes/HasModesIF.h;HAS_MODES_IF +0xe04;HM_InvalidSubmode;;0x04;../../fsfw/modes/HasModesIF.h;HAS_MODES_IF +0x2d01;HPA_InvalidIdentifierId;;0x01;../../fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d02;HPA_InvalidDomainId;;0x02;../../fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d03;HPA_InvalidValue;;0x03;../../fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2d05;HPA_ReadOnly;;0x05;../../fsfw/parameters/HasParametersIF.h;HAS_PARAMETERS_IF +0x2c01;PAW_UnknownDatatype;;0x01;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c02;PAW_DatatypeMissmatch;;0x02;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c03;PAW_Readonly;;0x03;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c04;PAW_TooBig;;0x04;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c05;PAW_SourceNotSet;;0x05;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c06;PAW_OutOfBounds;;0x06;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c07;PAW_NotSet;;0x07;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x2c08;PAW_ColumnOrRowsZero;;0x08;../../fsfw/parameters/ParameterWrapper.h;PARAMETER_WRAPPER +0x3101;CF_ObjectHasNoFunctions;;1;../../fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3102;CF_AlreadyCommanding;;2;../../fsfw/action/CommandsActionsIF.h;COMMANDS_ACTIONS_IF +0x3201;HF_IsBusy;;1;../../fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3202;HF_InvalidParameters;;2;../../fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3203;HF_ExecutionFinished;;3;../../fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x3204;HF_InvalidActionId;;4;../../fsfw/action/HasActionsIF.h;HAS_ACTIONS_IF +0x201;OM_InsertionFailed;;1;../../fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x202;OM_NotFound;;2;../../fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x203;OM_ChildInitFailed;;3;../../fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x204;OM_InternalErrReporterUninit;;4;../../fsfw/objectmanager/ObjectManagerIF.h;OBJECT_MANAGER_IF +0x2500;FDI_YourFault;;0;../../fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2501;FDI_MyFault;;1;../../fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2502;FDI_ConfirmLater;;2;../../fsfw/fdir/ConfirmsFailuresIF.h;HANDLES_FAILURES_IF +0x2101;TMF_Busy;;1;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2102;TMF_LastPacketFound;;2;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2103;TMF_StopFetch;;3;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2104;TMF_Timeout;;4;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2105;TMF_TmChannelFull;;5;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2106;TMF_NotStored;;6;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2107;TMF_AllDeleted;;7;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2108;TMF_InvalidData;;8;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2109;TMF_NotReady;;9;../../fsfw/tmstorage/TmStoreFrontendIF.h;TM_STORE_FRONTEND_IF +0x2001;TMB_Busy;;1;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2002;TMB_Full;;2;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2003;TMB_Empty;;3;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2004;TMB_NullRequested;;4;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2005;TMB_TooLarge;;5;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2006;TMB_NotReady;;6;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2007;TMB_DumpError;;7;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2008;TMB_CrcError;;8;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x2009;TMB_Timeout;;9;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200a;TMB_IdlePacketFound;;10;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200b;TMB_TelecommandFound;;11;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200c;TMB_NoPusATm;;12;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200d;TMB_TooSmall;;13;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200e;TMB_BlockNotFound;;14;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x200f;TMB_InvalidRequest;;15;../../fsfw/tmstorage/TmStoreBackendIF.h;TM_STORE_BACKEND_IF +0x1c01;TCD_PacketLost;;1;../../fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c02;TCD_DestinationNotFound;;2;../../fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1c03;TCD_ServiceIdAlreadyExists;;3;../../fsfw/tcdistribution/TcDistributor.h;PACKET_DISTRIBUTION +0x1b00;TCC_IllegalApid;;0;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b01;TCC_IncompletePacket;;1;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b02;TCC_IncorrectChecksum;;2;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b03;TCC_IllegalPacketType;;3;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b04;TCC_IllegalPacketSubtype;;4;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b05;TCC_IncorrectPrimaryHeader;;5;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x1b06;TCC_IncorrectSecondaryHeader;;6;../../fsfw/tcdistribution/TcPacketCheck.h;TC_PACKET_CHECK +0x4e1;RMP_CommandNoDescriptorsAvailable;;0xE1;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e2;RMP_CommandBufferFull;;0xE2;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e3;RMP_CommandChannelOutOfRange;;0xE3;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e6;RMP_CommandChannelDeactivated;;0xE6;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e7;RMP_CommandPortOutOfRange;;0xE7;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e8;RMP_CommandPortInUse;;0xE8;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4e9;RMP_CommandNoChannel;;0xE9;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4ea;RMP_NoHwCrc;;0xEA;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4d0;RMP_ReplyNoReply;;0xD0;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4d1;RMP_ReplyNotSent;;0xD1;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4d2;RMP_ReplyNotYetSent;;0xD2;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4d3;RMP_ReplyMissmatch;;0xD3;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4d4;RMP_ReplyTimeout;;0xD4;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4c0;RMP_ReplyInterfaceBusy;;0xC0;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4c1;RMP_ReplyTransmissionError;;0xC1;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4c2;RMP_ReplyInvalidData;;0xC2;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4c3;RMP_ReplyNotSupported;;0xC3;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f0;RMP_LinkDown;;0xF0;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f1;RMP_SpwCredit;;0xF1;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f2;RMP_SpwEscape;;0xF2;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f3;RMP_SpwDisconnect;;0xF3;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f4;RMP_SpwParity;;0xF4;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f5;RMP_SpwWriteSync;;0xF5;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f6;RMP_SpwInvalidAddress;;0xF6;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f7;RMP_SpwEarlyEop;;0xF7;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f8;RMP_SpwDma;;0xF8;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x4f9;RMP_SpwLinkError;;0xF9;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x400;RMP_ReplyOk;;0;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x401;RMP_ReplyGeneralErrorCode;;1;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x402;RMP_ReplyUnusedPacketTypeOrCommandCode;;2;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x403;RMP_ReplyInvalidKey;;3;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x404;RMP_ReplyInvalidDataCrc;;4;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x405;RMP_ReplyEarlyEop;;5;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x406;RMP_ReplyTooMuchData;;6;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x407;RMP_ReplyEep;;7;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x408;RMP_ReplyReserved;;8;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x409;RMP_ReplyVerifyBufferOverrun;;9;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x40a;RMP_ReplyCommandNotImplementedOrNotAuthorised;;10;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x40b;RMP_ReplyRmwDataLengthError;;11;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x40c;RMP_ReplyInvalidTargetLogicalAddress;;12;../../fsfw/rmap/RMAP.h;RMAP_CHANNEL +0x2701;SM_DataTooLarge;;1;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2702;SM_DataStorageFull;;2;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2703;SM_IllegalStorageId;;3;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2704;SM_DataDoesNotExist;;4;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2705;SM_IllegalAddress;;5;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x2706;SM_PoolTooLarge;;6;../../fsfw/storagemanager/StorageManagerIF.h;STORAGE_MANAGER_IF +0x36a1;SGP4_InvalidEccentricity;;0xA1;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36a2;SGP4_InvalidMeanMotion;;0xA2;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36a3;SGP4_InvalidPerturbationElements;;0xA3;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36a4;SGP4_InvalidSemiLatusRectum;;0xA4;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36a5;SGP4_InvalidEpochElements;;0xA5;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36a6;SGP4_SatelliteHasDecayed;;0xA6;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36b1;SGP4_TleTooOld;;0xB1;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x36b2;SGP4_TleNotInitialized;;0xB2;../../fsfw/coordinates/Sgp4Propagator.h;SGP4PROPAGATOR_CLASS +0x2301;MT_TooDetailedRequest;;1;../../fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2302;MT_TooGeneralRequest;;2;../../fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2303;MT_NoMatch;;3;../../fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2304;MT_Full;;4;../../fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x2305;MT_NewNodeCreated;;5;../../fsfw/globalfunctions/matching/MatchTree.h;MATCH_TREE_CLASS +0x3d01;DLEE_StreamTooShort;;0x01;../../fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x3d02;DLEE_DecodingError;;0x02;../../fsfw/globalfunctions/DleEncoder.h;DLE_ENCODER +0x2e01;ASC_TooLongForTargetType;;1;../../fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e02;ASC_InvalidCharacters;;2;../../fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0x2e03;ASC_BufferTooSmall;;0x3;../../fsfw/globalfunctions/AsciiConverter.h;ASCII_CONVERTER +0xf01;CM_UnknownCommand;;1;../../fsfw/ipc/CommandMessageIF.h;COMMAND_MESSAGE +0x3801;MQI_Empty;;1;../../fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3802;MQI_Full; No space left for more messages;2;../../fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3803;MQI_NoReplyPartner; Returned if a reply method was called without partner;3;../../fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3804;MQI_DestinationInvalid; Returned if the target destination is invalid.;4;../../fsfw/ipc/MessageQueueIF.h;MESSAGE_QUEUE_IF +0x3701;MUX_NotEnoughResources;;1;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3702;MUX_InsufficientMemory;;2;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3703;MUX_NoPrivilege;;3;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3704;MUX_WrongAttributeSetting;;4;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3705;MUX_MutexAlreadyLocked;;5;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3706;MUX_MutexNotFound;;6;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3707;MUX_MutexMaxLocks;;7;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3708;MUX_CurrThreadAlreadyOwnsMutex;;8;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3709;MUX_CurrThreadDoesNotOwnMutex;;9;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x370a;MUX_MutexTimeout;;10;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x370b;MUX_MutexInvalidId;;11;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x370c;MUX_MutexDestroyedWhileWaiting;;12;../../fsfw/ipc/MutexIF.h;MUTEX_IF +0x3901;SPH_SemaphoreTimeout;;1;../../fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3902;SPH_SemaphoreNotOwned;;2;../../fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x3903;SPH_SemaphoreInvalid;;3;../../fsfw/tasks/SemaphoreIF.h;SEMAPHORE_IF +0x2801;TC_InvalidTargetState;;1;../../fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f1;TC_AboveOperationalLimit;;0xF1;../../fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0x28f2;TC_BelowOperationalLimit;;0xF2;../../fsfw/thermal/ThermalComponentIF.h;THERMAL_COMPONENT_IF +0xc02;MS_InvalidEntry;;0x02;../../fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc03;MS_TooManyElements;;0x03;../../fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xc04;MS_CantStoreEmpty;;0x04;../../fsfw/subsystem/modes/ModeStoreIF.h;MODE_STORE_IF +0xd01;SS_SequenceAlreadyExists;;0x01;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd02;SS_TableAlreadyExists;;0x02;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd03;SS_TableDoesNotExist;;0x03;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd04;SS_TableOrSequenceLengthInvalid;;0x04;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd05;SS_SequenceDoesNotExist;;0x05;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd06;SS_TableContainsInvalidObjectId;;0x06;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd07;SS_FallbackSequenceDoesNotExist;;0x07;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd08;SS_NoTargetTable;;0x08;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd09;SS_SequenceOrTableTooLong;;0x09;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0b;SS_IsFallbackSequence;;0x0B;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0c;SS_AccessDenied;;0x0C;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xd0e;SS_TableInUse;;0x0E;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda1;SS_TargetTableNotReached;;0xA1;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xda2;SS_TableCheckFailed;;0xA2;../../fsfw/subsystem/Subsystem.h;SUBSYSTEM +0xb01;SB_ChildNotFound;;0x01;../../fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb02;SB_ChildInfoUpdated;;0x02;../../fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb03;SB_ChildDoesntHaveModes;;0x03;../../fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb04;SB_CouldNotInsertChild;;0x04;../../fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0xb05;SB_TableContainsInvalidObjectId;;0x05;../../fsfw/subsystem/SubsystemBase.h;SUBSYSTEM_BASE +0x3c00;HKM_QueueOrDestinationInvalid;;0;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3c01;HKM_WrongHkPacketType;;1;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3c02;HKM_ReportingStatusUnchanged;;2;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3c03;HKM_PeriodicHelperInvalid;;3;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3c04;HKM_PoolobjectNotFound;;4;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3c05;HKM_DatasetNotFound;;5;../../fsfw/datapoollocal/LocalDataPoolManager.h;HOUSEKEEPING_MANAGER +0x3a00;LPIF_PoolEntryNotFound;;0x00;../../fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3a01;LPIF_PoolEntryTypeConflict;;0x01;../../fsfw/datapoollocal/localPoolDefinitions.h;LOCAL_POOL_OWNER_IF +0x3ba0;PVA_InvalidReadWriteMode;;0xA0;../../fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x3ba1;PVA_InvalidPoolEntry;;0xA1;../../fsfw/datapool/PoolVariableIF.h;POOL_VARIABLE_IF +0x801;DPS_InvalidParameterDefinition;;1;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x802;DPS_SetWasAlreadyRead;;2;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x803;DPS_CommitingWithoutReading;;3;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x804;DPS_DataSetUninitialised;;4;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x805;DPS_DataSetFull;;5;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x806;DPS_PoolVarNull;;6;../../fsfw/datapool/DataSetIF.h;DATA_SET_CLASS +0x1000;TIM_UnsupportedTimeFormat;;0;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1001;TIM_NotEnoughInformationForTargetFormat;;1;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1002;TIM_LengthMismatch;;2;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1003;TIM_InvalidTimeFormat;;3;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1004;TIM_InvalidDayOfYear;;4;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x1005;TIM_TimeDoesNotFitFormat;;5;../../fsfw/timemanager/CCSDSTime.h;CCSDS_TIME_HELPER_CLASS +0x3501;TSI_BadTimestamp;;1;../../fsfw/timemanager/TimeStamperIF.h;TIME_STAMPER_IF +0x1d01;PUS_ActivityStarted;;1;../../fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d02;PUS_InvalidSubservice;;2;../../fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d03;PUS_IllegalApplicationData;;3;../../fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d04;PUS_SendTmFailed;;4;../../fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1d05;PUS_Timeout;;5;../../fsfw/tmtcservices/AcceptsTelecommandsIF.h;ACCEPTS_TELECOMMANDS_IF +0x1f01;CSB_ExecutionComplete;;1;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f02;CSB_NoStepMessage;;2;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f03;CSB_ObjectBusy;;3;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f04;CSB_Busy;;4;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f05;CSB_InvalidTc;;5;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f06;CSB_InvalidObject;;6;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1f07;CSB_InvalidReply;;7;../../fsfw/tmtcservices/CommandingServiceBase.h;COMMAND_SERVICE_BASE +0x1101;AL_Full;;0x01;../../fsfw/container/ArrayList.h;ARRAY_LIST +0x1801;FF_Full;;1;../../fsfw/container/FIFOBase.h;FIFO_CLASS +0x1802;FF_Empty;;2;../../fsfw/container/FIFOBase.h;FIFO_CLASS +0x1601;FMM_MapFull;;0x01;../../fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1602;FMM_KeyDoesNotExist;;0x02;../../fsfw/container/FixedOrderedMultimap.h;FIXED_MULTIMAP +0x1501;FM_KeyAlreadyExists;;0x01;../../fsfw/container/FixedMap.h;FIXED_MAP +0x1502;FM_MapFull;;0x02;../../fsfw/container/FixedMap.h;FIXED_MAP +0x1503;FM_KeyDoesNotExist;;0x03;../../fsfw/container/FixedMap.h;FIXED_MAP +0x2401;EV_ListenerNotFound;;1;../../fsfw/events/EventManagerIF.h;EVENT_MANAGER_IF +0x1701;HHI_ObjectNotHealthy;;1;../../fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x1702;HHI_InvalidHealthState;;2;../../fsfw/health/HasHealthIF.h;HAS_HEALTH_IF +0x2f01;POS_InPowerTransition;;1;../../fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x2f02;POS_SwitchStateMismatch;;2;../../fsfw/power/PowerSwitcher.h;POWER_SWITCHER +0x501;PS_SwitchOn;;1;../../fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x500;PS_SwitchOff;;0;../../fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x502;PS_SwitchTimeout;;2;../../fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x503;PS_FuseOn;;3;../../fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x504;PS_FuseOff;;4;../../fsfw/power/PowerSwitchIF.h;POWER_SWITCH_IF +0x1a01;TRC_NotEnoughSensors;;1;../../fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a02;TRC_LowestValueOol;;2;../../fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a03;TRC_HighestValueOol;;3;../../fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a04;TRC_BothValuesOol;;4;../../fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x1a05;TRC_DuplexOol;;5;../../fsfw/monitoring/TriplexMonitor.h;TRIPLE_REDUNDACY_CHECK +0x3001;LIM_Unchecked;;1;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3002;LIM_Invalid;;2;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3003;LIM_Unselected;;3;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3004;LIM_BelowLowLimit;;4;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3005;LIM_AboveHighLimit;;5;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3006;LIM_UnexpectedValue;;6;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x3007;LIM_OutOfRange;;7;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30a0;LIM_FirstSample;;0xA0;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e0;LIM_InvalidSize;;0xE0;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e1;LIM_WrongType;;0xE1;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e2;LIM_WrongPid;;0xE2;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30e3;LIM_WrongLimitId;;0xE3;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x30ee;LIM_MonitorNotFound;;0xEE;../../fsfw/monitoring/MonitoringIF.h;LIMITS_IF +0x4000;FILS_GenericFileError;;0;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4001;FILS_IsBusy;;1;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4002;FILS_InvalidParameters;;2;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4005;FILS_FileDoesNotExist;;5;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4006;FILS_FileAlreadyExists;;6;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4007;FILS_FileLocked;;7;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x400a;FILS_DirectoryDoesNotExist;;10;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x400b;FILS_DirectoryAlreadyExists;;11;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x400c;FILS_DirectoryNotEmpty;;12;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x400f;FILS_SequencePacketMissingWrite;;15;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x4010;FILS_SequencePacketMissingRead;;16;../../fsfw/memory/HasFileSystemIF.h;FILE_SYSTEM +0x601;PP_DoItMyself;;1;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x602;PP_PointsToVariable;;2;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x603;PP_PointsToMemory;;3;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x604;PP_ActivityCompleted;;4;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x605;PP_PointsToVectorUint8;;5;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x606;PP_PointsToVectorUint16;;6;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x607;PP_PointsToVectorUint32;;7;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x608;PP_PointsToVectorFloat;;8;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6a0;PP_DumpNotSupported;;0xA0;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e0;PP_InvalidSize;;0xE0;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e1;PP_InvalidAddress;;0xE1;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e2;PP_InvalidContent;;0xE2;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e3;PP_UnalignedAccess;;0xE3;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x6e4;PP_WriteProtected;;0xE4;../../fsfw/memory/HasMemoryIF.h;HAS_MEMORY_IF +0x13e0;MH_UnknownCmd;;0xE0;../../fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e1;MH_InvalidAddress;;0xE1;../../fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e2;MH_InvalidSize;;0xE2;../../fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x13e3;MH_StateMismatch;;0xE3;../../fsfw/memory/MemoryHelper.h;MEMORY_HELPER +0x1201;AB_NeedSecondStep;;0x01;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1202;AB_NeedToReconfigure;;0x02;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1203;AB_ModeFallback;;0x03;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1204;AB_ChildNotCommandable;;0x04;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x1205;AB_NeedToChangeHealth;;0x05;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x12a1;AB_NotEnoughChildrenInCorrectState;;0xa1;../../fsfw/devicehandlers/AssemblyBase.h;ASSEMBLY_BASE +0x3a0;DHB_InvalidChannel;;0xA0;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3b0;DHB_AperiodicReply;;0xB0;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3b1;DHB_IgnoreReplyData;;0xB1;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3b2;DHB_IgnoreFullPacket;;0xB2;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3c0;DHB_NothingToSend;;0xC0;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3c2;DHB_CommandMapError;;0xC2;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3d0;DHB_NoSwitch;;0xD0;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3e0;DHB_ChildTimeout;;0xE0;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3e1;DHB_SwitchFailed;;0xE1;../../fsfw/devicehandlers/DeviceHandlerBase.h;DEVICE_HANDLER_BASE +0x3301;DC_NoReplyReceived;;0x01;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3302;DC_ProtocolError;;0x02;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3303;DC_Nullpointer;;0x03;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3304;DC_InvalidCookieType;;0x04;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3305;DC_NotActive;;0x05;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x3306;DC_TooMuchData;;0x06;../../fsfw/devicehandlers/DeviceCommunicationIF.h;DEVICE_COMMUNICATION_IF +0x26a0;DHI_NoCommandData;;0xA0;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a1;DHI_CommandNotSupported;;0xA1;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a2;DHI_CommandAlreadySent;;0xA2;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a3;DHI_CommandWasNotSent;;0xA3;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a4;DHI_CantSwitchAddress;;0xA4;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a5;DHI_WrongModeForCommand;;0xA5;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a6;DHI_Timeout;;0xA6;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a7;DHI_Busy;;0xA7;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a8;DHI_NoReplyExpected;;0xA8;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26a9;DHI_NonOpTemperature;;0xA9;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26aa;DHI_CommandNotImplemented;;0xAA;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26b0;DHI_ChecksumError;;0xB0;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26b1;DHI_LengthMissmatch;;0xB1;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26b2;DHI_InvalidData;;0xB2;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26b3;DHI_ProtocolError;;0xB3;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26c0;DHI_DeviceDidNotExecute;;0xC0;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26c1;DHI_DeviceReportedError;;0xC1;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26c2;DHI_UnknownDeviceReply;;0xC2;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26c3;DHI_DeviceReplyInvalid;;0xC3;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26d0;DHI_InvalidCommandParameter;;0xD0;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x26d1;DHI_InvalidNumberOrLengthOfParameters;;0xD1;../../fsfw/devicehandlers/DeviceHandlerIF.h;DEVICE_HANDLER_IF +0x1401;SE_BufferTooShort;;1;../../fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1402;SE_StreamTooShort;;2;../../fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x1403;SE_TooManyElements;;3;../../fsfw/serialize/SerializeIF.h;SERIALIZE_IF +0x4aa1;HEATER_CommandNotSupported;;0xA1;../../linux/devices/HeaterHandler.h;HEATER_HANDLER +0x4aa2;HEATER_InitFailed;;0xA2;../../linux/devices/HeaterHandler.h;HEATER_HANDLER +0x4aa3;HEATER_InvalidSwitchNr;;0xA3;../../linux/devices/HeaterHandler.h;HEATER_HANDLER +0x4aa4;HEATER_MainSwitchSetTimeout;;0xA4;../../linux/devices/HeaterHandler.h;HEATER_HANDLER +0x4aa5;HEATER_CommandAlreadyWaiting;;0xA5;../../linux/devices/HeaterHandler.h;HEATER_HANDLER +0x4ea0;SUSS_ErrorUnlockMutex;;0xA0;../../linux/devices/SusHandler.h;SUS_HANDLER +0x4ea1;SUSS_ErrorLockMutex;;0xA1;../../linux/devices/SusHandler.h;SUS_HANDLER +0x57a0;SADPL_CommandNotSupported;;0xA0;../../linux/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x57a1;SADPL_DeploymentAlreadyExecuting;;0xA1;../../linux/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x57a2;SADPL_MainSwitchTimeoutFailure;;0xA2;../../linux/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x57a3;SADPL_SwitchingDeplSa1Failed;;0xA3;../../linux/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER +0x57a4;SADPL_SwitchingDeplSa2Failed;;0xA4;../../linux/devices/SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER diff --git a/generators/definitions.py b/generators/definitions.py new file mode 100644 index 00000000..42cf4f7b --- /dev/null +++ b/generators/definitions.py @@ -0,0 +1,9 @@ +import enum + +DATABASE_NAME = "eive_mod.db" + + +class BspType(enum.Enum): + BSP_Q7S = "bsp_q7s" + BSP_HOSTED = "bsp_hosted" + BSP_LINUX_BOARD = "bsp_linux_board" diff --git a/generators/events/__init__.py b/generators/events/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py new file mode 100644 index 00000000..565f2240 --- /dev/null +++ b/generators/events/event_parser.py @@ -0,0 +1,100 @@ +#! /usr/bin/python3 +""" +@file event_parser.py +@brief Part of the Mission Information Base Exporter for the SOURCE project by KSat. +@details +Event exporter. + +To use MySQLdb, run pip install mysqlclient or install in IDE. +On Windows, Build Tools installation might be necessary +@data 21.11.2019 +""" +import datetime + +from fsfwgen.events.event_parser import handle_csv_export, handle_cpp_export, SubsystemDefinitionParser, EventParser +from fsfwgen.parserbase.file_list_parser import FileListParser +from fsfwgen.utility.printer import PrettyPrinter +from fsfwgen.utility.file_management import copy_file, move_file + +from definitions import BspType + +DATE_TODAY = datetime.datetime.now() +DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") + +GENERATE_CPP = True +GENERATE_CPP_H = True +GENERATE_CSV = True +COPY_CPP_FILE = True +COPY_CPP_H_FILE = True +MOVE_CSV_FILE = True + +PARSE_HOST_BSP = True + +CPP_FILENAME = "translateEvents.cpp" +CPP_H_FILENAME = "translateEvents.h" + +BSP_SELECT = BspType.BSP_Q7S + +BSP_DIR_NAME = BSP_SELECT.value + +CSV_FILENAME = f"{BSP_SELECT.value}_events.csv" +CSV_MOVE_DESTINATION = "../" + +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + FSFW_CONFIG_ROOT = f"../../linux/fsfwconfig" + +else: + FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" + +CPP_COPY_DESTINATION = f"{FSFW_CONFIG_ROOT}/events/" + +FILE_SEPARATOR = ";" +SUBSYSTEM_DEFINITION_DESTINATIONS = [ + f"{FSFW_CONFIG_ROOT}/events/subsystemIdRanges.h", + "../../fsfw/events/fwSubsystemIdRanges.h", + f"../../common/config/commonSubsystemIds.h" +] +HEADER_DEFINITION_DESTINATIONS = ["../../mission/", "../../fsfw/", f"{FSFW_CONFIG_ROOT}", "../../test/"] + + +def main(): + print("EventParser: Parsing events: ") + event_list = parse_events() + if GENERATE_CSV: + handle_csv_export(file_name=CSV_FILENAME, event_list=event_list, file_separator=FILE_SEPARATOR) + if MOVE_CSV_FILE: + move_file(file_name=CSV_FILENAME, destination=CSV_MOVE_DESTINATION) + if GENERATE_CPP: + handle_cpp_export( + event_list=event_list, date_string=DATE_STRING_FULL, file_name=CPP_FILENAME, + generate_header=GENERATE_CPP_H, header_file_name=CPP_H_FILENAME + ) + if COPY_CPP_FILE: + print(f"EventParser: Copying file to {CPP_COPY_DESTINATION}") + copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + copy_file(CPP_H_FILENAME, CPP_COPY_DESTINATION) + print("") + + +def parse_events(): + subsystem_parser = SubsystemDefinitionParser(SUBSYSTEM_DEFINITION_DESTINATIONS) + subsystem_table = subsystem_parser.parse_files() + print(f"Found {len(subsystem_table)} subsystem definitions.") + PrettyPrinter.pprint(subsystem_table) + event_header_parser = FileListParser(HEADER_DEFINITION_DESTINATIONS) + event_headers = event_header_parser.parse_header_files( + True, "Parsing event header file list:\n", True + ) + # PrettyPrinter.pprint(event_headers) + # myEventList = parseHeaderFiles(subsystem_table, event_headers) + event_parser = EventParser(event_headers, subsystem_table) + event_parser.set_moving_window_mode(moving_window_size=7) + event_table = event_parser.parse_files() + list_items = sorted(event_table.items()) + print(f"Found {len(list_items)} entries:") + PrettyPrinter.pprint(list_items) + return list_items + + +if __name__ == "__main__": + main() diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp new file mode 100644 index 00000000..c3af08e1 --- /dev/null +++ b/generators/events/translateEvents.cpp @@ -0,0 +1,264 @@ +/** + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-06-08 17:09:32 + */ +#include "translateEvents.h" + +const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; +const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; +const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; +const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; +const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; +const char *STORING_FAILED_STRING = "STORING_FAILED"; +const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; +const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; +const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; +const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; +const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; +const char *INIT_DONE_STRING = "INIT_DONE"; +const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; +const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; +const char *DELETION_FAILED_STRING = "DELETION_FAILED"; +const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; +const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; +const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; +const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; +const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; +const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; +const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; +const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; +const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; +const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; +const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; +const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; +const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; +const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; +const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; +const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; +const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; +const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; +const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; +const char *HEATER_ON_STRING = "HEATER_ON"; +const char *HEATER_OFF_STRING = "HEATER_OFF"; +const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; +const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; +const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; +const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; +const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; +const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; +const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; +const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; +const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; +const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; +const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; +const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; +const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; +const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; +const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; +const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; +const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; +const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; +const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; +const char *CHANGING_MODE_STRING = "CHANGING_MODE"; +const char *MODE_INFO_STRING = "MODE_INFO"; +const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; +const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; +const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; +const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; +const char *FORCING_MODE_STRING = "FORCING_MODE"; +const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; +const char *HEALTH_INFO_STRING = "HEALTH_INFO"; +const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; +const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; +const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; +const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; +const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; +const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; +const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; +const char *RF_LOST_STRING = "RF_LOST"; +const char *BIT_LOCK_STRING = "BIT_LOCK"; +const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; +const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; + +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; +} diff --git a/generators/events/translateEvents.h b/generators/events/translateEvents.h new file mode 100644 index 00000000..9034dcf2 --- /dev/null +++ b/generators/events/translateEvents.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ +#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ + +#include + +const char * translateEvents(Event event); + +#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/generators/fsfwgen b/generators/fsfwgen new file mode 160000 index 00000000..78e890f9 --- /dev/null +++ b/generators/fsfwgen @@ -0,0 +1 @@ +Subproject commit 78e890f947f55a9417d390fea8d9bd5684d11730 diff --git a/generators/modgen b/generators/modgen deleted file mode 160000 index 5ed4a2ae..00000000 --- a/generators/modgen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ed4a2ae59e90c3763616bdaf41eb3317e849100 diff --git a/generators/objects/__init__.py b/generators/objects/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/generators/objects/objects.py b/generators/objects/objects.py new file mode 100644 index 00000000..d37b80d7 --- /dev/null +++ b/generators/objects/objects.py @@ -0,0 +1,112 @@ +#! /usr/bin/env python3 +""" +@file objects.py +@brief Part of the Mission Information Base Exporter for the SOURCE project by KSat. +@details +Object exporter. +To use MySQLdb, run pip install mysqlclient or install in IDE. +On Windows, Build Tools installation might be necessary +@data 21.11.2019 +""" +import datetime + +from fsfwgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, write_translation_file, \ + export_object_file, write_translation_header_file +from fsfwgen.utility.printer import PrettyPrinter +from fsfwgen.utility.file_management import copy_file, move_file + +from definitions import BspType, DATABASE_NAME + +DATE_TODAY = datetime.datetime.now() +DATE_STRING_FULL = DATE_TODAY.strftime("%Y-%m-%d %H:%M:%S") + +GENERATE_CSV = True +MOVE_CSV = True + +GENERATE_CPP = True +COPY_CPP = True + +GENERATE_HEADER = True + +BSP_SELECT = BspType.BSP_Q7S +BSP_DIR_NAME = BSP_SELECT.value +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + FSFW_CONFIG_ROOT = f"../../linux/fsfwconfig" +else: + FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" + +EXPORT_TO_SQL = True + +CPP_COPY_DESTINATION = f"{FSFW_CONFIG_ROOT}/objects/" +CSV_MOVE_DESTINATION = "../" +CPP_FILENAME = "translateObjects.cpp" +CPP_H_FILENAME = "translateObjects.h" +CSV_OBJECT_FILENAME = f"{BSP_SELECT.value}_objects.csv" +FILE_SEPARATOR = ";" + + +OBJECTS_PATH = f"{FSFW_CONFIG_ROOT}/objects/systemObjectList.h" +FRAMEWORK_OBJECT_PATH = "../../fsfw/objectmanager/frameworkObjects.h" +COMMON_OBJECTS_PATH = "../../common/config/commonObjects.h" +OBJECTS_DEFINITIONS = [OBJECTS_PATH, FRAMEWORK_OBJECT_PATH, COMMON_OBJECTS_PATH] + +SQL_DELETE_OBJECTS_CMD = """ + DROP TABLE IF EXISTS Objects + """ + +SQL_CREATE_OBJECTS_CMD = """ + CREATE TABLE IF NOT EXISTS Objects( + id INTEGER PRIMARY KEY, + objectid TEXT, + name TEXT + ) + """ + +SQL_INSERT_INTO_OBJECTS_CMD = """ +INSERT INTO Objects(objectid, name) +VALUES(?,?) +""" + + +def main(): + print("Parsing objects: ") + list_items = parse_objects() + handle_file_export(list_items) + if EXPORT_TO_SQL: + print("ObjectParser: Exporting to SQL") + sql_object_exporter( + object_table=list_items, delete_cmd=SQL_DELETE_OBJECTS_CMD, insert_cmd=SQL_INSERT_INTO_OBJECTS_CMD, + create_cmd=SQL_CREATE_OBJECTS_CMD, db_filename=f"../{DATABASE_NAME}" + ) + + +def parse_objects(): + # fetch objects + object_parser = ObjectDefinitionParser(OBJECTS_DEFINITIONS) + subsystem_definitions = object_parser.parse_files() + # id_subsystem_definitions.update(framework_subsystem_definitions) + list_items = sorted(subsystem_definitions.items()) + PrettyPrinter.pprint(list_items) + print("ObjectParser: Number of objects: ", len(list_items)) + return list_items + + +def handle_file_export(list_items): + if GENERATE_CPP: + print("ObjectParser: Generating translation C++ file.") + write_translation_file(filename=CPP_FILENAME, list_of_entries=list_items, date_string_full=DATE_STRING_FULL) + if COPY_CPP: + print("ObjectParser: Copying object file to " + CPP_COPY_DESTINATION) + copy_file(CPP_FILENAME, CPP_COPY_DESTINATION) + if GENERATE_HEADER: + write_translation_header_file(filename=CPP_H_FILENAME) + copy_file(filename=CPP_H_FILENAME, destination=CPP_COPY_DESTINATION) + if GENERATE_CSV: + print("ObjectParser: Generating text export.") + export_object_file(filename=CSV_OBJECT_FILENAME, object_list=list_items, file_separator=FILE_SEPARATOR) + if MOVE_CSV: + move_file(file_name=CSV_OBJECT_FILENAME, destination=CSV_MOVE_DESTINATION) + + +if __name__ == "__main__": + main() diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp new file mode 100644 index 00000000..47b55435 --- /dev/null +++ b/generators/objects/translateObjects.cpp @@ -0,0 +1,295 @@ +/** + * @brief Auto-generated object translation file. + * @details + * Contains 93 translations. + * Generated on: 2021-05-18 16:48:46 + */ +#include "translateObjects.h" + +const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *P60DOCK_HANDLER_STRING = "P60DOCK_HANDLER"; +const char *PDU1_HANDLER_STRING = "PDU1_HANDLER"; +const char *PDU2_HANDLER_STRING = "PDU2_HANDLER"; +const char *ACU_HANDLER_STRING = "ACU_HANDLER"; +const char *TMP1075_HANDLER_1_STRING = "TMP1075_HANDLER_1"; +const char *TMP1075_HANDLER_2_STRING = "TMP1075_HANDLER_2"; +const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; +const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER"; +const char *MGM_2_LIS3_HANDLER_STRING = "MGM_2_LIS3_HANDLER"; +const char *MGM_3_RM3100_HANDLER_STRING = "MGM_3_RM3100_HANDLER"; +const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; +const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER"; +const char *GYRO_2_L3G_HANDLER_STRING = "GYRO_2_L3G_HANDLER"; +const char *IMTQ_HANDLER_STRING = "IMTQ_HANDLER"; +const char *PLOC_HANDLER_STRING = "PLOC_HANDLER"; +const char *SUS_1_STRING = "SUS_1"; +const char *SUS_2_STRING = "SUS_2"; +const char *SUS_3_STRING = "SUS_3"; +const char *SUS_4_STRING = "SUS_4"; +const char *SUS_5_STRING = "SUS_5"; +const char *SUS_6_STRING = "SUS_6"; +const char *SUS_7_STRING = "SUS_7"; +const char *SUS_8_STRING = "SUS_8"; +const char *SUS_9_STRING = "SUS_9"; +const char *SUS_10_STRING = "SUS_10"; +const char *SUS_11_STRING = "SUS_11"; +const char *SUS_12_STRING = "SUS_12"; +const char *SUS_13_STRING = "SUS_13"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; +const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *GPIO_IF_STRING = "GPIO_IF"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *CSP_COM_IF_STRING = "CSP_COM_IF"; +const char *I2C_COM_IF_STRING = "I2C_COM_IF"; +const char *UART_COM_IF_STRING = "UART_COM_IF"; +const char *SPI_COM_IF_STRING = "SPI_COM_IF"; +const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR"; +const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR"; +const char *UDP_BRIDGE_STRING = "UDP_BRIDGE"; +const char *UDP_POLLING_TASK_STRING = "UDP_POLLING_TASK"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +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_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +const char *PUS_SERVICE_201_HEALTH_STRING = "PUS_SERVICE_201_HEALTH"; +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 *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; +const char *RTD_IC3_STRING = "RTD_IC3"; +const char *RTD_IC4_STRING = "RTD_IC4"; +const char *RTD_IC5_STRING = "RTD_IC5"; +const char *RTD_IC6_STRING = "RTD_IC6"; +const char *RTD_IC7_STRING = "RTD_IC7"; +const char *RTD_IC8_STRING = "RTD_IC8"; +const char *RTD_IC9_STRING = "RTD_IC9"; +const char *RTD_IC10_STRING = "RTD_IC10"; +const char *RTD_IC11_STRING = "RTD_IC11"; +const char *RTD_IC12_STRING = "RTD_IC12"; +const char *RTD_IC13_STRING = "RTD_IC13"; +const char *RTD_IC14_STRING = "RTD_IC14"; +const char *SPI_TEST_STRING = "SPI_TEST"; +const char *RTD_IC15_STRING = "RTD_IC15"; +const char *RTD_IC16_STRING = "RTD_IC16"; +const char *RTD_IC17_STRING = "RTD_IC17"; +const char *RTD_IC18_STRING = "RTD_IC18"; +const char *RAD_SENSOR_STRING = "RAD_SENSOR"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x44000001: + return P60DOCK_HANDLER_STRING; + case 0x44000002: + return PDU1_HANDLER_STRING; + case 0x44000003: + return PDU2_HANDLER_STRING; + case 0x44000004: + return ACU_HANDLER_STRING; + case 0x44000005: + return TMP1075_HANDLER_1_STRING; + case 0x44000006: + return TMP1075_HANDLER_2_STRING; + case 0x44000007: + return MGM_0_LIS3_HANDLER_STRING; + case 0x44000008: + return MGM_1_RM3100_HANDLER_STRING; + case 0x44000009: + return MGM_2_LIS3_HANDLER_STRING; + case 0x44000010: + return MGM_3_RM3100_HANDLER_STRING; + case 0x44000011: + return GYRO_0_ADIS_HANDLER_STRING; + case 0x44000012: + return GYRO_1_L3G_HANDLER_STRING; + case 0x44000013: + return GYRO_2_L3G_HANDLER_STRING; + case 0x44000014: + return IMTQ_HANDLER_STRING; + case 0x44000015: + return PLOC_HANDLER_STRING; + case 0x44000016: + return SUS_1_STRING; + case 0x44000017: + return SUS_2_STRING; + case 0x44000018: + return SUS_3_STRING; + case 0x44000019: + return SUS_4_STRING; + case 0x4400001A: + return SUS_5_STRING; + case 0x4400001B: + return SUS_6_STRING; + case 0x4400001C: + return SUS_7_STRING; + case 0x4400001D: + return SUS_8_STRING; + case 0x4400001E: + return SUS_9_STRING; + case 0x4400001F: + return SUS_10_STRING; + case 0x44000021: + return SUS_11_STRING; + case 0x44000022: + return SUS_12_STRING; + case 0x44000023: + return SUS_13_STRING; + case 0x44001000: + return PCDU_HANDLER_STRING; + case 0x44001001: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x44001002: + return SYRLINKS_HK_HANDLER_STRING; + case 0x47000001: + return GPIO_IF_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x49000002: + return CSP_COM_IF_STRING; + case 0x49000003: + return I2C_COM_IF_STRING; + case 0x49000004: + return UART_COM_IF_STRING; + case 0x49000005: + return SPI_COM_IF_STRING; + case 0x50000100: + return CCSDS_PACKET_DISTRIBUTOR_STRING; + case 0x50000200: + return PUS_PACKET_DISTRIBUTOR_STRING; + case 0x50000300: + return UDP_BRIDGE_STRING; + case 0x50000400: + return UDP_POLLING_TASK_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53000201: + return PUS_SERVICE_201_HEALTH_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 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0x54000003: + return HEATER_HANDLER_STRING; + case 0x54000004: + return RTD_IC3_STRING; + case 0x54000005: + return RTD_IC4_STRING; + case 0x54000006: + return RTD_IC5_STRING; + case 0x54000007: + return RTD_IC6_STRING; + case 0x54000008: + return RTD_IC7_STRING; + case 0x54000009: + return RTD_IC8_STRING; + case 0x5400000A: + return RTD_IC9_STRING; + case 0x5400000B: + return RTD_IC10_STRING; + case 0x5400000C: + return RTD_IC11_STRING; + case 0x5400000D: + return RTD_IC12_STRING; + case 0x5400000E: + return RTD_IC13_STRING; + case 0x5400000F: + return RTD_IC14_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x5400001F: + return RTD_IC15_STRING; + case 0x5400002F: + return RTD_IC16_STRING; + case 0x5400003F: + return RTD_IC17_STRING; + case 0x5400004F: + return RTD_IC18_STRING; + case 0x54000050: + return RAD_SENSOR_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: + return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/generators/objects/translateObjects.h b/generators/objects/translateObjects.h new file mode 100644 index 00000000..dbf5b468 --- /dev/null +++ b/generators/objects/translateObjects.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ +#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ + +#include + +const char* translateObject(object_id_t object); + +#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/generators/returnvalues/__init__.py b/generators/returnvalues/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py new file mode 100644 index 00000000..772e0bf1 --- /dev/null +++ b/generators/returnvalues/returnvalues_parser.py @@ -0,0 +1,112 @@ +#! /usr/bin/python3 +# -*- coding: utf-8 -*- +""" +:file: returnvalues_parser.py +:brief: Part of the MOD export tools for the SOURCE project by KSat. +TODO: Integrate into Parser Structure instead of calling this file (no cpp file generated yet) +:details: +Returnvalue exporter. +To use MySQLdb, run pip install mysqlclient or install in IDE. On Windows, Build Tools installation might be necessary. +:data: 21.11.2019 +""" +from fsfwgen.parserbase.file_list_parser import FileListParser +from fsfwgen.returnvalues.returnvalues_parser import InterfaceParser, ReturnValueParser +from fsfwgen.utility.sql_writer import SqlWriter +from fsfwgen.utility.file_management import move_file + +from definitions import BspType, DATABASE_NAME + +EXPORT_TO_FILE = True +MOVE_CSV_FILE = True +EXPORT_TO_SQL = True +PRINT_TABLES = True + + +FILE_SEPARATOR = ';' +MAX_STRING_LENGTH = 32 + +BSP_SELECT = BspType.BSP_Q7S +BSP_DIR_NAME = BSP_SELECT.value +CSV_RETVAL_FILENAME = f"{BSP_SELECT.value}_returnvalues.csv" +CSV_MOVE_DESTINATION = "../" +ADD_LINUX_FOLDER = False + +if BSP_SELECT == BspType.BSP_Q7S or BSP_SELECT == BspType.BSP_LINUX_BOARD: + FSFW_CONFIG_ROOT = f"../../linux/fsfwconfig" + ADD_LINUX_FOLDER = True +else: + FSFW_CONFIG_ROOT = f"../../{BSP_DIR_NAME}/fsfwconfig" +BSP_PATH = f"../../{BSP_DIR_NAME}" + +INTERFACE_DEFINITION_FILES = [ + "../../fsfw/returnvalues/FwClassIds.h", + "../../common/config/commonClassIds.h", + f"{FSFW_CONFIG_ROOT}/returnvalues/classIds.h" +] +RETURNVALUE_DESTINATIONS = [ + "../../mission/", "../../fsfw/", f"{BSP_PATH}" +] + +if ADD_LINUX_FOLDER: + RETURNVALUE_DESTINATIONS.append("../../linux") + +SQL_DELETE_RETURNVALUES_CMD = """ + DROP TABLE IF EXISTS Returnvalues +""" + +SQL_CREATE_RETURNVALUES_CMD = """ + CREATE TABLE IF NOT EXISTS Returnvalues ( + id INTEGER PRIMARY KEY, + code TEXT, + name TEXT, + interface TEXT, + file TEXT, + description TEXT + ) +""" + +SQL_INSERT_RETURNVALUES_CMD = """ +INSERT INTO Returnvalues(code,name,interface,file,description) +VALUES(?,?,?,?,?) +""" + + +def main(): + returnvalue_table = parse_returnvalues() + print("") + if EXPORT_TO_FILE: + ReturnValueParser.export_to_file(CSV_RETVAL_FILENAME, returnvalue_table, FILE_SEPARATOR) + if MOVE_CSV_FILE: + move_file(file_name=CSV_RETVAL_FILENAME, destination=CSV_MOVE_DESTINATION) + if EXPORT_TO_SQL: + print("ReturnvalueParser: Exporting to SQL") + sql_retval_exporter(returnvalue_table=returnvalue_table, db_file_dest=f"../{DATABASE_NAME}") + + +def parse_returnvalues(): + """ Core function to parse for the return values """ + interface_parser = InterfaceParser(file_list=INTERFACE_DEFINITION_FILES, print_table=PRINT_TABLES) + interfaces = interface_parser.parse_files() + header_parser = FileListParser(RETURNVALUE_DESTINATIONS) + header_list = header_parser.parse_header_files(True, "Parsing header file list: ") + print("") + returnvalue_parser = ReturnValueParser(interfaces, header_list, PRINT_TABLES) + returnvalue_parser.set_moving_window_mode(moving_window_size=7) + returnvalue_table = returnvalue_parser.parse_files(True) + print(f"ReturnvalueParser: Found {len(returnvalue_table)} returnvalues.") + return returnvalue_table + + +def sql_retval_exporter(returnvalue_table, db_file_dest: str): + sql_writer = SqlWriter(db_filename=db_file_dest) + sql_writer.open(SQL_CREATE_RETURNVALUES_CMD) + for entry in returnvalue_table.items(): + sql_writer.write_entries( + SQL_INSERT_RETURNVALUES_CMD, + (entry[0], entry[1][2], entry[1][4], entry[1][3], entry[1][1])) + sql_writer.commit() + sql_writer.close() + + +if __name__ == "__main__": + main() diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 7e6d1f35..79891a84 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -1,4 +1,6 @@ add_subdirectory(csp) -add_subdirectory(uart) add_subdirectory(utility) add_subdirectory(boardtest) +add_subdirectory(devices) +add_subdirectory(fsfwconfig) +add_subdirectory(obc) \ No newline at end of file diff --git a/linux/boardtest/LibgpiodTest.cpp b/linux/boardtest/LibgpiodTest.cpp index d085671a..39e863b4 100644 --- a/linux/boardtest/LibgpiodTest.cpp +++ b/linux/boardtest/LibgpiodTest.cpp @@ -1,15 +1,16 @@ #include "LibgpiodTest.h" -#include +#include "devices/gpioIds.h" + #include -#include +#include #include LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie): TestTask(objectId) { - gpioInterface = objectManager->get(gpioIfobjectId); + gpioInterface = ObjectManager::instance()->get(gpioIfobjectId); if (gpioInterface == nullptr) { sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl; } diff --git a/linux/boardtest/SpiTestClass.cpp b/linux/boardtest/SpiTestClass.cpp index 387c7eb5..4fc52f29 100644 --- a/linux/boardtest/SpiTestClass.cpp +++ b/linux/boardtest/SpiTestClass.cpp @@ -1,6 +1,6 @@ #include "SpiTestClass.h" -#include +#include "devices/gpioIds.h" #include #include diff --git a/linux/boardtest/SpiTestClass.h b/linux/boardtest/SpiTestClass.h index f93eb9c2..dd112a0e 100644 --- a/linux/boardtest/SpiTestClass.h +++ b/linux/boardtest/SpiTestClass.h @@ -55,6 +55,15 @@ private: uint8_t gyro2L3gd20ChipSelect = 3; uint8_t mgm2Lis3mdlChipSelect = 0; uint8_t mgm3Rm3100ChipSelect = 23; +#else + uint8_t mgm0Lis3mdlChipSelect = 0; + uint8_t mgm1Rm3100ChipSelect = 0; + uint8_t gyro0AdisResetLine = 0; + uint8_t gyro0AdisChipSelect = 0; + uint8_t gyro1L3gd20ChipSelect = 0; + uint8_t gyro2L3gd20ChipSelect = 0; + uint8_t mgm2Lis3mdlChipSelect = 0; + uint8_t mgm3Rm3100ChipSelect = 0; #endif static constexpr uint8_t STM_READ_MASK = 0b1000'0000; diff --git a/linux/boardtest/UartTestClass.cpp b/linux/boardtest/UartTestClass.cpp index dc9f79c3..e69f0e5f 100644 --- a/linux/boardtest/UartTestClass.cpp +++ b/linux/boardtest/UartTestClass.cpp @@ -1,8 +1,114 @@ -#include +#include "UartTestClass.h" +#if defined(RASPBERRY_PI) +#include "rpiConfig.h" +#elif defined(XIPHOS_Q7S) +#include "q7sConfig.h" +#endif + +#include "fsfw/serviceinterface/ServiceInterface.h" + +#include "lwgps/lwgps.h" + +#include // Contains file controls like O_RDWR +#include // Error integer and strerror() function +#include // write(), read(), close() + +#define GPS_REPLY_WIRETAPPING 0 UartTestClass::UartTestClass(object_id_t objectId): TestTask(objectId) { } -ReturnValue_t UartTestClass::performPeriodicAction() { +ReturnValue_t UartTestClass::initialize() { +#if RPI_TEST_GPS_DEVICE == 1 + int result = lwgps_init(&gpsData); + if(result == 0) { + sif::warning << "lwgps_init error: " << result << std::endl; + } + + /* Get file descriptor */ + serialPort = open("/dev/serial0", O_RDWR); + if(serialPort < 0) { + sif::warning << "open call failed with error [" << errno << ", " << strerror(errno) + << std::endl; + } + /* Setting up UART parameters */ + tty.c_cflag &= ~PARENB; // Clear parity bit + tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication + tty.c_cflag &= ~CSIZE; // Clear all the size bits + tty.c_cflag |= CS8; // 8 bits per byte + tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control + tty.c_cflag |= CREAD | CLOCAL; // Turn on READ & ignore ctrl lines (CLOCAL = 1) + // Use canonical mode for GPS device + tty.c_lflag |= ICANON; + tty.c_lflag &= ~ECHO; // Disable echo + tty.c_lflag &= ~ECHOE; // Disable erasure + tty.c_lflag &= ~ECHONL; // Disable new-line echo + tty.c_lflag &= ~ISIG; // Disable interpretation of INTR, QUIT and SUSP + tty.c_iflag &= ~(IXON | IXOFF | IXANY); // Turn off s/w flow ctrl + tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL); // Disable any special handling of received bytes + tty.c_oflag &= ~OPOST; // Prevent special interpretation of output bytes (e.g. newline chars) + tty.c_oflag &= ~ONLCR; // Prevent conversion of newline to carriage return/line feed + + // Non-blocking mode + tty.c_cc[VTIME] = 0; + tty.c_cc[VMIN] = 0; + + cfsetispeed(&tty, B9600); + cfsetospeed(&tty, B9600); + if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { + sif::warning << "tcsetattr call failed with error [" << errno << ", " << + strerror(errno) << std::endl;; + } + // Flush received and unread data. Those are old NMEA strings which are not relevant anymore + tcflush(serialPort, TCIFLUSH); +#endif + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t UartTestClass::performOneShotAction() { +#if RPI_TEST_GPS_DEVICE == 1 +#endif + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t UartTestClass::performPeriodicAction() { +#if RPI_TEST_GPS_DEVICE == 1 + int bytesRead = 0; + do { + bytesRead = read(serialPort, + reinterpret_cast(recBuf.data()), + static_cast(recBuf.size())); + if(bytesRead < 0) { + sif::warning << "UartTestClass::performPeriodicAction: read call failed with error [" << + errno << ", " << strerror(errno) << "]" << std::endl; + break; + } + else if(bytesRead >= static_cast(recBuf.size())) { + sif::debug << "UartTestClass::performPeriodicAction: " + "recv buffer might not be large enough" << std::endl; + } + else if(bytesRead > 0) { + // pass data to lwgps for processing +#if GPS_REPLY_WIRETAPPING == 1 + sif::info << recBuf.data() << std::endl; +#endif + int result = lwgps_process(&gpsData, recBuf.data(), bytesRead); + if(result == 0) { + sif::warning << "UartTestClass::performPeriodicAction: lwgps_process error" + << std::endl; + } + recvCnt++; + if(recvCnt == 6) { + recvCnt = 0; + sif::info << "GPS Data" << std::endl; + // Print messages + printf("Valid status: %d\n", gpsData.is_valid); + printf("Latitude: %f degrees\n", gpsData.latitude); + printf("Longitude: %f degrees\n", gpsData.longitude); + printf("Altitude: %f meters\n", gpsData.altitude); + } + } + } while(bytesRead > 0); +#endif return HasReturnvaluesIF::RETURN_OK; } diff --git a/linux/boardtest/UartTestClass.h b/linux/boardtest/UartTestClass.h index 406d2af5..aeb2c396 100644 --- a/linux/boardtest/UartTestClass.h +++ b/linux/boardtest/UartTestClass.h @@ -1,15 +1,27 @@ #ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_ #define LINUX_BOARDTEST_UARTTESTCLASS_H_ -#include +#include "test/testtasks/TestTask.h" +#include "lwgps/lwgps.h" + +#include +#include // Contains POSIX terminal control definitions class UartTestClass: public TestTask { public: UartTestClass(object_id_t objectId); + ReturnValue_t initialize() override; + ReturnValue_t performOneShotAction() override; ReturnValue_t performPeriodicAction() override; private: + lwgps_t gpsData = {}; + struct termios tty = {}; + int serialPort = 0; + std::array recBuf; + uint8_t recvCnt = 0; + }; #endif /* LINUX_BOARDTEST_UARTTESTCLASS_H_ */ diff --git a/linux/csp/CspComIF.cpp b/linux/csp/CspComIF.cpp index 1798b152..a8f13963 100644 --- a/linux/csp/CspComIF.cpp +++ b/linux/csp/CspComIF.cpp @@ -82,7 +82,7 @@ ReturnValue_t CspComIF::sendMessage(CookieIF *cookie, /* Extract csp port and bytes to query from command buffer */ uint8_t cspPort; - uint16_t querySize; + uint16_t querySize = 0; result = getPortAndQuerySize(&sendData, &sendLen, &cspPort, &querySize); if(result != HasReturnvaluesIF::RETURN_OK) { return result; diff --git a/bsp_q7s/devices/CMakeLists.txt b/linux/devices/CMakeLists.txt similarity index 85% rename from bsp_q7s/devices/CMakeLists.txt rename to linux/devices/CMakeLists.txt index 9e6fb793..3871a6a6 100644 --- a/bsp_q7s/devices/CMakeLists.txt +++ b/linux/devices/CMakeLists.txt @@ -1,4 +1,5 @@ target_sources(${TARGET_NAME} PRIVATE HeaterHandler.cpp SolarArrayDeploymentHandler.cpp + SusHandler.cpp ) diff --git a/bsp_q7s/devices/HeaterHandler.cpp b/linux/devices/HeaterHandler.cpp similarity index 95% rename from bsp_q7s/devices/HeaterHandler.cpp rename to linux/devices/HeaterHandler.cpp index 21a4a3f4..60a60328 100644 --- a/bsp_q7s/devices/HeaterHandler.cpp +++ b/linux/devices/HeaterHandler.cpp @@ -1,7 +1,9 @@ #include "HeaterHandler.h" -#include +#include "devices/gpioIds.h" +#include "devices/powerSwitcherList.h" + +#include #include -#include #include HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, @@ -37,7 +39,7 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = objectManager->get(gpioDriverId); + gpioInterface = ObjectManager::instance()->get(gpioDriverId); if (gpioInterface == nullptr) { sif::error << "HeaterHandler::initialize: Invalid Gpio interface." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; @@ -49,17 +51,18 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == nullptr) { sif::error << "HeaterHandler::initialize: IPC store not set up in factory." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } if(mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = objectManager->get(mainLineSwitcherObjectId); + mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); if (mainLineSwitcher == nullptr) { - sif::error << "HeaterHandler::initialize: Main line switcher failed to fetch object" - << "from object ID." << std::endl; + sif::error + << "HeaterHandler::initialize: Failed to get main line switcher. Make sure " + << "main line switcher object is initialized." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } } diff --git a/bsp_q7s/devices/HeaterHandler.h b/linux/devices/HeaterHandler.h similarity index 99% rename from bsp_q7s/devices/HeaterHandler.h rename to linux/devices/HeaterHandler.h index 8969ebd9..678710df 100644 --- a/bsp_q7s/devices/HeaterHandler.h +++ b/linux/devices/HeaterHandler.h @@ -1,12 +1,13 @@ #ifndef MISSION_DEVICES_HEATERHANDLER_H_ #define MISSION_DEVICES_HEATERHANDLER_H_ +#include "devices/heaterSwitcherList.h" + #include #include #include #include #include -#include #include #include #include diff --git a/bsp_q7s/devices/SolarArrayDeploymentHandler.cpp b/linux/devices/SolarArrayDeploymentHandler.cpp similarity index 97% rename from bsp_q7s/devices/SolarArrayDeploymentHandler.cpp rename to linux/devices/SolarArrayDeploymentHandler.cpp index 25be3927..eea546f6 100644 --- a/bsp_q7s/devices/SolarArrayDeploymentHandler.cpp +++ b/linux/devices/SolarArrayDeploymentHandler.cpp @@ -5,6 +5,7 @@ #include #include +#include SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, @@ -35,7 +36,7 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = objectManager->get(gpioDriverId); + gpioInterface = ObjectManager::instance()->get(gpioDriverId); if (gpioInterface == nullptr) { sif::error << "SolarArrayDeploymentHandler::initialize: Invalid Gpio interface." << std::endl; @@ -50,7 +51,7 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { } if (mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = objectManager->get(mainLineSwitcherObjectId); + mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); if (mainLineSwitcher == nullptr) { sif::error << "SolarArrayDeploymentHandler::initialize: Main line switcher failed to fetch object" diff --git a/bsp_q7s/devices/SolarArrayDeploymentHandler.h b/linux/devices/SolarArrayDeploymentHandler.h similarity index 100% rename from bsp_q7s/devices/SolarArrayDeploymentHandler.h rename to linux/devices/SolarArrayDeploymentHandler.h diff --git a/linux/devices/SusHandler.cpp b/linux/devices/SusHandler.cpp new file mode 100644 index 00000000..c31160c4 --- /dev/null +++ b/linux/devices/SusHandler.cpp @@ -0,0 +1,230 @@ +#include "SusHandler.h" +#include "OBSWConfig.h" + +#include +#include + +SusHandler::SusHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, + LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId) : + DeviceHandlerBase(objectId, comIF, comCookie), gpioComIF(gpioComIF), chipSelectId( + chipSelectId), dataset(this) { + if (comCookie == NULL) { + sif::error << "SusHandler: Invalid com cookie" << std::endl; + } + if (gpioComIF == NULL) { + sif::error << "SusHandler: Invalid GpioComIF" << std::endl; + } +} + +SusHandler::~SusHandler() { +} + +ReturnValue_t SusHandler::performOperation(uint8_t counter) { + + if (counter != FIRST_WRITE) { + DeviceHandlerBase::performOperation(counter); + return RETURN_OK; + } + + if (mode != MODE_NORMAL) { + DeviceHandlerBase::performOperation(DeviceHandlerIF::SEND_WRITE); + return RETURN_OK; + } + + /* If device is in normale mode the communication sequence is initiated here */ + if (communicationStep == CommunicationStep::IDLE) { + communicationStep = CommunicationStep::WRITE_SETUP; + } + + DeviceHandlerBase::performOperation(DeviceHandlerIF::SEND_WRITE); + + return RETURN_OK; +} + +ReturnValue_t SusHandler::initialize() { + ReturnValue_t result = RETURN_OK; + result = DeviceHandlerBase::initialize(); + if (result != RETURN_OK) { + return result; + } + auto spiComIF = dynamic_cast(communicationInterface); + if (spiComIF == nullptr) { + sif::debug << "SusHandler::initialize: Invalid communication interface" << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + spiMutex = spiComIF->getMutex(); + if (spiMutex == nullptr) { + sif::debug << "SusHandler::initialize: Failed to get spi mutex" << std::endl; + return ObjectManagerIF::CHILD_INIT_FAILED; + } + return RETURN_OK; +} + +void SusHandler::doStartUp(){ +#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1 + setMode(MODE_NORMAL); +#else + setMode(_MODE_TO_ON); +#endif +} + +void SusHandler::doShutDown(){ + setMode(_MODE_POWER_DOWN); +} + +ReturnValue_t SusHandler::buildNormalDeviceCommand( + DeviceCommandId_t * id) { + + if (communicationStep == CommunicationStep::IDLE) { + return NOTHING_TO_SEND; + } + + if (communicationStep == CommunicationStep::WRITE_SETUP) { + *id = SUS::WRITE_SETUP; + communicationStep = CommunicationStep::START_CONVERSIONS; + } + else if (communicationStep == CommunicationStep::START_CONVERSIONS) { + *id = SUS::START_CONVERSIONS; + communicationStep = CommunicationStep::READ_CONVERSIONS; + } + else if (communicationStep == CommunicationStep::READ_CONVERSIONS) { + *id = SUS::READ_CONVERSIONS; + communicationStep = CommunicationStep::IDLE; + } + return buildCommandFromCommand(*id, nullptr, 0); +} + +ReturnValue_t SusHandler::buildTransitionDeviceCommand( + DeviceCommandId_t * id){ + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t SusHandler::buildCommandFromCommand( + DeviceCommandId_t deviceCommand, const uint8_t * commandData, + size_t commandDataLen) { + switch(deviceCommand) { + case(SUS::WRITE_SETUP): { + /** + * The sun sensor ADC is shutdown when CS is pulled high, so each time requesting a + * measurement the setup has to be rewritten. There must also be a little delay between + * the transmission of the setup byte and the first conversion. Thus the conversion + * will be performed in an extra step. + * Because the chip select is driven manually by the SusHandler the SPI bus must be + * protected with a mutex here. + */ + ReturnValue_t result = spiMutex->lockMutex(timeoutType, timeoutMs); + if(result == MutexIF::MUTEX_TIMEOUT) { + sif::error << "SusHandler::buildCommandFromCommand: Mutex timeout" << std::endl; + return ERROR_LOCK_MUTEX; + } + else if(result != HasReturnvaluesIF::RETURN_OK) { + sif::error << "SusHandler::buildCommandFromCommand: Failed to lock spi mutex" + << std::endl; + return ERROR_LOCK_MUTEX; + } + + gpioComIF->pullLow(chipSelectId); + cmdBuffer[0] = SUS::SETUP; + rawPacket = cmdBuffer; + rawPacketLen = 1; + return RETURN_OK; + } + case(SUS::START_CONVERSIONS): { + std::memset(cmdBuffer, 0, sizeof(cmdBuffer)); + cmdBuffer[0] = SUS::CONVERSION; + rawPacket = cmdBuffer; + rawPacketLen = 2; + return RETURN_OK; + } + case(SUS::READ_CONVERSIONS): { + std::memset(cmdBuffer, 0, sizeof(cmdBuffer)); + rawPacket = cmdBuffer; + rawPacketLen = SUS::SIZE_READ_CONVERSIONS; + return RETURN_OK; + } + default: + return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; + } + return HasReturnvaluesIF::RETURN_FAILED; +} + +void SusHandler::fillCommandAndReplyMap() { + this->insertInCommandMap(SUS::WRITE_SETUP); + this->insertInCommandMap(SUS::START_CONVERSIONS); + this->insertInCommandAndReplyMap(SUS::READ_CONVERSIONS, 1, &dataset, SUS::SIZE_READ_CONVERSIONS); +} + +ReturnValue_t SusHandler::scanForReply(const uint8_t *start, + size_t remainingSize, DeviceCommandId_t *foundId, size_t *foundLen) { + *foundId = this->getPendingCommand(); + *foundLen = remainingSize; + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) { + switch (id) { + case SUS::READ_CONVERSIONS: { + PoolReadGuard readSet(&dataset); + dataset.temperatureCelcius = (*(packet) << 8 | *(packet + 1)) * 0.125; + dataset.ain0 = (*(packet + 2) << 8 | *(packet + 3)); + dataset.ain1 = (*(packet + 4) << 8 | *(packet + 5)); + dataset.ain2 = (*(packet + 6) << 8 | *(packet + 7)); + dataset.ain3 = (*(packet + 8) << 8 | *(packet + 9)); + dataset.ain4 = (*(packet + 10) << 8 | *(packet + 11)); + dataset.ain5 = (*(packet + 12) << 8 | *(packet + 13)); +#if OBSW_VERBOSE_LEVEL >= 1 && DEBUG_SUS + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", Temperature: " + << dataset.temperatureCelcius << " °C" << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN0: " + << std::dec << dataset.ain0 << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN1: " + << std::dec << dataset.ain1 << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN2: " + << std::dec << dataset.ain2 << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN3: " + << std::dec << dataset.ain3 << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN4: " + << std::dec << dataset.ain4 << std::endl; + sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN5: " + << std::dec << dataset.ain5 << std::endl; +#endif + /** SUS can now be shutdown and thus the SPI bus released again */ + gpioComIF->pullHigh(chipSelectId); + ReturnValue_t result = spiMutex->unlockMutex(); + if (result != RETURN_OK) { + sif::error << "SusHandler::interpretDeviceReply: Failed to unlock spi mutex" + << std::endl; + return ERROR_UNLOCK_MUTEX; + } + break; + } + default: { + sif::debug << "SusHandler::interpretDeviceReply: Unknown reply id" << std::endl; + return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY; + } + + } + return HasReturnvaluesIF::RETURN_OK; +} + +void SusHandler::setNormalDatapoolEntriesInvalid(){ + +} + +uint32_t SusHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo){ + return 1000; +} + +ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) { + localDataPoolMap.emplace(SUS::TEMPERATURE_C, new PoolEntry( { 0.0 })); + localDataPoolMap.emplace(SUS::AIN0, new PoolEntry( { 0 })); + localDataPoolMap.emplace(SUS::AIN1, new PoolEntry( { 0 })); + localDataPoolMap.emplace(SUS::AIN2, new PoolEntry( { 0 })); + localDataPoolMap.emplace(SUS::AIN3, new PoolEntry( { 0 })); + localDataPoolMap.emplace(SUS::AIN4, new PoolEntry( { 0 })); + localDataPoolMap.emplace(SUS::AIN5, new PoolEntry( { 0 })); + return HasReturnvaluesIF::RETURN_OK; +} + diff --git a/linux/devices/SusHandler.h b/linux/devices/SusHandler.h new file mode 100644 index 00000000..2312d383 --- /dev/null +++ b/linux/devices/SusHandler.h @@ -0,0 +1,81 @@ +#ifndef MISSION_DEVICES_SUSHANDLER_H_ +#define MISSION_DEVICES_SUSHANDLER_H_ + +#include "devicedefinitions/SusDefinitions.h" +#include +#include +#include + +/** + * @brief This is the device handler class for the SUS sensor. The sensor is + * based on the MAX1227 ADC. Details about the SUS electronic can be found at + * https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release + * + * @details Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf + * + * @note When adding a SusHandler to the polling sequence table make sure to add a slot with + * the executionStep FIRST_WRITE. Otherwise the communication sequence will never be + * started. + * + * @author J. Meier + */ +class SusHandler: public DeviceHandlerBase { +public: + + static const uint8_t FIRST_WRITE = 7; + + SusHandler(object_id_t objectId, object_id_t comIF, + CookieIF * comCookie, LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId); + virtual ~SusHandler(); + + virtual ReturnValue_t performOperation(uint8_t counter) override; + + virtual ReturnValue_t initialize() override; + +protected: + void doStartUp() override; + void doShutDown() override; + ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override; + ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t * id) override; + void fillCommandAndReplyMap() override; + ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, + const uint8_t * commandData,size_t commandDataLen) override; + ReturnValue_t scanForReply(const uint8_t *start, size_t remainingSize, + DeviceCommandId_t *foundId, size_t *foundLen) override; + ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, + const uint8_t *packet) override; + void setNormalDatapoolEntriesInvalid() override; + uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override; + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + +private: + + static const uint8_t INTERFACE_ID = CLASS_ID::SUS_HANDLER; + + static const ReturnValue_t ERROR_UNLOCK_MUTEX = MAKE_RETURN_CODE(0xA0); + static const ReturnValue_t ERROR_LOCK_MUTEX = MAKE_RETURN_CODE(0xA1); + + enum class CommunicationStep { + IDLE, + WRITE_SETUP, + START_CONVERSIONS, + READ_CONVERSIONS + }; + + LinuxLibgpioIF* gpioComIF = nullptr; + + gpioId_t chipSelectId = gpio::NO_GPIO; + + SUS::SusDataset dataset; + + uint8_t cmdBuffer[SUS::MAX_CMD_SIZE]; + CommunicationStep communicationStep = CommunicationStep::IDLE; + + MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING; + uint32_t timeoutMs = 20; + + MutexIF* spiMutex = nullptr; +}; + +#endif /* MISSION_DEVICES_SUSHANDLER_H_ */ diff --git a/linux/devices/devicedefinitions/SusDefinitions.h b/linux/devices/devicedefinitions/SusDefinitions.h new file mode 100644 index 00000000..ba56ec07 --- /dev/null +++ b/linux/devices/devicedefinitions/SusDefinitions.h @@ -0,0 +1,95 @@ +#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SUS_H_ +#define MISSION_DEVICES_DEVICEDEFINITIONS_SUS_H_ + +#include +#include +#include + + +namespace SUS { + + /** + * Some MAX1227 could not be reached with frequencies around 4 MHz. Maybe this is caused by + * the decoder and buffer circuits. Thus frequency is here defined to 1 MHz. + */ + static const uint32_t MAX1227_SPI_FREQ = 1000000; + + static const DeviceCommandId_t NONE = 0x0; // Set when no command is pending + + static const DeviceCommandId_t WRITE_SETUP = 0x1; + /** + * This command initiates the ADC conversion for all channels including the internal + * temperature sensor. + */ + static const DeviceCommandId_t START_CONVERSIONS = 0x2; + /** + * This command reads the internal fifo which holds the temperature and the channel + * conversions. + */ + static const DeviceCommandId_t READ_CONVERSIONS = 0x3; + + /** + * @brief This is the configuration byte which will be written to the setup register after + * power on. + * + * @note Bit1 (DIFFSEL1) - Bit0 (DIFFSEL0): 0b00, No byte is following the setup byte + * Bit3 (REFSEL1) - Bit2 (REFSEL0): 0b10, Internal reference, no wake-up delay + * Bit5 (CLKSEL1) - Bit4 (CLKSEL0): 0b10, Internally clocked + * Bit7 - Bit6: 0b01, Tells MAX1227 that this byte should be + * written to the setup register + * + */ + static const uint8_t SETUP = 0b01101000; + + /** + * @brief This values will always be written to the ADC conversion register to specify the + * conversions to perform. + * @details Bit0: 1 - Enables temperature conversion + * Bit2 (SCAN1) and Bit1 (SCAN0): 0b00, Scans channels 0 through N + * Bit6 - Bit3 defines N: 0b0101 (N = 5) + * Bit7: Always 1. Tells the ADC that this is the conversion register. + */ + static const uint8_t CONVERSION = 0b10101001; + + static const uint8_t SUS_DATA_SET_ID = READ_CONVERSIONS; + + /** Size of data replies. Temperature and 6 channel convesions (AIN0 - AIN5) */ + static const uint8_t SIZE_READ_CONVERSIONS = 14; + + static const uint8_t MAX_CMD_SIZE = SIZE_READ_CONVERSIONS; + + static const uint8_t POOL_ENTRIES = 7; + + enum Max1227PoolIds: lp_id_t { + TEMPERATURE_C, + AIN0, + AIN1, + AIN2, + AIN3, + AIN4, + AIN5, + }; + +class SusDataset: public StaticLocalDataSet { +public: + + SusDataset(HasLocalDataPoolIF* owner) : + StaticLocalDataSet(owner, SUS_DATA_SET_ID) { + } + + SusDataset(object_id_t objectId) : + StaticLocalDataSet(sid_t(objectId, SUS_DATA_SET_ID)) { + } + + lp_var_t temperatureCelcius = lp_var_t(sid.objectId, TEMPERATURE_C, this); + lp_var_t ain0 = lp_var_t(sid.objectId, AIN0, this); + lp_var_t ain1 = lp_var_t(sid.objectId, AIN1, this); + lp_var_t ain2 = lp_var_t(sid.objectId, AIN2, this); + lp_var_t ain3 = lp_var_t(sid.objectId, AIN3, this); + lp_var_t ain4 = lp_var_t(sid.objectId, AIN4, this); + lp_var_t ain5 = lp_var_t(sid.objectId, AIN5, this); +}; +} + + +#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_SUS_H_ */ diff --git a/linux/fsfwconfig/CMakeLists.txt b/linux/fsfwconfig/CMakeLists.txt new file mode 100644 index 00000000..277b89db --- /dev/null +++ b/linux/fsfwconfig/CMakeLists.txt @@ -0,0 +1,22 @@ +target_sources(${TARGET_NAME} PRIVATE + ipc/MissionMessageTypes.cpp + pollingsequence/pollingSequenceFactory.cpp +) + +target_include_directories(${TARGET_NAME} PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# If a special translation file for object IDs exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + objects/translateObjects.cpp + ) +endif() + +# If a special translation file for events exists, compile it. +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp") + target_sources(${TARGET_NAME} PRIVATE + events/translateEvents.cpp + ) +endif() diff --git a/fsfwconfig/FSFWConfig.h b/linux/fsfwconfig/FSFWConfig.h.in similarity index 93% rename from fsfwconfig/FSFWConfig.h rename to linux/fsfwconfig/FSFWConfig.h.in index 097f8aaf..a8519cff 100644 --- a/fsfwconfig/FSFWConfig.h +++ b/linux/fsfwconfig/FSFWConfig.h.in @@ -18,6 +18,7 @@ #endif #define FSFW_USE_PUS_C_TELEMETRY 1 +#define FSFW_USE_PUS_C_TELECOMMANDS 1 //! Can be used to disable the ANSI color sequences for C stdio. #define FSFW_COLORED_OUTPUT 1 @@ -25,7 +26,7 @@ //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects //! and translateEvents (and their compiled source files) -#define FSFW_OBJ_EVENT_TRANSLATION 0 +#define FSFW_OBJ_EVENT_TRANSLATION 1 #if FSFW_OBJ_EVENT_TRANSLATION == 1 //! Specify whether info events are printed too. @@ -66,6 +67,11 @@ static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6; static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124; + +static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048; + } +#define FSFW_HAL_LINUX_SPI_WIRETAPPING 0 + #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in new file mode 100644 index 00000000..b3002cf4 --- /dev/null +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -0,0 +1,70 @@ +/** + * @brief This file can be used to add preprocessor define for conditional + * code inclusion exclusion or various other project constants and + * properties in one place. + */ +#ifndef FSFWCONFIG_OBSWCONFIG_H_ +#define FSFWCONFIG_OBSWCONFIG_H_ + +#ifdef RASPBERRY_PI +#include "rpiConfig.h" +#elif defined(XIPHOS_Q7S) +#include "q7sConfig.h" +#endif +#include "commonConfig.h" +#include "OBSWVersion.h" + +/* These defines should be disabled for mission code but are useful for +debugging. */ +#define OBSW_VERBOSE_LEVEL 1 +#define OBSW_PRINT_MISSED_DEADLINES 1 +#define OBSW_ADD_TEST_CODE 1 +#define OBSW_ADD_TEST_PST 1 + +#define TEST_LIBGPIOD 0 +#define TEST_RADIATION_SENSOR_HANDLER 0 +#define TEST_SUS_HANDLER 1 +#define TEST_PLOC_HANDLER 0 +#define TEST_CCSDS_BRIDGE 0 +#define PERFORM_PTME_TEST 0 + +#define TE0720 0 +#define TE0720_HEATER_TEST 0 + +#define P60DOCK_DEBUG 0 +#define PDU1_DEBUG 0 +#define PDU2_DEBUG 0 +#define ACU_DEBUG 0 +#define SYRLINKS_DEBUG 0 +#define IMQT_DEBUG 0 +#define ADIS16507_DEBUG 1 +#define L3GD20_GYRO_DEBUG 0 +#define DEBUG_RAD_SENSOR 1 +#define DEBUG_SUS 1 +#define DEBUG_RTD 1 +#define IMTQ_DEBUG 1 + +// Leave at one as the BSP is linux. Used by the ADIS16507 device handler +#define OBSW_ADIS16507_LINUX_COM_IF 1 + +#include "OBSWVersion.h" + +/* Can be used to switch device to NORMAL mode immediately */ +#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 + +#ifdef __cplusplus + +#include "objects/systemObjectList.h" +#include "events/subsystemIdRanges.h" +#include "returnvalues/classIds.h" + +namespace config { +#endif + +/* Add mission configuration flags here */ + +#ifdef __cplusplus +} +#endif + +#endif /* FSFWCONFIG_OBSWCONFIG_H_ */ diff --git a/fsfwconfig/devices/addresses.cpp b/linux/fsfwconfig/devices/addresses.cpp similarity index 100% rename from fsfwconfig/devices/addresses.cpp rename to linux/fsfwconfig/devices/addresses.cpp diff --git a/fsfwconfig/devices/addresses.h b/linux/fsfwconfig/devices/addresses.h similarity index 72% rename from fsfwconfig/devices/addresses.h rename to linux/fsfwconfig/devices/addresses.h index 4974834d..0deb8490 100644 --- a/fsfwconfig/devices/addresses.h +++ b/linux/fsfwconfig/devices/addresses.h @@ -2,7 +2,7 @@ #define FSFWCONFIG_DEVICES_ADDRESSES_H_ #include -#include +#include "objects/systemObjectList.h" #include namespace addresses { @@ -19,6 +19,22 @@ namespace addresses { GYRO_1_L3G = objects::GYRO_1_L3G_HANDLER, GYRO_2_L3G = objects::GYRO_2_L3G_HANDLER, + RAD_SENSOR = objects::RAD_SENSOR, + + SUS_1 = objects::SUS_1, + SUS_2 = objects::SUS_2, + SUS_3 = objects::SUS_3, + SUS_4 = objects::SUS_4, + SUS_5 = objects::SUS_5, + SUS_6 = objects::SUS_6, + SUS_7 = objects::SUS_7, + SUS_8 = objects::SUS_8, + SUS_9 = objects::SUS_9, + SUS_10 = objects::SUS_10, + SUS_11 = objects::SUS_11, + SUS_12 = objects::SUS_12, + SUS_13 = objects::SUS_13, + /* Dummy and Test Addresses */ DUMMY_ECHO = 129, DUMMY_GPS0 = 130, diff --git a/fsfwconfig/devices/gpioIds.h b/linux/fsfwconfig/devices/gpioIds.h similarity index 72% rename from fsfwconfig/devices/gpioIds.h rename to linux/fsfwconfig/devices/gpioIds.h index ac999152..102b04b9 100644 --- a/fsfwconfig/devices/gpioIds.h +++ b/linux/fsfwconfig/devices/gpioIds.h @@ -44,12 +44,31 @@ namespace gpioIds { RTD_IC17, RTD_IC18, + CS_SUS_1, + CS_SUS_2, + CS_SUS_3, + CS_SUS_4, + CS_SUS_5, + CS_SUS_6, + CS_SUS_7, + CS_SUS_8, + CS_SUS_9, + CS_SUS_10, + CS_SUS_11, + CS_SUS_12, + CS_SUS_13, + SPI_MUX_BIT_1, SPI_MUX_BIT_2, SPI_MUX_BIT_3, SPI_MUX_BIT_4, SPI_MUX_BIT_5, - SPI_MUX_BIT_6 + SPI_MUX_BIT_6, + + CS_RAD_SENSOR, + + PAPB_BUSY_N, + PAPB_EMPTY }; } diff --git a/fsfwconfig/devices/heaterSwitcherList.h b/linux/fsfwconfig/devices/heaterSwitcherList.h similarity index 94% rename from fsfwconfig/devices/heaterSwitcherList.h rename to linux/fsfwconfig/devices/heaterSwitcherList.h index eeb59068..014e795c 100644 --- a/fsfwconfig/devices/heaterSwitcherList.h +++ b/linux/fsfwconfig/devices/heaterSwitcherList.h @@ -1,6 +1,8 @@ #ifndef FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ +#include + namespace heaterSwitches { enum switcherList: uint8_t { HEATER_0, @@ -15,6 +17,4 @@ namespace heaterSwitches { }; } - - #endif /* FSFWCONFIG_DEVICES_HEATERSWITCHERLIST_H_ */ diff --git a/fsfwconfig/devices/powerSwitcherList.h b/linux/fsfwconfig/devices/powerSwitcherList.h similarity index 95% rename from fsfwconfig/devices/powerSwitcherList.h rename to linux/fsfwconfig/devices/powerSwitcherList.h index b8e3f89f..48821db2 100644 --- a/fsfwconfig/devices/powerSwitcherList.h +++ b/linux/fsfwconfig/devices/powerSwitcherList.h @@ -1,7 +1,7 @@ #ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ #define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ -#include +#include "OBSWConfig.h" namespace pcduSwitches { /* Switches are uint8_t datatype and go from 0 to 255 */ diff --git a/fsfwconfig/events/subsystemIdRanges.h b/linux/fsfwconfig/events/subsystemIdRanges.h similarity index 58% rename from fsfwconfig/events/subsystemIdRanges.h rename to linux/fsfwconfig/events/subsystemIdRanges.h index b2e9aaac..be84c1a9 100644 --- a/fsfwconfig/events/subsystemIdRanges.h +++ b/linux/fsfwconfig/events/subsystemIdRanges.h @@ -1,7 +1,9 @@ #ifndef FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ #define FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ -#include +#include "common/config/commonSubsystemIds.h" +#include "fsfw/events/fwSubsystemIdRanges.h" + #include /** @@ -10,18 +12,7 @@ */ namespace SUBSYSTEM_ID { enum: uint8_t { - SUBSYSTE_ID_START = FW_SUBSYSTEM_ID_RANGE, - PUS_SERVICE_2, - PUS_SERVICE_3, - PUS_SERVICE_5, - PUS_SERVICE_6, - PUS_SERVICE_8, - PUS_SERVICE_23, - MGM_LIS3MDL, - MGM_RM3100, - PCDU_HANDLER, - HEATER_HANDLER, - SA_DEPL_HANDLER + SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END }; } diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp new file mode 100644 index 00000000..c3af08e1 --- /dev/null +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -0,0 +1,264 @@ +/** + * @brief Auto-generated event translation file. Contains 83 translations. + * @details + * Generated on: 2021-06-08 17:09:32 + */ +#include "translateEvents.h" + +const char *STORE_SEND_WRITE_FAILED_STRING = "STORE_SEND_WRITE_FAILED"; +const char *STORE_WRITE_FAILED_STRING = "STORE_WRITE_FAILED"; +const char *STORE_SEND_READ_FAILED_STRING = "STORE_SEND_READ_FAILED"; +const char *STORE_READ_FAILED_STRING = "STORE_READ_FAILED"; +const char *UNEXPECTED_MSG_STRING = "UNEXPECTED_MSG"; +const char *STORING_FAILED_STRING = "STORING_FAILED"; +const char *TM_DUMP_FAILED_STRING = "TM_DUMP_FAILED"; +const char *STORE_INIT_FAILED_STRING = "STORE_INIT_FAILED"; +const char *STORE_INIT_EMPTY_STRING = "STORE_INIT_EMPTY"; +const char *STORE_CONTENT_CORRUPTED_STRING = "STORE_CONTENT_CORRUPTED"; +const char *STORE_INITIALIZE_STRING = "STORE_INITIALIZE"; +const char *INIT_DONE_STRING = "INIT_DONE"; +const char *DUMP_FINISHED_STRING = "DUMP_FINISHED"; +const char *DELETION_FINISHED_STRING = "DELETION_FINISHED"; +const char *DELETION_FAILED_STRING = "DELETION_FAILED"; +const char *AUTO_CATALOGS_SENDING_FAILED_STRING = "AUTO_CATALOGS_SENDING_FAILED"; +const char *GET_DATA_FAILED_STRING = "GET_DATA_FAILED"; +const char *STORE_DATA_FAILED_STRING = "STORE_DATA_FAILED"; +const char *DEVICE_BUILDING_COMMAND_FAILED_STRING = "DEVICE_BUILDING_COMMAND_FAILED"; +const char *DEVICE_SENDING_COMMAND_FAILED_STRING = "DEVICE_SENDING_COMMAND_FAILED"; +const char *DEVICE_REQUESTING_REPLY_FAILED_STRING = "DEVICE_REQUESTING_REPLY_FAILED"; +const char *DEVICE_READING_REPLY_FAILED_STRING = "DEVICE_READING_REPLY_FAILED"; +const char *DEVICE_INTERPRETING_REPLY_FAILED_STRING = "DEVICE_INTERPRETING_REPLY_FAILED"; +const char *DEVICE_MISSED_REPLY_STRING = "DEVICE_MISSED_REPLY"; +const char *DEVICE_UNKNOWN_REPLY_STRING = "DEVICE_UNKNOWN_REPLY"; +const char *DEVICE_UNREQUESTED_REPLY_STRING = "DEVICE_UNREQUESTED_REPLY"; +const char *INVALID_DEVICE_COMMAND_STRING = "INVALID_DEVICE_COMMAND"; +const char *MONITORING_LIMIT_EXCEEDED_STRING = "MONITORING_LIMIT_EXCEEDED"; +const char *MONITORING_AMBIGUOUS_STRING = "MONITORING_AMBIGUOUS"; +const char *FUSE_CURRENT_HIGH_STRING = "FUSE_CURRENT_HIGH"; +const char *FUSE_WENT_OFF_STRING = "FUSE_WENT_OFF"; +const char *POWER_ABOVE_HIGH_LIMIT_STRING = "POWER_ABOVE_HIGH_LIMIT"; +const char *POWER_BELOW_LOW_LIMIT_STRING = "POWER_BELOW_LOW_LIMIT"; +const char *SWITCH_WENT_OFF_STRING = "SWITCH_WENT_OFF"; +const char *HEATER_ON_STRING = "HEATER_ON"; +const char *HEATER_OFF_STRING = "HEATER_OFF"; +const char *HEATER_TIMEOUT_STRING = "HEATER_TIMEOUT"; +const char *HEATER_STAYED_ON_STRING = "HEATER_STAYED_ON"; +const char *HEATER_STAYED_OFF_STRING = "HEATER_STAYED_OFF"; +const char *TEMP_SENSOR_HIGH_STRING = "TEMP_SENSOR_HIGH"; +const char *TEMP_SENSOR_LOW_STRING = "TEMP_SENSOR_LOW"; +const char *TEMP_SENSOR_GRADIENT_STRING = "TEMP_SENSOR_GRADIENT"; +const char *COMPONENT_TEMP_LOW_STRING = "COMPONENT_TEMP_LOW"; +const char *COMPONENT_TEMP_HIGH_STRING = "COMPONENT_TEMP_HIGH"; +const char *COMPONENT_TEMP_OOL_LOW_STRING = "COMPONENT_TEMP_OOL_LOW"; +const char *COMPONENT_TEMP_OOL_HIGH_STRING = "COMPONENT_TEMP_OOL_HIGH"; +const char *TEMP_NOT_IN_OP_RANGE_STRING = "TEMP_NOT_IN_OP_RANGE"; +const char *FDIR_CHANGED_STATE_STRING = "FDIR_CHANGED_STATE"; +const char *FDIR_STARTS_RECOVERY_STRING = "FDIR_STARTS_RECOVERY"; +const char *FDIR_TURNS_OFF_DEVICE_STRING = "FDIR_TURNS_OFF_DEVICE"; +const char *MONITOR_CHANGED_STATE_STRING = "MONITOR_CHANGED_STATE"; +const char *VALUE_BELOW_LOW_LIMIT_STRING = "VALUE_BELOW_LOW_LIMIT"; +const char *VALUE_ABOVE_HIGH_LIMIT_STRING = "VALUE_ABOVE_HIGH_LIMIT"; +const char *VALUE_OUT_OF_RANGE_STRING = "VALUE_OUT_OF_RANGE"; +const char *SWITCHING_TM_FAILED_STRING = "SWITCHING_TM_FAILED"; +const char *CHANGING_MODE_STRING = "CHANGING_MODE"; +const char *MODE_INFO_STRING = "MODE_INFO"; +const char *FALLBACK_FAILED_STRING = "FALLBACK_FAILED"; +const char *MODE_TRANSITION_FAILED_STRING = "MODE_TRANSITION_FAILED"; +const char *CANT_KEEP_MODE_STRING = "CANT_KEEP_MODE"; +const char *OBJECT_IN_INVALID_MODE_STRING = "OBJECT_IN_INVALID_MODE"; +const char *FORCING_MODE_STRING = "FORCING_MODE"; +const char *MODE_CMD_REJECTED_STRING = "MODE_CMD_REJECTED"; +const char *HEALTH_INFO_STRING = "HEALTH_INFO"; +const char *CHILD_CHANGED_HEALTH_STRING = "CHILD_CHANGED_HEALTH"; +const char *CHILD_PROBLEMS_STRING = "CHILD_PROBLEMS"; +const char *OVERWRITING_HEALTH_STRING = "OVERWRITING_HEALTH"; +const char *TRYING_RECOVERY_STRING = "TRYING_RECOVERY"; +const char *RECOVERY_STEP_STRING = "RECOVERY_STEP"; +const char *RECOVERY_DONE_STRING = "RECOVERY_DONE"; +const char *RF_AVAILABLE_STRING = "RF_AVAILABLE"; +const char *RF_LOST_STRING = "RF_LOST"; +const char *BIT_LOCK_STRING = "BIT_LOCK"; +const char *BIT_LOCK_LOST_STRING = "BIT_LOCK_LOST"; +const char *FRAME_PROCESSING_FAILED_STRING = "FRAME_PROCESSING_FAILED"; +const char *CLOCK_SET_STRING = "CLOCK_SET"; +const char *CLOCK_SET_FAILURE_STRING = "CLOCK_SET_FAILURE"; +const char *TEST_STRING = "TEST"; +const char *CHANGE_OF_SETUP_PARAMETER_STRING = "CHANGE_OF_SETUP_PARAMETER"; +const char *MEMORY_READ_RPT_CRC_FAILURE_STRING = "MEMORY_READ_RPT_CRC_FAILURE"; +const char *ACK_FAILURE_STRING = "ACK_FAILURE"; +const char *EXE_FAILURE_STRING = "EXE_FAILURE"; +const char *CRC_FAILURE_EVENT_STRING = "CRC_FAILURE_EVENT"; + +const char * translateEvents(Event event) { + switch( (event & 0xffff) ) { + case(2200): + return STORE_SEND_WRITE_FAILED_STRING; + case(2201): + return STORE_WRITE_FAILED_STRING; + case(2202): + return STORE_SEND_READ_FAILED_STRING; + case(2203): + return STORE_READ_FAILED_STRING; + case(2204): + return UNEXPECTED_MSG_STRING; + case(2205): + return STORING_FAILED_STRING; + case(2206): + return TM_DUMP_FAILED_STRING; + case(2207): + return STORE_INIT_FAILED_STRING; + case(2208): + return STORE_INIT_EMPTY_STRING; + case(2209): + return STORE_CONTENT_CORRUPTED_STRING; + case(2210): + return STORE_INITIALIZE_STRING; + case(2211): + return INIT_DONE_STRING; + case(2212): + return DUMP_FINISHED_STRING; + case(2213): + return DELETION_FINISHED_STRING; + case(2214): + return DELETION_FAILED_STRING; + case(2215): + return AUTO_CATALOGS_SENDING_FAILED_STRING; + case(2600): + return GET_DATA_FAILED_STRING; + case(2601): + return STORE_DATA_FAILED_STRING; + case(2800): + return DEVICE_BUILDING_COMMAND_FAILED_STRING; + case(2801): + return DEVICE_SENDING_COMMAND_FAILED_STRING; + case(2802): + return DEVICE_REQUESTING_REPLY_FAILED_STRING; + case(2803): + return DEVICE_READING_REPLY_FAILED_STRING; + case(2804): + return DEVICE_INTERPRETING_REPLY_FAILED_STRING; + case(2805): + return DEVICE_MISSED_REPLY_STRING; + case(2806): + return DEVICE_UNKNOWN_REPLY_STRING; + case(2807): + return DEVICE_UNREQUESTED_REPLY_STRING; + case(2808): + return INVALID_DEVICE_COMMAND_STRING; + case(2809): + return MONITORING_LIMIT_EXCEEDED_STRING; + case(2810): + return MONITORING_AMBIGUOUS_STRING; + case(4201): + return FUSE_CURRENT_HIGH_STRING; + case(4202): + return FUSE_WENT_OFF_STRING; + case(4204): + return POWER_ABOVE_HIGH_LIMIT_STRING; + case(4205): + return POWER_BELOW_LOW_LIMIT_STRING; + case(4300): + return SWITCH_WENT_OFF_STRING; + case(5000): + return HEATER_ON_STRING; + case(5001): + return HEATER_OFF_STRING; + case(5002): + return HEATER_TIMEOUT_STRING; + case(5003): + return HEATER_STAYED_ON_STRING; + case(5004): + return HEATER_STAYED_OFF_STRING; + case(5200): + return TEMP_SENSOR_HIGH_STRING; + case(5201): + return TEMP_SENSOR_LOW_STRING; + case(5202): + return TEMP_SENSOR_GRADIENT_STRING; + case(5901): + return COMPONENT_TEMP_LOW_STRING; + case(5902): + return COMPONENT_TEMP_HIGH_STRING; + case(5903): + return COMPONENT_TEMP_OOL_LOW_STRING; + case(5904): + return COMPONENT_TEMP_OOL_HIGH_STRING; + case(5905): + return TEMP_NOT_IN_OP_RANGE_STRING; + case(7101): + return FDIR_CHANGED_STATE_STRING; + case(7102): + return FDIR_STARTS_RECOVERY_STRING; + case(7103): + return FDIR_TURNS_OFF_DEVICE_STRING; + case(7201): + return MONITOR_CHANGED_STATE_STRING; + case(7202): + return VALUE_BELOW_LOW_LIMIT_STRING; + case(7203): + return VALUE_ABOVE_HIGH_LIMIT_STRING; + case(7204): + return VALUE_OUT_OF_RANGE_STRING; + case(7301): + return SWITCHING_TM_FAILED_STRING; + case(7400): + return CHANGING_MODE_STRING; + case(7401): + return MODE_INFO_STRING; + case(7402): + return FALLBACK_FAILED_STRING; + case(7403): + return MODE_TRANSITION_FAILED_STRING; + case(7404): + return CANT_KEEP_MODE_STRING; + case(7405): + return OBJECT_IN_INVALID_MODE_STRING; + case(7406): + return FORCING_MODE_STRING; + case(7407): + return MODE_CMD_REJECTED_STRING; + case(7506): + return HEALTH_INFO_STRING; + case(7507): + return CHILD_CHANGED_HEALTH_STRING; + case(7508): + return CHILD_PROBLEMS_STRING; + case(7509): + return OVERWRITING_HEALTH_STRING; + case(7510): + return TRYING_RECOVERY_STRING; + case(7511): + return RECOVERY_STEP_STRING; + case(7512): + return RECOVERY_DONE_STRING; + case(7900): + return RF_AVAILABLE_STRING; + case(7901): + return RF_LOST_STRING; + case(7902): + return BIT_LOCK_STRING; + case(7903): + return BIT_LOCK_LOST_STRING; + case(7905): + return FRAME_PROCESSING_FAILED_STRING; + case(8900): + return CLOCK_SET_STRING; + case(8901): + return CLOCK_SET_FAILURE_STRING; + case(9700): + return TEST_STRING; + case(10600): + return CHANGE_OF_SETUP_PARAMETER_STRING; + case(11101): + return MEMORY_READ_RPT_CRC_FAILURE_STRING; + case(11102): + return ACK_FAILURE_STRING; + case(11103): + return EXE_FAILURE_STRING; + case(11104): + return CRC_FAILURE_EVENT_STRING; + default: + return "UNKNOWN_EVENT"; + } + return 0; +} diff --git a/linux/fsfwconfig/events/translateEvents.h b/linux/fsfwconfig/events/translateEvents.h new file mode 100644 index 00000000..9034dcf2 --- /dev/null +++ b/linux/fsfwconfig/events/translateEvents.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ +#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ + +#include + +const char * translateEvents(Event event); + +#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/fsfwconfig/fsfwconfig.mk b/linux/fsfwconfig/fsfwconfig.mk similarity index 100% rename from fsfwconfig/fsfwconfig.mk rename to linux/fsfwconfig/fsfwconfig.mk diff --git a/linux/fsfwconfig/ipc/MissionMessageTypes.cpp b/linux/fsfwconfig/ipc/MissionMessageTypes.cpp new file mode 100644 index 00000000..9ac6f0f4 --- /dev/null +++ b/linux/fsfwconfig/ipc/MissionMessageTypes.cpp @@ -0,0 +1,12 @@ +#include "MissionMessageTypes.h" +#include + + +void messagetypes::clearMissionMessage(CommandMessage* message) { + switch(message->getMessageType()) { + default: + break; + } +} + + diff --git a/fsfwconfig/ipc/MissionMessageTypes.h b/linux/fsfwconfig/ipc/MissionMessageTypes.h similarity index 100% rename from fsfwconfig/ipc/MissionMessageTypes.h rename to linux/fsfwconfig/ipc/MissionMessageTypes.h diff --git a/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h similarity index 67% rename from fsfwconfig/objects/systemObjectList.h rename to linux/fsfwconfig/objects/systemObjectList.h index 110b5c17..5d5cdee1 100644 --- a/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -1,8 +1,9 @@ #ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ -#include +#include "commonObjects.h" #include +#include // The objects will be instantiated in the ID order namespace objects { @@ -11,18 +12,9 @@ namespace objects { FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, FW_ADDRESS_END = TIME_STAMPER, - /* First Byte 0x50-0x52 reserved for PUS Services **/ - CCSDS_PACKET_DISTRIBUTOR = 0x50000100, - PUS_PACKET_DISTRIBUTOR = 0x50000200, - UDP_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, + CCSDS_IP_CORE_BRIDGE = 0x50000500, - PUS_SERVICE_3 = 0x51000300, - PUS_SERVICE_5 = 0x51000400, PUS_SERVICE_6 = 0x51000500, - PUS_SERVICE_8 = 0x51000800, - PUS_SERVICE_23 = 0x51002300, - PUS_SERVICE_201 = 0x51020100, TM_FUNNEL = 0x52000002, @@ -36,23 +28,6 @@ namespace objects { /* 0x47 ('G') for Gpio Interfaces */ GPIO_IF = 0x47000001, - /* 0x44 ('D') for device handlers */ - P60DOCK_HANDLER = 0x44000001, - PDU1_HANDLER = 0x44000002, - PDU2_HANDLER = 0x44000003, - ACU_HANDLER = 0x44000004, - TMP1075_HANDLER_1 = 0x44000005, - TMP1075_HANDLER_2 = 0x44000006, - MGM_0_LIS3_HANDLER = 0x44000007, - MGM_1_RM3100_HANDLER = 0x44000008, - MGM_2_LIS3_HANDLER = 0x44000009, - MGM_3_RM3100_HANDLER = 0x44000010, - GYRO_0_ADIS_HANDLER = 0x44000011, - GYRO_1_L3G_HANDLER = 0x44000012, - GYRO_2_L3G_HANDLER = 0x44000013, - - IMTQ_HANDLER = 0x44000014, - /* Custom device handler */ PCDU_HANDLER = 0x44001000, SOLAR_ARRAY_DEPL_HANDLER = 0x44001001, @@ -81,10 +56,13 @@ namespace objects { RTD_IC17 = 0x5400003F, RTD_IC18 = 0x5400004F, + RAD_SENSOR = 0x54000050, + /* 0x54 ('T') for test handlers */ TEST_TASK = 0x54694269, LIBGPIOD_TEST = 0x54123456, SPI_TEST = 0x54000010, + UART_TEST = 0x54000020, DUMMY_INTERFACE = 0x5400CAFE, DUMMY_HANDLER = 0x5400AFFE, P60DOCK_TEST_TASK = 0x00005060 diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp new file mode 100644 index 00000000..47b55435 --- /dev/null +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -0,0 +1,295 @@ +/** + * @brief Auto-generated object translation file. + * @details + * Contains 93 translations. + * Generated on: 2021-05-18 16:48:46 + */ +#include "translateObjects.h" + +const char *P60DOCK_TEST_TASK_STRING = "P60DOCK_TEST_TASK"; +const char *P60DOCK_HANDLER_STRING = "P60DOCK_HANDLER"; +const char *PDU1_HANDLER_STRING = "PDU1_HANDLER"; +const char *PDU2_HANDLER_STRING = "PDU2_HANDLER"; +const char *ACU_HANDLER_STRING = "ACU_HANDLER"; +const char *TMP1075_HANDLER_1_STRING = "TMP1075_HANDLER_1"; +const char *TMP1075_HANDLER_2_STRING = "TMP1075_HANDLER_2"; +const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER"; +const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER"; +const char *MGM_2_LIS3_HANDLER_STRING = "MGM_2_LIS3_HANDLER"; +const char *MGM_3_RM3100_HANDLER_STRING = "MGM_3_RM3100_HANDLER"; +const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER"; +const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER"; +const char *GYRO_2_L3G_HANDLER_STRING = "GYRO_2_L3G_HANDLER"; +const char *IMTQ_HANDLER_STRING = "IMTQ_HANDLER"; +const char *PLOC_HANDLER_STRING = "PLOC_HANDLER"; +const char *SUS_1_STRING = "SUS_1"; +const char *SUS_2_STRING = "SUS_2"; +const char *SUS_3_STRING = "SUS_3"; +const char *SUS_4_STRING = "SUS_4"; +const char *SUS_5_STRING = "SUS_5"; +const char *SUS_6_STRING = "SUS_6"; +const char *SUS_7_STRING = "SUS_7"; +const char *SUS_8_STRING = "SUS_8"; +const char *SUS_9_STRING = "SUS_9"; +const char *SUS_10_STRING = "SUS_10"; +const char *SUS_11_STRING = "SUS_11"; +const char *SUS_12_STRING = "SUS_12"; +const char *SUS_13_STRING = "SUS_13"; +const char *PCDU_HANDLER_STRING = "PCDU_HANDLER"; +const char *SOLAR_ARRAY_DEPL_HANDLER_STRING = "SOLAR_ARRAY_DEPL_HANDLER"; +const char *SYRLINKS_HK_HANDLER_STRING = "SYRLINKS_HK_HANDLER"; +const char *GPIO_IF_STRING = "GPIO_IF"; +const char *ARDUINO_COM_IF_STRING = "ARDUINO_COM_IF"; +const char *CSP_COM_IF_STRING = "CSP_COM_IF"; +const char *I2C_COM_IF_STRING = "I2C_COM_IF"; +const char *UART_COM_IF_STRING = "UART_COM_IF"; +const char *SPI_COM_IF_STRING = "SPI_COM_IF"; +const char *CCSDS_PACKET_DISTRIBUTOR_STRING = "CCSDS_PACKET_DISTRIBUTOR"; +const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR"; +const char *UDP_BRIDGE_STRING = "UDP_BRIDGE"; +const char *UDP_POLLING_TASK_STRING = "UDP_POLLING_TASK"; +const char *PUS_SERVICE_3_STRING = "PUS_SERVICE_3"; +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_23_STRING = "PUS_SERVICE_23"; +const char *PUS_SERVICE_201_STRING = "PUS_SERVICE_201"; +const char *TM_FUNNEL_STRING = "TM_FUNNEL"; +const char *FSFW_OBJECTS_START_STRING = "FSFW_OBJECTS_START"; +const char *PUS_SERVICE_1_VERIFICATION_STRING = "PUS_SERVICE_1_VERIFICATION"; +const char *PUS_SERVICE_2_DEVICE_ACCESS_STRING = "PUS_SERVICE_2_DEVICE_ACCESS"; +const char *PUS_SERVICE_3_HOUSEKEEPING_STRING = "PUS_SERVICE_3_HOUSEKEEPING"; +const char *PUS_SERVICE_5_EVENT_REPORTING_STRING = "PUS_SERVICE_5_EVENT_REPORTING"; +const char *PUS_SERVICE_8_FUNCTION_MGMT_STRING = "PUS_SERVICE_8_FUNCTION_MGMT"; +const char *PUS_SERVICE_9_TIME_MGMT_STRING = "PUS_SERVICE_9_TIME_MGMT"; +const char *PUS_SERVICE_17_TEST_STRING = "PUS_SERVICE_17_TEST"; +const char *PUS_SERVICE_20_PARAMETERS_STRING = "PUS_SERVICE_20_PARAMETERS"; +const char *PUS_SERVICE_200_MODE_MGMT_STRING = "PUS_SERVICE_200_MODE_MGMT"; +const char *PUS_SERVICE_201_HEALTH_STRING = "PUS_SERVICE_201_HEALTH"; +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 *TIME_STAMPER_STRING = "TIME_STAMPER"; +const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END"; +const char *HEATER_HANDLER_STRING = "HEATER_HANDLER"; +const char *RTD_IC3_STRING = "RTD_IC3"; +const char *RTD_IC4_STRING = "RTD_IC4"; +const char *RTD_IC5_STRING = "RTD_IC5"; +const char *RTD_IC6_STRING = "RTD_IC6"; +const char *RTD_IC7_STRING = "RTD_IC7"; +const char *RTD_IC8_STRING = "RTD_IC8"; +const char *RTD_IC9_STRING = "RTD_IC9"; +const char *RTD_IC10_STRING = "RTD_IC10"; +const char *RTD_IC11_STRING = "RTD_IC11"; +const char *RTD_IC12_STRING = "RTD_IC12"; +const char *RTD_IC13_STRING = "RTD_IC13"; +const char *RTD_IC14_STRING = "RTD_IC14"; +const char *SPI_TEST_STRING = "SPI_TEST"; +const char *RTD_IC15_STRING = "RTD_IC15"; +const char *RTD_IC16_STRING = "RTD_IC16"; +const char *RTD_IC17_STRING = "RTD_IC17"; +const char *RTD_IC18_STRING = "RTD_IC18"; +const char *RAD_SENSOR_STRING = "RAD_SENSOR"; +const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER"; +const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE"; +const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST"; +const char *TEST_TASK_STRING = "TEST_TASK"; +const char *NO_OBJECT_STRING = "NO_OBJECT"; + +const char* translateObject(object_id_t object) { + switch( (object & 0xFFFFFFFF) ) { + case 0x00005060: + return P60DOCK_TEST_TASK_STRING; + case 0x44000001: + return P60DOCK_HANDLER_STRING; + case 0x44000002: + return PDU1_HANDLER_STRING; + case 0x44000003: + return PDU2_HANDLER_STRING; + case 0x44000004: + return ACU_HANDLER_STRING; + case 0x44000005: + return TMP1075_HANDLER_1_STRING; + case 0x44000006: + return TMP1075_HANDLER_2_STRING; + case 0x44000007: + return MGM_0_LIS3_HANDLER_STRING; + case 0x44000008: + return MGM_1_RM3100_HANDLER_STRING; + case 0x44000009: + return MGM_2_LIS3_HANDLER_STRING; + case 0x44000010: + return MGM_3_RM3100_HANDLER_STRING; + case 0x44000011: + return GYRO_0_ADIS_HANDLER_STRING; + case 0x44000012: + return GYRO_1_L3G_HANDLER_STRING; + case 0x44000013: + return GYRO_2_L3G_HANDLER_STRING; + case 0x44000014: + return IMTQ_HANDLER_STRING; + case 0x44000015: + return PLOC_HANDLER_STRING; + case 0x44000016: + return SUS_1_STRING; + case 0x44000017: + return SUS_2_STRING; + case 0x44000018: + return SUS_3_STRING; + case 0x44000019: + return SUS_4_STRING; + case 0x4400001A: + return SUS_5_STRING; + case 0x4400001B: + return SUS_6_STRING; + case 0x4400001C: + return SUS_7_STRING; + case 0x4400001D: + return SUS_8_STRING; + case 0x4400001E: + return SUS_9_STRING; + case 0x4400001F: + return SUS_10_STRING; + case 0x44000021: + return SUS_11_STRING; + case 0x44000022: + return SUS_12_STRING; + case 0x44000023: + return SUS_13_STRING; + case 0x44001000: + return PCDU_HANDLER_STRING; + case 0x44001001: + return SOLAR_ARRAY_DEPL_HANDLER_STRING; + case 0x44001002: + return SYRLINKS_HK_HANDLER_STRING; + case 0x47000001: + return GPIO_IF_STRING; + case 0x49000001: + return ARDUINO_COM_IF_STRING; + case 0x49000002: + return CSP_COM_IF_STRING; + case 0x49000003: + return I2C_COM_IF_STRING; + case 0x49000004: + return UART_COM_IF_STRING; + case 0x49000005: + return SPI_COM_IF_STRING; + case 0x50000100: + return CCSDS_PACKET_DISTRIBUTOR_STRING; + case 0x50000200: + return PUS_PACKET_DISTRIBUTOR_STRING; + case 0x50000300: + return UDP_BRIDGE_STRING; + case 0x50000400: + return UDP_POLLING_TASK_STRING; + case 0x51000300: + return PUS_SERVICE_3_STRING; + case 0x51000400: + return PUS_SERVICE_5_STRING; + case 0x51000500: + return PUS_SERVICE_6_STRING; + case 0x51000800: + return PUS_SERVICE_8_STRING; + case 0x51002300: + return PUS_SERVICE_23_STRING; + case 0x51020100: + return PUS_SERVICE_201_STRING; + case 0x52000002: + return TM_FUNNEL_STRING; + case 0x53000000: + return FSFW_OBJECTS_START_STRING; + case 0x53000001: + return PUS_SERVICE_1_VERIFICATION_STRING; + case 0x53000002: + return PUS_SERVICE_2_DEVICE_ACCESS_STRING; + case 0x53000003: + return PUS_SERVICE_3_HOUSEKEEPING_STRING; + case 0x53000005: + return PUS_SERVICE_5_EVENT_REPORTING_STRING; + case 0x53000008: + return PUS_SERVICE_8_FUNCTION_MGMT_STRING; + case 0x53000009: + return PUS_SERVICE_9_TIME_MGMT_STRING; + case 0x53000017: + return PUS_SERVICE_17_TEST_STRING; + case 0x53000020: + return PUS_SERVICE_20_PARAMETERS_STRING; + case 0x53000200: + return PUS_SERVICE_200_MODE_MGMT_STRING; + case 0x53000201: + return PUS_SERVICE_201_HEALTH_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 0x53500010: + return TIME_STAMPER_STRING; + case 0x53ffffff: + return FSFW_OBJECTS_END_STRING; + case 0x54000003: + return HEATER_HANDLER_STRING; + case 0x54000004: + return RTD_IC3_STRING; + case 0x54000005: + return RTD_IC4_STRING; + case 0x54000006: + return RTD_IC5_STRING; + case 0x54000007: + return RTD_IC6_STRING; + case 0x54000008: + return RTD_IC7_STRING; + case 0x54000009: + return RTD_IC8_STRING; + case 0x5400000A: + return RTD_IC9_STRING; + case 0x5400000B: + return RTD_IC10_STRING; + case 0x5400000C: + return RTD_IC11_STRING; + case 0x5400000D: + return RTD_IC12_STRING; + case 0x5400000E: + return RTD_IC13_STRING; + case 0x5400000F: + return RTD_IC14_STRING; + case 0x54000010: + return SPI_TEST_STRING; + case 0x5400001F: + return RTD_IC15_STRING; + case 0x5400002F: + return RTD_IC16_STRING; + case 0x5400003F: + return RTD_IC17_STRING; + case 0x5400004F: + return RTD_IC18_STRING; + case 0x54000050: + return RAD_SENSOR_STRING; + case 0x5400AFFE: + return DUMMY_HANDLER_STRING; + case 0x5400CAFE: + return DUMMY_INTERFACE_STRING; + case 0x54123456: + return LIBGPIOD_TEST_STRING; + case 0x54694269: + return TEST_TASK_STRING; + case 0xFFFFFFFF: + return NO_OBJECT_STRING; + default: + return "UNKNOWN_OBJECT"; + } + return 0; +} diff --git a/linux/fsfwconfig/objects/translateObjects.h b/linux/fsfwconfig/objects/translateObjects.h new file mode 100644 index 00000000..dbf5b468 --- /dev/null +++ b/linux/fsfwconfig/objects/translateObjects.h @@ -0,0 +1,8 @@ +#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ +#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ + +#include + +const char* translateObject(object_id_t object); + +#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */ diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp new file mode 100644 index 00000000..60059d3c --- /dev/null +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -0,0 +1,620 @@ +#include "pollingSequenceFactory.h" +#include "linux/devices/SusHandler.h" +#include "OBSWConfig.h" + +#include +#include +#include +#include +#include "objects/systemObjectList.h" + + +ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) +{ + /* Length of a communication cycle */ + uint32_t length = thisSequence->getPeriodMs(); + thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::HEATER_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SOLAR_ARRAY_DEPL_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + +#if Q7S_ADD_RTD_DEVICES == 1 + thisSequence->addSlot(objects::RTD_IC3, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC4, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC5, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC6, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC7, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC8, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC9, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC10, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC11, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC12, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC13, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC14, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC15, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC16, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC17, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RTD_IC18, length * 0, DeviceHandlerIF::PERFORM_OPERATION); +#endif /* Q7S_ADD_RTD_DEVICES */ + + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.2, DeviceHandlerIF::SEND_WRITE); + +#if Q7S_ADD_RTD_DEVICES == 1 + thisSequence->addSlot(objects::RTD_IC3, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC4, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC5, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC6, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC7, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC8, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC9, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC10, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC11, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC12, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC13, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC14, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC15, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC16, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC17, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RTD_IC18, length * 0.2, DeviceHandlerIF::SEND_WRITE); +#endif /* Q7S_ADD_RTD_DEVICES */ + + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.4, DeviceHandlerIF::GET_WRITE); + +#if Q7S_ADD_RTD_DEVICES == 1 + thisSequence->addSlot(objects::RTD_IC3, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC4, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC5, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC6, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC7, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC8, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC9, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC10, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC11, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC12, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC13, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC14, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC15, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC16, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC17, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RTD_IC18, length * 0.4, DeviceHandlerIF::GET_WRITE); +#endif /* Q7S_ADD_RTD_DEVICES */ + + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.6, DeviceHandlerIF::SEND_READ); + +#if Q7S_ADD_RTD_DEVICES == 1 + thisSequence->addSlot(objects::RTD_IC3, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC4, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC5, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC6, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC7, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC8, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC9, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC10, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC11, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC12, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC13, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC14, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC15, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC16, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC17, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RTD_IC18, length * 0.6, DeviceHandlerIF::SEND_READ); +#endif /* Q7S_ADD_RTD_DEVICES */ + + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0.8, DeviceHandlerIF::GET_READ); + +#if Q7S_ADD_RTD_DEVICES == 1 + thisSequence->addSlot(objects::RTD_IC3, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC4, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC5, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC6, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC7, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC8, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC9, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC10, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC11, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC12, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC13, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC14, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC15, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC16, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC17, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::RTD_IC18, length * 0.8, DeviceHandlerIF::GET_READ); +#endif /* Q7S_ADD_RTD_DEVICES */ + + thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); + + + /* Radiation sensor */ +// thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::RAD_SENSOR, length * 0.2, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::RAD_SENSOR, length * 0.4, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::RAD_SENSOR, length * 0.6, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ); + + if (length != 3000) { + sif::warning << "pollingSequenceInitDefault: Frequency changed. Make sure timing critical " + << "SUS sensors still produce correct values" << std::endl; + } + + /** + * The sun sensor will be shutdown as soon as the chip select is pulled high. Thus all + * requests to a sun sensor must be performed consecutively. Another reason for calling multiple + * device handler cycles is that the ADC conversions take some time. Thus first the ADC + * conversions are initiated and in a next step the results can be read from the internal FIFO. + * One sun sensor communication sequence also blocks the SPI bus. So other devices can not be + * inserted between the device handler cycles of one SUS. + */ + + /* Write setup */ +// thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_1, length * 0.9, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_1, length * 0.901, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::GET_READ); + + /* Write setup */ +// thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_2, length * 0.903, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_2, length * 0.904, SusHandler::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_2, length * 0.905, SusHandler::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::GET_READ); + + /* Write setup */ +// thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_3, length * 0.8, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_3, length * 0.91, SusHandler::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_3, length * 0.93, SusHandler::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_4, length * 0.909, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_4, length * 0.91, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_4, length * 0.911, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_5, length * 0.912, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_5, length * 0.913, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::GET_READ); +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_5, length * 0.914, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_6, length * 0.915, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions from inernal FIFO */ +// thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_7, length * 0.918, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions from inernal FIFO */ +// thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_8, length * 0.921, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions from inernal FIFO */ +// thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_9, length * 0.924, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions */ +// thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_10, length * 0.927, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions */ +// thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_11, length * 0.93, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions */ +// thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_12, length * 0.933, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions */ +// thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::GET_READ); +// +// /* Write setup */ +// thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_13, length * 0.936, SusHandler::FIRST_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::GET_READ); +// /* Start ADC conversions */ +// thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::GET_READ); +// /* Read ADC conversions */ +// thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::PERFORM_OPERATION); +// thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::SEND_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::GET_WRITE); +// thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::SEND_READ); +// thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::GET_READ); + + if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { + return HasReturnvaluesIF::RETURN_OK; + } + + sif::error << "PollingSequence::initialize has errors!" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; +} + +ReturnValue_t pst::gomspacePstInit(FixedTimeslotTaskIF *thisSequence){ + uint32_t length = thisSequence->getPeriodMs(); + + thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::P60DOCK_HANDLER, + length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PDU1_HANDLER, + length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PDU2_HANDLER, + length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::ACU_HANDLER, + length * 0, DeviceHandlerIF::PERFORM_OPERATION); + + thisSequence->addSlot(objects::P60DOCK_HANDLER, + length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PDU1_HANDLER, + length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PDU2_HANDLER, + length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::ACU_HANDLER, + length * 0.2, DeviceHandlerIF::SEND_WRITE); + + thisSequence->addSlot(objects::P60DOCK_HANDLER, + length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PDU1_HANDLER, + length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PDU2_HANDLER, + length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::ACU_HANDLER, + length * 0.4, DeviceHandlerIF::GET_WRITE); + + thisSequence->addSlot(objects::P60DOCK_HANDLER, + length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PDU1_HANDLER, + length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PDU2_HANDLER, + length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::ACU_HANDLER, + length * 0.6, DeviceHandlerIF::SEND_READ); + + thisSequence->addSlot(objects::P60DOCK_HANDLER, + length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::PDU1_HANDLER, + length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::PDU2_HANDLER, + length * 0.8, DeviceHandlerIF::GET_READ); + thisSequence->addSlot(objects::ACU_HANDLER, + length * 0.8, DeviceHandlerIF::GET_READ); + + if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Initialization of GomSpace PST failed" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t pst::pollingSequenceTest(FixedTimeslotTaskIF* thisSequence) { + /* Length of a communication cycle */ + uint32_t length = thisSequence->getPeriodMs(); +#if OBSW_ADD_ACS_BOARD == 1 + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); + + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); + + + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); + + + thisSequence->addSlot(objects::GYRO_2_L3G_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_2_L3G_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_2_L3G_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_2_L3G_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_2_L3G_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); + + + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.2, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.4, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.6, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.8, + DeviceHandlerIF::GET_READ); +#endif + +#if RPI_TEST_ADIS16507 == 1 + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); +#endif + static_cast(length); + if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { + return HasReturnvaluesIF::RETURN_OK; + } + + sif::error << "PollingSequence::initialize has errors!" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; +} + +ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) { + uint32_t length = thisSequence->getPeriodMs(); + +#if TEST_PLOC_HANDLER == 1 + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::PLOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ); +#endif + +#if TEST_RADIATION_SENSOR_HANDLER == 1 + thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::RAD_SENSOR, length * 0.2, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * 0.4, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::RAD_SENSOR, length * 0.6, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ); +#endif + +#if TEST_SUS_HANDLER == 1 + /* Write setup */ + thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.903, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.904, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1, length * 0.905, DeviceHandlerIF::GET_READ); + + /* Start conversion*/ + thisSequence->addSlot(objects::SUS_1, length * 0.906, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_1, length * 0.907, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.908, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.909, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1, length * 0.91, DeviceHandlerIF::GET_READ); + + /* Read conversions */ + thisSequence->addSlot(objects::SUS_1, length * 0.911, DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::SUS_1, length * 0.912, DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.913, DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::SUS_1, length * 0.914, DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::SUS_1, length * 0.915, DeviceHandlerIF::GET_READ); +#endif + + if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { + sif::error << "Initialization of TE0720 PST failed" << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; +} + diff --git a/fsfwconfig/pollingsequence/pollingSequenceFactory.h b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h similarity index 85% rename from fsfwconfig/pollingsequence/pollingSequenceFactory.h rename to linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h index 09dd7242..e05f96aa 100644 --- a/fsfwconfig/pollingsequence/pollingSequenceFactory.h +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.h @@ -34,7 +34,12 @@ ReturnValue_t pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence); */ ReturnValue_t gomspacePstInit(FixedTimeslotTaskIF *thisSequence); -ReturnValue_t pollingSequenceAcsTest(FixedTimeslotTaskIF* thisSequence); +ReturnValue_t pollingSequenceTest(FixedTimeslotTaskIF* thisSequence); + +/** + * @brief This polling sequence will be created when the software is compiled for the TE0720. + */ +ReturnValue_t pollingSequenceTE0720(FixedTimeslotTaskIF* thisSequence); } diff --git a/fsfwconfig/returnvalues/classIds.h b/linux/fsfwconfig/returnvalues/classIds.h similarity index 65% rename from fsfwconfig/returnvalues/classIds.h rename to linux/fsfwconfig/returnvalues/classIds.h index 93349596..d1bfe7e2 100644 --- a/fsfwconfig/returnvalues/classIds.h +++ b/linux/fsfwconfig/returnvalues/classIds.h @@ -2,6 +2,7 @@ #define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ #include +#include /** * Source IDs starts at 73 for now @@ -10,16 +11,9 @@ */ namespace CLASS_ID { enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - MGM_LIS3MDL, - MGM_RM3100, - LINUX_LIBGPIO_IF, - LINUX_SPI_COM_IF, - PCDU_HANDLER, - HEATER_HANDLER, - SA_DEPL_HANDLER, - SYRLINKS_HANDLER, - IMTQ_HANDLER, + CLASS_ID_START = COMMON_CLASS_ID_END, + SA_DEPL_HANDLER, //SADPL + CLASS_ID_END // [EXPORT] : [END] }; } diff --git a/fsfwconfig/tmtc/apid.h b/linux/fsfwconfig/tmtc/apid.h similarity index 100% rename from fsfwconfig/tmtc/apid.h rename to linux/fsfwconfig/tmtc/apid.h diff --git a/fsfwconfig/tmtc/pusIds.h b/linux/fsfwconfig/tmtc/pusIds.h similarity index 100% rename from fsfwconfig/tmtc/pusIds.h rename to linux/fsfwconfig/tmtc/pusIds.h diff --git a/linux/obc/CCSDSIPCoreBridge.cpp b/linux/obc/CCSDSIPCoreBridge.cpp new file mode 100644 index 00000000..2678e76f --- /dev/null +++ b/linux/obc/CCSDSIPCoreBridge.cpp @@ -0,0 +1,136 @@ +#include +#include + +#include + +CCSDSIPCoreBridge::CCSDSIPCoreBridge(object_id_t objectId, object_id_t tcDestination, + object_id_t tmStoreId, object_id_t tcStoreId, LinuxLibgpioIF* gpioComIF, + std::string uioPtme, gpioId_t papbBusyId, gpioId_t papbEmptyId) : + TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId), gpioComIF(gpioComIF), uioPtme( + uioPtme), papbBusyId(papbBusyId), papbEmptyId(papbEmptyId) { +} + +CCSDSIPCoreBridge::~CCSDSIPCoreBridge() { +} + +ReturnValue_t CCSDSIPCoreBridge::initialize() { + ReturnValue_t result = TmTcBridge::initialize(); + + fd = open("/dev/uio0", O_RDWR); + if (fd < 1) { + sif::debug << "CCSDSIPCoreBridge::initialize: Invalid UIO device file" << std::endl; + return RETURN_FAILED; + } + + /** + * Map uio device in virtual address space + * PROT_WRITE: Map uio device in writable only mode + */ + ptmeBaseAddress = static_cast(mmap(NULL, MAP_SIZE, PROT_READ | PROT_WRITE, + MAP_SHARED, fd, 0)); + + if (ptmeBaseAddress == MAP_FAILED) { + sif::error << "CCSDSIPCoreBridge::initialize: Failed to map uio address" << std::endl; + return RETURN_FAILED; + } + + return result; +} + +ReturnValue_t CCSDSIPCoreBridge::handleTm() { + +#if PERFORM_PTME_TEST == 1 + return sendTestFrame(); +#else + return TmTcBridge::handleTm(); +#endif + +} + +ReturnValue_t CCSDSIPCoreBridge::sendTm(const uint8_t * data, size_t dataLen) { + + if(pollPapbBusySignal() == RETURN_OK) { + startPacketTransfer(); + } + + for(size_t idx = 0; idx < dataLen; idx++) { + if(pollPapbBusySignal() == RETURN_OK) { + *(ptmeBaseAddress + PTME_DATA_REG_OFFSET) = static_cast(*(data + idx)); + } + else { + sif::debug << "CCSDSIPCoreBridge::sendTm: Only written " << idx - 1 << " of " << dataLen + << " data" << std::endl; + return RETURN_FAILED; + } + } + + if(pollPapbBusySignal() == RETURN_OK) { + endPacketTransfer(); + } + return RETURN_OK; +} + +void CCSDSIPCoreBridge::startPacketTransfer() { + *ptmeBaseAddress = PTME_CONFIG_START; +} + +void CCSDSIPCoreBridge::endPacketTransfer() { + *ptmeBaseAddress = PTME_CONFIG_END; +} + +ReturnValue_t CCSDSIPCoreBridge::pollPapbBusySignal() { + int papbBusyState = 0; + ReturnValue_t result = RETURN_OK; + + /** Check if PAPB interface is ready to receive data */ + result = gpioComIF->readGpio(papbBusyId, &papbBusyState); + if (result != RETURN_OK) { + sif::debug << "CCSDSIPCoreBridge::pollPapbBusySignal: Failed to read papb busy signal" + << std::endl; + return RETURN_FAILED; + } + if (!papbBusyState) { + sif::debug << "CCSDSIPCoreBridge::pollPapbBusySignal: PAPB busy" << std::endl; + return PAPB_BUSY; + } + + return RETURN_OK; +} + +void CCSDSIPCoreBridge::isPtmeBufferEmpty() { + ReturnValue_t result = RETURN_OK; + int papbEmptyState = 1; + + result = gpioComIF->readGpio(papbEmptyId, &papbEmptyState); + + if (result != RETURN_OK) { + sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Failed to read papb empty signal" + << std::endl; + return; + } + + if (papbEmptyState == 1) { + sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Buffer is empty" << std::endl; + } + else { + sif::debug << "CCSDSIPCoreBridge::isPtmeBufferEmpty: Buffer is not empty" << std::endl; + } + return; +} + +ReturnValue_t CCSDSIPCoreBridge::sendTestFrame() { + /** Size of one complete transfer frame data field amounts to 1105 bytes */ + uint8_t testPacket[1105]; + + /** Fill one test packet */ + for(int idx = 0; idx < 1105; idx++) { + testPacket[idx] = static_cast(idx & 0xFF); + } + + ReturnValue_t result = sendTm(testPacket, 1105); + if(result != RETURN_OK) { + return result; + } + + return RETURN_OK; +} diff --git a/linux/obc/CCSDSIPCoreBridge.h b/linux/obc/CCSDSIPCoreBridge.h new file mode 100644 index 00000000..5b7674e9 --- /dev/null +++ b/linux/obc/CCSDSIPCoreBridge.h @@ -0,0 +1,130 @@ +#ifndef MISSION_OBC_CCSDSIPCOREBRIDGE_H_ +#define MISSION_OBC_CCSDSIPCOREBRIDGE_H_ + +#include +#include +#include +#include +#include "OBSWConfig.h" + +/** + * @brief This class handles the interfacing to the telemetry (PTME) and telecommand (PDEC) IP + * cores responsible for the CCSDS encoding and decoding. The IP cores are implemented + * on the programmable logic and are accessible through the linux UIO driver. + */ +class CCSDSIPCoreBridge: public TmTcBridge { +public: + /** + * @brief Constructor + * + * @param objectId + * @param tcDestination + * @param tmStoreId + * @param tcStoreId + * @param uioPtme Name of the uio device file which provides access to the PTME IP Core. + * @param papbBusyId The ID of the GPIO which is connected to the PAPBBusy_N signal of the + * PTME IP Core. A low logic level indicates the PTME is not ready to + * receive more data. + * @param papbEmptyId The ID of the GPIO which is connected to the PAPBEmpty signal of the + * PTME IP Core. The signal is high when there are no packets in the + * external buffer memory (BRAM). + */ + CCSDSIPCoreBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId, + object_id_t tcStoreId, LinuxLibgpioIF* gpioComIF, std::string uioPtme, + gpioId_t papbBusyId, gpioId_t papbEmptyId); + virtual ~CCSDSIPCoreBridge(); + + ReturnValue_t initialize() override; + +protected: + + /** + * Overwriting this function to provide the capability of testing the PTME IP Core + * implementation. + */ + virtual ReturnValue_t handleTm() override; + + virtual ReturnValue_t sendTm(const uint8_t * data, size_t dataLen) override; + +private: + + static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_IP_CORE_BRIDGE; + + static const ReturnValue_t PAPB_BUSY = MAKE_RETURN_CODE(0xA0); + + + /** Size of mapped address space. 4k (minimal size of pl device) */ +// static const int MAP_SIZE = 0xFA0; + static const int MAP_SIZE = 0x1000; + + /** + * Configuration bits: + * bit[1:0]: Size of data (1,2,3 or 4 bytes). 1 Byte <=> b00 + * bit[2]: Set this bit to 1 to abort a transfered packet + * bit[3]: Signals to PTME the start of a new telemetry packet + */ + static const uint32_t PTME_CONFIG_START = 0x8; + + /** + * Writing this word to the ptme base address signals to the PTME that a complete tm packet has + * been transferred. + */ + static const uint32_t PTME_CONFIG_END = 0x0; + + /** + * Writing to this offset within the PTME memory space will insert data for encoding to the + * PTME IP core. + * The address offset is 0x400 (= 4 * 256) + */ + static const int PTME_DATA_REG_OFFSET = 256; + + LinuxLibgpioIF* gpioComIF = nullptr; + + /** The uio device file related to the PTME IP Core */ + std::string uioPtme; + + /** Pulled to low when PTME not ready to receive data */ + gpioId_t papbBusyId = gpio::NO_GPIO; + + /** High when externally buffer memory of PTME is empty */ + gpioId_t papbEmptyId = gpio::NO_GPIO; + + /** The file descriptor of the UIO driver */ + int fd; + + uint32_t* ptmeBaseAddress = nullptr; + + /** + * @brief This function sends the config byte to the PTME IP Core to initiate a packet + * transfer. + */ + void startPacketTransfer(); + + /** + * @brief This function sends the config byte to the PTME IP Core to signal the end of a + * packet transfer. + */ + void endPacketTransfer(); + + /** + * @brief This function reads the papb busy signal indicating whether the PAPB interface is + * ready to receive more data or not. PAPB is ready when PAPB_Busy_N == '1'. + * + * @return RETURN_OK when ready to receive data else PAPB_BUSY. + */ + ReturnValue_t pollPapbBusySignal(); + + /** + * @brief This function can be used for debugging to check wheter there are packets in + * the packet buffer of the PTME or not. + */ + void isPtmeBufferEmpty(); + + /** + * @brief This function sends a complete telemetry transfer frame data field (1105 bytes) + * to the input of the PTME IP Core. Can be used to test the implementation. + */ + ReturnValue_t sendTestFrame(); +}; + +#endif /* MISSION_OBC_CCSDSIPCOREBRIDGE_H_ */ diff --git a/bsp_rpi/gpio/CMakeLists.txt b/linux/obc/CMakeLists.txt similarity index 64% rename from bsp_rpi/gpio/CMakeLists.txt rename to linux/obc/CMakeLists.txt index b816684d..79d9ba9b 100644 --- a/bsp_rpi/gpio/CMakeLists.txt +++ b/linux/obc/CMakeLists.txt @@ -1,8 +1,5 @@ target_sources(${TARGET_NAME} PUBLIC + CCSDSIPCoreBridge.cpp ) - - - - diff --git a/linux/uart/CMakeLists.txt b/linux/uart/CMakeLists.txt deleted file mode 100644 index 7b503d02..00000000 --- a/linux/uart/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -target_sources(${TARGET_NAME} PUBLIC - UartComIF.cpp - UartCookie.cpp -) - - - - diff --git a/linux/uart/UartComIF.cpp b/linux/uart/UartComIF.cpp deleted file mode 100644 index 79470a45..00000000 --- a/linux/uart/UartComIF.cpp +++ /dev/null @@ -1,368 +0,0 @@ -#include "UartComIF.h" - -#include -#include - -#include -#include -#include -#include - -UartComIF::UartComIF(object_id_t objectId): SystemObject(objectId){ -} - -UartComIF::~UartComIF() {} - -ReturnValue_t UartComIF::initializeInterface(CookieIF * cookie) { - - std::string deviceFile; - UartDeviceMapIter uartDeviceMapIter; - - if(cookie == nullptr) { - return NULLPOINTER; - } - - UartCookie* uartCookie = dynamic_cast(cookie); - if (uartCookie == nullptr) { - sif::error << "UartComIF::initializeInterface: Invalid UART Cookie!" << std::endl; - return NULLPOINTER; - } - - deviceFile = uartCookie->getDeviceFile(); - - uartDeviceMapIter = uartDeviceMap.find(deviceFile); - if(uartDeviceMapIter == uartDeviceMap.end()) { - int fileDescriptor = configureUartPort(uartCookie); - if (fileDescriptor < 0) { - return RETURN_FAILED; - } - size_t maxReplyLen = uartCookie->getMaxReplyLen(); - UartElements_t uartElements = {fileDescriptor, std::vector(maxReplyLen), 0}; - std::pair status = uartDeviceMap.emplace(deviceFile, uartElements); - if (status.second == false) { - sif::debug << "UartComIF::initializeInterface: Failed to insert device " << deviceFile - << "to Uart device map" << std::endl; - return RETURN_FAILED; - } - } - else { - sif::debug << "UartComIF::initializeInterface: Uart device " << deviceFile << "already in " - << "use" << std::endl; - return RETURN_FAILED; - } - - return RETURN_OK; -} - -int UartComIF::configureUartPort(UartCookie* uartCookie) { - - struct termios options; - - std::string deviceFile = uartCookie->getDeviceFile(); - int fd = open(deviceFile.c_str(), O_RDWR); - - if (fd < 0) { - sif::debug << "UartComIF::configureUartPort: Failed to open uart " << deviceFile << "with" - << " error code " << errno << strerror(errno) << std::endl; - return fd; - } - - /* Read in existing settings */ - if(tcgetattr(fd, &options) != 0) { - sif::debug << "UartComIF::configureUartPort: Error " << errno << "from tcgetattr: " - << strerror(errno) << std::endl; - return fd; - } - - setParityOptions(&options, uartCookie); - setStopBitOptions(&options, uartCookie); - setDatasizeOptions(&options, uartCookie); - setFixedOptions(&options); - - /* Sets uart to non-blocking mode. Read returns immediately when there are no data available */ - options.c_cc[VTIME] = 0; - options.c_cc[VMIN] = 0; - - configureBaudrate(&options, uartCookie); - - /* Save option settings */ - if (tcsetattr(fd, TCSANOW, &options) != 0) { - sif::debug << "UartComIF::configureUartPort: Failed to set options with error " << errno - << ": " << strerror(errno); - return fd; - } - return fd; -} - -void UartComIF::setParityOptions(struct termios* options, UartCookie* uartCookie) { - /* Clear parity bit */ - options->c_cflag &= ~PARENB; - switch (uartCookie->getParity()) { - case Parity::EVEN: - options->c_cflag |= PARENB; - options->c_cflag &= ~PARODD; - break; - case Parity::ODD: - options->c_cflag |= PARENB; - options->c_cflag |= PARODD; - break; - default: - break; - } -} - -void UartComIF::setStopBitOptions(struct termios* options, UartCookie* uartCookie) { - /* Clear stop field. Sets stop bit to one bit */ - options->c_cflag &= ~CSTOPB; - switch (uartCookie->getStopBits()) { - case StopBits::TWO_STOP_BITS: - options->c_cflag |= CSTOPB; - break; - default: - break; - } -} - -void UartComIF::setDatasizeOptions(struct termios* options, UartCookie* uartCookie) { - /* Clear size bits */ - options->c_cflag &= ~CSIZE; - switch (uartCookie->getBitsPerWord()) { - case 5: - options->c_cflag |= CS5; - break; - case 6: - options->c_cflag |= CS6; - break; - case 7: - options->c_cflag |= CS7; - break; - case 8: - options->c_cflag |= CS8; - break; - default: - sif::debug << "UartComIF::setDatasizeOptions: Invalid size specified" << std::endl; - break; - } -} - -void UartComIF::setFixedOptions(struct termios* options) { - /* Disable RTS/CTS hardware flow control */ - options->c_cflag &= ~CRTSCTS; - /* Turn on READ & ignore ctrl lines (CLOCAL = 1) */ - options->c_cflag |= CREAD | CLOCAL; - /* Disable canonical mode */ - options->c_lflag &= ~ICANON; - /* Disable echo */ - options->c_lflag &= ~ECHO; - /* Disable erasure */ - options->c_lflag &= ~ECHOE; - /* Disable new-line echo */ - options->c_lflag &= ~ECHONL; - /* Disable interpretation of INTR, QUIT and SUSP */ - options->c_lflag &= ~ISIG; - /* Turn off s/w flow ctrl */ - options->c_iflag &= ~(IXON | IXOFF | IXANY); - /* Disable any special handling of received bytes */ - options->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL); - /* Prevent special interpretation of output bytes (e.g. newline chars) */ - options->c_oflag &= ~OPOST; - /* Prevent conversion of newline to carriage return/line feed */ - options->c_oflag &= ~ONLCR; -} - -void UartComIF::configureBaudrate(struct termios* options, UartCookie* uartCookie) { - switch (uartCookie->getBaudrate()) { - case 50: - cfsetispeed(options, B50); - cfsetospeed(options, B50); - break; - case 75: - cfsetispeed(options, B75); - cfsetospeed(options, B75); - break; - case 110: - cfsetispeed(options, B110); - cfsetospeed(options, B110); - break; - case 134: - cfsetispeed(options, B134); - cfsetospeed(options, B134); - break; - case 150: - cfsetispeed(options, B150); - cfsetospeed(options, B150); - break; - case 200: - cfsetispeed(options, B200); - cfsetospeed(options, B200); - break; - case 300: - cfsetispeed(options, B300); - cfsetospeed(options, B300); - break; - case 600: - cfsetispeed(options, B600); - cfsetospeed(options, B600); - break; - case 1200: - cfsetispeed(options, B1200); - cfsetospeed(options, B1200); - break; - case 1800: - cfsetispeed(options, B1800); - cfsetospeed(options, B1800); - break; - case 2400: - cfsetispeed(options, B2400); - cfsetospeed(options, B2400); - break; - case 4800: - cfsetispeed(options, B4800); - cfsetospeed(options, B4800); - break; - case 9600: - cfsetispeed(options, B9600); - cfsetospeed(options, B9600); - break; - case 19200: - cfsetispeed(options, B19200); - cfsetospeed(options, B19200); - break; - case 38400: - cfsetispeed(options, B38400); - cfsetospeed(options, B38400); - break; - case 57600: - cfsetispeed(options, B57600); - cfsetospeed(options, B57600); - break; - case 115200: - cfsetispeed(options, B115200); - cfsetospeed(options, B115200); - break; - case 230400: - cfsetispeed(options, B230400); - cfsetospeed(options, B230400); - break; - case 460800: - cfsetispeed(options, B460800); - cfsetospeed(options, B460800); - break; - default: - sif::debug << "UartComIF::configureBaudrate: Baudrate not supported" << std::endl; - break; - } -} - -ReturnValue_t UartComIF::sendMessage(CookieIF *cookie, - const uint8_t *sendData, size_t sendLen) { - - int fd; - std::string deviceFile; - UartDeviceMapIter uartDeviceMapIter; - - if(sendData == nullptr) { - sif::debug << "UartComIF::sendMessage: Send Data is nullptr" << std::endl; - return RETURN_FAILED; - } - - if(sendLen == 0) { - return RETURN_OK; - } - - UartCookie* uartCookie = dynamic_cast(cookie); - if(uartCookie == nullptr) { - sif::debug << "UartComIF::sendMessasge: Invalid Uart Cookie!" << std::endl; - return NULLPOINTER; - } - - deviceFile = uartCookie->getDeviceFile(); - uartDeviceMapIter = uartDeviceMap.find(deviceFile); - if (uartDeviceMapIter == uartDeviceMap.end()) { - sif::debug << "UartComIF::sendMessage: Device file " << deviceFile << "not in uart map" - << std::endl; - return RETURN_FAILED; - } - - fd = uartDeviceMapIter->second.fileDescriptor; - - if (write(fd, sendData, sendLen) != (int)sendLen) { - sif::error << "UartComIF::sendMessage: Failed to send data with error code " << errno - << ": Error description: " << strerror(errno) << std::endl; - return RETURN_FAILED; - } - - return RETURN_OK; -} - -ReturnValue_t UartComIF::getSendSuccess(CookieIF *cookie) { - return RETURN_OK; -} - -ReturnValue_t UartComIF::requestReceiveMessage(CookieIF *cookie, - size_t requestLen) { - - int fd; - std::string deviceFile; - UartDeviceMapIter uartDeviceMapIter; - uint8_t* bufferPtr; - - if(requestLen == 0) { - return RETURN_OK; - } - - UartCookie* uartCookie = dynamic_cast(cookie); - if(uartCookie == nullptr) { - sif::debug << "UartComIF::requestReceiveMessage: Invalid Uart Cookie!" << std::endl; - return NULLPOINTER; - } - - deviceFile = uartCookie->getDeviceFile(); - uartDeviceMapIter = uartDeviceMap.find(deviceFile); - if (uartDeviceMapIter == uartDeviceMap.end()) { - sif::debug << "UartComIF::requestReceiveMessage: Device file " << deviceFile - << " not in uart map" << std::endl; - return RETURN_FAILED; - } - - fd = uartDeviceMapIter->second.fileDescriptor; - bufferPtr = uartDeviceMapIter->second.replyBuffer.data(); - int bytesRead = read(fd, bufferPtr, requestLen); - if (bytesRead != static_cast(requestLen)) { - sif::debug << "UartComIF::requestReceiveMessage: Only read " << bytesRead - << " of " << requestLen << " bytes" << std::endl; - return RETURN_FAILED; - } - else { - uartDeviceMapIter->second.replyLen = bytesRead; - } - - return RETURN_OK; -} - -ReturnValue_t UartComIF::readReceivedMessage(CookieIF *cookie, - uint8_t **buffer, size_t* size) { - - std::string deviceFile; - UartDeviceMapIter uartDeviceMapIter; - - UartCookie* uartCookie = dynamic_cast(cookie); - if(uartCookie == nullptr) { - sif::debug << "UartComIF::readReceivedMessage: Invalid uart cookie!" << std::endl; - return NULLPOINTER; - } - - deviceFile = uartCookie->getDeviceFile(); - uartDeviceMapIter = uartDeviceMap.find(deviceFile); - if (uartDeviceMapIter == uartDeviceMap.end()) { - sif::debug << "UartComIF::readReceivedMessage: Device file " << deviceFile - << " not in uart map" << std::endl; - return RETURN_FAILED; - } - - *buffer = uartDeviceMapIter->second.replyBuffer.data(); - *size = uartDeviceMapIter->second.replyLen; - - return RETURN_OK; -} - diff --git a/linux/uart/UartComIF.h b/linux/uart/UartComIF.h deleted file mode 100644 index 9dd854da..00000000 --- a/linux/uart/UartComIF.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef BSP_Q7S_COMIF_UARTCOMIF_H_ -#define BSP_Q7S_COMIF_UARTCOMIF_H_ - -#include -#include - -#include -#include - -#include "UartCookie.h" - -/** - * @brief This is the communication interface to access serial ports on linux based operating - * systems. - * - * @details The implementation follows the instructions from https://blog.mbedded.ninja/programming/ - * operating-systems/linux/linux-serial-ports-using-c-cpp/#disabling-canonical-mode - * - * @author J. Meier - */ -class UartComIF: public DeviceCommunicationIF, public SystemObject { -public: - UartComIF(object_id_t objectId); - - virtual ~UartComIF(); - - ReturnValue_t initializeInterface(CookieIF * cookie) override; - ReturnValue_t sendMessage(CookieIF *cookie,const uint8_t *sendData, - size_t sendLen) override; - ReturnValue_t getSendSuccess(CookieIF *cookie) override; - ReturnValue_t requestReceiveMessage(CookieIF *cookie, - size_t requestLen) override; - ReturnValue_t readReceivedMessage(CookieIF *cookie, uint8_t **buffer, - size_t *size) override; - -private: - - using UartDeviceFile_t = std::string; - - typedef struct UartElements { - int fileDescriptor; - std::vector replyBuffer; - /** Number of bytes read will be written to this variable */ - size_t replyLen; - } UartElements_t; - - using UartDeviceMap = std::unordered_map; - using UartDeviceMapIter = UartDeviceMap::iterator; - - /** - * The uart devie map stores informations of initialized uart ports. - */ - UartDeviceMap uartDeviceMap; - - /** - * @brief This function opens and configures a uart device by using the information stored - * in the uart cookie. - * @param uartCookie Pointer to uart cookie with information about the uart. Contains the - * uart device file, baudrate, parity, stopbits etc. - * @return The file descriptor of the configured uart. - */ - int configureUartPort(UartCookie* uartCookie); - - /** - * @brief This function adds the parity settings to the termios options struct. - * - * @param options Pointer to termios options struct which will be modified to enable or disable - * parity checking. - * @param uartCookie Pointer to uart cookie containing the information about the desired - * parity settings. - * - */ - void setParityOptions(struct termios* options, UartCookie* uartCookie); - - void setStopBitOptions(struct termios* options, UartCookie* uartCookie); - - /** - * @brief This function sets options which are not configurable by the uartCookie. - */ - void setFixedOptions(struct termios* options); - - /** - * @brief With this function the datasize settings are added to the termios options struct. - */ - void setDatasizeOptions(struct termios* options, UartCookie* uartCookie); - - /** - * @brief This functions adds the baudrate specified in the uartCookie to the termios options - * struct. - */ - void configureBaudrate(struct termios* options, UartCookie* uartCookie); -}; - -#endif /* BSP_Q7S_COMIF_UARTCOMIF_H_ */ diff --git a/linux/uart/UartCookie.cpp b/linux/uart/UartCookie.cpp deleted file mode 100644 index b8149388..00000000 --- a/linux/uart/UartCookie.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include "UartCookie.h" - -#include - -UartCookie::UartCookie(std::string deviceFile, uint32_t baudrate, size_t maxReplyLen) : - deviceFile(deviceFile), baudrate(baudrate), maxReplyLen(maxReplyLen) { -} - -UartCookie::~UartCookie() {} - -uint32_t UartCookie::getBaudrate() const { - return baudrate; -} - -size_t UartCookie::getMaxReplyLen() const { - return maxReplyLen; -} - -std::string UartCookie::getDeviceFile() const { - return deviceFile; -} - -void UartCookie::setParityOdd() { - parity = Parity::ODD; -} - -void UartCookie::setParityEven() { - parity = Parity::EVEN; -} - -Parity UartCookie::getParity() const { - return parity; -} - -void UartCookie::setBitsPerWord(uint8_t bitsPerWord_) { - switch(bitsPerWord_) { - case 5: - case 6: - case 7: - case 8: - break; - default: - sif::debug << "UartCookie::setBitsPerWord: Invalid bits per word specified" << std::endl; - return; - } - bitsPerWord = bitsPerWord_; -} - -uint8_t UartCookie::getBitsPerWord() const { - return bitsPerWord; -} - -StopBits UartCookie::getStopBits() const { - return stopBits; -} - -void UartCookie::setTwoStopBits() { - stopBits = StopBits::TWO_STOP_BITS; -} - -void UartCookie::setOneStopBit() { - stopBits = StopBits::ONE_STOP_BIT; -} diff --git a/linux/uart/UartCookie.h b/linux/uart/UartCookie.h deleted file mode 100644 index 59004719..00000000 --- a/linux/uart/UartCookie.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef SAM9G20_COMIF_COOKIES_UART_COOKIE_H_ -#define SAM9G20_COMIF_COOKIES_UART_COOKIE_H_ - -#include -#include - -enum class Parity { - NONE, - EVEN, - ODD -}; - -enum class StopBits { - ONE_STOP_BIT, - TWO_STOP_BITS -}; - -/** - * @brief Cookie for the UartComIF. There are many options available to configure the uart driver. - * The constructor only requests for common options like the baudrate. Other options can - * be set by member functions. - * - * @author J. Meier - */ -class UartCookie: public CookieIF { -public: - - /** - * @brief Constructor for the uart cookie. - * @param deviceFile The device file specifying the uart to use. E.g. "/dev/ttyPS1". - * @param baudrate The baudrate to use for input and output. Possible Baudrates are: 50, - * 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, B19200, - * 38400, 57600, 115200, 230400, 460800 - * @param maxReplyLen The maximum size an object using this cookie expects. - * - * @details Default configuration: No parity - * 8 databits (number of bits transfered with one uart frame) - * One stop bit - * - * - */ - UartCookie(std::string deviceFile, uint32_t baudrate, size_t maxReplyLen); - - virtual ~UartCookie(); - - uint32_t getBaudrate() const; - size_t getMaxReplyLen() const; - std::string getDeviceFile() const; - Parity getParity() const; - uint8_t getBitsPerWord() const; - StopBits getStopBits() const; - - /** - * Functions two enable parity checking. - */ - void setParityOdd(); - void setParityEven(); - - /** - * Function two set number of bits per UART frame. - */ - void setBitsPerWord(uint8_t bitsPerWord_); - - /** - * Function to specify the number of stopbits. - */ - void setTwoStopBits(); - void setOneStopBit(); - - -private: - - std::string deviceFile; - uint32_t baudrate; - size_t maxReplyLen = 0; - Parity parity = Parity::NONE; - uint8_t bitsPerWord = 8; - StopBits stopBits = StopBits::ONE_STOP_BIT; -}; - -#endif diff --git a/misc/archive/GPIORPi.cpp b/misc/archive/GPIORPi.cpp index 74b67a42..34d0f69a 100644 --- a/misc/archive/GPIORPi.cpp +++ b/misc/archive/GPIORPi.cpp @@ -1,7 +1,6 @@ #include "GPIORPi.h" -#include - #include +#include #include ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin, diff --git a/misc/archive/GyroL3GD20Handler.cpp b/misc/archive/GyroL3GD20Handler.cpp new file mode 100644 index 00000000..a2850dfa --- /dev/null +++ b/misc/archive/GyroL3GD20Handler.cpp @@ -0,0 +1,260 @@ +//#include "GyroL3GD20Handler.h" +//#include +// +//#include +// +//GyroHandlerL3GD20H::GyroHandlerL3GD20H(object_id_t objectId, object_id_t deviceCommunication, +// CookieIF *comCookie): +// DeviceHandlerBase(objectId, deviceCommunication, comCookie), +// dataset(this) { +//#if L3GD20_GYRO_DEBUG == 1 +// debugDivider = new PeriodicOperationDivider(5); +//#endif +//} +// +//GyroHandlerL3GD20H::~GyroHandlerL3GD20H() {} +// +//void GyroHandlerL3GD20H::doStartUp() { +// if(internalState == InternalState::NONE) { +// internalState = InternalState::CONFIGURE; +// } +// +// if(internalState == InternalState::CONFIGURE) { +// if(commandExecuted) { +// internalState = InternalState::CHECK_REGS; +// commandExecuted = false; +// } +// } +// +// if(internalState == InternalState::CHECK_REGS) { +// if(commandExecuted) { +// internalState = InternalState::NORMAL; +//#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1 +// setMode(MODE_NORMAL); +//#else +// setMode(_MODE_TO_ON); +//#endif +// commandExecuted = false; +// } +// } +//} +// +//void GyroHandlerL3GD20H::doShutDown() { +// setMode(_MODE_POWER_DOWN); +//} +// +//ReturnValue_t GyroHandlerL3GD20H::buildTransitionDeviceCommand(DeviceCommandId_t *id) { +// switch(internalState) { +// case(InternalState::NONE): +// case(InternalState::NORMAL): { +// return HasReturnvaluesIF::RETURN_OK; +// } +// case(InternalState::CONFIGURE): { +// *id = L3GD20H::CONFIGURE_CTRL_REGS; +// uint8_t command [5]; +// command[0] = L3GD20H::CTRL_REG_1_VAL; +// command[1] = L3GD20H::CTRL_REG_2_VAL; +// command[2] = L3GD20H::CTRL_REG_3_VAL; +// command[3] = L3GD20H::CTRL_REG_4_VAL; +// command[4] = L3GD20H::CTRL_REG_5_VAL; +// return buildCommandFromCommand(*id, command, 5); +// } +// case(InternalState::CHECK_REGS): { +// *id = L3GD20H::READ_REGS; +// return buildCommandFromCommand(*id, nullptr, 0); +// } +// default: +// /* Might be a configuration error. */ +// sif::debug << "GyroHandler::buildTransitionDeviceCommand: Unknown internal state!" << +// std::endl; +// return HasReturnvaluesIF::RETURN_OK; +// } +// return HasReturnvaluesIF::RETURN_OK; +//} +// +//ReturnValue_t GyroHandlerL3GD20H::buildNormalDeviceCommand(DeviceCommandId_t *id) { +// *id = L3GD20H::READ_REGS; +// return buildCommandFromCommand(*id, nullptr, 0); +//} +// +//ReturnValue_t GyroHandlerL3GD20H::buildCommandFromCommand( +// DeviceCommandId_t deviceCommand, const uint8_t *commandData, +// size_t commandDataLen) { +// switch(deviceCommand) { +// case(L3GD20H::READ_REGS): { +// commandBuffer[0] = L3GD20H::READ_START | L3GD20H::AUTO_INCREMENT_MASK | +// L3GD20H::READ_MASK; +// +// std::memset(commandBuffer + 1, 0, L3GD20H::READ_LEN); +// rawPacket = commandBuffer; +// rawPacketLen = L3GD20H::READ_LEN + 1; +// break; +// } +// case(L3GD20H::CONFIGURE_CTRL_REGS): { +// commandBuffer[0] = L3GD20H::CTRL_REG_1 | L3GD20H::AUTO_INCREMENT_MASK; +// if(commandData == nullptr or commandDataLen != 5) { +// return DeviceHandlerIF::INVALID_COMMAND_PARAMETER; +// } +// +// ctrlReg1Value = commandData[0]; +// ctrlReg2Value = commandData[1]; +// ctrlReg3Value = commandData[2]; +// ctrlReg4Value = commandData[3]; +// ctrlReg5Value = commandData[4]; +// +// bool fsH = ctrlReg4Value & L3GD20H::SET_FS_1; +// bool fsL = ctrlReg4Value & L3GD20H::SET_FS_0; +// +// if(not fsH and not fsL) { +// scaleFactor = static_cast(L3GD20H::RANGE_DPS_00) / INT16_MAX; +// } +// else if(not fsH and fsL) { +// scaleFactor = static_cast(L3GD20H::RANGE_DPS_01) / INT16_MAX; +// } +// else { +// scaleFactor = static_cast(L3GD20H::RANGE_DPS_11) / INT16_MAX; +// } +// +// commandBuffer[1] = ctrlReg1Value; +// commandBuffer[2] = ctrlReg2Value; +// commandBuffer[3] = ctrlReg3Value; +// commandBuffer[4] = ctrlReg4Value; +// commandBuffer[5] = ctrlReg5Value; +// +// rawPacket = commandBuffer; +// rawPacketLen = 6; +// break; +// } +// case(L3GD20H::READ_CTRL_REGS): { +// commandBuffer[0] = L3GD20H::READ_START | L3GD20H::AUTO_INCREMENT_MASK | +// L3GD20H::READ_MASK; +// +// std::memset(commandBuffer + 1, 0, 5); +// rawPacket = commandBuffer; +// rawPacketLen = 6; +// break; +// } +// default: +// return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; +// } +// return HasReturnvaluesIF::RETURN_OK; +//} +// +//ReturnValue_t GyroHandlerL3GD20H::scanForReply(const uint8_t *start, size_t len, +// DeviceCommandId_t *foundId, size_t *foundLen) { +// /* For SPI, the ID will always be the one of the last sent command. */ +// *foundId = this->getPendingCommand(); +// *foundLen = this->rawPacketLen; +// +// /* Data with SPI Interface has always this answer */ +// if (start[0] == 0b11111111) { +// return HasReturnvaluesIF::RETURN_OK; +// } +// return DeviceHandlerIF::INVALID_DATA; +//} +// +//ReturnValue_t GyroHandlerL3GD20H::interpretDeviceReply(DeviceCommandId_t id, +// const uint8_t *packet) { +// ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; +// switch(id) { +// case(L3GD20H::CONFIGURE_CTRL_REGS): { +// commandExecuted = true; +// break; +// } +// case(L3GD20H::READ_CTRL_REGS): { +// if(packet[1] == ctrlReg1Value and packet[2] == ctrlReg2Value and +// packet[3] == ctrlReg3Value and packet[4] == ctrlReg4Value and +// packet[5] == ctrlReg5Value) { +// commandExecuted = true; +// } +// else { +// /* Attempt reconfiguration. */ +// internalState = InternalState::CONFIGURE; +// return DeviceHandlerIF::DEVICE_REPLY_INVALID; +// } +// break; +// } +// case(L3GD20H::READ_REGS): { +// if(packet[1] != ctrlReg1Value and packet[2] != ctrlReg2Value and +// packet[3] != ctrlReg3Value and packet[4] != ctrlReg4Value and +// packet[5] != ctrlReg5Value) { +// return DeviceHandlerIF::DEVICE_REPLY_INVALID; +// } +// else { +// if(internalState == InternalState::CHECK_REGS) { +// commandExecuted = true; +// } +// } +// +// statusReg = packet[L3GD20H::STATUS_IDX]; +// +// float angVelocX = (packet[L3GD20H::OUT_X_H] << 8 | +// packet[L3GD20H::OUT_X_L]) * scaleFactor; +// float angVelocY = (packet[L3GD20H::OUT_Y_H] << 8 | +// packet[L3GD20H::OUT_Y_L]) * scaleFactor; +// float angVelocZ = (packet[L3GD20H::OUT_Z_H] << 8 | +// packet[L3GD20H::OUT_Z_L]) * scaleFactor; +// +// int8_t temperaturOffset = (-1) * packet[L3GD20H::TEMPERATURE_IDX]; +// float temperature = 25.0 + temperaturOffset; +//#if L3GD20_GYRO_DEBUG == 1 +// if(debugDivider->checkAndIncrement()) { +// /* Set terminal to utf-8 if there is an issue with micro printout. */ +//#if FSFW_CPP_OSTREAM_ENABLED == 1 +// sif::info << "GyroHandlerL3GD20H: Angular velocities in degrees per second:" << +// std::endl; +// sif::info << "X: " << angVelocX << " \xC2\xB0" << std::endl; +// sif::info << "Y: " << angVelocY << " \xC2\xB0" << std::endl; +// sif::info << "Z: " << angVelocZ << " \xC2\xB0" << std::endl; +//#else +// sif::printInfo("GyroHandlerL3GD20H: Angular velocities in degrees per second:\n"); +// sif::printInfo("X: %f " "\xC2\xB0" "T\n", angVelocX); +// sif::printInfo("Y: %f " "\xC2\xB0" "T\n", angVelocY); +// sif::printInfo("Z: %f " "\xC2\xB0" "T\n", angVelocZ); +//#endif +// } +//#endif +// +// PoolReadGuard readSet(&dataset); +// if(readSet.getReadResult() == HasReturnvaluesIF::RETURN_OK) { +// dataset.angVelocX = angVelocX; +// dataset.angVelocY = angVelocY; +// dataset.angVelocZ = angVelocZ; +// dataset.temperature = temperature; +// dataset.setValidity(true, true); +// } +// break; +// } +// default: +// return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; +// } +// return result; +//} +// +// +//uint32_t GyroHandlerL3GD20H::getTransitionDelayMs(Mode_t from, Mode_t to) { +// return 10000; +//} +// +//ReturnValue_t GyroHandlerL3GD20H::initializeLocalDataPool( +// localpool::DataPool &localDataPoolMap, LocalDataPoolManager &poolManager) { +// localDataPoolMap.emplace(L3GD20H::ANG_VELOC_X, +// new PoolEntry({0.0})); +// localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Y, +// new PoolEntry({0.0})); +// localDataPoolMap.emplace(L3GD20H::ANG_VELOC_Z, +// new PoolEntry({0.0})); +// localDataPoolMap.emplace(L3GD20H::TEMPERATURE, +// new PoolEntry({0.0})); +// return HasReturnvaluesIF::RETURN_OK; +//} +// +//void GyroHandlerL3GD20H::fillCommandAndReplyMap() { +// insertInCommandAndReplyMap(L3GD20H::READ_REGS, 1, &dataset); +// insertInCommandAndReplyMap(L3GD20H::CONFIGURE_CTRL_REGS, 1); +// insertInCommandAndReplyMap(L3GD20H::READ_CTRL_REGS, 1); +//} +// +//void GyroHandlerL3GD20H::modeChanged() { +// internalState = InternalState::NONE; +//} diff --git a/misc/archive/GyroL3GD20Handler.h b/misc/archive/GyroL3GD20Handler.h new file mode 100644 index 00000000..b2e03b35 --- /dev/null +++ b/misc/archive/GyroL3GD20Handler.h @@ -0,0 +1,80 @@ +//#ifndef MISSION_DEVICES_GYROL3GD20HANDLER_H_ +//#define MISSION_DEVICES_GYROL3GD20HANDLER_H_ +// +//#include "devicedefinitions/GyroL3GD20Definitions.h" +//#include +// +//#include +//#include +// +// +///** +// * @brief Device Handler for the L3GD20H gyroscope sensor +// * (https://www.st.com/en/mems-and-sensors/l3gd20h.html) +// * @details +// * Advanced documentation: +// * https://egit.irs.uni-stuttgart.de/redmine/projects/eive-flight-manual/wiki/L3GD20H_Gyro +// * +// * Data is read big endian with the smallest possible range of 245 degrees per second. +// */ +//class GyroHandlerL3GD20H: public DeviceHandlerBase { +//public: +// GyroHandlerL3GD20H(object_id_t objectId, object_id_t deviceCommunication, +// CookieIF* comCookie); +// virtual ~GyroHandlerL3GD20H(); +// +//protected: +// +// /* DeviceHandlerBase overrides */ +// ReturnValue_t buildTransitionDeviceCommand( +// DeviceCommandId_t *id) override; +// void doStartUp() override; +// void doShutDown() override; +// ReturnValue_t buildNormalDeviceCommand( +// DeviceCommandId_t *id) override; +// ReturnValue_t buildCommandFromCommand( +// DeviceCommandId_t deviceCommand, const uint8_t *commandData, +// size_t commandDataLen) override; +// ReturnValue_t scanForReply(const uint8_t *start, size_t len, +// DeviceCommandId_t *foundId, size_t *foundLen) override; +// ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, +// const uint8_t *packet) override; +// +// void fillCommandAndReplyMap() override; +// void modeChanged() override; +// uint32_t getTransitionDelayMs(Mode_t from, Mode_t to) override; +// ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap, +// LocalDataPoolManager &poolManager) override; +// +//private: +// GyroPrimaryDataset dataset; +// +// enum class InternalState { +// NONE, +// CONFIGURE, +// CHECK_REGS, +// NORMAL +// }; +// InternalState internalState = InternalState::NONE; +// bool commandExecuted = false; +// +// uint8_t statusReg = 0; +// +// uint8_t ctrlReg1Value = L3GD20H::CTRL_REG_1_VAL; +// uint8_t ctrlReg2Value = L3GD20H::CTRL_REG_2_VAL; +// uint8_t ctrlReg3Value = L3GD20H::CTRL_REG_3_VAL; +// uint8_t ctrlReg4Value = L3GD20H::CTRL_REG_4_VAL; +// uint8_t ctrlReg5Value = L3GD20H::CTRL_REG_5_VAL; +// +// uint8_t commandBuffer[L3GD20H::READ_LEN + 1]; +// +// float scaleFactor = static_cast(L3GD20H::RANGE_DPS_00) / INT16_MAX; +// +//#if L3GD20_GYRO_DEBUG == 1 +// PeriodicOperationDivider* debugDivider = nullptr; +//#endif +//}; +// +// +// +//#endif /* MISSION_DEVICES_GYROL3GD20HANDLER_H_ */ diff --git a/Makefile b/misc/archive/Makefile similarity index 100% rename from Makefile rename to misc/archive/Makefile diff --git a/Makefile-Hosted b/misc/archive/Makefile-Hosted similarity index 100% rename from Makefile-Hosted rename to misc/archive/Makefile-Hosted diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index 6caf4a08..22a4a09c 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -19,20 +19,25 @@ - + + @@ -72,18 +77,19 @@ + @@ -121,11 +127,12 @@ - + @@ -183,6 +194,7 @@ @@ -220,6 +236,7 @@ + @@ -233,7 +250,7 @@ - +