eive-obsw/mission/power/Pdu1Handler.h

60 lines
2.1 KiB
C
Raw Normal View History

2021-01-28 14:55:21 +01:00
#ifndef MISSION_DEVICES_PDU1Handler_H_
#define MISSION_DEVICES_PDU1Handler_H_
2023-03-26 16:13:54 +02:00
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/gsDefs.h>
2021-01-28 14:55:21 +01:00
/**
* @brief This is the device handler for the PDU1.
*
* @details The PDU1 controls the
* power supply of the following devices:
* TCS Board, 3.3V, channel 0
* Syrlinks, 12V, channel 1
* Star Tracker, 5V, channel 2
* MGT, 5V, channel 3
* SUS 1-6 Nominal, 3.3V, channel 4
* Solar cell experiment, 5V, channel 5
* PLOC, 12V, channel 6
* ACS 3.3V for Side A group, channel 7
* Unoccupied, 5V, channel 8
*/
2023-03-14 13:32:13 +01:00
class Pdu1Handler : public GomspaceDeviceHandler {
2022-01-18 11:41:19 +01:00
public:
2023-03-14 13:32:13 +01:00
Pdu1Handler(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 ~Pdu1Handler();
2021-02-06 16:13:31 +01:00
2022-01-18 11:41:19 +01:00
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
2021-01-28 14:55:21 +01:00
2022-01-19 18:05:17 +01:00
void assignChannelHookFunction(GOMSPACE::ChannelSwitchHook hook, void* args);
2022-01-19 17:10:51 +01:00
2022-01-18 11:41:19 +01:00
protected:
/**
* @brief In MODE_NORMAL, a command will be built periodically by this function.
*/
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-04-07 12:22:08 +02:00
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
2022-01-19 18:51:44 +01:00
ReturnValue_t setParamCallback(SetParamMessageUnpacker& unpacker, bool afterExectuion) override;
2022-01-19 17:10:51 +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 PDU1 */
2022-04-07 19:48:09 +02:00
PDU1::Pdu1CoreHk coreHk;
PDU1::Pdu1AuxHk 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;
2022-01-18 11:41:19 +01:00
void printHkTableSwitchVI();
void printHkTableLatchups();
2022-01-18 11:41:19 +01:00
void parseHkTableReply(const uint8_t* packet);
2021-01-28 14:55:21 +01:00
};
#endif /* MISSION_DEVICES_PDU1Handler_H_ */