GNU Radio 3.4.0 C++ API
db_wbxng_adf4350_regs.h
Go to the documentation of this file.
00001 //
00002 // Copyright 2009 Free Software Foundation, Inc.
00003 //
00004 // This file is part of GNU Radio
00005 //
00006 // GNU Radio is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either asversion 3, or (at your option)
00009 // any later version.
00010 //
00011 // GNU Radio is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU General Public License
00017 // along with GNU Radio; see the file COPYING.  If not, write to
00018 // the Free Software Foundation, Inc., 51 Franklin Street,
00019 // Boston, MA 02110-1301, USA.
00020 
00021 #ifndef ADF4350_REGS_H
00022 #define ADF4350_REGS_H
00023 
00024 #include <usrp/db_base.h>
00025 #include <stdint.h>
00026 
00027 class adf4350;
00028 
00029 class adf4350_regs
00030 {
00031 public:
00032     adf4350_regs();
00033     ~adf4350_regs();
00034 
00035     uint32_t _reg_shift(uint32_t data, uint32_t shift);
00036     uint32_t compute_register(uint8_t addr);
00037 
00038     /* reg 0 */
00039     uint16_t d_int;
00040     uint16_t d_frac;
00041     /* reg 1 */
00042     uint8_t d_prescaler;
00043     static const uint16_t s_phase;
00044     uint16_t d_mod;
00045     /* reg 2 */
00046     static const uint8_t s_low_noise_and_low_spur_modes;
00047     static const uint8_t s_muxout;
00048     static const uint8_t s_reference_doubler;
00049     static const uint8_t s_rdiv2;
00050     uint16_t d_10_bit_r_counter;
00051     static const uint8_t s_double_buff;
00052     static const uint8_t s_charge_pump_setting;
00053     static const uint8_t s_ldf;
00054     static const uint8_t s_ldp;
00055     static const uint8_t s_pd_polarity;
00056     static const uint8_t s_power_down;
00057     static const uint8_t s_cp_three_state;
00058     static const uint8_t s_counter_reset;
00059     /* reg 3 */
00060     static const uint8_t s_csr;
00061     static const uint8_t s_clk_div_mode;
00062     static const uint16_t s_12_bit_clock_divider_value;
00063     /* reg 4 */
00064     static const uint8_t s_feedback_select;
00065     uint8_t d_divider_select;
00066     uint8_t d_8_bit_band_select_clock_divider_value;
00067     static const uint8_t s_vco_power_down;
00068     static const uint8_t s_mtld;
00069     static const uint8_t s_aux_output_select;
00070     static const uint8_t s_aux_output_enable;
00071     static const uint8_t s_aux_output_power;
00072     static const uint8_t s_rf_output_enable;
00073     static const uint8_t s_output_power;
00074     /* reg 5 */
00075     static const uint8_t s_ld_pin_mode;
00076 
00077 protected:
00078     usrp_basic_sptr d_usrp;
00079     int d_spi_enable;
00080     int d_spi_format;
00081 };
00082 
00083 #endif /* ADF4350_REGS_H */