eive-obsw/bsp_q7s/core/defs.h

46 lines
1.4 KiB
C
Raw Permalink Normal View History

2023-07-03 16:55:45 +02:00
#ifndef BSP_Q7S_CORE_DEFS_H_
#define BSP_Q7S_CORE_DEFS_H_
2022-03-13 16:32:40 +01:00
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
namespace core {
2023-07-03 16:55:45 +02:00
extern uint8_t FW_VERSION_MAJOR;
extern uint8_t FW_VERSION_MINOR;
extern uint8_t FW_VERSION_REVISION;
extern bool FW_VERSION_HAS_SHA;
extern char FW_VERSION_GIT_SHA[4];
2022-03-13 18:29:14 +01:00
static const uint8_t HK_SET_ENTRIES = 3;
2022-03-13 16:32:40 +01:00
static const uint32_t HK_SET_ID = 5;
enum PoolIds { TEMPERATURE, PS_VOLTAGE, PL_VOLTAGE };
2022-03-13 16:32:40 +01:00
/**
* @brief Set storing OBC internal housekeeping data
*/
class HkSet : public StaticLocalDataSet<HK_SET_ENTRIES> {
public:
HkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_SET_ID) {}
HkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, HK_SET_ID)) {}
// On-chip temperature
lp_var_t<float> temperature = lp_var_t<float>(sid.objectId, PoolIds::TEMPERATURE, this);
// Processing system VCC
lp_var_t<float> psVoltage = lp_var_t<float>(sid.objectId, PoolIds::PS_VOLTAGE, this);
// Programmable logic VCC
lp_var_t<float> plVoltage = lp_var_t<float>(sid.objectId, PoolIds::PL_VOLTAGE, this);
void printSet() {
sif::info << "HkSet::printSet: On-chip temperature: " << this->temperature << " °C"
<< std::endl;
2022-03-13 16:32:40 +01:00
sif::info << "HkSet::printSet: PS voltage: " << this->psVoltage << " mV" << std::endl;
sif::info << "HkSet::printSet: PL voltage: " << this->plVoltage << " mV" << std::endl;
}
};
} // namespace core
2022-03-13 16:32:40 +01:00
2023-07-03 16:55:45 +02:00
#endif /* BSP_Q7S_CORE_DEFS_H_ */