diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-04-26 14:57:37 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-04-26 14:57:37 +0200 |
commit | fd05ca739d94b23609e85e074fb659b5e279d358 (patch) | |
tree | 05235900d669dfe8cd903e4120069cd332785856 /src/output/Dexter.cpp | |
parent | c7961c2e8688d6db2a87b5079c60a04b8fe37e74 (diff) | |
download | dabmod-fd05ca739d94b23609e85e074fb659b5e279d358.tar.gz dabmod-fd05ca739d94b23609e85e074fb659b5e279d358.tar.bz2 dabmod-fd05ca739d94b23609e85e074fb659b5e279d358.zip |
dexter: set frequency to ad9957, lo_offset to dsp
Diffstat (limited to 'src/output/Dexter.cpp')
-rw-r--r-- | src/output/Dexter.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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); } } |