From a5c88f85716ce84dda8348281a8fd877d72f5e48 Mon Sep 17 00:00:00 2001 From: Sergey Musikhin <musihin_sergei@mail.ru> Date: Tue, 15 Jun 2021 21:05:30 +0000 Subject: [PATCH] use dac --- grc/gen_bladerf_blocks.py | 8 ++++++++ lib/bladerf/bladerf_common.cc | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/grc/gen_bladerf_blocks.py b/grc/gen_bladerf_blocks.py index b891acf..3485640 100644 --- a/grc/gen_bladerf_blocks.py +++ b/grc/gen_bladerf_blocks.py @@ -87,11 +87,18 @@ parameters: options: [False, True] option_labels: ['Disable', 'Enable'] +- id: use_dac + label: 'Use VCXTO DAC' + dtype: enum + default: False + options: ['False', 'True'] + hide: part - id: dac label: 'VCXTO DAC' dtype: real default: 10000 + hide: ${'$'}{ 'none' if use_dac == 'True' else 'part'} - id: xb200 category: x40/x115 @@ -181,6 +188,7 @@ templates: + ",ref_clk=" + str(int(${'$'}{ref_clk})) + ",in_clk=" + '${'$'}{in_clk}' + ",out_clk=" + str(${'$'}{out_clk}) + + ",use_dac=" + '${'$'}{use_dac}' + ",dac=" + str(${'$'}{dac}) + ",xb200=" + '${'$'}{xb200}' + ",tamer=" + '${'$'}{tamer}' diff --git a/lib/bladerf/bladerf_common.cc b/lib/bladerf/bladerf_common.cc index d32f71c..ab38a6f 100644 --- a/lib/bladerf/bladerf_common.cc +++ b/lib/bladerf/bladerf_common.cc @@ -309,7 +309,9 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction) } else { - if (dict.count("dac")) { + if (dict.count("dac") + && dict.count("use_dac") + && _get(dict, "use_dac") == "True") { init_dac(boost::lexical_cast<uint16_t>(_get(dict, "dac"))); } } -- GitLab