Skip to content
Snippets Groups Projects
Commit 96e9234d authored by Sergey Musikhin's avatar Sergey Musikhin
Browse files

lpf mode

parent c16e4a26
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,7 @@ parameters:
default: 'none'
options: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom']
option_labels: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom']
hide: part
- id: tamer
category: x40/x115
......@@ -128,6 +129,16 @@ parameters:
default: 'internal'
options: ['internal','external_1pps', 'external']
option_labels: ['Internal','External 1pps', 'External 10 MHz']
hide: part
- id: lpf_mode
label: 'LPF mode'
category: x40/x115
dtype: enum
default: 'disabled'
options: ['disabled', 'bypassed']
option_labels: ['Disabled', 'Bypassed']
hide: part
......@@ -185,6 +196,7 @@ templates:
+ ",dac=" + str(${'$'}{dac})
+ ",xb200=" + '${'$'}{xb200}'
+ ",tamer=" + '${'$'}{tamer}'
+ ",lpf_mode="+'${'$'}{lpf_mode}'
+ ",trigger0="+'${'$'}{trigger0}'
+ ",trigger_role0="+'${'$'}{trigger_role0}'
+ ",trigger_signal0="+'${'$'}{trigger_signal0}'
......@@ -194,6 +206,7 @@ templates:
+ ",bias_tee0="+'${'$'}{bias_tee0}'
+ ",bias_tee1="+'${'$'}{bias_tee1}'
)
self.${'$'}{id}.set_sample_rate(${'$'}{sample_rate})
% for n in range(max_nchan):
......@@ -412,6 +425,8 @@ PARAMS_TMPL = """
option_labels: ['J71_4', 'J51_1', 'MINI_EXP_1', 'USER_0', 'USER_1', 'USER_2', 'USER_3', 'USER_4', 'USER_5', 'USER_6', 'USER_7']
hide: ${'$'}{ 'part' if (nchan > ${n}) else 'all'}
"""
......
......@@ -418,6 +418,15 @@ void bladerf_common::init_bladerf1(const dict_t &dict, bladerf_direction directi
if (dict.count("tamer")) {
set_clock_source(_get(dict, "tamer"));
}
bladerf_channel ch = (direction == BLADERF_RX) ? BLADERF_CHANNEL_RX(0)
: BLADERF_CHANNEL_TX(0);
if (dict.count("lpf_mode")) {
bladerf_lpf_mode mode = _get(dict, "lpf_mode") == "bypassed"
? BLADERF_LPF_BYPASSED : BLADERF_LPF_DISABLED;
set_lpf_mode(ch, mode);
}
}
void bladerf_common::init_bladerf2(const dict_t &dict, bladerf_direction direction)
......@@ -1319,6 +1328,15 @@ double bladerf_common::get_smb_frequency()
return static_cast<double>(actual_frequency);
}
void bladerf_common::set_lpf_mode(bladerf_channel ch, bladerf_lpf_mode mode)
{
auto status = bladerf_set_lpf_mode(_dev.get(), ch, mode);
if(status != 0)
{
BLADERF_THROW_STATUS(status, "Failed to set LPF mode");
}
}
/******************************************************************************
* Private methods
******************************************************************************/
......
......@@ -273,6 +273,9 @@ protected:
/* Get the current SMB frequency */
double get_smb_frequency();
void set_lpf_mode(bladerf_channel ch, bladerf_lpf_mode mode);
/*****************************************************************************
* Protected members
****************************************************************************/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment