SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
thermal.hpp
Go to the documentation of this file.
1/*
2 * SatNOGS-COMMS MCU software
3 *
4 * Copyright (C) 2025, Libre Space Foundation <http://libre.space>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * SPDX-License-Identifier: GNU General Public License v3.0 or later
20 */
21
22#pragma once
23
24#include <utils/moving_avg.hpp>
25#include <zephyr/kernel.h>
26
27namespace satnogs::comms
28{
29
45class thermal
46{
47public:
48 static constexpr uint32_t task_wdg_period = 60000;
49
50 class state
51 {
52 public:
63
65 : uhf_triggered(false),
66 sband_triggered(false),
67 uhf_sensor_valid(false),
68 sband_sensor_valid(false),
69 pcb_sensor_valid(false)
70 {
71 }
72 };
73
74 static thermal &
76 {
77 static thermal instance;
78 return instance;
79 }
80
81 void
82 start();
83
84 state
85 get_state() const
86 {
87 return m_state;
88 }
89
90private:
91 state m_state;
92 bool m_uhf_triggered;
93 bool m_sband_triggered;
94 bool m_uhf_sensor_valid;
95 bool m_sband_sensor_valid;
96 bool m_pcb_sensor_valid;
100 k_tid_t m_tid;
101
102 thermal();
103
104 static void
105 thermal_thread(void *arg1, void *arg2, void *arg3);
106};
107
108} // namespace satnogs::comms
Thermal monitoring.
Definition thermal.hpp:46
void start()
Activates and starts the thermal monitoring mechanism.
Definition thermal.cpp:45
static constexpr uint32_t task_wdg_period
Definition thermal.hpp:48
state get_state() const
Definition thermal.hpp:85
static thermal & get_instance()
Definition thermal.hpp:75