eive-obsw/mission/power/Pdu2Handler.h

59 lines
2.1 KiB
C
Raw Normal View History

2023-03-26 16:13:54 +02:00
#ifndef MISSION_POWER_PDU2HANDLER_H_
#define MISSION_POWER_PDU2HANDLER_H_
2021-01-23 17:22:40 +01:00
2023-03-26 16:13:54 +02:00
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/gsDefs.h>
2022-01-18 11:41:19 +01:00
2021-01-23 17:22:40 +01:00
/**
* @brief This is the device handler for the PDU2.
*
* @details The PDU2 controls the
* power supply of the following devices:
* Xiphos Q7S, 8V, channel 0
* Reaction wheels 5V, channel 2
* TCS Board heater input, 8V, channel 3
2021-01-28 14:55:21 +01:00
* SUS 8-12 Redundant, 3.3V, channel 4
2021-01-23 17:22:40 +01:00
* Deployment mechanism, 8V, channel 5
2021-01-28 14:55:21 +01:00
* P/L PCDU, Battery voltage (Vnominal = 14.8V), channel 1 and channel 6
* ACS Board (Gyro, MGMs, GPS), 3.3V channel 7
2021-01-23 17:22:40 +01:00
* Payload Camera, 8V, channel 8
*/
2023-03-14 13:32:13 +01:00
class Pdu2Handler : public GomspaceDeviceHandler {
2022-01-18 11:41:19 +01:00
public:
2023-03-14 13:32:13 +01:00
Pdu2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
2023-03-26 15:28:00 +02:00
FailureIsolationBase* customFdir, bool enableHkSets);
2023-03-14 13:32:13 +01:00
virtual ~Pdu2Handler();
2021-01-28 14:55:21 +01:00
2022-01-18 11:41:19 +01:00
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
2022-01-19 18:05:17 +01:00
void assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void* args);
2022-01-18 11:41:19 +01:00
protected:
/**
* @brief As soon as the device is in MODE_NORMAL, this function is executed periodically.
*/
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
2022-08-27 01:02:08 +02:00
void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override;
void letChildHandleConfigReply(DeviceCommandId_t id, const uint8_t* packet) override;
2022-01-18 11:41:19 +01:00
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
2022-01-19 18:51:44 +01:00
ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExecution) override;
2022-04-07 12:22:08 +02:00
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
2022-01-19 18:05:17 +01:00
2022-01-18 11:41:19 +01:00
private:
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24;
2022-01-18 11:41:19 +01:00
/** Dataset for the housekeeping table of the PDU2 */
2022-04-07 19:48:09 +02:00
PDU2::Pdu2CoreHk coreHk;
PDU2::Pdu2AuxHk auxHk;
2022-08-26 14:28:06 +02:00
TableConfig cfg;
2022-01-19 17:17:06 +01:00
GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr;
2022-01-19 18:05:17 +01:00
void* hookArgs = nullptr;
2021-02-06 11:57:45 +01:00
void printHkTableSwitchVI();
void printHkTableLatchups();
2021-09-16 14:51:14 +02:00
2022-01-18 11:41:19 +01:00
void parseHkTableReply(const uint8_t* packet);
2021-01-23 17:22:40 +01:00
};
2023-03-26 16:13:54 +02:00
#endif /* MISSION_POWER_PDU2HANDLER_H_ */