SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
rf_frontend.hpp
Go to the documentation of this file.
1/*
2 * SatNOGS-COMMS control library
3 *
4 * Copyright (C) 2022-2024, 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 <at86rf215.h>
25#include <etl/string.h>
33#include <utility>
34
35namespace satnogs::comms::lib
36{
37
43{
44public:
49 class params
50 {
51 public:
52 const std::pair<uint32_t, uint32_t> rx_range;
53 const std::pair<uint32_t, uint32_t> tx_range;
54 const std::pair<float, float>
57 const std::pair<float, float>
59 const std::pair<float, float>
64 const std::pair<float, float>
69 };
70
78
82 enum class dir : uint8_t
83 {
87 };
88
92 enum class gain_mode : uint8_t
93 {
96 };
97
98 enum class filter : uint8_t
99 {
102 };
103
112 {
113 public:
115 union
116 {
117 float tgt;
118 float gain;
121 union
122 {
123 at86rf215_agc_conf agc;
127 float gain;
129 };
130
131 rf_frontend(const params &init_params, io_conf &&io, power &pwr);
132
137 virtual void
138 enable(bool set = true) = 0;
139
140 virtual bool
141 enabled() const = 0;
142
143 virtual void
145
146 virtual filter
147 get_filter() const;
148
149 virtual void
150 set_direction(dir d, uint64_t lo_freq = 0) = 0;
151
152 dir
153 direction() const;
154
155 void
156 set_rx_gain(const rx_gain_params &gain);
157
158 bool
159 frequency_valid(dir d, uint32_t freq) const;
160
161protected:
168};
169
170} // namespace satnogs::comms::lib
DAC device abstraction.
Definition dac.hpp:40
GPIO device abstraction.
Definition gpio.hpp:38
Manages power supplies and monitors subsystem status.
Definition power.hpp:43
RF frontend initialization settings.
const std::pair< float, float > gain0_calib
const std::pair< float, float > gain0_range
The gainl range of the first gain stage.
const std::pair< float, float > agc0_calib
const std::pair< uint32_t, uint32_t > rx_range
RX tuning range.
const std::pair< float, float > agc0_range
const std::pair< uint32_t, uint32_t > tx_range
TX tuning range.
RX gain settings for the two different gain stages. Gain0 stage corresponds to the first stage (close...
union satnogs::comms::lib::rf_frontend::rx_gain_params::@057170116231345201073375110000256144366370046377 gain0
float tgt
Target signal level for the AGC [-60, -35].
union satnogs::comms::lib::rf_frontend::rx_gain_params::@215011014006014333052114215072331261330071377362 gain1
float gain
Fixed gain value in dB [-6, 29.5].
virtual void enable(bool set=true)=0
void set_rx_gain(const rx_gain_params &gain)
Sets the RX gain parameters.
virtual bool enabled() const =0
virtual void set_filter(filter f)
virtual filter get_filter() const
bool frequency_valid(dir d, uint32_t freq) const
Checks if a frequency is within the permissible range.
rf_frontend(const params &init_params, io_conf &&io, power &pwr)
virtual void set_direction(dir d, uint64_t lo_freq=0)=0