aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/n230/n230_frontend_ctrl.hpp
blob: c5aa302de1d6b8d159bed80f100d75ffc015b35f (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Copyright 2013-2014 Ettus Research LLC
//
// SPDX-License-Identifier: GPL-3.0
//

#ifndef INCLUDED_N230_FRONTEND_CTRL_HPP
#define INCLUDED_N230_FRONTEND_CTRL_HPP

#include "radio_ctrl_core_3000.hpp"
#include "ad9361_ctrl.hpp"
#include "gpio_atr_3000.hpp"
#include <uhd/types/sensors.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include <vector>
#include "n230_fpga_defs.h"

namespace uhd { namespace usrp { namespace n230 {

enum fe_state_t {
    NONE_STREAMING, TX_STREAMING, RX_STREAMING, TXRX_STREAMING
};

enum self_test_mode_t {
    LOOPBACK_DISABLED, LOOPBACK_RADIO, LOOPBACK_CODEC
};


class n230_frontend_ctrl : boost::noncopyable
{
public:
    typedef boost::shared_ptr<n230_frontend_ctrl> sptr;

    static sptr make(
        radio_ctrl_core_3000::sptr core_ctrl,
        fpga::core_misc_reg_t& core_misc_reg,
        ad9361_ctrl::sptr codec_ctrl,
        const std::vector<gpio_atr::gpio_atr_3000::sptr>& gpio_cores);

    virtual ~n230_frontend_ctrl() {}

    virtual void set_antenna_sel(
        const size_t which,
        const std::string &ant) = 0;

    virtual void set_stream_state(
        const size_t which,
        const fe_state_t state) = 0;

    virtual void set_stream_state(
        const fe_state_t fe0_state,
        const fe_state_t fe1_state) = 0;

    virtual void set_bandsel(
        const std::string& which,
        double freq) = 0;

    virtual void set_self_test_mode(
        self_test_mode_t mode) = 0;
};

}}} //namespace

#endif /* INCLUDED_N230_FRONTEND_CTRL_HPP */