2b0783c20719e0127eb414cb71f68d50f24eb85f
[debian/gnuradio] / usrp / host / lib / db_wbxng_adf4350.h
1 //
2 // Copyright 2009 Free Software Foundation, Inc.
3 //
4 // This file is part of GNU Radio
5 //
6 // GNU Radio 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 asversion 3, or (at your option)
9 // any later version.
10 //
11 // GNU Radio 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 GNU Radio; see the file COPYING.  If not, write to
18 // the Free Software Foundation, Inc., 51 Franklin Street,
19 // Boston, MA 02110-1301, USA.
20
21 #ifndef INCLUDED_ADF4350_H
22 #define INCLUDED_ADF4350_H
23
24 #include "db_wbxng_adf4350_regs.h"
25 #include <usrp/db_base.h>
26 #include <stdint.h>
27
28 typedef uint64_t freq_t;
29 class adf4350_regs;
30
31 class adf4350
32 {
33 public:
34     adf4350(usrp_basic_sptr _usrp, int _which, int _spi_enable);
35     ~adf4350();
36     void _update();
37     bool _get_locked();
38     void _enable(bool enable);
39     void _write(uint8_t addr, uint32_t data);
40     bool _set_freq(freq_t freq);
41     freq_t _get_freq();
42     freq_t _get_max_freq();
43     freq_t _get_min_freq();
44
45 protected:
46     usrp_basic_sptr d_usrp;
47     int d_which;
48     int d_spi_enable;
49     int d_spi_format;
50     adf4350_regs *d_regs;
51 };
52
53 #endif /* INCLUDED_ADF4350_H */