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

split init bladerf1/bladerf2, tamer

parent c16f54a7
No related branches found
No related tags found
No related merge requests found
...@@ -114,13 +114,21 @@ parameters: ...@@ -114,13 +114,21 @@ parameters:
default: 10000 default: 10000
- id: xb200 - id: xb200
category: Advanced category: x40/x115
label: 'XB-200' label: 'XB-200'
dtype: enum dtype: enum
default: 'none' default: 'none'
options: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom'] options: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom']
option_labels: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom'] option_labels: ['none','auto', 'auto3db', '50M', '144M', '222M', 'custom']
- id: tamer
category: x40/x115
label: 'Tamer'
dtype: enum
default: 'internal'
options: ['internal','external_1pps', 'external']
option_labels: ['Internal','External 1pps', 'External 10 MHz']
...@@ -176,6 +184,7 @@ templates: ...@@ -176,6 +184,7 @@ templates:
+ ",out_clk=" + str(${'$'}{out_clk}) + ",out_clk=" + str(${'$'}{out_clk})
+ ",dac=" + str(${'$'}{dac}) + ",dac=" + str(${'$'}{dac})
+ ",xb200=" + '${'$'}{xb200}' + ",xb200=" + '${'$'}{xb200}'
+ ",tamer=" + '${'$'}{tamer}'
+ ",trigger0="+'${'$'}{trigger0}' + ",trigger0="+'${'$'}{trigger0}'
+ ",trigger_role0="+'${'$'}{trigger_role0}' + ",trigger_role0="+'${'$'}{trigger_role0}'
+ ",trigger_signal0="+'${'$'}{trigger_signal0}' + ",trigger_signal0="+'${'$'}{trigger_signal0}'
......
...@@ -271,10 +271,16 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction) ...@@ -271,10 +271,16 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
"fpga=/path/to/the/bitstream.rbf to load it."); "fpga=/path/to/the/bitstream.rbf to load it.");
} }
if (dict.count("xb200") && _get(dict, "xb200") != "none") { if(get_board_type() == BOARD_TYPE_BLADERF_1)
init_xb200(_get(dict, "xb200"), direction); {
init_bladerf1(dict, direction);
} }
if(get_board_type() == BOARD_TYPE_BLADERF_2)
{
init_bladerf2(dict, direction);
}
if(dict.count("ref_clk")) if(dict.count("ref_clk"))
{ {
...@@ -334,11 +340,7 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction) ...@@ -334,11 +340,7 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
/* Show some info about the device we've opened */ /* Show some info about the device we've opened */
print_device_info(); print_device_info();
if (dict.count("tamer")) {
set_clock_source(_get(dict, "tamer"));
BLADERF_INFO(boost::str(boost::format("Tamer mode set to '%s'")
% get_clock_source()));
}
...@@ -408,6 +410,21 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction) ...@@ -408,6 +410,21 @@ void bladerf_common::init(dict_t const &dict, bladerf_direction direction)
% _num_transfers)); % _num_transfers));
} }
void bladerf_common::init_bladerf1(const dict_t &dict, bladerf_direction direction)
{
if (dict.count("xb200") && _get(dict, "xb200") != "none") {
init_xb200(_get(dict, "xb200"), direction);
}
if (dict.count("tamer")) {
set_clock_source(_get(dict, "tamer"));
}
}
void bladerf_common::init_bladerf2(const dict_t &dict, bladerf_direction direction)
{
}
std::vector<std::string> bladerf_common::devices() std::vector<std::string> bladerf_common::devices()
{ {
struct bladerf_devinfo *devices; struct bladerf_devinfo *devices;
......
...@@ -156,6 +156,9 @@ protected: ...@@ -156,6 +156,9 @@ protected:
*/ */
void init(dict_t const &dict, bladerf_direction direction); void init(dict_t const &dict, bladerf_direction direction);
void init_bladerf1(dict_t const &dict, bladerf_direction direction);
void init_bladerf2(dict_t const &dict, bladerf_direction direction);
/* Get a vector of available devices */ /* Get a vector of available devices */
static std::vector<std::string> devices(); static std::vector<std::string> devices();
/* Get the type of the open bladeRF board */ /* Get the type of the open bladeRF board */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment