summaryrefslogtreecommitdiff
path: root/gr-uhd/lib/rfnoc_duc_impl.cc
blob: c77f2313b4db37d33980f4426081c6fced25683d (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
/* -*- c++ -*- */
/*
 * Copyright 2019 Ettus Research, a National Instruments Brand.
 * Copyright 2020 Free Software Foundation, Inc.
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "rfnoc_duc_impl.h"
#include <gnuradio/io_signature.h>

namespace gr {
namespace uhd {

rfnoc_duc::sptr rfnoc_duc::make(rfnoc_graph::sptr graph,
                                const ::uhd::device_addr_t& block_args,
                                const int device_select,
                                const int instance)
{
    return gnuradio::get_initial_sptr(new rfnoc_duc_impl(
        rfnoc_block::make_block_ref(graph, block_args, "DUC", device_select, instance)));
}


rfnoc_duc_impl::rfnoc_duc_impl(::uhd::rfnoc::noc_block_base::sptr block_ref)
    : rfnoc_block(block_ref), d_duc_ref(get_block_ref<::uhd::rfnoc::duc_block_control>())
{
}

rfnoc_duc_impl::~rfnoc_duc_impl() {}

/******************************************************************************
 * rfnoc_duc API
 *****************************************************************************/
double rfnoc_duc_impl::set_freq(const double freq,
                                const size_t chan,
                                const ::uhd::time_spec_t time)
{
    return d_duc_ref->set_freq(freq, chan, time);
}

double rfnoc_duc_impl::set_input_rate(const double rate, const size_t chan)
{
    return d_duc_ref->set_input_rate(rate, chan);
}

} /* namespace uhd */
} /* namespace gr */