eive-obsw/mission/devices/PDU2Handler.h
Robin Mueller 1a0f9164ef
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
Add Latchup print commands
2022-03-14 14:46:26 +01:00

55 lines
1.9 KiB
C++

#ifndef MISSION_DEVICES_PDU2HANDLER_H_
#define MISSION_DEVICES_PDU2HANDLER_H_
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#include "GomspaceDeviceHandler.h"
/**
* @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
* SUS 8-12 Redundant, 3.3V, channel 4
* Deployment mechanism, 8V, channel 5
* P/L PCDU, Battery voltage (Vnominal = 14.8V), channel 1 and channel 6
* ACS Board (Gyro, MGMs, GPS), 3.3V channel 7
* Payload Camera, 8V, channel 8
*/
class PDU2Handler : public GomspaceDeviceHandler {
public:
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
virtual ~PDU2Handler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
void assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void* args);
protected:
/**
* @brief As soon as the device is in MODE_NORMAL, this function is executed periodically.
*/
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t* packet) override;
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExecution) override;
private:
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 24;
/** Dataset for the housekeeping table of the PDU2 */
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
GOMSPACE::ChannelSwitchHook channelSwitchHook = nullptr;
void* hookArgs = nullptr;
void printHkTableSwitchVI();
void printHkTableLatchups();
void parseHkTableReply(const uint8_t* packet);
};
#endif /* MISSION_DEVICES_PDU2HANDLER_H_ */