From fd05ca739d94b23609e85e074fb659b5e279d358 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 26 Apr 2023 14:57:37 +0200 Subject: dexter: set frequency to ad9957, lo_offset to dsp --- src/output/Dexter.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/output/Dexter.cpp') diff --git a/src/output/Dexter.cpp b/src/output/Dexter.cpp index 515d810..2d053aa 100644 --- a/src/output/Dexter.cpp +++ b/src/output/Dexter.cpp @@ -277,12 +277,18 @@ Dexter::~Dexter() void Dexter::tune(double lo_offset, double frequency) { - // TODO lo_offset - long long freq = m_conf.frequency - 204800000; + // lo_offset is applied to the DSP, and frequency is given to the ad9957 + + long long freq = frequency; int r = 0; + if ((r = iio_device_attr_write_longlong(m_ad9957_tx0, "center_frequency", freq)) != 0) { + etiLog.level(warn) << "Failed to set ad9957_tx0.center_frequency = " << freq << " : " << get_iio_error(r); + } + + long long lo_offs = lo_offset; - if ((r = iio_device_attr_write_longlong(m_dexter_dsp_tx, "frequency0", freq)) != 0) { - etiLog.level(warn) << "Failed to set dexter_dsp_tx.frequency0 = " << freq << " : " << get_iio_error(r); + if ((r = iio_device_attr_write_longlong(m_dexter_dsp_tx, "frequency0", lo_offs)) != 0) { + etiLog.level(warn) << "Failed to set dexter_dsp_tx.frequency0 = " << lo_offs << " : " << get_iio_error(r); } } -- cgit v1.2.3