2021-07-13 08:32:14 +02:00
|
|
|
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_
|
|
|
|
#define MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_
|
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
|
|
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
2021-07-13 08:32:14 +02:00
|
|
|
#include <fsfw/globalfunctions/CRC.h>
|
|
|
|
#include <fsfw/serialize/SerializeAdapter.h>
|
|
|
|
#include <fsfw/timemanager/Clock.h>
|
2022-08-15 12:23:54 +02:00
|
|
|
#include <fsfw/tmtcpacket/ccsds/SpacePacketCreator.h>
|
2022-08-15 17:25:16 +02:00
|
|
|
#include <fsfw/tmtcpacket/ccsds/SpacePacketReader.h>
|
|
|
|
#include <linux/devices/devicedefinitions/PlocSupervisorDefinitions.h>
|
2022-04-11 16:52:50 +02:00
|
|
|
|
2022-04-10 18:46:39 +02:00
|
|
|
#include "linux/devices/devicedefinitions/SupvReturnValuesIF.h"
|
2022-08-15 17:25:16 +02:00
|
|
|
#include "mission/devices/devicedefinitions/SpBase.h"
|
2021-07-13 08:32:14 +02:00
|
|
|
|
2022-03-30 09:19:30 +02:00
|
|
|
namespace supv {
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
/** Command IDs */
|
|
|
|
static const DeviceCommandId_t NONE = 0;
|
|
|
|
static const DeviceCommandId_t GET_HK_REPORT = 1;
|
|
|
|
static const DeviceCommandId_t START_MPSOC = 3;
|
|
|
|
static const DeviceCommandId_t SHUTDOWN_MPSOC = 4;
|
|
|
|
static const DeviceCommandId_t SEL_MPSOC_BOOT_IMAGE = 5;
|
|
|
|
static const DeviceCommandId_t SET_BOOT_TIMEOUT = 6;
|
|
|
|
static const DeviceCommandId_t SET_MAX_RESTART_TRIES = 7;
|
|
|
|
static const DeviceCommandId_t RESET_MPSOC = 8;
|
|
|
|
static const DeviceCommandId_t SET_TIME_REF = 9;
|
2021-07-22 08:06:04 +02:00
|
|
|
static const DeviceCommandId_t DISABLE_PERIOIC_HK_TRANSMISSION = 10;
|
2021-07-24 13:57:05 +02:00
|
|
|
static const DeviceCommandId_t GET_BOOT_STATUS_REPORT = 11;
|
2021-07-27 12:02:30 +02:00
|
|
|
static const DeviceCommandId_t ENABLE_LATCHUP_ALERT = 15;
|
|
|
|
static const DeviceCommandId_t DISABLE_LATCHUP_ALERT = 16;
|
2021-07-28 08:38:36 +02:00
|
|
|
static const DeviceCommandId_t SET_ALERT_LIMIT = 18;
|
|
|
|
static const DeviceCommandId_t SET_ADC_ENABLED_CHANNELS = 21;
|
|
|
|
static const DeviceCommandId_t SET_ADC_WINDOW_AND_STRIDE = 22;
|
|
|
|
static const DeviceCommandId_t SET_ADC_THRESHOLD = 23;
|
|
|
|
static const DeviceCommandId_t GET_LATCHUP_STATUS_REPORT = 24;
|
|
|
|
static const DeviceCommandId_t COPY_ADC_DATA_TO_MRAM = 25;
|
|
|
|
static const DeviceCommandId_t RUN_AUTO_EM_TESTS = 28;
|
|
|
|
static const DeviceCommandId_t WIPE_MRAM = 29;
|
2021-08-29 07:31:34 +02:00
|
|
|
static const DeviceCommandId_t FIRST_MRAM_DUMP = 30;
|
2021-07-28 08:38:36 +02:00
|
|
|
static const DeviceCommandId_t SET_GPIO = 34;
|
|
|
|
static const DeviceCommandId_t READ_GPIO = 35;
|
|
|
|
static const DeviceCommandId_t RESTART_SUPERVISOR = 36;
|
2021-08-02 15:28:57 +02:00
|
|
|
static const DeviceCommandId_t FACTORY_RESET_CLEAR_ALL = 37;
|
2022-04-13 11:56:37 +02:00
|
|
|
static const DeviceCommandId_t LOGGING_REQUEST_COUNTERS = 38;
|
2021-08-02 15:28:57 +02:00
|
|
|
static const DeviceCommandId_t FACTORY_RESET_CLEAR_MIRROR = 40;
|
|
|
|
static const DeviceCommandId_t FACTORY_RESET_CLEAR_CIRCULAR = 41;
|
2021-08-31 11:20:21 +02:00
|
|
|
static const DeviceCommandId_t CONSECUTIVE_MRAM_DUMP = 43;
|
2022-04-06 07:10:20 +02:00
|
|
|
static const DeviceCommandId_t START_MPSOC_QUIET = 45;
|
|
|
|
static const DeviceCommandId_t SET_SHUTDOWN_TIMEOUT = 46;
|
|
|
|
static const DeviceCommandId_t FACTORY_FLASH = 47;
|
2022-04-10 18:46:39 +02:00
|
|
|
static const DeviceCommandId_t PERFORM_UPDATE = 48;
|
|
|
|
static const DeviceCommandId_t TERMINATE_SUPV_HELPER = 49;
|
2022-04-11 16:52:50 +02:00
|
|
|
static const DeviceCommandId_t ENABLE_AUTO_TM = 50;
|
|
|
|
static const DeviceCommandId_t DISABLE_AUTO_TM = 51;
|
2022-04-13 11:56:37 +02:00
|
|
|
static const DeviceCommandId_t LOGGING_REQUEST_EVENT_BUFFERS = 54;
|
|
|
|
static const DeviceCommandId_t LOGGING_CLEAR_COUNTERS = 55;
|
|
|
|
static const DeviceCommandId_t LOGGING_SET_TOPIC = 56;
|
2022-04-21 16:30:23 +02:00
|
|
|
static const DeviceCommandId_t REQUEST_ADC_REPORT = 57;
|
2022-04-28 11:27:28 +02:00
|
|
|
static const DeviceCommandId_t RESET_PL = 58;
|
2022-05-05 19:18:39 +02:00
|
|
|
static const DeviceCommandId_t ENABLE_NVMS = 59;
|
2022-05-23 12:05:42 +02:00
|
|
|
static const DeviceCommandId_t CONTINUE_UPDATE = 60;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
/** Reply IDs */
|
2022-05-05 19:18:39 +02:00
|
|
|
static const DeviceCommandId_t ACK_REPORT = 100;
|
|
|
|
static const DeviceCommandId_t EXE_REPORT = 101;
|
|
|
|
static const DeviceCommandId_t HK_REPORT = 102;
|
|
|
|
static const DeviceCommandId_t BOOT_STATUS_REPORT = 103;
|
|
|
|
static const DeviceCommandId_t LATCHUP_REPORT = 104;
|
|
|
|
static const DeviceCommandId_t LOGGING_REPORT = 105;
|
|
|
|
static const DeviceCommandId_t ADC_REPORT = 106;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
2022-04-13 11:56:37 +02:00
|
|
|
// Size of complete space packet (6 byte header + size of data + 2 byte CRC)
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint16_t SIZE_ACK_REPORT = 14;
|
|
|
|
static const uint16_t SIZE_EXE_REPORT = 14;
|
2022-04-11 16:52:50 +02:00
|
|
|
static const uint16_t SIZE_HK_REPORT = 52;
|
2022-04-06 07:10:20 +02:00
|
|
|
static const uint16_t SIZE_BOOT_STATUS_REPORT = 24;
|
|
|
|
static const uint16_t SIZE_LATCHUP_STATUS_REPORT = 31;
|
2022-05-04 12:49:43 +02:00
|
|
|
static const uint16_t SIZE_LOGGING_REPORT = 73;
|
2022-04-21 16:30:23 +02:00
|
|
|
static const uint16_t SIZE_ADC_REPORT = 72;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SpacePacket apids of telemetry packets
|
|
|
|
*/
|
|
|
|
static const uint16_t APID_ACK_SUCCESS = 0x200;
|
|
|
|
static const uint16_t APID_ACK_FAILURE = 0x201;
|
|
|
|
static const uint16_t APID_EXE_SUCCESS = 0x202;
|
|
|
|
static const uint16_t APID_EXE_FAILURE = 0x203;
|
|
|
|
static const uint16_t APID_HK_REPORT = 0x204;
|
|
|
|
static const uint16_t APID_BOOT_STATUS_REPORT = 0x205;
|
|
|
|
static const uint16_t APID_UPDATE_STATUS_REPORT = 0x206;
|
2022-04-21 16:30:23 +02:00
|
|
|
static const uint16_t APID_ADC_REPORT = 0x207;
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint16_t APID_LATCHUP_STATUS_REPORT = 0x208;
|
|
|
|
static const uint16_t APID_SOC_SYSMON = 0x209;
|
2021-07-31 08:32:57 +02:00
|
|
|
static const uint16_t APID_MRAM_DUMP_TM = 0x20A;
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint16_t APID_SRAM = 0x20B;
|
|
|
|
static const uint16_t APID_NOR_DATA = 0x20C;
|
|
|
|
static const uint16_t APID_DATA_LOGGER_DATA = 0x20D;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* APIDs of telecommand packets
|
|
|
|
*/
|
|
|
|
static const uint16_t APID_START_MPSOC = 0xA1;
|
|
|
|
static const uint16_t APID_SHUTWOWN_MPSOC = 0xA2;
|
|
|
|
static const uint16_t APID_SEL_MPSOC_BOOT_IMAGE = 0xA3;
|
|
|
|
static const uint16_t APID_SET_BOOT_TIMEOUT = 0xA4;
|
|
|
|
static const uint16_t APID_SET_MAX_RESTART_TRIES = 0xA5;
|
|
|
|
static const uint16_t APID_RESET_MPSOC = 0xA6;
|
2022-04-28 11:27:28 +02:00
|
|
|
static const uint16_t APID_RESET_PL = 0xA7;
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint16_t APID_GET_BOOT_STATUS_RPT = 0xA8;
|
2022-04-06 07:10:20 +02:00
|
|
|
static const uint16_t APID_PREPARE_UPDATE = 0xA9;
|
|
|
|
static const uint16_t APID_START_MPSOC_QUIET = 0xAA;
|
|
|
|
static const uint16_t APID_SET_SHUTDOWN_TIMEOUT = 0xAB;
|
|
|
|
static const uint16_t APID_FACTORY_FLASH = 0xAC;
|
2022-04-10 18:46:39 +02:00
|
|
|
static const uint16_t APID_ERASE_MEMORY = 0xB0;
|
|
|
|
static const uint16_t APID_WRITE_MEMORY = 0xB1;
|
|
|
|
static const uint16_t APID_CHECK_MEMORY = 0xB2;
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint16_t APID_SET_TIME_REF = 0xC2;
|
2021-07-22 08:06:04 +02:00
|
|
|
static const uint16_t APID_DISABLE_HK = 0xC3;
|
2022-04-11 16:52:50 +02:00
|
|
|
static const uint16_t APID_AUTO_TM = 0xC5;
|
2021-07-27 12:02:30 +02:00
|
|
|
static const uint16_t APID_ENABLE_LATCHUP_ALERT = 0xD0;
|
|
|
|
static const uint16_t APID_DISABLE_LATCHUP_ALERT = 0xD1;
|
|
|
|
static const uint16_t APID_SET_ALERT_LIMIT = 0xD3;
|
2022-04-28 14:29:23 +02:00
|
|
|
static const uint16_t APID_SET_ADC_ENABLED_CHANNELS = 0xE1;
|
|
|
|
static const uint16_t APID_SET_ADC_WINDOW_AND_STRIDE = 0xE2;
|
|
|
|
static const uint16_t APID_SET_ADC_THRESHOLD = 0xE3;
|
2021-07-27 12:02:30 +02:00
|
|
|
static const uint16_t APID_GET_LATCHUP_STATUS_REPORT = 0xD9;
|
|
|
|
static const uint16_t APID_COPY_ADC_DATA_TO_MRAM = 0xDA;
|
2022-04-21 16:30:23 +02:00
|
|
|
static const uint16_t APID_REQUEST_ADC_REPORT = 0xDB;
|
2022-05-05 19:18:39 +02:00
|
|
|
static const uint16_t APID_ENABLE_NVMS = 0xF0;
|
2021-07-27 12:02:30 +02:00
|
|
|
static const uint16_t APID_RUN_AUTO_EM_TESTS = 0xF2;
|
|
|
|
static const uint16_t APID_WIPE_MRAM = 0xF3;
|
|
|
|
static const uint16_t APID_DUMP_MRAM = 0xF4;
|
|
|
|
static const uint16_t APID_SET_GPIO = 0xF9;
|
|
|
|
static const uint16_t APID_READ_GPIO = 0xFA;
|
|
|
|
static const uint16_t APID_RESTART_SUPERVISOR = 0xFB;
|
|
|
|
static const uint16_t APID_FACTORY_RESET = 0xFC;
|
|
|
|
static const uint16_t APID_REQUEST_LOGGING_DATA = 0xFD;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
static const uint16_t APID_GET_HK_REPORT = 0xC6;
|
|
|
|
|
2021-08-01 17:11:32 +02:00
|
|
|
static const uint16_t APID_MASK = 0x3FF;
|
2021-08-08 15:02:59 +02:00
|
|
|
static const uint16_t SEQUENCE_COUNT_MASK = 0xFFF;
|
2021-08-01 17:11:32 +02:00
|
|
|
|
2021-07-13 08:32:14 +02:00
|
|
|
/** Offset from first byte in Space packet to first byte of data field */
|
|
|
|
static const uint8_t DATA_FIELD_OFFSET = 6;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Space packet length for fixed size packets. This is the size of the whole packet data
|
|
|
|
* field. For the length field in the space packet this size will be substracted by one.
|
|
|
|
*/
|
2022-01-17 15:58:27 +01:00
|
|
|
static const uint16_t LENGTH_EMPTY_TC = 2; // Only CRC will be transported with the data field
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
/** This is the maximum length of a space packet as defined by the TAS ICD */
|
|
|
|
static const size_t MAX_COMMAND_SIZE = 1024;
|
2021-07-31 08:32:57 +02:00
|
|
|
static const size_t MAX_DATA_CAPACITY = 1016;
|
|
|
|
/** This is the maximum size of a space packet for the supervisor */
|
|
|
|
static const size_t MAX_PACKET_SIZE = 1024;
|
|
|
|
|
|
|
|
static const uint8_t SPACE_PACKET_HEADER_LENGTH = 6;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
enum PoolIds : lp_id_t {
|
|
|
|
NUM_TMS,
|
|
|
|
TEMP_PS,
|
|
|
|
TEMP_PL,
|
2022-04-11 16:52:50 +02:00
|
|
|
HK_SOC_STATE,
|
2022-01-17 15:58:27 +01:00
|
|
|
NVM0_1_STATE,
|
|
|
|
NVM3_STATE,
|
|
|
|
MISSION_IO_STATE,
|
|
|
|
FMC_STATE,
|
|
|
|
NUM_TCS,
|
|
|
|
TEMP_SUP,
|
|
|
|
UPTIME,
|
|
|
|
CPULOAD,
|
|
|
|
AVAILABLEHEAP,
|
2022-04-11 16:52:50 +02:00
|
|
|
BR_SOC_STATE,
|
|
|
|
POWER_CYCLES,
|
2022-01-17 15:58:27 +01:00
|
|
|
BOOT_AFTER_MS,
|
|
|
|
BOOT_TIMEOUT_MS,
|
|
|
|
ACTIVE_NVM,
|
|
|
|
BP0_STATE,
|
|
|
|
BP1_STATE,
|
|
|
|
BP2_STATE,
|
2022-04-06 07:10:20 +02:00
|
|
|
BOOT_STATE,
|
|
|
|
BOOT_CYCLES,
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
LATCHUP_ID,
|
|
|
|
CNT0,
|
|
|
|
CNT1,
|
|
|
|
CNT2,
|
|
|
|
CNT3,
|
|
|
|
CNT4,
|
|
|
|
CNT5,
|
|
|
|
CNT6,
|
|
|
|
LATCHUP_RPT_TIME_SEC,
|
|
|
|
LATCHUP_RPT_TIME_MIN,
|
|
|
|
LATCHUP_RPT_TIME_HOUR,
|
|
|
|
LATCHUP_RPT_TIME_DAY,
|
|
|
|
LATCHUP_RPT_TIME_MON,
|
|
|
|
LATCHUP_RPT_TIME_YEAR,
|
|
|
|
LATCHUP_RPT_TIME_MSEC,
|
2022-04-11 16:52:50 +02:00
|
|
|
LATCHUP_RPT_IS_SET,
|
2022-04-13 11:56:37 +02:00
|
|
|
|
2022-04-22 08:55:57 +02:00
|
|
|
LATCHUP_HAPPENED_CNT_0,
|
|
|
|
LATCHUP_HAPPENED_CNT_1,
|
|
|
|
LATCHUP_HAPPENED_CNT_2,
|
|
|
|
LATCHUP_HAPPENED_CNT_3,
|
|
|
|
LATCHUP_HAPPENED_CNT_4,
|
|
|
|
LATCHUP_HAPPENED_CNT_5,
|
|
|
|
LATCHUP_HAPPENED_CNT_6,
|
|
|
|
ADC_DEVIATION_TRIGGERS_CNT,
|
|
|
|
TC_RECEIVED_CNT,
|
|
|
|
TM_AVAILABLE_CNT,
|
|
|
|
SUPERVISOR_BOOTS,
|
|
|
|
MPSOC_BOOTS,
|
|
|
|
MPSOC_BOOT_FAILED_ATTEMPTS,
|
|
|
|
MPSOC_POWER_UP,
|
|
|
|
MPSOC_UPDATES,
|
|
|
|
LAST_RECVD_TC,
|
2022-04-21 16:30:23 +02:00
|
|
|
|
|
|
|
ADC_RAW_0,
|
|
|
|
ADC_RAW_1,
|
|
|
|
ADC_RAW_2,
|
|
|
|
ADC_RAW_3,
|
|
|
|
ADC_RAW_4,
|
|
|
|
ADC_RAW_5,
|
|
|
|
ADC_RAW_6,
|
|
|
|
ADC_RAW_7,
|
|
|
|
ADC_RAW_8,
|
|
|
|
ADC_RAW_9,
|
|
|
|
ADC_RAW_10,
|
|
|
|
ADC_RAW_11,
|
|
|
|
ADC_RAW_12,
|
|
|
|
ADC_RAW_13,
|
|
|
|
ADC_RAW_14,
|
|
|
|
ADC_RAW_15,
|
|
|
|
ADC_ENG_0,
|
|
|
|
ADC_ENG_1,
|
|
|
|
ADC_ENG_2,
|
|
|
|
ADC_ENG_3,
|
|
|
|
ADC_ENG_4,
|
|
|
|
ADC_ENG_5,
|
|
|
|
ADC_ENG_6,
|
|
|
|
ADC_ENG_7,
|
|
|
|
ADC_ENG_8,
|
|
|
|
ADC_ENG_9,
|
|
|
|
ADC_ENG_10,
|
|
|
|
ADC_ENG_11,
|
|
|
|
ADC_ENG_12,
|
|
|
|
ADC_ENG_13,
|
|
|
|
ADC_ENG_14,
|
|
|
|
ADC_ENG_15
|
2021-07-13 08:32:14 +02:00
|
|
|
};
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
static constexpr uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
2021-07-13 08:32:14 +02:00
|
|
|
static const uint8_t HK_SET_ENTRIES = 13;
|
2022-04-06 17:27:44 +02:00
|
|
|
static const uint8_t BOOT_REPORT_SET_ENTRIES = 10;
|
2021-08-20 06:56:29 +02:00
|
|
|
static const uint8_t LATCHUP_RPT_SET_ENTRIES = 16;
|
2022-04-22 08:55:57 +02:00
|
|
|
static const uint8_t LOGGING_RPT_SET_ENTRIES = 16;
|
2022-04-21 16:30:23 +02:00
|
|
|
static const uint8_t ADC_RPT_SET_ENTRIES = 32;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
|
|
|
static const uint32_t HK_SET_ID = HK_REPORT;
|
2021-07-28 08:38:36 +02:00
|
|
|
static const uint32_t BOOT_REPORT_SET_ID = BOOT_STATUS_REPORT;
|
|
|
|
static const uint32_t LATCHUP_RPT_ID = LATCHUP_REPORT;
|
2022-05-07 12:01:05 +02:00
|
|
|
static const uint32_t LOGGING_RPT_ID = LOGGING_REPORT;
|
|
|
|
static const uint32_t ADC_REPORT_SET_ID = ADC_REPORT;
|
2021-07-13 08:32:14 +02:00
|
|
|
|
2022-04-19 13:33:37 +02:00
|
|
|
namespace recv_timeout {
|
2022-04-25 11:03:02 +02:00
|
|
|
// Erase memory can require up to 60 seconds for execution
|
|
|
|
static const uint32_t ERASE_MEMORY = 60000;
|
2022-04-27 16:08:17 +02:00
|
|
|
static const uint32_t UPDATE_STATUS_REPORT = 70000;
|
2022-04-25 11:03:02 +02:00
|
|
|
} // namespace recv_timeout
|
2022-04-19 13:33:37 +02:00
|
|
|
|
2021-07-13 08:32:14 +02:00
|
|
|
/**
|
2022-04-10 18:46:39 +02:00
|
|
|
* @brief This class creates a space packet containing only the header data and the CRC.
|
2021-07-13 08:32:14 +02:00
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class ApidOnlyPacket : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param apid The APID to set in the space packet.
|
|
|
|
*
|
|
|
|
* @note Sequence count of empty packet is always 1.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
ApidOnlyPacket(ploc::SpTcParams params, uint16_t apid) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(LENGTH_EMPTY_TC);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(apid);
|
2022-08-15 12:23:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket() {
|
2022-08-15 13:03:23 +02:00
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
2022-08-15 12:23:54 +02:00
|
|
|
}
|
2022-08-15 13:03:23 +02:00
|
|
|
return calcCrc();
|
2022-08-15 12:23:54 +02:00
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
private:
|
2021-07-13 08:32:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class can be used to generate the space packet selecting the boot image of
|
|
|
|
* of the MPSoC.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class MPSoCBootSelect : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
2022-05-17 13:40:19 +02:00
|
|
|
static const uint8_t NVM0 = 0;
|
|
|
|
static const uint8_t NVM1 = 1;
|
2022-05-13 18:37:16 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param mem The memory to boot from: NVM0 (0), NVM1 (1)
|
|
|
|
* @param bp0 Partition pin 0
|
|
|
|
* @param bp1 Partition pin 1
|
|
|
|
* @param bp2 Partition pin 2
|
2022-05-23 12:05:42 +02:00
|
|
|
*
|
|
|
|
* @note Selection of partitions is currently not supported.
|
2022-01-17 15:58:27 +01:00
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
MPSoCBootSelect(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SEL_MPSOC_BOOT_IMAGE);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 12:23:54 +02:00
|
|
|
return res;
|
|
|
|
}
|
2022-08-15 13:03:23 +02:00
|
|
|
initPacket(mem, bp0, bp1, bp2);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 6;
|
|
|
|
|
|
|
|
static const uint8_t MEM_OFFSET = 0;
|
|
|
|
static const uint8_t BP0_OFFSET = 1;
|
|
|
|
static const uint8_t BP1_OFFSET = 2;
|
|
|
|
static const uint8_t BP2_OFFSET = 3;
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint8_t mem = 0, uint8_t bp0 = 0, uint8_t bp1 = 0, uint8_t bp2 = 0) {
|
2022-08-15 12:23:54 +02:00
|
|
|
std::memcpy(payloadStart + MEM_OFFSET, &mem, sizeof(mem));
|
|
|
|
std::memcpy(payloadStart + BP0_OFFSET, &bp0, sizeof(bp0));
|
|
|
|
std::memcpy(payloadStart + BP1_OFFSET, &bp1, sizeof(bp1));
|
|
|
|
std::memcpy(payloadStart + BP2_OFFSET, &bp2, sizeof(bp2));
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-13 08:32:14 +02:00
|
|
|
};
|
|
|
|
|
2022-05-05 19:18:39 +02:00
|
|
|
/**
|
|
|
|
* @brief This class creates the command to enable or disable the NVMs connected to the
|
|
|
|
* supervisor.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class EnableNvms : public ploc::SpTcBase {
|
2022-05-05 19:18:39 +02:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param mem The memory to boot from: NVM0 (0), NVM1 (1)
|
|
|
|
* @param bp0 Partition pin 0
|
|
|
|
* @param bp1 Partition pin 1
|
|
|
|
* @param bp2 Partition pin 2
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
EnableNvms(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_ENABLE_NVMS);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t nvm01, uint8_t nvm3) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(nvm01, nvm3);
|
|
|
|
return calcCrc();
|
2022-05-05 19:18:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint8_t DATA_FIELD_LENGTH = 4;
|
|
|
|
static const uint8_t CRC_OFFSET = 2;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint8_t nvm01, uint8_t nvm3) {
|
|
|
|
payloadStart[0] = nvm01;
|
|
|
|
payloadStart[1] = nvm3;
|
2022-05-05 19:18:39 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-07-13 08:32:14 +02:00
|
|
|
/**
|
|
|
|
* @brief This class generates the space packet to update the time of the PLOC supervisor.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetTimeRef : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
SetTimeRef(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_TIME_REF);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(Clock::TimeOfDay_t* time) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
initPacket(time);
|
2022-08-15 13:03:23 +02:00
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-04-06 07:10:20 +02:00
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 10;
|
2022-01-17 15:58:27 +01:00
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
2022-04-06 07:10:20 +02:00
|
|
|
static const uint16_t SYNC = 0x8000;
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
void initPacket(Clock::TimeOfDay_t* time) {
|
|
|
|
size_t serializedSize = 0;
|
2022-08-15 13:03:23 +02:00
|
|
|
uint8_t* dataFieldPtr = payloadStart;
|
2022-04-06 07:10:20 +02:00
|
|
|
uint16_t milliseconds = static_cast<uint16_t>(time->usecond / 1000) | SYNC;
|
2022-04-10 18:46:39 +02:00
|
|
|
SerializeAdapter::serialize<uint16_t>(&milliseconds, &dataFieldPtr, &serializedSize,
|
2022-04-06 07:10:20 +02:00
|
|
|
sizeof(milliseconds), SerializeIF::Endianness::BIG);
|
|
|
|
uint8_t second = static_cast<uint8_t>(time->second);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-10 18:46:39 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&second, &dataFieldPtr, &serializedSize,
|
2022-04-06 07:10:20 +02:00
|
|
|
sizeof(time->second), SerializeIF::Endianness::BIG);
|
|
|
|
uint8_t minute = static_cast<uint8_t>(time->minute);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-10 18:46:39 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&minute, &dataFieldPtr, &serializedSize,
|
2022-04-06 07:10:20 +02:00
|
|
|
sizeof(time->minute), SerializeIF::Endianness::BIG);
|
|
|
|
uint8_t hour = static_cast<uint8_t>(time->hour);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-11 16:52:50 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&hour, &dataFieldPtr, &serializedSize, sizeof(time->hour),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-04-06 07:10:20 +02:00
|
|
|
uint8_t day = static_cast<uint8_t>(time->day);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-10 18:46:39 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&day, &dataFieldPtr, &serializedSize, sizeof(time->day),
|
2022-04-06 07:10:20 +02:00
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
uint8_t month = static_cast<uint8_t>(time->month);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-10 18:46:39 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&month, &dataFieldPtr, &serializedSize,
|
2022-04-06 07:10:20 +02:00
|
|
|
sizeof(time->month), SerializeIF::Endianness::BIG);
|
2022-04-06 17:27:44 +02:00
|
|
|
uint8_t year = static_cast<uint8_t>(time->year - 1900);
|
2022-01-17 15:58:27 +01:00
|
|
|
serializedSize = 0;
|
2022-04-11 16:52:50 +02:00
|
|
|
SerializeAdapter::serialize<uint8_t>(&year, &dataFieldPtr, &serializedSize, sizeof(time->year),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-13 08:32:14 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class can be used to generate the set boot timout command.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetBootTimeout : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param timeout The boot timeout in milliseconds.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetBootTimeout(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_BOOT_TIMEOUT);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
ReturnValue_t buildPacket(uint32_t timeout) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(timeout);
|
|
|
|
return calcCrc();
|
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
private:
|
2022-01-17 15:58:27 +01:00
|
|
|
/** boot timeout value (uint32_t) and crc (uint16_t) */
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 6;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint32_t timeout) {
|
2022-01-17 15:58:27 +01:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 13:03:23 +02:00
|
|
|
uint8_t* dataFieldPtr = payloadStart;
|
2022-04-11 16:52:50 +02:00
|
|
|
SerializeAdapter::serialize<uint32_t>(&timeout, &dataFieldPtr, &serializedSize, sizeof(timeout),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-13 08:32:14 +02:00
|
|
|
};
|
|
|
|
|
2021-07-22 08:06:04 +02:00
|
|
|
/**
|
|
|
|
* @brief This class can be used to generate the space packet to set the maximum boot tries.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetRestartTries : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param restartTries Maximum restart tries to set.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetRestartTries(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_MAX_RESTART_TRIES);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t restartTries) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(restartTries);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t restartTries = 0;
|
|
|
|
|
|
|
|
/** Restart tries value (uint8_t) and crc (uint16_t) */
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 3;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t restartTries) { payloadStart[0] = restartTries; }
|
2021-07-22 08:06:04 +02:00
|
|
|
};
|
|
|
|
|
2021-07-26 12:08:38 +02:00
|
|
|
/**
|
|
|
|
* @brief With this class the space packet can be generated to disable to periodic transmission
|
|
|
|
* of housekeeping data. Normally, this will be disabled by default. However, adding this
|
|
|
|
* command can be useful for debugging.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class DisablePeriodicHkTransmission : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
DisablePeriodicHkTransmission(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_DISABLE_HK);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket() {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
initPacket();
|
2022-08-15 13:03:23 +02:00
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
/** Restart tries value (uint8_t) and crc (uint16_t) */
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 3;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket() { payloadStart[0] = false; }
|
2021-07-26 12:08:38 +02:00
|
|
|
};
|
|
|
|
|
2021-07-27 12:02:30 +02:00
|
|
|
/**
|
|
|
|
* @brief This class packages the command to enable of disable the latchup alert.
|
|
|
|
*
|
|
|
|
* @details There are 7 different latchup alerts.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class LatchupAlert : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param state true - enable, false - disable
|
|
|
|
* @param latchupId Identifies the latchup to enable/disable (0 - 0.85V, 1 - 1.8V, 2 - MISC,
|
|
|
|
* 3 - 3.3V, 4 - NVM_4XO, 5 - MISSION, 6 - SAFECOTS)
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
LatchupAlert(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(bool state, uint8_t latchupId) {
|
2022-01-17 15:58:27 +01:00
|
|
|
if (state) {
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_ENABLE_LATCHUP_ALERT);
|
2022-01-17 15:58:27 +01:00
|
|
|
} else {
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_DISABLE_LATCHUP_ALERT);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2022-08-15 13:03:23 +02:00
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(latchupId);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 3;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint8_t latchupId = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t latchupId) { payloadStart[0] = latchupId; }
|
2021-07-26 16:30:20 +02:00
|
|
|
};
|
|
|
|
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetAlertlimit : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param latchupId Identifies the latchup alert to calibrate (0 - 0.85V, 1 - 1.8V, 2 - MISC,
|
|
|
|
* 3 - 3.3V, 4 - NVM_4XO, 5 - MISSION, 6 - SAFECOTS)
|
|
|
|
* @param dutycycle
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetAlertlimit(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_ALERT_LIMIT);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
ReturnValue_t buildPacket(uint8_t latchupId, uint32_t dutycycle) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
res = initPacket(latchupId, dutycycle);
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
return calcCrc();
|
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 7;
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint8_t latchupId = 0;
|
|
|
|
uint32_t dutycycle = 0;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
ReturnValue_t initPacket(uint8_t latchupId, uint32_t dutycycle) {
|
|
|
|
payloadStart[0] = latchupId;
|
|
|
|
size_t serLen = 0;
|
|
|
|
return SerializeAdapter::serialize<uint32_t>(&dutycycle, payloadStart + 1, &serLen,
|
2022-08-15 17:25:16 +02:00
|
|
|
sizeof(dutycycle), SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-28 08:38:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to enable or disable ADC channels.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetAdcEnabledChannels : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param ch Defines channels to be enabled or disabled.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetAdcEnabledChannels(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_ADC_ENABLED_CHANNELS);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint16_t ch) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
2022-08-15 17:25:16 +02:00
|
|
|
if (res != result::OK) {
|
2022-08-15 13:03:23 +02:00
|
|
|
return res;
|
|
|
|
}
|
2022-08-15 17:25:16 +02:00
|
|
|
initPacket(ch);
|
2022-08-15 13:03:23 +02:00
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 4;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint16_t ch) {
|
2022-01-17 15:58:27 +01:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 13:03:23 +02:00
|
|
|
SerializeAdapter::serialize(&ch, &payloadStart, &serializedSize, sizeof(ch),
|
2022-08-15 17:25:16 +02:00
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-28 08:38:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to configures the window size and striding step of
|
|
|
|
* the moving average filter applied to the ADC readings.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetAdcWindowAndStride : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param windowSize
|
|
|
|
* @param stridingStepSize
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetAdcWindowAndStride(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_SET_ADC_WINDOW_AND_STRIDE);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
ReturnValue_t buildPacket(uint16_t windowSize, uint16_t stridingStepSize) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(windowSize, stridingStepSize);
|
|
|
|
return calcCrc();
|
|
|
|
}
|
2022-01-17 15:58:27 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 6;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint16_t windowSize, uint16_t stridingStepSize) {
|
2022-01-17 15:58:27 +01:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 13:03:23 +02:00
|
|
|
uint8_t* data = payloadStart;
|
2022-08-15 17:25:16 +02:00
|
|
|
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, sizeof(windowSize),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, sizeof(stridingStepSize),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-28 08:38:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to set the ADC trigger threshold.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetAdcThreshold : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param threshold
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetAdcThreshold(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_SET_ADC_THRESHOLD);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint32_t threshold) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(threshold);
|
|
|
|
return calcCrc();
|
|
|
|
}
|
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 6;
|
|
|
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
2022-08-15 13:03:23 +02:00
|
|
|
void initPacket(uint32_t threshold) {
|
2022-01-17 15:58:27 +01:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
SerializeAdapter::serialize(&threshold, payloadStart, &serializedSize, sizeof(threshold),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-28 11:55:16 +02:00
|
|
|
};
|
|
|
|
|
2021-07-28 19:34:10 +02:00
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to run auto EM tests.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class RunAutoEmTests : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param test 1 - complete EM test, 2 - Short test (only memory readback NVM0,1,3)
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
RunAutoEmTests(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
2022-08-15 13:03:23 +02:00
|
|
|
spParams.creator.setApid(APID_RUN_AUTO_EM_TESTS);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
ReturnValue_t buildPacket(uint8_t test) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(test);
|
|
|
|
return calcCrc();
|
|
|
|
}
|
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 3;
|
|
|
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint8_t test = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t test) { payloadStart[0] = test; }
|
2021-07-28 19:34:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to wipe or dump parts of the MRAM.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class MramCmd : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
enum class MramAction { WIPE, DUMP };
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param start Start address of the MRAM section to wipe or dump
|
|
|
|
* @param stop End address of the MRAM section to wipe or dump
|
|
|
|
* @param action Dump or wipe MRAM
|
|
|
|
*
|
|
|
|
* @note The content at the stop address is excluded from the dump or wipe operation.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
MramCmd(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint32_t start, uint32_t stop, MramAction action) {
|
2022-01-17 15:58:27 +01:00
|
|
|
if (action == MramAction::WIPE) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.creator.setApid(APID_WIPE_MRAM);
|
2022-01-17 15:58:27 +01:00
|
|
|
} else if (action == MramAction::DUMP) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.creator.setApid(APID_DUMP_MRAM);
|
2022-01-17 15:58:27 +01:00
|
|
|
} else {
|
|
|
|
sif::debug << "WipeMram: Invalid action specified";
|
|
|
|
}
|
2022-08-15 17:25:16 +02:00
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(start, stop);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 8;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint32_t start = 0;
|
|
|
|
uint32_t stop = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint32_t start, uint32_t stop) {
|
2022-01-17 15:58:27 +01:00
|
|
|
uint8_t concatBuffer[6];
|
|
|
|
concatBuffer[0] = static_cast<uint8_t>(start >> 16);
|
|
|
|
concatBuffer[1] = static_cast<uint8_t>(start >> 8);
|
|
|
|
concatBuffer[2] = static_cast<uint8_t>(start);
|
|
|
|
concatBuffer[3] = static_cast<uint8_t>(stop >> 16);
|
|
|
|
concatBuffer[4] = static_cast<uint8_t>(stop >> 8);
|
|
|
|
concatBuffer[5] = static_cast<uint8_t>(stop);
|
2022-08-15 17:25:16 +02:00
|
|
|
std::memcpy(payloadStart, concatBuffer, sizeof(concatBuffer));
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-07-28 08:38:36 +02:00
|
|
|
};
|
|
|
|
|
2021-08-02 15:28:57 +02:00
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet change the state of a GPIO. This command is only
|
|
|
|
* required for ground testing.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetGpio : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param port
|
|
|
|
* @param pin
|
|
|
|
* @param val
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
SetGpio(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_SET_GPIO);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t port, uint8_t pin, uint8_t val) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(port, pin, val);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 5;
|
|
|
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint8_t port = 0;
|
|
|
|
uint8_t pin = 0;
|
|
|
|
uint8_t val = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t port, uint8_t pin, uint8_t val) {
|
|
|
|
payloadStart[0] = port;
|
|
|
|
payloadStart[1] = pin;
|
|
|
|
payloadStart[2] = val;
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-08-02 15:28:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet causing the supervisor print the state of a GPIO
|
|
|
|
* to the debug output.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class ReadGpio : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param port
|
|
|
|
* @param pin
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
ReadGpio(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(DATA_FIELD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_READ_GPIO);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t port, uint8_t pin) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(port, pin);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DATA_FIELD_LENGTH = 4;
|
|
|
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
|
|
|
|
|
|
|
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
|
|
|
|
|
|
|
|
uint8_t port = 0;
|
|
|
|
uint8_t pin = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t port, uint8_t pin) {
|
|
|
|
payloadStart[0] = port;
|
|
|
|
payloadStart[1] = pin;
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-08-02 15:28:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet to perform the factory reset. The op parameter is
|
|
|
|
* optional.
|
|
|
|
*
|
|
|
|
* @details: Without OP: All MRAM entries will be cleared.
|
|
|
|
* OP = 0x01: Only the mirror entries will be wiped.
|
|
|
|
* OP = 0x02: Only the circular entries will be wiped.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class FactoryReset : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
enum class Op { CLEAR_ALL, MIRROR_ENTRIES, CIRCULAR_ENTRIES };
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param op
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
FactoryReset(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.creator.setApid(APID_FACTORY_RESET);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(Op op) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(op);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(Op op) {
|
|
|
|
size_t packetDataLen = 2;
|
2022-01-17 15:58:27 +01:00
|
|
|
switch (op) {
|
|
|
|
case Op::MIRROR_ENTRIES:
|
2022-08-15 17:25:16 +02:00
|
|
|
payloadStart[0] = 1;
|
|
|
|
packetDataLen = 3;
|
2022-01-17 15:58:27 +01:00
|
|
|
break;
|
|
|
|
case Op::CIRCULAR_ENTRIES:
|
2022-08-15 17:25:16 +02:00
|
|
|
payloadStart[0] = 2;
|
|
|
|
packetDataLen = 3;
|
2022-01-17 15:58:27 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setDataFieldLen(packetDataLen);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-08-02 15:28:57 +02:00
|
|
|
};
|
|
|
|
|
2022-08-15 18:34:26 +02:00
|
|
|
class SetShutdownTimeout : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
SetShutdownTimeout(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LEN);
|
|
|
|
spParams.creator.setApid(APID_SET_SHUTDOWN_TIMEOUT);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
ReturnValue_t buildPacket(uint32_t timeout) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(timeout);
|
|
|
|
return calcCrc();
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-08-15 17:25:16 +02:00
|
|
|
static const uint16_t PAYLOAD_LEN = 4; // uint32_t timeout
|
2022-04-11 16:52:50 +02:00
|
|
|
|
|
|
|
uint32_t timeout = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint32_t timeout) {
|
|
|
|
size_t serLen = 0;
|
|
|
|
SerializeAdapter::serialize(&timeout, payloadStart, &serLen, sizeof(timeout),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-08-05 16:37:39 +02:00
|
|
|
/**
|
2022-04-10 18:46:39 +02:00
|
|
|
* @brief Command to request CRC over memory region of the supervisor.
|
2021-08-05 16:37:39 +02:00
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class CheckMemory : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
2022-04-10 18:46:39 +02:00
|
|
|
* @param memoryId
|
|
|
|
* @param startAddress Start address of CRC calculation
|
|
|
|
* @param length Length in bytes of memory region
|
2022-01-17 15:58:27 +01:00
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
CheckMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_CHECK_MEMORY);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(memoryId, startAddress, length);
|
|
|
|
return calcCrc();
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-04-10 18:46:39 +02:00
|
|
|
static const uint16_t PAYLOAD_LENGTH = 10; // length without CRC field
|
2022-01-17 15:58:27 +01:00
|
|
|
|
2022-04-10 18:46:39 +02:00
|
|
|
uint8_t memoryId = 0;
|
|
|
|
uint8_t n = 1;
|
|
|
|
uint32_t startAddress = 0;
|
|
|
|
uint32_t length = 0;
|
2022-01-17 15:58:27 +01:00
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
|
|
|
uint8_t* data = payloadStart;
|
|
|
|
size_t serLen = 0;
|
|
|
|
SerializeAdapter::serialize(&memoryId, &data, &serLen, sizeof(memoryId),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&n, &data, &serLen, sizeof(n), SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&startAddress, &data, &serLen, sizeof(startAddress),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&length, &data, &serLen, sizeof(length),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-01-17 15:58:27 +01:00
|
|
|
}
|
2021-08-05 16:37:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class packages the space packet transporting a part of an MPSoC update.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class WriteMemory : public ploc::SpTcBase {
|
2022-01-17 15:58:27 +01:00
|
|
|
public:
|
2022-04-10 18:46:39 +02:00
|
|
|
/**
|
|
|
|
* @brief Constructor
|
|
|
|
*
|
|
|
|
* @param seqFlags Sequence flags
|
|
|
|
* @param sequenceCount Sequence count (first update packet expects 1 as sequence count)
|
|
|
|
* @param updateData Pointer to buffer containing update data
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
WriteMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.creator.setApid(APID_WRITE_MEMORY);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(ccsds::SequenceFlags seqFlags, uint16_t sequenceCount, uint8_t memoryId,
|
|
|
|
uint32_t startAddress, uint16_t length, uint8_t* updateData) {
|
|
|
|
if (length > CHUNK_MAX + 1) {
|
2022-04-10 18:46:39 +02:00
|
|
|
sif::error << "WriteMemory::WriteMemory: Invalid length" << std::endl;
|
2022-08-15 17:25:16 +02:00
|
|
|
return SerializeIF::BUFFER_TOO_SHORT;
|
|
|
|
}
|
|
|
|
spParams.creator.setSeqFlags(seqFlags);
|
|
|
|
spParams.creator.setSeqCount(sequenceCount);
|
|
|
|
initPacket(memoryId, startAddress, length, updateData);
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
2022-04-10 18:46:39 +02:00
|
|
|
}
|
2022-08-15 17:25:16 +02:00
|
|
|
return calcCrc();
|
2022-04-06 08:36:34 +02:00
|
|
|
}
|
2022-04-10 18:46:39 +02:00
|
|
|
// Although the space packet has space left for 1010 bytes of data to supervisor can only process
|
2022-04-24 12:34:08 +02:00
|
|
|
// update packets with a maximum of 512 bytes.
|
2022-04-10 18:46:39 +02:00
|
|
|
static const uint16_t CHUNK_MAX = 512;
|
2022-04-06 08:36:34 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t META_DATA_LENGTH = 8;
|
|
|
|
uint8_t n = 1;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
|
|
|
|
uint8_t* updateData) {
|
2022-04-06 08:36:34 +02:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
uint8_t* data = payloadStart;
|
|
|
|
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, sizeof(startAddr),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, sizeof(updateDataLen),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
std::memcpy(data, updateData, updateDataLen);
|
|
|
|
if (updateDataLen % 2 != 0) {
|
|
|
|
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1);
|
2022-04-10 18:46:39 +02:00
|
|
|
// The data field must be two bytes aligned. Thus, in case the number of bytes to write is odd
|
|
|
|
// a value of zero is added here
|
2022-08-15 17:25:16 +02:00
|
|
|
*(data + updateDataLen + 1) = 0;
|
|
|
|
} else {
|
|
|
|
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen);
|
2022-04-10 18:46:39 +02:00
|
|
|
}
|
2022-04-06 08:36:34 +02:00
|
|
|
}
|
2021-07-26 16:30:20 +02:00
|
|
|
};
|
|
|
|
|
2022-04-11 16:52:50 +02:00
|
|
|
/**
|
|
|
|
* @brief This class can be used to package the update available or update verify command.
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class EraseMemory : public ploc::SpTcBase {
|
2022-04-11 16:52:50 +02:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
EraseMemory(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_ERASE_MEMORY);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
initPacket(memoryId, startAddress, length);
|
|
|
|
return calcCrc();
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t PAYLOAD_LENGTH = 10; // length without CRC field
|
|
|
|
|
|
|
|
uint8_t memoryId = 0;
|
|
|
|
uint8_t n = 1;
|
|
|
|
uint32_t startAddress = 0;
|
|
|
|
uint32_t length = 0;
|
|
|
|
|
2022-08-15 17:25:16 +02:00
|
|
|
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
|
2022-04-11 16:52:50 +02:00
|
|
|
size_t serializedSize = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
uint8_t* data = payloadStart;
|
|
|
|
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-04-11 16:52:50 +02:00
|
|
|
serializedSize = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, sizeof(startAddress),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-04-11 16:52:50 +02:00
|
|
|
serializedSize = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
SerializeAdapter::serialize(&length, &data, &serializedSize, sizeof(length),
|
|
|
|
SerializeIF::Endianness::BIG);
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class creates the space packet to enable the auto TM generation
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class EnableAutoTm : public ploc::SpTcBase {
|
2022-04-11 16:52:50 +02:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
EnableAutoTm(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_AUTO_TM);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket() {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
payloadStart[0] = ENABLE;
|
|
|
|
return calcCrc();
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
|
|
|
|
static const uint8_t ENABLE = 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This class creates the space packet to disable the auto TM generation
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class DisableAutoTm : public ploc::SpTcBase {
|
2022-04-11 16:52:50 +02:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
DisableAutoTm(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_AUTO_TM);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket() {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
payloadStart[0] = DISABLE;
|
|
|
|
return calcCrc();
|
2022-04-11 16:52:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
|
|
|
|
static const uint8_t DISABLE = 0;
|
|
|
|
};
|
|
|
|
|
2022-04-13 11:56:37 +02:00
|
|
|
/**
|
|
|
|
* @brief This class creates the space packet to request the logging data from the supervisor
|
|
|
|
*/
|
2022-08-15 18:34:26 +02:00
|
|
|
class RequestLoggingData : public ploc::SpTcBase {
|
2022-04-13 11:56:37 +02:00
|
|
|
public:
|
|
|
|
enum class Sa : uint8_t {
|
|
|
|
REQUEST_COUNTERS = 1,
|
|
|
|
REQUEST_EVENT_BUFFERS = 2,
|
|
|
|
CLEAR_COUNTERS = 3,
|
|
|
|
SET_LOGGING_TOPIC = 4
|
|
|
|
};
|
|
|
|
|
2022-08-15 18:34:26 +02:00
|
|
|
RequestLoggingData(ploc::SpTcParams params) : ploc::SpTcBase(params) {
|
2022-08-15 17:25:16 +02:00
|
|
|
spParams.setPayloadLen(PAYLOAD_LENGTH);
|
|
|
|
spParams.creator.setApid(APID_REQUEST_LOGGING_DATA);
|
|
|
|
spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t buildPacket(Sa sa, uint8_t tpc = 0) {
|
|
|
|
auto res = checkSizeAndSerializeHeader();
|
|
|
|
if (res != result::OK) {
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
payloadStart[0] = static_cast<uint8_t>(sa);
|
|
|
|
payloadStart[1] = tpc;
|
|
|
|
return calcCrc();
|
2022-04-13 11:56:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint16_t PAYLOAD_LENGTH = 2; // length without CRC field
|
|
|
|
static const uint8_t TPC_OFFSET = 1;
|
|
|
|
};
|
|
|
|
|
2022-08-15 18:34:26 +02:00
|
|
|
class VerificationReport : public ploc::SpTmReader {
|
2022-04-25 11:03:02 +02:00
|
|
|
public:
|
2022-08-15 18:34:26 +02:00
|
|
|
VerificationReport(const uint8_t* buf, size_t maxSize) : ploc::SpTmReader(buf, maxSize) {}
|
2022-04-25 11:03:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Gets the APID of command which caused the transmission of this verification report.
|
|
|
|
*/
|
|
|
|
uint16_t getRefApid() {
|
|
|
|
uint16_t refApid = 0;
|
|
|
|
size_t size = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
const uint8_t* refApidPtr = this->getPacketData();
|
2022-04-29 23:22:44 +02:00
|
|
|
ReturnValue_t result =
|
|
|
|
SerializeAdapter::deSerialize(&refApid, refApidPtr, &size, SerializeIF::Endianness::BIG);
|
2022-04-25 11:03:02 +02:00
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
|
|
sif::debug << "ExecutionReport: Failed to deserialize reference APID field" << std::endl;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
return refApid;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16_t getStatusCode() {
|
|
|
|
uint16_t statusCode = 0;
|
|
|
|
size_t size = 0;
|
2022-08-15 17:25:16 +02:00
|
|
|
const uint8_t* statusCodePtr = this->getPacketData() + OFFSET_STATUS_CODE;
|
2022-04-25 11:03:02 +02:00
|
|
|
ReturnValue_t result = SerializeAdapter::deSerialize(&statusCode, statusCodePtr, &size,
|
|
|
|
SerializeIF::Endianness::BIG);
|
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
|
|
sif::debug << "ExecutionReport: Failed to deserialize status code field" << std::endl;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
return statusCode;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ReturnValue_t checkApid() { return HasReturnvaluesIF::RETURN_FAILED; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
static const uint8_t OFFSET_STATUS_CODE = 4;
|
|
|
|
};
|
|
|
|
|
|
|
|
class AcknowledgmentReport : public VerificationReport {
|
|
|
|
public:
|
2022-08-15 17:25:16 +02:00
|
|
|
AcknowledgmentReport(const uint8_t* buf, size_t maxSize) : VerificationReport(buf, maxSize) {}
|
2022-04-25 11:03:02 +02:00
|
|
|
|
|
|
|
ReturnValue_t checkApid() {
|
2022-08-15 17:25:16 +02:00
|
|
|
uint16_t apid = this->getApid();
|
2022-04-25 11:03:02 +02:00
|
|
|
if (apid == APID_ACK_SUCCESS) {
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
} else if (apid == APID_ACK_FAILURE) {
|
|
|
|
printStatusInformation();
|
|
|
|
return SupvReturnValuesIF::RECEIVED_ACK_FAILURE;
|
|
|
|
} else {
|
|
|
|
sif::warning << "AcknowledgmentReport::checkApid: Invalid apid: 0x" << std::hex << apid
|
|
|
|
<< std::endl;
|
|
|
|
return SupvReturnValuesIF::INVALID_APID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void printStatusInformation() {
|
|
|
|
StatusCode statusCode = static_cast<StatusCode>(getStatusCode());
|
|
|
|
switch (statusCode) {
|
|
|
|
case StatusCode::OK: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: Ok" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BAD_PARAM: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: Bad param" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TIMEOUT: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: Timeout" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::RX_ERROR: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: RX error" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TX_ERROR: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: TX error" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::HEADER_EMPTY: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: Header empty" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::DEFAULT_NAK: {
|
2022-04-29 23:22:44 +02:00
|
|
|
sif::warning << "Supervisor acknowledgment report status: Default code for nak"
|
|
|
|
<< std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::ROUTE_PACKET: {
|
|
|
|
sif::warning << "Supervisor acknowledgment report status: Route packet error" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
sif::warning << "AcknowledgmentReport::printStatusInformation: Invalid status code: 0x"
|
|
|
|
<< std::hex << static_cast<uint16_t>(statusCode) << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum class StatusCode : uint16_t {
|
|
|
|
OK = 0x0,
|
|
|
|
BAD_PARAM = 0x1,
|
|
|
|
TIMEOUT = 0x2,
|
|
|
|
RX_ERROR = 0x3,
|
|
|
|
TX_ERROR = 0x4,
|
|
|
|
HEADER_EMPTY = 0x5,
|
|
|
|
DEFAULT_NAK = 0x6,
|
|
|
|
ROUTE_PACKET = 0x7
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
class ExecutionReport : public VerificationReport {
|
|
|
|
public:
|
2022-08-15 17:25:16 +02:00
|
|
|
ExecutionReport(const uint8_t* buf, size_t maxSize) : VerificationReport(buf, maxSize) {}
|
2022-04-25 11:03:02 +02:00
|
|
|
|
|
|
|
ReturnValue_t checkApid() {
|
2022-08-15 17:25:16 +02:00
|
|
|
uint16_t apid = this->getApid();
|
2022-04-25 11:03:02 +02:00
|
|
|
if (apid == APID_EXE_SUCCESS) {
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
} else if (apid == APID_EXE_FAILURE) {
|
|
|
|
printStatusInformation();
|
|
|
|
return SupvReturnValuesIF::RECEIVED_EXE_FAILURE;
|
|
|
|
} else {
|
|
|
|
sif::warning << "ExecutionReport::checkApid: Invalid apid: 0x" << std::hex << apid
|
|
|
|
<< std::endl;
|
|
|
|
return SupvReturnValuesIF::INVALID_APID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-04-30 11:08:36 +02:00
|
|
|
static constexpr char STATUS_PRINTOUT_PREFIX[] = "Supervisor execution failure report status: ";
|
|
|
|
|
2022-04-25 11:03:02 +02:00
|
|
|
enum class StatusCode : uint16_t {
|
|
|
|
OK = 0x0,
|
|
|
|
INIT_ERROR = 0x1,
|
|
|
|
BAD_PARAM = 0x2,
|
|
|
|
NOT_INITIALIZED = 0x3,
|
|
|
|
BAD_PERIPH_ID = 0x4,
|
|
|
|
TIMEOUT = 0x5,
|
|
|
|
RX_ERROR = 0x6,
|
|
|
|
TX_ERROR = 0x7,
|
|
|
|
BUF_EMPTY = 0x8,
|
|
|
|
BUF_FULL = 0x9,
|
|
|
|
NAK = 0xA,
|
|
|
|
ARB_LOST = 0xB,
|
|
|
|
BUSY = 0xC,
|
|
|
|
NOT_IMPLEMENTED = 0xD,
|
|
|
|
ALIGNEMENT_ERROR = 0xE,
|
|
|
|
PERIPH_ERR = 0xF,
|
|
|
|
FAILED_LATCH = 0x10,
|
|
|
|
GPIO_HIGH = 0x11,
|
|
|
|
GPIO_LOW = 0x12,
|
|
|
|
TEST_PASSED = 0x13,
|
2022-04-29 09:03:13 +02:00
|
|
|
TEST_FAILED = 0x14,
|
|
|
|
NOTHING_TODO = 0x100,
|
|
|
|
POWER_FAULT = 0x101,
|
|
|
|
INVALID_LENGTH = 0x102,
|
|
|
|
OUT_OF_RANGE = 0x103,
|
|
|
|
OUT_OF_HEAP_MEMORY = 0x104,
|
|
|
|
INVALID_STATE_TRANSITION = 0x105,
|
2022-05-12 10:50:12 +02:00
|
|
|
MPSOC_ALREADY_BOOTING = 0x106,
|
|
|
|
MPSOC_ALREADY_OPERATIONAL = 0x107,
|
|
|
|
MPSOC_BOOT_FAILED = 0x108,
|
2022-04-29 09:03:13 +02:00
|
|
|
SP_NOT_AVAILABLE = 0x200,
|
|
|
|
SP_DATA_INSUFFICIENT = 0x201,
|
2022-04-29 23:22:44 +02:00
|
|
|
SP_MEMORY_ID_INVALID = 0x202,
|
|
|
|
MPSOC_NOT_IN_RESET = 0x203,
|
|
|
|
FLASH_INIT_FAILED = 0x204,
|
|
|
|
FLASH_ERASE_FAILED = 0x205,
|
|
|
|
FLASH_WRITE_FAILED = 0x206,
|
|
|
|
FLASH_VERIFY_FAILED = 0x207,
|
|
|
|
CANNOT_ACCESS_TM = 0x208,
|
|
|
|
CANNOT_SEND_TM = 0x209,
|
2022-04-29 09:03:13 +02:00
|
|
|
PG_LOW = 0x300,
|
|
|
|
PG_5V_LOW = 0x301,
|
|
|
|
PG_0V85_LOW = 0x302,
|
|
|
|
PG_1V8_LOW = 0x303,
|
|
|
|
PG_MISC_LOW = 0x304,
|
|
|
|
PG_3V3_LOW = 0x305,
|
2022-04-29 23:22:44 +02:00
|
|
|
PG_MB_VAIO_LOW = 0x306,
|
2022-04-29 09:03:13 +02:00
|
|
|
PG_MB_MPSOCIO_LOW = 0x307
|
2022-04-25 11:03:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
void printStatusInformation() {
|
|
|
|
StatusCode statusCode = static_cast<StatusCode>(getStatusCode());
|
|
|
|
switch (statusCode) {
|
|
|
|
case StatusCode::OK: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Ok" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::INIT_ERROR: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Init error" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BAD_PARAM: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Bad param" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::NOT_INITIALIZED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Not initialized" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BAD_PERIPH_ID: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Bad periph ID" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TIMEOUT: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Timeout" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::RX_ERROR: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "RX error" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TX_ERROR: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "TX error" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BUF_EMPTY: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Buf empty" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BUF_FULL: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Buf full" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::NAK: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Nak, default error code" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::ARB_LOST: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Arb lost" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::BUSY: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Busy" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::NOT_IMPLEMENTED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Not implemented" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::ALIGNEMENT_ERROR: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Alignment error" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PERIPH_ERR: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Periph error" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::FAILED_LATCH: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Failed latch" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::GPIO_HIGH: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "GPIO high" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::GPIO_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "GPIO low" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TEST_PASSED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Test passed" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::TEST_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Test failed" << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-04-29 09:03:13 +02:00
|
|
|
case StatusCode::NOTHING_TODO: {
|
2022-04-30 16:21:59 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Nothing todo, not an error but a warning"
|
|
|
|
<< std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::POWER_FAULT: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Power fault" << std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::INVALID_LENGTH: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Invalid length" << std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::OUT_OF_RANGE: {
|
2022-04-30 16:21:59 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Out of range, lenght check of parameter failed"
|
|
|
|
<< std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::OUT_OF_HEAP_MEMORY: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Out of heap memory" << std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::INVALID_STATE_TRANSITION: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Invalid state transition" << std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-05-12 10:50:12 +02:00
|
|
|
case StatusCode::MPSOC_ALREADY_BOOTING: {
|
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC already booting" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::MPSOC_ALREADY_OPERATIONAL: {
|
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC already operational" << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
2022-04-29 09:03:13 +02:00
|
|
|
case StatusCode::MPSOC_BOOT_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC boot failed" << std::endl;
|
2022-04-29 09:03:13 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-04-29 13:31:58 +02:00
|
|
|
case StatusCode::SP_NOT_AVAILABLE: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "SP not available" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-04-29 13:31:58 +02:00
|
|
|
case StatusCode::SP_DATA_INSUFFICIENT: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "SP data insufficient" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::SP_MEMORY_ID_INVALID: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "SP data insufficient" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::MPSOC_NOT_IN_RESET: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "MPSoC not in reset" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::FLASH_INIT_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash init failed" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::FLASH_ERASE_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash erase failed" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::FLASH_WRITE_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash write failed" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::FLASH_VERIFY_FAILED: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Flash verify failed" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::CANNOT_ACCESS_TM: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Can not access tm" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::CANNOT_SEND_TM: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "Can not access tm" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_5V_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 5V low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_0V85_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 0V85 low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_1V8_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 1V8 low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_MISC_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG misc low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_3V3_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG 3V3 low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_MB_VAIO_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG mb vaio low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case StatusCode::PG_MB_MPSOCIO_LOW: {
|
2022-04-30 11:08:36 +02:00
|
|
|
sif::warning << STATUS_PRINTOUT_PREFIX << "PG mb mpsocio low" << std::endl;
|
2022-04-29 23:22:44 +02:00
|
|
|
break;
|
|
|
|
}
|
2022-04-25 11:03:02 +02:00
|
|
|
default:
|
|
|
|
sif::warning << "ExecutionReport::printStatusInformation: Invalid status code: 0x"
|
|
|
|
<< std::hex << static_cast<uint16_t>(statusCode) << std::endl;
|
|
|
|
break;
|
|
|
|
}
|
2022-04-29 23:22:44 +02:00
|
|
|
}
|
2022-04-25 11:03:02 +02:00
|
|
|
};
|
|
|
|
|
2022-04-10 18:46:39 +02:00
|
|
|
/**
|
|
|
|
* @brief This dataset stores the boot status report of the supervisor.
|
|
|
|
*/
|
|
|
|
class BootStatusReport : public StaticLocalDataSet<BOOT_REPORT_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
BootStatusReport(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, BOOT_REPORT_SET_ID) {}
|
|
|
|
|
|
|
|
BootStatusReport(object_id_t objectId)
|
|
|
|
: StaticLocalDataSet(sid_t(objectId, BOOT_REPORT_SET_ID)) {}
|
|
|
|
|
|
|
|
/** Information about boot status of MPSoC */
|
2022-04-11 16:52:50 +02:00
|
|
|
lp_var_t<uint8_t> socState = lp_var_t<uint8_t>(sid.objectId, PoolIds::BR_SOC_STATE, this);
|
|
|
|
lp_var_t<uint8_t> powerCycles = lp_var_t<uint8_t>(sid.objectId, PoolIds::POWER_CYCLES, this);
|
2022-04-10 18:46:39 +02:00
|
|
|
/** Time the MPSoC needs for last boot */
|
|
|
|
lp_var_t<uint32_t> bootAfterMs = lp_var_t<uint32_t>(sid.objectId, PoolIds::BOOT_AFTER_MS, this);
|
|
|
|
/** The currently set boot timeout */
|
|
|
|
lp_var_t<uint32_t> bootTimeoutMs =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::BOOT_TIMEOUT_MS, this);
|
|
|
|
lp_var_t<uint8_t> activeNvm = lp_var_t<uint8_t>(sid.objectId, PoolIds::ACTIVE_NVM, this);
|
|
|
|
/** States of the boot partition pins */
|
|
|
|
lp_var_t<uint8_t> bp0State = lp_var_t<uint8_t>(sid.objectId, PoolIds::BP0_STATE, this);
|
|
|
|
lp_var_t<uint8_t> bp1State = lp_var_t<uint8_t>(sid.objectId, PoolIds::BP1_STATE, this);
|
|
|
|
lp_var_t<uint8_t> bp2State = lp_var_t<uint8_t>(sid.objectId, PoolIds::BP2_STATE, this);
|
|
|
|
lp_var_t<uint8_t> bootState = lp_var_t<uint8_t>(sid.objectId, PoolIds::BOOT_STATE, this);
|
|
|
|
lp_var_t<uint8_t> bootCycles = lp_var_t<uint8_t>(sid.objectId, PoolIds::BOOT_CYCLES, this);
|
|
|
|
};
|
|
|
|
|
2021-07-26 12:08:38 +02:00
|
|
|
/**
|
|
|
|
* @brief This dataset stores the housekeeping data of the supervisor.
|
|
|
|
*/
|
2022-01-17 15:58:27 +01:00
|
|
|
class HkSet : public StaticLocalDataSet<HK_SET_ENTRIES> {
|
|
|
|
public:
|
2022-05-05 19:18:39 +02:00
|
|
|
enum class SocState { OFF = 0, BOOTING = 1, OPERATIONAL = 3, SHUTDOWN = 4 };
|
2022-05-03 14:59:23 +02:00
|
|
|
|
2022-01-17 15:58:27 +01:00
|
|
|
HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {}
|
|
|
|
|
|
|
|
HkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, HK_SET_ID)) {}
|
|
|
|
|
|
|
|
lp_var_t<uint32_t> tempPs = lp_var_t<uint32_t>(sid.objectId, PoolIds::TEMP_PS, this);
|
|
|
|
lp_var_t<uint32_t> tempPl = lp_var_t<uint32_t>(sid.objectId, PoolIds::TEMP_PS, this);
|
|
|
|
lp_var_t<uint32_t> tempSup = lp_var_t<uint32_t>(sid.objectId, PoolIds::TEMP_SUP, this);
|
2022-04-06 07:10:20 +02:00
|
|
|
lp_var_t<uint64_t> uptime = lp_var_t<uint64_t>(sid.objectId, PoolIds::UPTIME, this);
|
2022-01-17 15:58:27 +01:00
|
|
|
lp_var_t<uint32_t> cpuLoad = lp_var_t<uint32_t>(sid.objectId, PoolIds::CPULOAD, this);
|
|
|
|
lp_var_t<uint32_t> availableHeap = lp_var_t<uint32_t>(sid.objectId, PoolIds::AVAILABLEHEAP, this);
|
|
|
|
lp_var_t<uint32_t> numTcs = lp_var_t<uint32_t>(sid.objectId, PoolIds::NUM_TCS, this);
|
|
|
|
lp_var_t<uint32_t> numTms = lp_var_t<uint32_t>(sid.objectId, PoolIds::NUM_TMS, this);
|
2022-04-11 16:52:50 +02:00
|
|
|
lp_var_t<uint32_t> socState = lp_var_t<uint32_t>(sid.objectId, PoolIds::HK_SOC_STATE, this);
|
2022-01-17 15:58:27 +01:00
|
|
|
lp_var_t<uint8_t> nvm0_1_state = lp_var_t<uint8_t>(sid.objectId, PoolIds::NVM0_1_STATE, this);
|
|
|
|
lp_var_t<uint8_t> nvm3_state = lp_var_t<uint8_t>(sid.objectId, PoolIds::NVM3_STATE, this);
|
|
|
|
lp_var_t<uint8_t> missionIoState =
|
|
|
|
lp_var_t<uint8_t>(sid.objectId, PoolIds::MISSION_IO_STATE, this);
|
|
|
|
lp_var_t<uint8_t> fmcState = lp_var_t<uint8_t>(sid.objectId, PoolIds::FMC_STATE, this);
|
2021-07-26 12:08:38 +02:00
|
|
|
};
|
2021-07-28 08:38:36 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This dataset stores the last requested latchup status report.
|
|
|
|
*/
|
2022-01-17 15:58:27 +01:00
|
|
|
class LatchupStatusReport : public StaticLocalDataSet<LATCHUP_RPT_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
LatchupStatusReport(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LATCHUP_RPT_ID) {}
|
|
|
|
|
|
|
|
LatchupStatusReport(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LATCHUP_RPT_ID)) {}
|
|
|
|
|
|
|
|
lp_var_t<uint8_t> id = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_ID, this);
|
|
|
|
lp_var_t<uint16_t> cnt0 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT0, this);
|
|
|
|
lp_var_t<uint16_t> cnt1 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT1, this);
|
|
|
|
lp_var_t<uint16_t> cnt2 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT2, this);
|
|
|
|
lp_var_t<uint16_t> cnt3 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT3, this);
|
|
|
|
lp_var_t<uint16_t> cnt4 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT4, this);
|
|
|
|
lp_var_t<uint16_t> cnt5 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT5, this);
|
|
|
|
lp_var_t<uint16_t> cnt6 = lp_var_t<uint16_t>(sid.objectId, PoolIds::CNT6, this);
|
2022-04-06 07:10:20 +02:00
|
|
|
lp_var_t<uint16_t> timeMsec =
|
|
|
|
lp_var_t<uint16_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_MSEC, this);
|
|
|
|
lp_var_t<uint8_t> timeSec = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_SEC, this);
|
|
|
|
lp_var_t<uint8_t> timeMin = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_MIN, this);
|
|
|
|
lp_var_t<uint8_t> timeHour =
|
|
|
|
lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_HOUR, this);
|
|
|
|
lp_var_t<uint8_t> timeDay = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_DAY, this);
|
|
|
|
lp_var_t<uint8_t> timeMon = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_MON, this);
|
|
|
|
lp_var_t<uint8_t> timeYear =
|
|
|
|
lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_YEAR, this);
|
2022-04-11 16:52:50 +02:00
|
|
|
lp_var_t<uint8_t> isSet = lp_var_t<uint8_t>(sid.objectId, PoolIds::LATCHUP_RPT_IS_SET, this);
|
2022-04-06 08:36:34 +02:00
|
|
|
|
2022-04-11 16:52:50 +02:00
|
|
|
static const uint8_t IS_SET_BIT_POS = 15;
|
2022-04-10 18:46:39 +02:00
|
|
|
};
|
|
|
|
|
2022-04-13 11:56:37 +02:00
|
|
|
/**
|
|
|
|
* @brief This dataset stores the logging report.
|
|
|
|
*/
|
|
|
|
class LoggingReport : public StaticLocalDataSet<LOGGING_RPT_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
LoggingReport(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, LOGGING_RPT_ID) {}
|
|
|
|
|
|
|
|
LoggingReport(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, LOGGING_RPT_ID)) {}
|
|
|
|
|
2022-04-22 08:55:57 +02:00
|
|
|
lp_var_t<uint32_t> latchupHappenCnt0 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_0, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt1 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_1, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt2 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_2, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt3 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_3, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt4 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_4, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt5 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_5, this);
|
|
|
|
lp_var_t<uint32_t> latchupHappenCnt6 =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_HAPPENED_CNT_6, this);
|
|
|
|
lp_var_t<uint32_t> adcDeviationTriggersCnt =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::ADC_DEVIATION_TRIGGERS_CNT, this);
|
|
|
|
lp_var_t<uint32_t> tcReceivedCnt =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::TC_RECEIVED_CNT, this);
|
|
|
|
lp_var_t<uint32_t> tmAvailableCnt =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::TM_AVAILABLE_CNT, this);
|
|
|
|
lp_var_t<uint32_t> supervisorBoots =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::SUPERVISOR_BOOTS, this);
|
2022-04-25 11:03:02 +02:00
|
|
|
lp_var_t<uint32_t> mpsocBoots = lp_var_t<uint32_t>(sid.objectId, PoolIds::MPSOC_BOOTS, this);
|
2022-04-22 08:55:57 +02:00
|
|
|
lp_var_t<uint32_t> mpsocBootFailedAttempts =
|
|
|
|
lp_var_t<uint32_t>(sid.objectId, PoolIds::MPSOC_BOOT_FAILED_ATTEMPTS, this);
|
2022-04-25 11:03:02 +02:00
|
|
|
lp_var_t<uint32_t> mpsocPowerup = lp_var_t<uint32_t>(sid.objectId, PoolIds::MPSOC_POWER_UP, this);
|
|
|
|
lp_var_t<uint32_t> mpsocUpdates = lp_var_t<uint32_t>(sid.objectId, PoolIds::MPSOC_UPDATES, this);
|
|
|
|
lp_var_t<uint32_t> lastRecvdTc = lp_var_t<uint32_t>(sid.objectId, PoolIds::LAST_RECVD_TC, this);
|
2022-04-13 11:56:37 +02:00
|
|
|
|
|
|
|
void printSet() {
|
2022-04-25 11:03:02 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 0: " << this->latchupHappenCnt0
|
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 1: " << this->latchupHappenCnt1
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 2: " << this->latchupHappenCnt2
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 3: " << this->latchupHappenCnt3
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 4: " << this->latchupHappenCnt4
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 5: " << this->latchupHappenCnt5
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: Latchup happened count 6: " << this->latchupHappenCnt6
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: ADC deviation triggers count: " << this->adcDeviationTriggersCnt
|
2022-04-25 11:03:02 +02:00
|
|
|
<< std::endl;
|
2022-04-22 08:55:57 +02:00
|
|
|
sif::info << "LoggingReport: TC received count: " << this->tcReceivedCnt << std::endl;
|
|
|
|
sif::info << "LoggingReport: TM available count: " << this->tmAvailableCnt << std::endl;
|
|
|
|
sif::info << "LoggingReport: Supervisor boots: " << this->supervisorBoots << std::endl;
|
|
|
|
sif::info << "LoggingReport: MPSoC boots: " << this->mpsocBoots << std::endl;
|
2022-04-25 11:03:02 +02:00
|
|
|
sif::info << "LoggingReport: MPSoC boot failed attempts: " << this->mpsocBootFailedAttempts
|
|
|
|
<< std::endl;
|
2022-04-22 08:55:57 +02:00
|
|
|
sif::info << "LoggingReport: MPSoC power up: " << this->mpsocPowerup << std::endl;
|
|
|
|
sif::info << "LoggingReport: MPSoC updates: " << this->mpsocUpdates << std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "LoggingReport: APID of last received TC: 0x" << std::hex << this->lastRecvdTc
|
|
|
|
<< std::endl;
|
2022-04-13 11:56:37 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-08-15 18:34:26 +02:00
|
|
|
class UpdateStatusReport : public ploc::SpTmReader {
|
2022-04-10 18:46:39 +02:00
|
|
|
public:
|
2022-08-15 17:25:16 +02:00
|
|
|
UpdateStatusReport() = default;
|
2022-08-15 18:34:26 +02:00
|
|
|
UpdateStatusReport(const uint8_t* buf, size_t maxSize) : ploc::SpTmReader(buf, maxSize) {}
|
2022-04-10 18:46:39 +02:00
|
|
|
|
|
|
|
ReturnValue_t parseDataField() {
|
|
|
|
ReturnValue_t result = lengthCheck();
|
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
|
|
return result;
|
|
|
|
}
|
2022-08-15 17:25:16 +02:00
|
|
|
const uint8_t* dataFieldPtr = getFullData() + ccsds::HEADER_LEN;
|
2022-04-10 18:46:39 +02:00
|
|
|
size_t size = sizeof(memoryId);
|
|
|
|
SerializeAdapter::deSerialize(&memoryId, dataFieldPtr, &size, SerializeIF::Endianness::BIG);
|
|
|
|
dataFieldPtr += size;
|
|
|
|
size = sizeof(n);
|
|
|
|
SerializeAdapter::deSerialize(&n, dataFieldPtr, &size, SerializeIF::Endianness::BIG);
|
|
|
|
dataFieldPtr += size;
|
|
|
|
size = sizeof(startAddress);
|
|
|
|
SerializeAdapter::deSerialize(&startAddress, dataFieldPtr, &size, SerializeIF::Endianness::BIG);
|
|
|
|
dataFieldPtr += size;
|
|
|
|
size = sizeof(length);
|
|
|
|
SerializeAdapter::deSerialize(&length, dataFieldPtr, &size, SerializeIF::Endianness::BIG);
|
|
|
|
dataFieldPtr += size;
|
|
|
|
size = sizeof(crc);
|
|
|
|
SerializeAdapter::deSerialize(&crc, dataFieldPtr, &size, SerializeIF::Endianness::BIG);
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t verifycrc(uint16_t goodCrc) const {
|
2022-04-11 16:52:50 +02:00
|
|
|
if (crc != goodCrc) {
|
|
|
|
return SupvReturnValuesIF::UPDATE_CRC_FAILURE;
|
|
|
|
}
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
2022-04-10 18:46:39 +02:00
|
|
|
}
|
|
|
|
|
2022-04-11 16:52:50 +02:00
|
|
|
uint16_t getCrc() const { return crc; }
|
2022-04-10 18:46:39 +02:00
|
|
|
|
2022-04-11 16:52:50 +02:00
|
|
|
uint16_t getNominalSize() const { return FULL_SIZE; }
|
2022-04-10 18:46:39 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Nominal size of the space packet
|
|
|
|
static const uint16_t FULL_SIZE = 20; // header, data field and crc
|
|
|
|
|
|
|
|
uint8_t memoryId = 0;
|
|
|
|
uint8_t n = 0;
|
|
|
|
uint32_t startAddress = 0;
|
|
|
|
uint32_t length = 0;
|
|
|
|
uint16_t crc = 0;
|
|
|
|
|
|
|
|
ReturnValue_t lengthCheck() {
|
2022-08-15 17:25:16 +02:00
|
|
|
if (getFullPacketLen() != FULL_SIZE) {
|
2022-04-10 18:46:39 +02:00
|
|
|
return SupvReturnValuesIF::UPDATE_STATUS_REPORT_INVALID_LENGTH;
|
|
|
|
}
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
2022-04-06 08:36:34 +02:00
|
|
|
}
|
|
|
|
};
|
2022-04-21 16:30:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This dataset stores the ADC report.
|
|
|
|
*/
|
|
|
|
class AdcReport : public StaticLocalDataSet<ADC_RPT_SET_ENTRIES> {
|
|
|
|
public:
|
|
|
|
AdcReport(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, ADC_REPORT_SET_ID) {}
|
|
|
|
|
|
|
|
AdcReport(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, ADC_REPORT_SET_ID)) {}
|
|
|
|
|
|
|
|
lp_var_t<uint16_t> adcRaw0 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_0, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw1 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_1, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw2 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_2, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw3 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_3, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw4 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_4, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw5 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_5, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw6 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_6, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw7 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_7, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw8 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_8, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw9 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_9, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw10 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_10, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw11 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_11, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw12 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_12, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw13 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_13, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw14 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_14, this);
|
|
|
|
lp_var_t<uint16_t> adcRaw15 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_RAW_15, this);
|
|
|
|
lp_var_t<uint16_t> adcEng0 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_0, this);
|
|
|
|
lp_var_t<uint16_t> adcEng1 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_1, this);
|
|
|
|
lp_var_t<uint16_t> adcEng2 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_2, this);
|
|
|
|
lp_var_t<uint16_t> adcEng3 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_3, this);
|
|
|
|
lp_var_t<uint16_t> adcEng4 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_4, this);
|
|
|
|
lp_var_t<uint16_t> adcEng5 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_5, this);
|
|
|
|
lp_var_t<uint16_t> adcEng6 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_6, this);
|
|
|
|
lp_var_t<uint16_t> adcEng7 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_7, this);
|
|
|
|
lp_var_t<uint16_t> adcEng8 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_8, this);
|
|
|
|
lp_var_t<uint16_t> adcEng9 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_9, this);
|
|
|
|
lp_var_t<uint16_t> adcEng10 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_10, this);
|
|
|
|
lp_var_t<uint16_t> adcEng11 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_11, this);
|
|
|
|
lp_var_t<uint16_t> adcEng12 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_12, this);
|
|
|
|
lp_var_t<uint16_t> adcEng13 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_13, this);
|
|
|
|
lp_var_t<uint16_t> adcEng14 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_14, this);
|
|
|
|
lp_var_t<uint16_t> adcEng15 = lp_var_t<uint16_t>(sid.objectId, PoolIds::ADC_ENG_15, this);
|
|
|
|
|
|
|
|
void printSet() {
|
|
|
|
sif::info << "---- Adc Report: Raw values ----" << std::endl;
|
2022-05-04 12:49:43 +02:00
|
|
|
sif::info << "AdcReport: ADC raw 0: " << std::dec << this->adcRaw0 << std::endl;
|
2022-04-21 16:30:23 +02:00
|
|
|
sif::info << "AdcReport: ADC raw 1: " << this->adcRaw1 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 2: " << this->adcRaw2 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 3: " << this->adcRaw3 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 4: " << this->adcRaw4 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 5: " << this->adcRaw5 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 6: " << this->adcRaw6 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 7: " << this->adcRaw7 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 8: " << this->adcRaw8 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 9: " << this->adcRaw9 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 10: " << this->adcRaw10 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 11: " << this->adcRaw11 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 12: " << this->adcRaw12 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 13: " << this->adcRaw13 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 14: " << this->adcRaw14 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC raw 15: " << this->adcRaw15 << std::endl;
|
|
|
|
sif::info << "---- Adc Report: Engineering values ----" << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 0: " << this->adcEng0 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 1: " << this->adcEng1 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 2: " << this->adcEng2 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 3: " << this->adcEng3 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 4: " << this->adcEng4 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 5: " << this->adcEng5 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 6: " << this->adcEng6 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 7: " << this->adcEng7 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 8: " << this->adcEng8 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 9: " << this->adcEng9 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 10: " << this->adcEng10 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 11: " << this->adcEng11 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 12: " << this->adcEng12 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 13: " << this->adcEng13 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 14: " << this->adcEng14 << std::endl;
|
|
|
|
sif::info << "AdcReport: ADC eng 15: " << this->adcEng15 << std::endl;
|
|
|
|
}
|
|
|
|
};
|
2022-04-04 13:40:45 +02:00
|
|
|
} // namespace supv
|
2021-07-26 12:08:38 +02:00
|
|
|
|
2021-07-13 08:32:14 +02:00
|
|
|
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */
|