From 41de3d1f00e9823f4a04ba44fca2a342c5a89d2a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 17 May 2021 16:22:51 +0200 Subject: [PATCH] common config files --- CMakeLists.txt | 4 +- .../fsfwconfig/objects/systemObjectList.h | 21 +------- bsp_hosted/fsfwconfig/returnvalues/classIds.h | 5 +- common/config/commonClassIds.h | 23 +++++++++ common/config/commonObjects.h | 49 +++++++++++++++++++ fsfwconfig/objects/systemObjectList.h | 40 +-------------- fsfwconfig/returnvalues/classIds.h | 11 +---- 7 files changed, 81 insertions(+), 72 deletions(-) create mode 100644 common/config/commonClassIds.h create mode 100644 common/config/commonObjects.h diff --git a/CMakeLists.txt b/CMakeLists.txt index f32d4e3e..ec57a867 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,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. @@ -94,7 +94,9 @@ if(TGT_BSP) else() # Required by FSFW library set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig") + set(FSFW_ADDITIONAL_INC_PATH "${COMMON_PATH}/config") endif() + # Set for lwgps library set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") 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/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/common/config/commonClassIds.h b/common/config/commonClassIds.h new file mode 100644 index 00000000..c42dda0f --- /dev/null +++ b/common/config/commonClassIds.h @@ -0,0 +1,23 @@ +#ifndef COMMON_CONFIG_COMMONCLASSIDS_H_ +#define COMMON_CONFIG_COMMONCLASSIDS_H_ + +#include +#include + +namespace CLASS_ID { +enum commonClassIds: uint8_t { + MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, + MGM_LIS3MDL, + MGM_RM3100, + PCDU_HANDLER, + HEATER_HANDLER, + SYRLINKS_HANDLER, + IMTQ_HANDLER, + PLOC_HANDLER, + SUS_HANDLER, + COMMON_CLASS_ID_END +}; + +} + +#endif /* COMMON_CONFIG_COMMONCLASSIDS_H_ */ diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h new file mode 100644 index 00000000..fd7e5a92 --- /dev/null +++ b/common/config/commonObjects.h @@ -0,0 +1,49 @@ +#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, + + /* 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/fsfwconfig/objects/systemObjectList.h b/fsfwconfig/objects/systemObjectList.h index 746e83cf..95730e09 100644 --- a/fsfwconfig/objects/systemObjectList.h +++ b/fsfwconfig/objects/systemObjectList.h @@ -3,6 +3,7 @@ #include #include +#include // The objects will be instantiated in the ID order namespace objects { @@ -11,12 +12,6 @@ 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, - PUS_SERVICE_3 = 0x51000300, PUS_SERVICE_5 = 0x51000400, PUS_SERVICE_6 = 0x51000500, @@ -36,39 +31,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, - 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, - /* Custom device handler */ PCDU_HANDLER = 0x44001000, SOLAR_ARRAY_DEPL_HANDLER = 0x44001001, diff --git a/fsfwconfig/returnvalues/classIds.h b/fsfwconfig/returnvalues/classIds.h index 50bb3cea..5b39df62 100644 --- a/fsfwconfig/returnvalues/classIds.h +++ b/fsfwconfig/returnvalues/classIds.h @@ -2,6 +2,7 @@ #define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ #include +#include /** * Source IDs starts at 73 for now @@ -10,18 +11,10 @@ */ namespace CLASS_ID { enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - MGM_LIS3MDL, - MGM_RM3100, + CLASS_ID_START = COMMON_CLASS_ID_END, LINUX_LIBGPIO_IF, LINUX_SPI_COM_IF, - PCDU_HANDLER, - HEATER_HANDLER, SA_DEPL_HANDLER, - SYRLINKS_HANDLER, - IMTQ_HANDLER, - PLOC_HANDLER, - SUS_HANDLER }; }