00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DB_DBS_RX_H
00023 #define DB_DBS_RX_H
00024
00025 #include <db_base.h>
00026 #include <vector>
00027
00028 #if 0
00029 struct bw_t {
00030 int m;
00031 int fdac;
00032 float div;
00033 };
00034 #endif
00035
00036 class db_dbs_rx : public db_base
00037 {
00038 private:
00039 int d_osc, d_cp, d_n, d_div2, d_r, d_r_int;
00040 int d_fdac, d_m, d_dl, d_ade, d_adl, d_gc1, d_gc2, d_diag;
00041 int d_i2c_addr;
00042
00043
00044 void _write_reg(int regno, int v);
00045 void _write_regs(int starting_regno, const std::vector<int> &vals);
00046 std::vector<int> _read_status();
00047 void _send_reg(int regno);
00048 void _set_m(int m);
00049 void _set_fdac(int fdac);
00050 void _set_dl(int dl);
00051 void _set_gc2(int gc2);
00052 void _set_gc1(int gc1);
00053 void _set_pga(int pga_gain);
00054
00055
00056 void _set_osc(int osc);
00057 void _set_cp(int cp);
00058 void _set_n(int n);
00059 void _set_div2(int div2);
00060 void _set_r(int r);
00061 void _set_ade(int ade);
00062
00063 int _refclk_divisor();
00064
00065 protected:
00066 void shutdown();
00067
00068 public:
00069 db_dbs_rx(usrp_basic_sptr usrp, int which);
00070 ~db_dbs_rx();
00071
00072 float gain_min();
00073 float gain_max();
00074 float gain_db_per_step();
00075 double freq_min();
00076 double freq_max();
00077 struct freq_result_t set_freq(double freq);
00078 bool set_gain(float gain);
00079 bool is_quadrature();
00080 bool set_bw(float bw);
00081 };
00082
00083 #endif