2010-02-19 23:24:56 +00:00
|
|
|
//
|
|
|
|
// Copyright 2009 Free Software Foundation, Inc.
|
|
|
|
//
|
|
|
|
// This file is part of GNU Radio
|
|
|
|
//
|
|
|
|
// GNU Radio is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either asversion 3, or (at your option)
|
|
|
|
// any later version.
|
|
|
|
//
|
|
|
|
// GNU Radio is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with GNU Radio; see the file COPYING. If not, write to
|
|
|
|
// the Free Software Foundation, Inc., 51 Franklin Street,
|
|
|
|
// Boston, MA 02110-1301, USA.
|
2009-08-21 17:08:44 +00:00
|
|
|
|
|
|
|
#ifndef ADF4350_REGS_H
|
|
|
|
#define ADF4350_REGS_H
|
|
|
|
|
|
|
|
#include <usrp/db_base.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
class adf4350;
|
|
|
|
|
|
|
|
class adf4350_regs
|
|
|
|
{
|
|
|
|
public:
|
2010-06-03 21:35:18 +00:00
|
|
|
adf4350_regs();
|
2009-08-21 17:08:44 +00:00
|
|
|
~adf4350_regs();
|
|
|
|
|
|
|
|
uint32_t _reg_shift(uint32_t data, uint32_t shift);
|
2010-06-03 21:35:18 +00:00
|
|
|
uint32_t compute_register(uint8_t addr);
|
2009-08-21 17:08:44 +00:00
|
|
|
|
|
|
|
/* reg 0 */
|
2009-08-21 22:16:18 +00:00
|
|
|
uint16_t d_int;
|
|
|
|
uint16_t d_frac;
|
2009-08-21 17:08:44 +00:00
|
|
|
/* reg 1 */
|
2009-10-30 03:26:47 +00:00
|
|
|
uint8_t d_prescaler;
|
2009-08-21 22:16:18 +00:00
|
|
|
static const uint16_t s_phase;
|
|
|
|
uint16_t d_mod;
|
2009-08-21 17:08:44 +00:00
|
|
|
/* reg 2 */
|
2009-08-21 22:16:18 +00:00
|
|
|
static const uint8_t s_low_noise_and_low_spur_modes;
|
|
|
|
static const uint8_t s_muxout;
|
|
|
|
static const uint8_t s_reference_doubler;
|
|
|
|
static const uint8_t s_rdiv2;
|
|
|
|
uint16_t d_10_bit_r_counter;
|
|
|
|
static const uint8_t s_double_buff;
|
|
|
|
static const uint8_t s_charge_pump_setting;
|
|
|
|
static const uint8_t s_ldf;
|
|
|
|
static const uint8_t s_ldp;
|
|
|
|
static const uint8_t s_pd_polarity;
|
|
|
|
static const uint8_t s_power_down;
|
|
|
|
static const uint8_t s_cp_three_state;
|
|
|
|
static const uint8_t s_counter_reset;
|
2009-08-21 17:08:44 +00:00
|
|
|
/* reg 3 */
|
2009-08-21 22:16:18 +00:00
|
|
|
static const uint8_t s_csr;
|
|
|
|
static const uint8_t s_clk_div_mode;
|
|
|
|
static const uint16_t s_12_bit_clock_divider_value;
|
2009-08-21 17:08:44 +00:00
|
|
|
/* reg 4 */
|
2009-08-21 22:16:18 +00:00
|
|
|
static const uint8_t s_feedback_select;
|
|
|
|
uint8_t d_divider_select;
|
|
|
|
uint8_t d_8_bit_band_select_clock_divider_value;
|
|
|
|
static const uint8_t s_vco_power_down;
|
|
|
|
static const uint8_t s_mtld;
|
|
|
|
static const uint8_t s_aux_output_select;
|
|
|
|
static const uint8_t s_aux_output_enable;
|
|
|
|
static const uint8_t s_aux_output_power;
|
|
|
|
static const uint8_t s_rf_output_enable;
|
|
|
|
static const uint8_t s_output_power;
|
2009-08-21 17:08:44 +00:00
|
|
|
/* reg 5 */
|
2009-08-21 22:16:18 +00:00
|
|
|
static const uint8_t s_ld_pin_mode;
|
2010-06-03 21:35:18 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
usrp_basic_sptr d_usrp;
|
|
|
|
int d_spi_enable;
|
|
|
|
int d_spi_format;
|
2009-08-21 17:08:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ADF4350_REGS_H */
|