eive-obsw/mission/power/defs.h

80 lines
3.0 KiB
C
Raw Permalink Normal View History

2023-03-26 16:13:54 +02:00
#ifndef MISSION_POWER_DEFS_H_
#define MISSION_POWER_DEFS_H_
2023-03-16 18:47:51 +01:00
#include <fsfw/events/Event.h>
#include <fsfw/modes/ModeMessage.h>
2023-03-24 21:20:27 +01:00
#include <fsfw/power/definitions.h>
2023-03-16 18:47:51 +01:00
2022-09-16 12:28:39 +02:00
#include "eive/eventSubsystemIds.h"
2023-03-16 18:47:51 +01:00
namespace power {
/* 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,
P60_DOCK_5V_STACK,
2023-04-03 16:25:32 +02:00
P60_DOCK_3V3_STACK,
2023-03-16 18:47:51 +01:00
NUMBER_OF_SWITCHES
};
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_HANDLER;
//! [EXPORT] : [COMMENT] Indicates that a FSFW object requested setting a switch
//! P1: 1 if on was requested, 0 for off | P2: Switch Index
static constexpr Event SWITCH_CMD_SENT = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO);
2022-05-10 18:34:39 +02:00
//! [EXPORT] : [COMMENT] Indicated that a switch state has changed
//! P1: New switch state, 1 for on, 0 for off | P2: Switch Index
static constexpr Event SWITCH_HAS_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO);
static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
2022-04-28 15:25:03 +02:00
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM);
2023-07-28 11:36:20 +02:00
//! [EXPORT] : [COMMENT] The dataset read for the inputs of the Power Controller has failed.
static constexpr Event DATASET_READ_FAILED = event::makeEvent(SUBSYSTEM_ID, 4, severity::INFO);
//! [EXPORT] : [COMMENT] The battery voltage read is out of the bounds in which it is supposed to
//! be.
//! P1: 1 too high, 0 too low
//! P2: voltage in V * 10
2023-07-28 11:36:20 +02:00
static constexpr Event VOLTAGE_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 5, severity::HIGH);
2023-07-31 13:14:04 +02:00
//! [EXPORT] : [COMMENT] Time difference for Coulomb Counter was too large.
//! P1: time in s * 10
2023-09-26 11:56:04 +02:00
static constexpr Event TIMEDELTA_OUT_OF_BOUNDS = event::makeEvent(SUBSYSTEM_ID, 6, severity::LOW);
2023-09-27 14:46:45 +02:00
//! [EXPORT] : [COMMENT] The State of Charge is below the limit for payload use. Setting Payload to
//! faulty.
static constexpr Event POWER_LEVEL_LOW = event::makeEvent(SUBSYSTEM_ID, 7, severity::HIGH);
//! [EXPORT] : [COMMENT] The State of Charge is below the limit for higher modes. Setting Reaction
//! Wheels to faulty.
static constexpr Event POWER_LEVEL_CRITICAL = event::makeEvent(SUBSYSTEM_ID, 8, severity::HIGH);
2023-07-28 11:36:20 +02:00
2022-03-22 15:49:22 +01:00
enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING };
enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED };
2022-03-22 15:49:22 +01:00
2023-04-11 22:58:13 +02:00
enum RecoveryCustomStates { IDLE, POWER_SWITCHING_OFF, POWER_SWITCHING_ON, DONE };
2023-03-16 18:47:51 +01:00
} // namespace power
2022-03-22 15:49:22 +01:00
namespace duallane {
enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 };
2023-03-26 16:13:54 +02:00
}
#endif /* MISSION_POWER_DEFS_H_ */