mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-10-22 02:57:41 +00:00
Prepare for gr-iio integration into GNU Radio
This commit is contained in:
@@ -217,6 +217,16 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
PUBLIC -DGRIIO_INCLUDE_HAS_GNURADIO=1
|
||||
)
|
||||
endif()
|
||||
if(GNURADIO_API_IIO)
|
||||
target_compile_definitions(signal_source_adapters
|
||||
PUBLIC -DGNURADIO_API_IIO=1
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(signal_source_adapters
|
||||
PUBLIC
|
||||
Gnuradio::iio
|
||||
Boost::chrono
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_CLANG_TIDY)
|
||||
|
@@ -64,6 +64,10 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
rf_gain_rx2_ = configuration->property(role + ".gain_rx2", 64.0);
|
||||
rf_port_select_ = configuration->property(role + ".rf_port_select", std::string("A_BALANCED"));
|
||||
filter_file_ = configuration->property(role + ".filter_file", std::string(""));
|
||||
filter_source_ = configuration->property(role + ".filter_source", std::string("Off"));
|
||||
filter_filename_ = configuration->property(role + ".filter_filename", std::string(""));
|
||||
Fpass_ = configuration->property(role + ".Fpass", 0.0);
|
||||
Fstop_ = configuration->property(role + ".Fstop", 0.0);
|
||||
filter_auto_ = configuration->property(role + ".filter_auto", true);
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
@@ -94,6 +98,17 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
}
|
||||
else
|
||||
{
|
||||
#if GNURADIO_API_IIO
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_source_.c_str(),
|
||||
filter_filename_.c_str(), Fpass_, Fstop_);
|
||||
#else
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
@@ -103,7 +118,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_file_.c_str(),
|
||||
filter_auto_);
|
||||
|
||||
#endif
|
||||
// configure LO
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
@@ -126,6 +141,17 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
}
|
||||
else
|
||||
{
|
||||
#if GNURADIO_API_IIO
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_source_.c_str(),
|
||||
filter_filename_.c_str(), Fpass_, Fstop_);
|
||||
#else
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
@@ -135,6 +161,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_file_.c_str(),
|
||||
filter_auto_);
|
||||
#endif
|
||||
// configure LO
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
|
@@ -102,6 +102,10 @@ private:
|
||||
std::string rf_port_select_;
|
||||
std::string filter_file_;
|
||||
bool filter_auto_;
|
||||
std::string filter_source_;
|
||||
std::string filter_filename_;
|
||||
float Fpass_;
|
||||
float Fstop_;
|
||||
|
||||
// DDS configuration for LO generation for external mixer
|
||||
bool enable_dds_lo_;
|
||||
|
@@ -55,7 +55,10 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
||||
rf_gain_ = configuration->property(role + ".gain", 50.0);
|
||||
filter_file_ = configuration->property(role + ".filter_file", std::string(""));
|
||||
filter_auto_ = configuration->property(role + ".filter_auto", true);
|
||||
|
||||
filter_source_ = configuration->property(role + ".filter_source", std::string("Off"));
|
||||
filter_filename_ = configuration->property(role + ".filter_filename", std::string(""));
|
||||
Fpass_ = configuration->property(role + ".Fpass", 0.0);
|
||||
Fstop_ = configuration->property(role + ".Fstop", 0.0);
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
samples_ = configuration->property(role + ".samples", 0);
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
@@ -75,10 +78,16 @@ PlutosdrSignalSource::PlutosdrSignalSource(ConfigurationInterface* configuration
|
||||
std::cout << "gain mode: " << gain_mode_ << std::endl;
|
||||
std::cout << "item type: " << item_type_ << std::endl;
|
||||
|
||||
#if GNURADIO_API_IIO
|
||||
plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_,
|
||||
bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_,
|
||||
gain_mode_.c_str(), rf_gain_, filter_source_.c_str(),
|
||||
filter_filename_.c_str(), Fpass_, Fstop_);
|
||||
#else
|
||||
plutosdr_source_ = gr::iio::pluto_source::make(uri_, freq_, sample_rate_,
|
||||
bandwidth_, buffer_size_, quadrature_, rf_dc_, bb_dc_,
|
||||
gain_mode_.c_str(), rf_gain_, filter_file_.c_str(), filter_auto_);
|
||||
|
||||
#endif
|
||||
if (samples_ != 0)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
|
@@ -97,6 +97,10 @@ private:
|
||||
double rf_gain_;
|
||||
std::string filter_file_;
|
||||
bool filter_auto_;
|
||||
std::string filter_source_;
|
||||
std::string filter_filename_;
|
||||
float Fpass_;
|
||||
float Fstop_;
|
||||
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
|
@@ -63,16 +63,6 @@ target_include_directories(signal_source_libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
)
|
||||
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
target_link_libraries(signal_source_libs
|
||||
PUBLIC
|
||||
Gnuradio::iio
|
||||
PRIVATE
|
||||
Gnuradio::analog
|
||||
Iio::iio
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
|
||||
target_link_libraries(signal_source_libs
|
||||
PUBLIC
|
||||
|
Reference in New Issue
Block a user