~ubuntu-branches/ubuntu/utopic/uhd/utopic

« back to all changes in this revision

Viewing changes to host/lib/usrp/dboard/db_dbsrx2.cpp

  • Committer: Package Import Robot
  • Author(s): A. Maitland Bottoms
  • Date: 2014-07-01 22:34:32 UTC
  • mfrom: (9.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20140701223432-beg73ip3q8b3lgeg
Tags: 3.7.1-2
* Apply maint branch fixes through release_003_007_001-49-gdf4cf6d
* Fix B2xx udev rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
/***********************************************************************
41
41
 * The DBSRX2 constants
42
42
 **********************************************************************/
43
 
static const freq_range_t dbsrx2_freq_range(0.8e9, 2.4e9);
 
43
static const freq_range_t dbsrx2_freq_range(0.8e9, 2.3e9);
44
44
 
45
45
//Multiplied by 2.0 for conversion to complex bandpass from lowpass
46
46
static const freq_range_t dbsrx2_bandwidth_range(2.0*4.0e6, 2.0*40.0e6);
245
245
    //target_freq = dbsrx2_freq_range.clip(target_freq);
246
246
 
247
247
    //variables used in the calculation below
248
 
    int scaler = target_freq > 1125e6 ? 2 : 4;
 
248
    int scaler = target_freq >= 1125e6 ? 2 : 4;
249
249
    double ref_freq = this->get_iface()->get_clock_rate(dboard_iface::UNIT_RX);
250
250
    int R, intdiv, fracdiv, ext_div;
251
251
    double N;
279
279
        << boost::format("    Actual Freq=%fMHz\n") % (_lo_freq/1e6)
280
280
        << std::endl;
281
281
 
282
 
    //send the registers
283
 
    send_reg(0x0, 0x7);
 
282
    //send the registers 0x0 through 0x7
 
283
    //writing register 0x4 (F divider LSB) starts the VCO auto seletion so it must be written last
 
284
    send_reg(0x5, 0x7);
 
285
    send_reg(0x0, 0x4);
284
286
 
285
287
    //FIXME: probably unnecessary to call get_locked here
286
288
    //get_locked();
304
306
 
305
307
    UHD_LOGV(often)
306
308
        << boost::format("DBSRX2 BBG Gain:\n")
307
 
        << boost::format("    %f dB, bbg: %d") % gain % reg 
 
309
        << boost::format("    %f dB, bbg: %d") % gain % reg
308
310
        << std::endl;
309
311
 
310
312
    return reg;
329
331
 
330
332
    UHD_LOGV(often)
331
333
        << boost::format("DBSRX2 GC1 Gain:\n")
332
 
        << boost::format("    %f dB, dac_volts: %f V") % gain % dac_volts 
 
334
        << boost::format("    %f dB, dac_volts: %f V") % gain % dac_volts
333
335
        << std::endl;
334
336
 
335
337
    //the actual gain setting