eive-obsw/mission/controller/controllerdefinitions/PowerCtrlDefinitions.h

51 lines
1.5 KiB
C
Raw Normal View History

2023-07-26 11:18:15 +02:00
#ifndef MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_
#define MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_
2023-07-28 11:36:20 +02:00
#include <fsfw/datapool/PoolReadGuard.h>
2023-07-26 11:18:15 +02:00
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
#include <fsfw/datapoollocal/localPoolDefinitions.h>
2023-07-28 11:36:20 +02:00
#include <mission/power/defs.h>
2023-07-26 11:18:15 +02:00
#include <cstdint>
namespace pwrctrl {
2023-09-29 10:16:23 +02:00
enum SetIds : uint32_t { CORE_HK, ENABLE_PL };
2023-07-26 11:18:15 +02:00
enum PoolIds : lp_id_t {
2023-07-28 11:36:20 +02:00
TOTAL_BATTERY_CURRENT,
2023-07-26 17:01:48 +02:00
OPEN_CIRCUIT_VOLTAGE_CHARGE,
COULOMB_COUNTER_CHARGE,
2023-09-29 10:16:23 +02:00
PAYLOAD_FLAG
2023-07-26 11:18:15 +02:00
};
2023-07-28 11:36:20 +02:00
static constexpr uint8_t CORE_HK_ENTRIES = 3;
2023-09-29 10:16:23 +02:00
static constexpr uint8_t ENABLE_PL_ENTRIES = 1;
2023-07-26 11:18:15 +02:00
2023-07-28 11:36:20 +02:00
class CoreHk : public StaticLocalDataSet<CORE_HK_ENTRIES> {
2023-07-26 11:18:15 +02:00
public:
2023-07-28 11:36:20 +02:00
CoreHk(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, CORE_HK) {}
2023-07-26 11:18:15 +02:00
2023-07-28 11:36:20 +02:00
lp_var_t<int16_t> totalBatteryCurrent =
lp_var_t<int16_t>(sid.objectId, TOTAL_BATTERY_CURRENT, this);
2023-07-26 17:01:48 +02:00
lp_var_t<float> openCircuitVoltageCharge =
lp_var_t<float>(sid.objectId, OPEN_CIRCUIT_VOLTAGE_CHARGE, this);
lp_var_t<float> coulombCounterCharge =
lp_var_t<float>(sid.objectId, COULOMB_COUNTER_CHARGE, this);
2023-07-26 11:18:15 +02:00
private:
};
2023-09-29 10:16:23 +02:00
class EnablePl : public StaticLocalDataSet<ENABLE_PL_ENTRIES> {
public:
EnablePl(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, ENABLE_PL) {}
lp_var_t<uint8_t> plUseAllowed = lp_var_t<uint8_t>(sid.objectId, PAYLOAD_FLAG, this);
private:
};
2023-07-26 11:18:15 +02:00
} // namespace pwrctrl
#endif /* MISSION_CONTROLLER_CONTROLLERDEFINITIONS_POWERCTRLDEFINITIONS_H_ */