mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-28 01:44:52 +00:00
Merge branch 'next' of https://github.com/carlesfernandez/gnss-sdr into next
This commit is contained in:
commit
65a60c3a8d
@ -2275,11 +2275,17 @@ endif()
|
||||
# IIO blocks for GNU Radio
|
||||
# https://github.com/analogdevicesinc/gr-iio
|
||||
##############################################
|
||||
find_package(GRIIO)
|
||||
set_package_properties(GRIIO PROPERTIES
|
||||
PURPOSE "Used for communication with PlutoSDR and FMCOMMS devices."
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
if(GNURADIO_IIO_FOUND)
|
||||
set(GRIIO_FOUND TRUE)
|
||||
set(GR_IIO_INCLUDE_HAS_GNURADIO TRUE)
|
||||
set(GNURADIO_API_IIO TRUE)
|
||||
else()
|
||||
find_package(GRIIO)
|
||||
set_package_properties(GRIIO PROPERTIES
|
||||
PURPOSE "Used for communication with PlutoSDR and FMCOMMS devices."
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
endif()
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
if(NOT GRIIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
|
@ -76,7 +76,6 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
|
||||
PATHS /usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
${GNURADIO_INSTALL_PREFIX}/include
|
||||
${GNURADIO_ROOT}/include
|
||||
$ENV{GNURADIO_ROOT}/include
|
||||
$ENV{GNURADIO_RUNTIME_DIR}/include
|
||||
@ -118,7 +117,6 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/opt/local/lib
|
||||
${GNURADIO_INSTALL_PREFIX}/lib
|
||||
${GNURADIO_ROOT}/lib
|
||||
$ENV{GNURADIO_ROOT}/lib
|
||||
${GNURADIO_ROOT}/lib64
|
||||
@ -277,6 +275,99 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# Search for IIO component
|
||||
if(GNURADIO_VERSION VERSION_GREATER 3.8.99)
|
||||
pkg_check_modules(PC_GNURADIO_IIO QUIET gnuradio-iio)
|
||||
# look for include files
|
||||
message(STATUS "Checking for GNU Radio Module: IIO")
|
||||
find_path(GNURADIO_IIO_INCLUDE_DIRS
|
||||
NAMES gnuradio/iio/api.h
|
||||
HINTS ${PC_GNURADIO_IIO_INCLUDEDIR}
|
||||
PATHS /usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
${GNURADIO_INSTALL_PREFIX}/include
|
||||
${GNURADIO_ROOT}/include
|
||||
$ENV{GNURADIO_ROOT}/include
|
||||
$ENV{GNURADIO_RUNTIME_DIR}/include
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
${GNURADIO_INSTALL_PREFIX}/include
|
||||
)
|
||||
|
||||
# look for libs
|
||||
find_library(GNURADIO_IIO_LIBRARIES
|
||||
NAMES gnuradio-iio gnuradio-iio-${GNURADIO_VERSION}
|
||||
HINTS ${PC_GNURADIO_IIO_LIBDIR}
|
||||
PATHS /usr/lib
|
||||
/usr/lib64
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/i386-linux-gnu
|
||||
/usr/lib/arm-linux-gnueabihf
|
||||
/usr/lib/arm-linux-gnueabi
|
||||
/usr/lib/aarch64-linux-gnu
|
||||
/usr/lib/mipsel-linux-gnu
|
||||
/usr/lib/mips-linux-gnu
|
||||
/usr/lib/mips64el-linux-gnuabi64
|
||||
/usr/lib/powerpc-linux-gnu
|
||||
/usr/lib/powerpc64-linux-gnu
|
||||
/usr/lib/powerpc64le-linux-gnu
|
||||
/usr/lib/powerpc-linux-gnuspe
|
||||
/usr/lib/hppa-linux-gnu
|
||||
/usr/lib/s390x-linux-gnu
|
||||
/usr/lib/i386-gnu
|
||||
/usr/lib/hppa-linux-gnu
|
||||
/usr/lib/x86_64-kfreebsd-gnu
|
||||
/usr/lib/i386-kfreebsd-gnu
|
||||
/usr/lib/m68k-linux-gnu
|
||||
/usr/lib/sh4-linux-gnu
|
||||
/usr/lib/sparc64-linux-gnu
|
||||
/usr/lib/x86_64-linux-gnux32
|
||||
/usr/lib/alpha-linux-gnu
|
||||
/usr/lib/riscv64-linux-gnu
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/opt/local/lib
|
||||
${GNURADIO_ROOT}/lib
|
||||
$ENV{GNURADIO_ROOT}/lib
|
||||
${GNURADIO_ROOT}/lib64
|
||||
$ENV{GNURADIO_ROOT}/lib64
|
||||
$ENV{GNURADIO_RUNTIME_DIR}/lib
|
||||
${CMAKE_INSTALL_PREFIX}/lib
|
||||
${CMAKE_INSTALL_PREFIX}/lib64
|
||||
${GNURADIO_INSTALL_PREFIX}/lib
|
||||
${GNURADIO_INSTALL_PREFIX}/lib64
|
||||
)
|
||||
|
||||
if(GNURADIO_IIO_LIBRARIES)
|
||||
message(STATUS " * INCLUDES=${GNURADIO_IIO_INCLUDE_DIRS}")
|
||||
message(STATUS " * LIBS=${GNURADIO_IIO_LIBRARIES}")
|
||||
endif()
|
||||
find_package_handle_standard_args(GNURADIO_IIO DEFAULT_MSG GNURADIO_IIO_LIBRARIES GNURADIO_IIO_INCLUDE_DIRS)
|
||||
|
||||
if(GNURADIO_IIO_FOUND)
|
||||
message(STATUS "GNURADIO_IIO_FOUND = ${GNURADIO_IIO_FOUND}")
|
||||
# append to all includes and libs list
|
||||
set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_IIO_INCLUDE_DIRS})
|
||||
set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_IIO_LIBRARIES})
|
||||
|
||||
# Create imported target
|
||||
if(NOT TARGET Gnuradio::iio)
|
||||
add_library(Gnuradio::iio SHARED IMPORTED)
|
||||
set(GNURADIO_LIBRARY ${GNURADIO_IIO_LIBRARIES})
|
||||
list(GET GNURADIO_LIBRARY 0 FIRST_DIR)
|
||||
get_filename_component(GNURADIO_DIR ${FIRST_DIR} ABSOLUTE)
|
||||
set_target_properties(Gnuradio::iio PROPERTIES
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
||||
IMPORTED_LOCATION "${GNURADIO_DIR}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_IIO_INCLUDE_DIRS}"
|
||||
INTERFACE_LINK_LIBRARIES "${GNURADIO_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
set_package_properties(GNURADIO PROPERTIES
|
||||
URL "https://www.gnuradio.org/"
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user