SatNOGS-COMMS
4.1.0
A COMMS subsystem for CubeSats
Toggle main menu visibility
Loading...
Searching...
No Matches
test.hpp
Go to the documentation of this file.
1
/*
2
* SatNOGS-COMMS MCU software
3
*
4
* Copyright (C) 2023, 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 <
satnogs-comms-lib/board.hpp
>
25
#include <zephyr/kernel.h>
26
27
namespace
satnogs::comms
28
{
29
class
test
30
{
31
public
:
32
struct
params_work_container
33
{
34
struct
k_work
work
;
35
int
test_id
;
36
uint32_t
param0
;
37
uint32_t
param1
;
38
uint32_t
param2
;
39
};
40
41
static
test
&
42
get_instance
()
43
{
44
static
test
inst;
45
return
inst;
46
}
47
48
enum class
test_id
:
int
49
{
50
TX_UHF_SIMPLE
= 0,
51
TX_SBAND_SIMPLE
= 1,
52
EMMC_SIMPLE
= 2,
53
EMC_ROUTINE
= 3
54
};
55
56
/* Singleton */
57
test
(
test
const
&) =
delete
;
58
59
void
60
operator=
(
test
const
&) =
delete
;
61
62
void
63
exec_test
(
test_id
id
, std::initializer_list<uint32_t> params);
64
65
void
66
stop
();
67
68
bool
69
running
()
const
;
70
71
void
72
emc_routine
();
73
74
bool
75
emmc_success
()
const
;
76
77
private
:
78
test
();
79
80
static
void
81
exec(
struct
k_work *item);
82
83
void
84
uhf_tx_simple(uint32_t nframes, uint32_t delay_us, uint32_t len);
85
86
void
87
sband_tx_simple(uint32_t nframes, uint32_t delay_us, uint32_t len);
88
89
void
90
emmc_simple(uint32_t nbytes);
91
92
void
93
init_workq();
94
95
void
96
tx_simple(
satnogs::comms::lib::radio::interface
iface, uint32_t nframes,
97
uint32_t delay_us, uint32_t len);
98
bool
m_emmc_success;
99
bool
m_running;
100
bool
m_stop;
101
struct
params_work_container
m_test_internal_params;
102
};
103
104
}
// namespace satnogs::comms
board.hpp
satnogs::comms::lib::radio::interface
interface
Radio interface identifier.
Definition
radio.hpp:177
satnogs::comms::test::operator=
void operator=(test const &)=delete
satnogs::comms::test::running
bool running() const
Definition
test.cpp:288
satnogs::comms::test::emmc_success
bool emmc_success() const
Definition
test.cpp:157
satnogs::comms::test::test
test(test const &)=delete
satnogs::comms::test::test_id
test_id
Definition
test.hpp:49
satnogs::comms::test::test_id::EMC_ROUTINE
@ EMC_ROUTINE
Definition
test.hpp:53
satnogs::comms::test::test_id::TX_UHF_SIMPLE
@ TX_UHF_SIMPLE
Definition
test.hpp:50
satnogs::comms::test::test_id::EMMC_SIMPLE
@ EMMC_SIMPLE
Definition
test.hpp:52
satnogs::comms::test::test_id::TX_SBAND_SIMPLE
@ TX_SBAND_SIMPLE
Definition
test.hpp:51
satnogs::comms::test::exec_test
void exec_test(test_id id, std::initializer_list< uint32_t > params)
Definition
test.cpp:64
satnogs::comms::test::get_instance
static test & get_instance()
Definition
test.hpp:42
satnogs::comms::test::emc_routine
void emc_routine()
A simple routine for EMC testing.
Definition
test.cpp:222
satnogs::comms::test::stop
void stop()
Definition
test.cpp:282
satnogs::comms
Definition
bsp.cpp:28
satnogs::comms::test::params_work_container
Definition
test.hpp:33
satnogs::comms::test::params_work_container::param2
uint32_t param2
Definition
test.hpp:38
satnogs::comms::test::params_work_container::test_id
int test_id
Definition
test.hpp:35
satnogs::comms::test::params_work_container::param1
uint32_t param1
Definition
test.hpp:37
satnogs::comms::test::params_work_container::param0
uint32_t param0
Definition
test.hpp:36
satnogs::comms::test::params_work_container::work
struct k_work work
Definition
test.hpp:34
src
tests
test.hpp
Generated by
1.17.0