aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard/magnesium/magnesium_gain_table.hpp
blob: 28a75ef5b31b0400a205acc7df29a559aa04e452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Copyright 2017 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0
//

#ifndef INCLUDED_LIBUHD_MAGNESIUM_GAIN_TABLE_HPP
#define INCLUDED_LIBUHD_MAGNESIUM_GAIN_TABLE_HPP

#include "magnesium_radio_ctrl_impl.hpp"
#include <uhd/types/direction.hpp>

namespace magnesium {

/*! Store all gain-table related settings for the N310 (Magnesium) daughterboard
 *
 * For every requested gain value, one of these will be returned. Works for TX
 * and RX paths.
 */
struct gain_tuple_t
{
    //! Attenuation value of the DSA in dB
    double dsa_att;
    //! Attenuation value of Mykonos (AD9371) in dB
    double ad9371_att;
    //! If true, bypass LNA or PA section
    bool bypass;
};


/*! Given a gain index, return a tuple of gain-related settings (Rx)
 */
gain_tuple_t get_rx_gain_tuple(
    const double gain_index,
    const uhd::rfnoc::magnesium_radio_ctrl_impl::rx_band band_
);

/*! Given a gain index, return a tuple of gain-related settings (Tx)
 */
gain_tuple_t get_tx_gain_tuple(
    const double gain_index,
    const uhd::rfnoc::magnesium_radio_ctrl_impl::tx_band band_
);

} /* namespace magnesium */

#endif