eive-obsw/common/config/eive/definitions.h

136 lines
5.9 KiB
C
Raw Normal View History

#ifndef COMMON_CONFIG_DEFINITIONS_H_
#define COMMON_CONFIG_DEFINITIONS_H_
#include <cstdint>
namespace config {
2022-09-26 11:39:17 +02:00
static constexpr char SD_0_MOUNT_POINT[] = "/mnt/sd0";
static constexpr char SD_1_MOUNT_POINT[] = "/mnt/sd1";
static constexpr char OBSW_UPDATE_ARCHIVE_FILE_NAME[] = "eive-sw-update.tar.xz";
static constexpr char STRIPPED_OBSW_BINARY_FILE_NAME[] = "eive-obsw-stripped";
2022-09-26 11:50:35 +02:00
static constexpr char OBSW_VERSION_FILE_NAME[] = "obsw_version.txt";
static constexpr char PUS_SEQUENCE_COUNT_FILE[] = "pus-sequence-count.txt";
static constexpr char CFDP_SEQUENCE_COUNT_FILE[] = "cfdp-sequence-count.txt";
2022-09-26 11:39:17 +02:00
2022-09-26 12:26:08 +02:00
static constexpr char OBSW_PATH[] = "/usr/bin/eive-obsw";
static constexpr char OBSW_VERSION_FILE_PATH[] = "/usr/share/eive-obsw/obsw_version.txt";
2023-04-01 14:23:11 +02:00
// ISO8601 timestamp.
static constexpr char FILE_DATE_FORMAT[] = "%FT%H%M%SZ";
2024-03-05 09:06:48 +01:00
// Leap Seconds as of 2024-03-04
static constexpr uint16_t LEAP_SECONDS = 37;
2022-09-16 12:22:46 +02:00
static constexpr uint16_t EIVE_PUS_APID = 0x65;
static constexpr uint16_t EIVE_CFDP_APID = 0x66;
static constexpr uint16_t EIVE_LOCAL_CFDP_ENTITY_ID = EIVE_CFDP_APID;
static constexpr uint16_t EIVE_GROUND_CFDP_ENTITY_ID = 1;
2022-03-25 18:39:21 +01:00
static constexpr uint32_t PL_PCDU_TRANSITION_TIMEOUT_MS = 20 * 60 * 1000;
static constexpr uint32_t LONGEST_MODE_TIMEOUT_SECONDS = PL_PCDU_TRANSITION_TIMEOUT_MS / 1000;
2022-03-26 13:54:05 +01:00
/* Add mission configuration flags here */
static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50;
static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50;
static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50;
static constexpr uint8_t LIVE_TM = 0;
2023-10-13 15:10:52 +02:00
static constexpr size_t MAX_SPACEPACKET_TC_SIZE = 2048;
2022-03-27 10:44:32 +02:00
/* Limits for filename and path checks */
2023-05-11 20:21:44 +02:00
static constexpr uint32_t MAX_PATH_SIZE = 200;
static constexpr uint32_t MAX_FILENAME_SIZE = 100;
2022-03-27 10:44:32 +02:00
2022-10-12 15:19:21 +02:00
static constexpr uint32_t SA_DEPL_INIT_BUFFER_SECS = 120;
2022-10-13 15:59:56 +02:00
// Burn time for autonomous deployment
2022-10-14 20:37:02 +02:00
static constexpr uint32_t SA_DEPL_BURN_TIME_SECS = 180;
static constexpr uint32_t SA_DEPL_WAIT_TIME_SECS = 45 * 60;
// HW constraints (current limit) mean that the GPIO channels need to be switched on in alternation
2023-01-20 11:51:29 +01:00
static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5;
2022-10-13 15:59:56 +02:00
// Maximum allowed burn time allowed by the software.
2022-10-14 14:17:20 +02:00
static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180;
2022-10-12 15:19:21 +02:00
2023-10-18 17:24:44 +02:00
static constexpr size_t CFDP_MAX_FILE_SEGMENT_LEN = 900;
2023-01-23 11:52:46 +01:00
static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50;
static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4;
2023-03-10 02:05:51 +01:00
static constexpr uint32_t VC0_LIVE_TM_QUEUE_SIZE = 300;
// There are three individual log stores!
static constexpr uint32_t MISC_STORE_QUEUE_SIZE = 200;
static constexpr uint32_t OK_STORE_QUEUE_SIZE = 350;
static constexpr uint32_t NOK_STORE_QUEUE_SIZE = 350;
static constexpr uint32_t HK_STORE_QUEUE_SIZE = 300;
static constexpr uint32_t CFDP_STORE_QUEUE_SIZE = 300;
2023-01-23 11:52:46 +01:00
2023-09-14 10:38:43 +02:00
static constexpr uint32_t LIVE_CHANNEL_NORMAL_QUEUE_SIZE = 250;
2023-10-18 17:24:44 +02:00
static constexpr uint32_t LIVE_CHANNEL_CFDP_QUEUE_SIZE = 350;
2023-09-11 20:16:54 +02:00
static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_SRC_HANDLER = 10;
2023-09-06 13:40:38 +02:00
static constexpr uint32_t CFDP_MAX_FSM_CALL_COUNT_DEST_HANDLER = 300;
2023-10-18 12:24:22 +02:00
static constexpr uint32_t CFDP_SHORT_DELAY_MS = 40;
2023-09-06 13:40:38 +02:00
static constexpr uint32_t CFDP_REGULAR_DELAY_MS = 200;
2023-01-27 11:02:04 +01:00
static constexpr uint32_t MAX_PUS_FUNNEL_QUEUE_DEPTH = 100;
2023-10-18 17:24:44 +02:00
static constexpr uint32_t MAX_CFDP_FUNNEL_QUEUE_DEPTH = LIVE_CHANNEL_CFDP_QUEUE_SIZE;
2023-06-09 14:25:59 +02:00
static constexpr uint32_t VERIFICATION_SERVICE_QUEUE_DEPTH = 120;
2023-03-26 20:05:24 +02:00
static constexpr uint32_t HK_SERVICE_QUEUE_DEPTH = 60;
2023-06-07 16:21:51 +02:00
static constexpr uint32_t ACTION_SERVICE_QUEUE_DEPTH = 60;
2023-01-27 11:02:04 +01:00
2023-09-06 13:40:38 +02:00
static constexpr uint32_t UDP_MAX_STORED_CMDS = 200;
static constexpr uint32_t UDP_MSG_QUEUE_DEPTH = UDP_MAX_STORED_CMDS;
2023-10-18 17:24:44 +02:00
static constexpr uint32_t TCP_MAX_STORED_CMDS = 350;
2023-09-06 13:40:38 +02:00
static constexpr uint32_t TCP_MSG_QUEUE_DEPTH = TCP_MAX_STORED_CMDS;
static constexpr uint32_t TCP_MAX_NUMBER_TMS_SENT_PER_CYCLE = TCP_MSG_QUEUE_DEPTH;
2023-01-27 11:02:04 +01:00
2023-03-01 23:17:33 +01:00
namespace spiSched {
2023-02-08 16:45:19 +01:00
static constexpr uint32_t SCHED_BLOCK_1_SUS_READ_MS = 15;
static constexpr uint32_t SCHED_BLOCK_2_SENSOR_READ_MS = 30;
2023-03-06 09:17:03 +01:00
static constexpr uint32_t SCHED_BLOCK_3_READ_IMTQ_MGM_MS = 43;
2023-02-19 12:25:26 +01:00
static constexpr uint32_t SCHED_BLOCK_4_ACS_CTRL_MS = 45;
2023-02-24 10:28:33 +01:00
static constexpr uint32_t SCHED_BLOCK_5_ACTUATOR_MS = 55;
2023-03-04 17:06:23 +01:00
static constexpr uint32_t SCHED_BLOCK_6_IMTQ_BLOCK_2_MS = 105;
2023-02-22 18:07:15 +01:00
static constexpr uint32_t SCHED_BLOCK_RTD = 150;
2023-02-19 12:25:26 +01:00
static constexpr uint32_t SCHED_BLOCK_7_RW_READ_MS = 300;
2023-03-01 23:17:33 +01:00
static constexpr uint32_t SCHED_BLOCK_8_PLPCDU_MS = 320;
static constexpr uint32_t SCHED_BLOCK_9_RAD_SENS_MS = 340;
2023-09-28 13:09:53 +02:00
static constexpr uint32_t SCHED_BLOCK_10_PWR_CTRL_MS = 350;
2023-02-08 16:45:19 +01:00
// 15 ms for FM
static constexpr float SCHED_BLOCK_1_PERIOD = static_cast<float>(SCHED_BLOCK_1_SUS_READ_MS) / 400.0;
static constexpr float SCHED_BLOCK_2_PERIOD =
static_cast<float>(SCHED_BLOCK_2_SENSOR_READ_MS) / 400.0;
2023-02-19 12:25:26 +01:00
static constexpr float SCHED_BLOCK_3_PERIOD =
static_cast<float>(SCHED_BLOCK_3_READ_IMTQ_MGM_MS) / 400.0;
static constexpr float SCHED_BLOCK_4_PERIOD = static_cast<float>(SCHED_BLOCK_4_ACS_CTRL_MS) / 400.0;
static constexpr float SCHED_BLOCK_5_PERIOD = static_cast<float>(SCHED_BLOCK_5_ACTUATOR_MS) / 400.0;
static constexpr float SCHED_BLOCK_6_PERIOD =
static_cast<float>(SCHED_BLOCK_6_IMTQ_BLOCK_2_MS) / 400.0;
2023-02-22 18:07:15 +01:00
static constexpr float SCHED_BLOCK_RTD_PERIOD = static_cast<float>(SCHED_BLOCK_RTD) / 400.0;
2023-03-01 23:17:33 +01:00
static constexpr float SCHED_BLOCK_7_PERIOD = static_cast<float>(SCHED_BLOCK_7_RW_READ_MS) / 400.0;
static constexpr float SCHED_BLOCK_8_PERIOD = static_cast<float>(SCHED_BLOCK_8_PLPCDU_MS) / 400.0;
static constexpr float SCHED_BLOCK_9_PERIOD = static_cast<float>(SCHED_BLOCK_9_RAD_SENS_MS) / 400.0;
2023-09-28 13:09:53 +02:00
static constexpr float SCHED_BLOCK_10_PERIOD =
static_cast<float>(SCHED_BLOCK_10_PWR_CTRL_MS) / 400.0;
2023-02-08 16:45:19 +01:00
2023-03-02 15:05:12 +01:00
} // namespace spiSched
2023-02-08 16:45:19 +01:00
2023-10-25 08:23:36 +02:00
namespace pdec {
2023-10-25 09:10:04 +02:00
// Pre FW v6.0.0
2023-10-25 08:23:36 +02:00
static constexpr uint32_t PDEC_CONFIG_BASE_ADDR_LEGACY = 0x24000000;
2023-10-25 09:10:04 +02:00
static constexpr uint32_t PDEC_RAM_ADDR_LEGACY = 0x26000000;
// Post FW v6.0.0
static constexpr uint32_t PDEC_CONFIG_BASE_ADDR = 0x4000000;
static constexpr uint32_t PDEC_RAM_ADDR = 0x7000000;
} // namespace pdec
2022-05-17 13:40:19 +02:00
} // namespace config
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */