eive-obsw/mission/system/objects/Stack5VHandler.h
Robin Mueller dcf6367314
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
this is annoying
2022-12-21 14:43:12 +01:00

33 lines
912 B
C++

#ifndef MISSION_SYSTEM_OBJECTS_STACK5VHANDLER_H_
#define MISSION_SYSTEM_OBJECTS_STACK5VHANDLER_H_
#include <fsfw/power/PowerSwitchIF.h>
#include "mission/devices/devicedefinitions/GomspaceDefinitions.h"
enum class StackCommander { RAD_SENSOR = 0, PL_PCDU = 1 };
enum class HandlerState { SWITCH_PENDING, IDLE };
class Stack5VHandler {
public:
Stack5VHandler(PowerSwitchIF& switcher);
ReturnValue_t deviceToOn(StackCommander commander);
ReturnValue_t deviceToOff(StackCommander commander);
bool isSwitchOn();
private:
MutexIF* stackLock;
PowerSwitchIF& switcher;
bool switchIsOn = false;
HandlerState handlerState = HandlerState::IDLE;
bool plPcduCommandedOn = false;
bool radSensorCommandedOn = false;
bool radSensorIsOn = false;
bool plPcduIsOn = false;
pcdu::Switches stackSwitch = pcdu::Switches::P60_DOCK_5V_STACK;
};
#endif /* MISSION_SYSTEM_OBJECTS_STACK5VHANDLER_H_ */