Statistics
| Branch: | Tag: | Revision:

root / host / lib / usrp / usrp2 / codec_ctrl.hpp @ dc2f14d7

History | View | Annotate | Download (2.07 KB)

1
//
2
// Copyright 2010-2012 Ettus Research LLC
3
//
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
//
17

    
18
#ifndef INCLUDED_CODEC_CTRL_HPP
19
#define INCLUDED_CODEC_CTRL_HPP
20

    
21
#include "usrp2_iface.hpp"
22
#include <boost/shared_ptr.hpp>
23
#include <boost/utility.hpp>
24

    
25
class usrp2_codec_ctrl : boost::noncopyable{
26
public:
27
    typedef boost::shared_ptr<usrp2_codec_ctrl> sptr;
28

    
29
    /*!
30
     * Make a codec control for the DAC and ADC.
31
     * \param iface a pointer to the usrp2 interface object
32
     * \param spiface the interface to spi
33
     * \return a new codec control object
34
     */
35
    static sptr make(usrp2_iface::sptr iface, uhd::spi_iface::sptr spiface);
36

    
37
    /*!
38
     * Set the modulation mode for the DAC.
39
     * Possible modes are 0, +/-1, +/-2, +/-4, +/-8
40
     * which correspond to shifts of fs/mod_mode.
41
     * A mode of 0 or +/-1 means no modulation.
42
     * \param mod_mode the modulation mode
43
     */
44
    virtual void set_tx_mod_mode(int mod_mode) = 0;
45

    
46
    /*!
47
     * Set the analog preamplifier on the USRP2+ ADC (ADS62P44).
48
     * \param gain enable or disable the 3.5dB preamp
49
     */
50

    
51
    virtual void set_rx_analog_gain(bool gain) = 0;
52

    
53
    /*!
54
     * Set the digital gain on the USRP2+ ADC (ADS62P44).
55
     * \param gain from 0-6dB
56
     */
57

    
58
    virtual void set_rx_digital_gain(double gain) = 0;
59

    
60
    /*!
61
     * Set the digital gain correction on the USRP2+ ADC (ADS62P44).
62
     * \param gain from 0-0.5dB
63
     */
64

    
65
    virtual void set_rx_digital_fine_gain(double gain) = 0;
66

    
67
};
68

    
69
#endif /* INCLUDED_CODEC_CTRL_HPP */