eive-obsw/mission/devices/devicedefinitions/GomspaceDefinitions.h

803 lines
30 KiB
C
Raw Normal View History

2020-12-20 13:31:44 +01:00
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_
2021-01-28 14:55:21 +01:00
#include <fsfw/datapoollocal/LocalPoolVariable.h>
2022-01-18 11:41:19 +01:00
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
2022-04-07 19:48:09 +02:00
#include <fsfw/power/definitions.h>
2020-12-20 13:31:44 +01:00
2022-01-18 11:41:19 +01:00
#include <cstdint>
2022-04-07 19:48:09 +02:00
#include "devices/powerSwitcherList.h"
2022-01-18 11:41:19 +01:00
namespace GOMSPACE {
2022-01-19 17:17:06 +01:00
2022-01-19 18:05:17 +01:00
enum class Pdu { PDU1, PDU2 };
using ChannelSwitchHook = void (*)(Pdu pdu, uint8_t channel, bool on, void* args);
2022-01-19 17:17:06 +01:00
2021-09-07 16:11:02 +02:00
static const uint16_t IGNORE_CHECKSUM = 0xbb0;
/** The size of the header of a gomspace CSP packet. */
static const uint8_t GS_HDR_LENGTH = 12;
/** CSP port to ping gomspace devices. */
static const uint8_t PING_PORT = 1;
static const uint8_t REBOOT_PORT = 4;
/** CSP port of gomspace devices to request or set parameters */
static const uint8_t PARAM_PORT = 7;
static const uint8_t P60_PORT_GNDWDT_RESET = 9;
2021-12-17 10:45:55 +01:00
/**
* Device commands are derived from the rparam.h of the gomspace lib..
* IDs above 50 are reserved for device specific commands.
*/
2022-01-18 11:41:19 +01:00
static const DeviceCommandId_t PING = 1; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t NONE = 2; // Set when no command is pending
static const DeviceCommandId_t REBOOT = 4; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t GNDWDT_RESET = 9; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_GET = 0; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t PARAM_SET = 255; //!< [EXPORT] : [COMMAND]
static const DeviceCommandId_t REQUEST_HK_TABLE = 16; //!< [EXPORT] : [COMMAND]
2021-09-20 11:22:11 +02:00
//!< [EXPORT] : [COMMAND] Print switch states, voltages and currents to the console
2021-09-20 11:47:19 +02:00
static const DeviceCommandId_t PRINT_SWITCH_V_I = 32;
static const DeviceCommandId_t PRINT_LATCHUPS = 33;
2021-09-16 14:51:14 +02:00
2022-01-18 11:41:19 +01:00
} // namespace GOMSPACE
2021-01-28 14:55:21 +01:00
2021-02-03 08:09:54 +01:00
namespace P60System {
2022-04-04 17:16:52 +02:00
enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 };
2022-04-07 19:48:09 +02:00
enum class SetIds : uint32_t {
PDU_1_CORE = 1,
PDU_1_AUX = 2,
PDU_2_CORE = 3,
PDU_2_AUX = 4,
P60_CORE = 5,
P60_AUX = 6,
ACU = 7
};
2022-04-07 12:53:51 +02:00
2022-04-04 17:16:52 +02:00
namespace pool {
enum Ids : lp_id_t {
2022-04-07 19:48:09 +02:00
P60_CURRENTS,
P60_VOLTAGES,
P60_OUTPUT_ENABLE,
2022-01-18 11:41:19 +01:00
P60DOCK_TEMPERATURE_1,
P60DOCK_TEMPERATURE_2,
P60DOCK_BOOT_CAUSE,
P60DOCK_BOOT_CNT,
P60DOCK_UPTIME,
P60DOCK_RESETCAUSE,
P60DOCK_BATT_MODE,
P60DOCK_HEATER_ON,
P60DOCK_CONV_5V_ENABLE_STATUS,
2022-04-04 17:16:52 +02:00
LATCHUPS,
P60DOCK_DOCK_VBAT,
P60DOCK_DOCK_VCC_CURRENT,
// Difference between charge and discharge
2022-01-18 11:41:19 +01:00
P60DOCK_BATTERY_CURRENT,
P60DOCK_BATTERY_VOLTAGE,
P60DOCK_BATTERY_TEMPERATURE_1,
P60DOCK_BATTERY_TEMPERATURE_2,
2022-04-04 17:16:52 +02:00
DEVICES_TYPE,
DEVICES_STATUS,
2022-01-18 11:41:19 +01:00
P60DOCK_DEVICE_TYPE_GROUP,
P60DOCK_DEVICE_STATUS_GROUP,
P60DOCK_DEARM_STATUS,
P60DOCK_WDT_CNT_GND,
P60DOCK_WDT_CNT_I2C,
P60DOCK_WDT_CNT_CAN,
P60DOCK_WDT_CNT_CSP_1,
P60DOCK_WDT_CNT_CSP_2,
P60DOCK_WDT_GND_LEFT,
P60DOCK_WDT_I2C_LEFT,
P60DOCK_WDT_CAN_LEFT,
P60DOCK_WDT_CSP_LEFT_1,
P60DOCK_WDT_CSP_LEFT_2,
P60DOCK_BATT_CHARGE_CURRENT,
P60DOCK_BATT_DISCHARGE_CURRENT,
P60DOCK_ANT6_DEPL,
P60DOCK_AR6_DEPL,
2022-04-07 19:48:09 +02:00
// IDs for both PDUs
PDU_CURRENTS,
PDU_VOLTAGES,
PDU_VCC,
PDU_VBAT,
PDU_TEMPERATURE,
PDU_CONV_EN_1,
PDU_CONV_EN_2,
PDU_CONV_EN_3,
PDU_OUT_ENABLE,
PDU_BOOTCAUSE,
PDU_BOOTCNT,
PDU_UPTIME,
PDU_RESETCAUSE,
PDU_BATT_MODE,
PDU_LATCHUPS,
PDU_DEVICES,
PDU_STATUSES,
PDU_WDT_CNT_GND,
PDU_WDT_CNT_I2C,
PDU_WDT_CNT_CAN,
PDU_WDT_CNT_CSP1,
PDU_WDT_CNT_CSP2,
PDU_WDT_GND_LEFT,
PDU_WDT_I2C_LEFT,
PDU_WDT_CAN_LEFT,
PDU_WDT_CSP_LEFT1,
PDU_WDT_CSP_LEFT2,
2022-01-18 11:41:19 +01:00
/** ACU Ids */
ACU_CURRENT_IN_CHANNEL0,
ACU_CURRENT_IN_CHANNEL1,
ACU_CURRENT_IN_CHANNEL2,
ACU_CURRENT_IN_CHANNEL3,
ACU_CURRENT_IN_CHANNEL4,
ACU_CURRENT_IN_CHANNEL5,
ACU_VOLTAGE_IN_CHANNEL0,
ACU_VOLTAGE_IN_CHANNEL1,
ACU_VOLTAGE_IN_CHANNEL2,
ACU_VOLTAGE_IN_CHANNEL3,
ACU_VOLTAGE_IN_CHANNEL4,
ACU_VOLTAGE_IN_CHANNEL5,
ACU_VCC,
ACU_VBAT,
ACU_TEMPERATURE_1,
ACU_TEMPERATURE_2,
ACU_TEMPERATURE_3,
ACU_MPPT_MODE,
ACU_VBOOST_CHANNEL0,
ACU_VBOOST_CHANNEL1,
ACU_VBOOST_CHANNEL2,
ACU_VBOOST_CHANNEL3,
ACU_VBOOST_CHANNEL4,
ACU_VBOOST_CHANNEL5,
ACU_POWER_CHANNEL0,
ACU_POWER_CHANNEL1,
ACU_POWER_CHANNEL2,
ACU_POWER_CHANNEL3,
ACU_POWER_CHANNEL4,
ACU_POWER_CHANNEL5,
ACU_DAC_EN_0,
ACU_DAC_EN_1,
ACU_DAC_EN_2,
ACU_DAC_RAW_0,
ACU_DAC_RAW_1,
ACU_DAC_RAW_2,
ACU_DAC_RAW_3,
ACU_DAC_RAW_4,
ACU_DAC_RAW_5,
ACU_BOOTCAUSE,
ACU_BOOTCNT,
ACU_UPTIME,
ACU_RESET_CAUSE,
ACU_MPPT_TIME,
ACU_MPPT_PERIOD,
ACU_DEVICE_0,
ACU_DEVICE_1,
ACU_DEVICE_2,
ACU_DEVICE_3,
ACU_DEVICE_4,
ACU_DEVICE_5,
ACU_DEVICE_6,
ACU_DEVICE_7,
ACU_DEVICE_0_STATUS,
ACU_DEVICE_1_STATUS,
ACU_DEVICE_2_STATUS,
ACU_DEVICE_3_STATUS,
ACU_DEVICE_4_STATUS,
ACU_DEVICE_5_STATUS,
ACU_DEVICE_6_STATUS,
ACU_DEVICE_7_STATUS,
ACU_WDT_CNT_GND,
2022-04-07 19:48:09 +02:00
ACU_WDT_GND_LEFT,
2021-09-07 16:11:02 +02:00
};
2021-02-03 08:09:54 +01:00
}
2022-04-04 17:16:52 +02:00
} // namespace P60System
2021-02-03 08:09:54 +01:00
namespace P60Dock {
2021-02-14 15:49:03 +01:00
2022-04-04 17:16:52 +02:00
static constexpr uint8_t NUM_DEVS = 8;
namespace hk {
enum Index : uint8_t {
ACU_VCC = 0,
PDU1_VCC = 1,
X3_IDLE_VCC = 2,
PDU2_VCC = 3,
ACU_VBAT = 4,
PDU1_VBAT = 5,
X3_IDLE_VBAT = 6,
PDU2_VBAT = 7,
STACK_VBAT = 8,
STACK_3V3 = 9,
STACK_5V = 10,
GS3V3 = 11,
GS5V = 12,
CHNLS_LEN = 13
};
}
2022-01-27 16:04:45 +01:00
enum SwitchChannels : uint8_t {
ACU = 0,
PDU1 = 1,
X3_IDLE = 2,
PDU2_VCC = 3,
ACU_VBAT = 4,
PDU1_VBAT = 5,
X3_IDLE_VBAT = 6,
PDU2_VBAT = 7,
STACK_VBAT = 8,
STACK_3V3 = 9,
STACK_5V = 10,
GS3V3 = 11,
GS5V = 12
};
2021-09-07 16:11:02 +02:00
/** Max reply size reached when requesting full hk table */
static const uint16_t MAX_REPLY_LENGTH = 407;
2021-02-03 08:09:54 +01:00
2021-09-07 16:11:02 +02:00
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408;
static const uint16_t MAX_HKTABLE_ADDRESS = 187;
static const uint16_t HK_TABLE_SIZE = 188;
2021-02-03 08:09:54 +01:00
2021-09-07 16:11:02 +02:00
static const uint8_t HK_TABLE_ENTRIES = 100;
2021-02-03 08:09:54 +01:00
2021-09-07 16:11:02 +02:00
/**
* Requesting the full housekeeping table from the P60 dock will generate a reply comprising
* 402 bytes of data.
*/
static const uint16_t HK_TABLE_REPLY_SIZE = 407;
2021-02-12 10:20:39 +01:00
2022-04-07 12:22:08 +02:00
class CoreHkSet : public StaticLocalDataSet<16> {
2022-01-18 11:41:19 +01:00
public:
2022-04-07 12:53:51 +02:00
CoreHkSet(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::P60_CORE)) {}
2022-01-18 11:41:19 +01:00
2022-04-07 12:53:51 +02:00
CoreHkSet(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::P60_CORE))) {}
2022-01-18 11:41:19 +01:00
/** Measured output currents */
2022-04-04 17:16:52 +02:00
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN> currents =
2022-04-07 19:48:09 +02:00
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::P60_CURRENTS,
2022-04-04 17:16:52 +02:00
this);
2022-01-18 11:41:19 +01:00
/** Measured output voltages */
2022-04-04 17:16:52 +02:00
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN> voltages =
2022-04-07 19:48:09 +02:00
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::P60_VOLTAGES,
2022-04-04 17:16:52 +02:00
this);
2022-01-18 11:41:19 +01:00
/** Output enable states */
2022-04-04 17:16:52 +02:00
lp_vec_t<uint8_t, P60Dock::hk::Index::CHNLS_LEN> outputEnables =
2022-04-07 19:48:09 +02:00
lp_vec_t<uint8_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId,
P60System::pool::P60_OUTPUT_ENABLE, this);
2022-04-07 12:22:08 +02:00
lp_var_t<uint32_t> bootCount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_BOOT_CNT, this);
lp_var_t<uint8_t> battMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_BATT_MODE, this);
// Difference between charge and discharge current
lp_var_t<int16_t> batteryCurrent =
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATTERY_CURRENT, this);
lp_var_t<uint16_t> batteryVoltage =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::P60DOCK_BATTERY_VOLTAGE, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> temperature1 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> temperature2 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_TEMPERATURE_2, this);
2022-04-07 12:22:08 +02:00
};
/**
* @brief This class defines a dataset for the hk table of the P60 Dock.
* @details
* The GS port and X3 are not required for EIVE. X3 is another slot on the P60 dock and
* GS is required for a module from Gomspace which is not used.
*/
class HkTableDataset : public StaticLocalDataSet<32> {
public:
2022-04-07 12:53:51 +02:00
HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::P60_AUX)) {}
2022-04-07 12:22:08 +02:00
HkTableDataset(object_id_t objectId)
2022-04-07 12:53:51 +02:00
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::P60_AUX))) {}
/** Number of detected latchups on each output channel */
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN> latchups =
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::LATCHUPS,
this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> bootcause =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this);
lp_var_t<uint32_t> uptime =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_UPTIME, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> resetcause =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::P60DOCK_RESETCAUSE, this);
2022-04-07 12:22:08 +02:00
2022-01-18 11:41:19 +01:00
/** Battery heater control only possible on BP4 packs */
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t> heaterOn =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_HEATER_ON, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> converter5VStatus =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_CONV_5V_ENABLE_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dockVbatVoltageValue =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this);
lp_var_t<int16_t> dockVccCurrent =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_DOCK_VCC_CURRENT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> batteryTemperature1 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> batteryTemperature2 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> dearmStatus =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_DEARM_STATUS, this);
2022-01-18 11:41:19 +01:00
/** Number of reboots due to gnd, i2c, csp watchdog timeout */
lp_var_t<uint32_t> wdtCntGnd =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_GND, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtCntI2c =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_I2C, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtCntCan =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CAN, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtCntCsp1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtCntCsp2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CNT_CSP_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtGndLeft =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_GND_LEFT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtI2cLeft =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_I2C_LEFT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtCanLeft =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CAN_LEFT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> wdtCspLeft1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> wdtCspLeft2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_WDT_CSP_LEFT_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> batteryChargeCurrent =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATT_CHARGE_CURRENT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> batteryDischargeCurrent =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATT_DISCHARGE_CURRENT, this);
lp_var_t<int8_t> ant6Depl =
lp_var_t<int8_t>(sid.objectId, P60System::pool::P60DOCK_ANT6_DEPL, this);
lp_var_t<int8_t> ar6Depl =
lp_var_t<int8_t>(sid.objectId, P60System::pool::P60DOCK_AR6_DEPL, this);
2022-04-07 12:53:51 +02:00
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesType =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_TYPE, this);
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesStatus =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_STATUS, this);
2021-09-07 16:11:02 +02:00
};
2022-01-18 11:41:19 +01:00
} // namespace P60Dock
2021-01-28 14:55:21 +01:00
2021-02-03 08:09:54 +01:00
/**
* @brief Constants common for both PDU1 and PDU2.
*/
2022-01-18 11:41:19 +01:00
namespace PDU {
2021-09-07 16:11:02 +02:00
/** When retrieving full configuration parameter table */
static const uint16_t MAX_REPLY_LENGTH = 318;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 316;
static const uint16_t MAX_HKTABLE_ADDRESS = 141;
/** The size of the csp reply containing the housekeeping table data */
static const uint16_t HK_TABLE_REPLY_SIZE = 303;
static const uint8_t HK_TABLE_ENTRIES = 73;
2021-02-03 08:09:54 +01:00
2022-04-07 19:48:09 +02:00
static constexpr uint8_t CHANNELS_LEN = 9;
static constexpr uint8_t DEVICES_NUM = 8;
2022-01-19 18:05:17 +01:00
2022-04-07 19:48:09 +02:00
class PduCoreHk : public StaticLocalDataSet<9> {
public:
PduCoreHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
2022-01-19 18:05:17 +01:00
2022-04-07 19:48:09 +02:00
PduCoreHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
/** Measured output currents */
lp_vec_t<int16_t, 9> currents =
lp_vec_t<int16_t, 9>(sid.objectId, P60System::pool::PDU_CURRENTS, this);
/** Measured output currents */
lp_vec_t<int16_t, 9> voltages =
lp_vec_t<int16_t, 9>(sid.objectId, P60System::pool::PDU_VOLTAGES, this);
/** Output switch states */
lp_vec_t<uint8_t, 9> outputEnables =
lp_vec_t<uint8_t, 9>(sid.objectId, P60System::pool::PDU_VOLTAGES, this);
/** Number of reboots */
lp_var_t<uint32_t> bootcount =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_BOOTCNT, this);
/** Battery mode: 1 = Critical, 2 = Safe, 3 = Normal, 4 = Full */
lp_var_t<uint8_t> battMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_BATT_MODE, this);
lp_var_t<int16_t> temperature =
lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_TEMPERATURE, this);
};
2021-09-07 16:11:02 +02:00
/**
2022-04-07 19:48:09 +02:00
* @brief This class defines a dataset for the hk table of a PDU
2021-09-07 16:11:02 +02:00
*/
2022-04-07 19:48:09 +02:00
class PduAuxHk : public StaticLocalDataSet<36> {
2022-01-18 11:41:19 +01:00
public:
2022-04-07 19:48:09 +02:00
PduAuxHk(HasLocalDataPoolIF* owner, uint32_t setId) : StaticLocalDataSet(owner, setId) {}
2022-01-18 11:41:19 +01:00
2022-04-07 19:48:09 +02:00
PduAuxHk(object_id_t objectId, uint32_t setId) : StaticLocalDataSet(sid_t(objectId, setId)) {}
2022-01-18 11:41:19 +01:00
/** Measured VCC */
2022-04-07 19:48:09 +02:00
lp_var_t<int16_t> vcc = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_VCC, this);
2022-01-18 11:41:19 +01:00
/** Measured VBAT */
2022-04-07 19:48:09 +02:00
lp_var_t<int16_t> vbat = lp_var_t<int16_t>(sid.objectId, P60System::pool::PDU_VBAT, this);
2022-01-18 11:41:19 +01:00
/** Output converter enable status */
lp_var_t<uint8_t> converterEnable1 =
2022-04-07 19:48:09 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_CONV_EN_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> converterEnable2 =
2022-04-07 19:48:09 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_CONV_EN_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> converterEnable3 =
2022-04-07 19:48:09 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_CONV_EN_3, this);
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t> bootcause =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_BOOTCAUSE, this);
2022-01-18 11:41:19 +01:00
/** Uptime in seconds */
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_UPTIME, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> resetcause =
2022-04-07 19:48:09 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::PDU_RESETCAUSE, this);
2022-01-18 11:41:19 +01:00
/** Number of detected latchups on each output channel */
2022-04-07 19:48:09 +02:00
lp_vec_t<uint16_t, 9> latchups =
lp_vec_t<uint16_t, 9>(sid.objectId, P60System::pool::PDU_LATCHUPS, this);
2022-01-18 11:41:19 +01:00
/**
* There are 8 devices on the PDU. FRAM, ADCs, temperature sensor etc. Each device is
* identified by an ID. Refer also to gs-man-nanopower-p60-pdu-200-1.pdf on pages 17 and 18.
*/
2022-04-07 19:48:09 +02:00
lp_vec_t<uint8_t, 8> deviceTypes =
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::PDU_DEVICES, this);
2022-01-18 11:41:19 +01:00
/** The status of each device. 0 = None, 1 = Ok, 2 = Error, 3 = Not found */
2022-04-07 19:48:09 +02:00
lp_vec_t<uint8_t, 8> devicesStatus =
lp_vec_t<uint8_t, 8>(sid.objectId, P60System::pool::PDU_STATUSES, this);
2022-01-18 11:41:19 +01:00
/** Number of reboots triggered by the ground watchdog */
lp_var_t<uint32_t> gndWdtReboots =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_GND, this);
2022-01-18 11:41:19 +01:00
/** Number of reboots triggered through the I2C watchdog. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWdtReboots =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_I2C, this);
2022-01-18 11:41:19 +01:00
/** Number of reboots triggered through the CAN watchdog */
lp_var_t<uint32_t> canWdtReboots =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CAN, this);
2022-01-18 11:41:19 +01:00
/** Number of reboots triggered through the CSP watchdog */
lp_var_t<uint32_t> csp1WdtReboots =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> csp2WdtReboots =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CNT_CSP2, this);
2022-01-18 11:41:19 +01:00
/** Ground watchdog remaining seconds before rebooting */
lp_var_t<uint32_t> groundWatchdogSecondsLeft =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_GND_LEFT, this);
2022-01-18 11:41:19 +01:00
/** I2C watchdog remaining seconds before rebooting. Not relevant for EIVE. */
lp_var_t<uint32_t> i2cWatchdogSecondsLeft =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_I2C_LEFT, this);
2022-01-18 11:41:19 +01:00
/** CAN watchdog remaining seconds before rebooting. */
lp_var_t<uint32_t> canWatchdogSecondsLeft =
2022-04-07 19:48:09 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::PDU_WDT_CAN_LEFT, this);
2022-01-18 11:41:19 +01:00
/** CSP watchdogs remaining pings before rebooting. */
lp_var_t<uint8_t> csp2WatchdogPingsLeft =
2022-04-07 19:48:09 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> csp1WatchdogPingsLeft =
2022-04-07 19:48:09 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::PDU_WDT_CSP_LEFT2, this);
};
} // namespace PDU
namespace PDU1 {
enum Channels : uint8_t {
TCS_BOARD_3V3 = 0,
SYRLINKS = 1,
STR = 2,
MGT = 3,
SUS_NOMINAL = 4,
SOL_CELL_EXPERIMENT = 5,
PLOC = 6,
ACS_A_SIDE = 7,
UNUSED = 8,
LEN = 9
};
/**
* Addresses within configuration table to enable or disable output channels. Refer also to
* gs-man-nanopower-p60-pdu-200.pdf on page 16.
*/
static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_3V3 = 0x48;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SYRLINKS = 0x49;
static const uint16_t CONFIG_ADDRESS_OUT_EN_STAR_TRACKER = 0x4A;
static const uint16_t CONFIG_ADDRESS_OUT_EN_MGT = 0x4B;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_NOMINAL = 0x4C;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SOLAR_CELL_EXP = 0x4D;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PLOC = 0x4E;
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_A = 0x4F;
static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50;
class Pdu1CoreHk : public ::PDU::PduCoreHk {
public:
Pdu1CoreHk(HasLocalDataPoolIF* owner)
: PduCoreHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1_CORE)) {}
Pdu1CoreHk(object_id_t objectId)
: PduCoreHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1_CORE)) {}
};
class Pdu1AuxHk : public ::PDU::PduAuxHk {
public:
Pdu1AuxHk(HasLocalDataPoolIF* owner)
: PduAuxHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1_AUX)) {}
Pdu1AuxHk(object_id_t objectId)
: PduAuxHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1_AUX)) {}
2021-09-07 16:11:02 +02:00
};
2022-04-07 19:48:09 +02:00
2022-01-18 11:41:19 +01:00
} // namespace PDU1
2021-01-28 14:55:21 +01:00
namespace PDU2 {
2022-01-19 18:05:17 +01:00
2022-04-07 19:48:09 +02:00
enum Channels : uint8_t {
2022-01-19 18:05:17 +01:00
Q7S = 0,
PAYLOAD_PCDU_CH1 = 1,
RW = 2,
TCS_HEATER_IN = 3,
SUS_REDUNDANT = 4,
DEPY_MECHANISM = 5,
PAYLOAD_PCDU_CH6 = 6,
ACS_B_SIDE = 7,
2022-04-07 19:48:09 +02:00
PAYLOAD_CAMERA = 8,
LEN = 9
2022-01-19 18:05:17 +01:00
};
2021-09-07 16:11:02 +02:00
/**
* Addresses within configuration table to enable or disable output channels. Refer also to
* gs-man-nanopower-p60-pdu-200.pdf on page 16.
*/
static const uint16_t CONFIG_ADDRESS_OUT_EN_Q7S = 0x48;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH1 = 0x49;
static const uint16_t CONFIG_ADDRESS_OUT_EN_RW = 0x4A;
static const uint16_t CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN = 0x4B;
static const uint16_t CONFIG_ADDRESS_OUT_EN_SUS_REDUNDANT = 0x4C;
static const uint16_t CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM = 0x4D;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_PCDU_CH6 = 0x4E;
2021-09-07 16:11:02 +02:00
static const uint16_t CONFIG_ADDRESS_OUT_EN_ACS_BOARD_SIDE_B = 0x4F;
static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50;
2022-04-07 19:48:09 +02:00
class Pdu2CoreHk : public ::PDU::PduCoreHk {
2022-01-18 11:41:19 +01:00
public:
2022-04-07 19:48:09 +02:00
Pdu2CoreHk(HasLocalDataPoolIF* owner)
: PduCoreHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2_CORE)) {}
2022-01-18 11:41:19 +01:00
2022-04-07 19:48:09 +02:00
Pdu2CoreHk(object_id_t objectId)
: PduCoreHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2_CORE)) {}
};
2022-01-18 11:41:19 +01:00
2022-04-07 19:48:09 +02:00
class Pdu2AuxHk : public ::PDU::PduAuxHk {
public:
Pdu2AuxHk(HasLocalDataPoolIF* owner)
: PduAuxHk(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2_AUX)) {}
2022-01-18 11:41:19 +01:00
2022-04-07 19:48:09 +02:00
Pdu2AuxHk(object_id_t objectId)
: PduAuxHk(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2_AUX)) {}
2021-09-07 16:11:02 +02:00
};
2022-04-07 19:48:09 +02:00
2022-01-18 11:41:19 +01:00
} // namespace PDU2
2020-12-20 17:35:03 +01:00
2021-01-28 14:55:21 +01:00
namespace ACU {
2021-02-03 08:09:54 +01:00
2021-09-07 16:11:02 +02:00
/* When receiving full housekeeping (telemetry) table */
static const uint16_t MAX_REPLY_LENGTH = 262;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26;
static const uint16_t MAX_HKTABLE_ADDRESS = 120;
static const uint8_t HK_TABLE_ENTRIES = 64;
static const uint16_t HK_TABLE_REPLY_SIZE = 262;
2021-02-03 08:09:54 +01:00
2021-09-07 16:11:02 +02:00
/**
* @brief This class defines a dataset for the hk table of the ACU.
*/
2022-01-18 11:41:19 +01:00
class HkTableDataset : public StaticLocalDataSet<HK_TABLE_ENTRIES> {
public:
2022-04-07 12:53:51 +02:00
HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::ACU)) {}
2022-01-18 11:41:19 +01:00
HkTableDataset(object_id_t objectId)
2022-04-07 12:53:51 +02:00
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU))) {}
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel0 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel1 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel2 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel3 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL3, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel4 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL4, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> currentInChannel5 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL5, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel0 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL0, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel3 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL3, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel4 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL4, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> voltageInChannel5 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VOLTAGE_IN_CHANNEL5, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t> vcc = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VCC, this);
lp_var_t<uint16_t> vbat = lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBAT, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> temperature1 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> temperature2 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<int16_t> temperature3 =
2022-04-04 17:16:52 +02:00
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_TEMPERATURE_3, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t> mpptMode =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_MPPT_MODE, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel0 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL0, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel3 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL3, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel4 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL4, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> vboostInChannel5 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_VBOOST_CHANNEL5, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel0 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL0, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel3 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL3, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel4 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL4, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> powerInChannel5 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_POWER_CHANNEL5, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t> dac0Enable =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_0, this);
lp_var_t<uint8_t> dac1Enable =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_1, this);
lp_var_t<uint8_t> dac2Enable =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DAC_EN_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal0 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_0, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal1 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_1, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal2 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_2, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal3 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_3, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal4 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_4, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> dacRawChannelVal5 =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_DAC_RAW_5, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t> bootCause =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_BOOTCAUSE, this);
lp_var_t<uint32_t> bootcnt = lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_BOOTCNT, this);
lp_var_t<uint32_t> uptime = lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_UPTIME, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> resetCause =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_RESET_CAUSE, this);
lp_var_t<uint16_t> mpptTime =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_TIME, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint16_t> mpptPeriod =
2022-04-04 17:16:52 +02:00
lp_var_t<uint16_t>(sid.objectId, P60System::pool::ACU_MPPT_PERIOD, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t> device0 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_0, this);
lp_var_t<uint8_t> device1 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_1, this);
lp_var_t<uint8_t> device2 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_2, this);
lp_var_t<uint8_t> device3 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_3, this);
lp_var_t<uint8_t> device4 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_4, this);
lp_var_t<uint8_t> device5 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_5, this);
lp_var_t<uint8_t> device6 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_6, this);
lp_var_t<uint8_t> device7 = lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_7, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device0Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_0_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device1Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_1_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device2Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_2_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device3Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_3_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device4Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_4_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device5Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_5_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device6Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_6_STATUS, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint8_t> device7Status =
2022-04-04 17:16:52 +02:00
lp_var_t<uint8_t>(sid.objectId, P60System::pool::ACU_DEVICE_7_STATUS, this);
2022-01-18 11:41:19 +01:00
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t> wdtCntGnd =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_WDT_CNT_GND, this);
2022-01-18 11:41:19 +01:00
lp_var_t<uint32_t> wdtGndLeft =
2022-04-04 17:16:52 +02:00
lp_var_t<uint32_t>(sid.objectId, P60System::pool::ACU_WDT_GND_LEFT, this);
2021-09-07 16:11:02 +02:00
};
2022-01-18 11:41:19 +01:00
} // namespace ACU
2020-12-20 17:35:03 +01:00
2022-04-07 19:48:09 +02:00
namespace pcdu {
enum PoolIds : uint32_t { PDU1_SWITCHES, PDU2_SWITCHES };
/* Switches are uint8_t datatype and go from 0 to 255 */
enum Switches : power::Switch_t {
PDU1_CH0_TCS_BOARD_3V3,
PDU1_CH1_SYRLINKS_12V,
PDU1_CH2_STAR_TRACKER_5V,
PDU1_CH3_MGT_5V,
PDU1_CH4_SUS_NOMINAL_3V3,
PDU1_CH5_SOLAR_CELL_EXP_5V,
PDU1_CH6_PLOC_12V,
PDU1_CH7_ACS_A_SIDE_3V3,
PDU1_CH8_UNOCCUPIED,
PDU2_CH0_Q7S,
PDU2_CH1_PL_PCDU_BATT_0_14V8,
PDU2_CH2_RW_5V,
PDU2_CH3_TCS_BOARD_HEATER_IN_8V,
PDU2_CH4_SUS_REDUNDANT_3V3,
PDU2_CH5_DEPLOYMENT_MECHANISM_8V,
PDU2_CH6_PL_PCDU_BATT_1_14V8,
PDU2_CH7_ACS_BOARD_SIDE_B_3V3,
PDU2_CH8_PAYLOAD_CAMERA
};
static constexpr uint8_t NUMBER_OF_SWITCHES = 18;
static const uint8_t ON = 1;
static const uint8_t OFF = 0;
// Output states after reboot of the PDUs
const std::array<uint8_t, PDU::CHANNELS_LEN> INIT_SWITCHES_PDU1 = {
// Because the TE0720 is not connected to the PCDU, this switch is always on
#ifdef TE0720_1CFA
ON,
#else
OFF,
#endif
OFF, OFF, OFF, OFF, OFF, OFF, OFF, OFF,
};
const std::array<uint8_t, PDU::CHANNELS_LEN> INIT_SWITCHES_PDU2 = {ON, OFF, OFF, OFF, OFF,
OFF, OFF, OFF, OFF};
static constexpr uint32_t SWITCHER_SET_ID = 0;
class SwitcherStates : public StaticLocalDataSet<NUMBER_OF_SWITCHES> {
public:
SwitcherStates(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, SWITCHER_SET_ID) {}
SwitcherStates(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SWITCHER_SET_ID)) {}
lp_vec_t<uint8_t, PDU::CHANNELS_LEN> pdu1Switches =
lp_vec_t<uint8_t, PDU::CHANNELS_LEN>(sid.objectId, PDU1_SWITCHES, this);
lp_vec_t<uint8_t, PDU::CHANNELS_LEN> pdu2Switches =
lp_vec_t<uint8_t, PDU::CHANNELS_LEN>(sid.objectId, PDU2_SWITCHES, this);
};
} // namespace pcdu
2020-12-20 13:31:44 +01:00
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_GOMSPACEDEFINITIONS_H_ */