mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-31 03:14:56 +00:00
Adding a native AD936x custom signal source, still not usable
This commit is contained in:
parent
f8b227952a
commit
e074883f06
@ -39,6 +39,8 @@ option(ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requ
|
||||
|
||||
option(ENABLE_PLUTOSDR "Enable the use of ADALM-PLUTO Evaluation Boards (Analog Devices Inc.), requires gr-iio" OFF)
|
||||
|
||||
option(ENABLE_AD936X_SDR "Enable the use of AD936X front-ends using libiio, requires libiio" OFF)
|
||||
|
||||
option(ENABLE_AD9361 "Enable the use of AD9361 direct to FPGA hardware, requires libiio" OFF)
|
||||
|
||||
option(ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample source, requires libpcap" OFF)
|
||||
@ -3055,6 +3057,7 @@ set_package_properties(LIBAD9361 PROPERTIES
|
||||
)
|
||||
if(NOT LIBAD9361_FOUND)
|
||||
set(ENABLE_AD9361 OFF)
|
||||
set(ENABLE_AD936X_SDR OFF)
|
||||
set(ENABLE_FMCOMMS2 OFF)
|
||||
endif()
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
@ -3094,6 +3097,7 @@ if(ENABLE_AD9361 OR ENABLE_FMCOMMS2)
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
if(ENABLE_PACKAGING)
|
||||
set(ENABLE_AD9361 OFF)
|
||||
set(ENABLE_AD936X_SDR OFF)
|
||||
set(ENABLE_FMCOMMS2 OFF)
|
||||
else()
|
||||
message(FATAL_ERROR "libiio is required for building gnss-sdr with -DENABLE_AD9361=ON.")
|
||||
@ -3337,6 +3341,7 @@ add_feature_info(ENABLE_LIMESDR ENABLE_LIMESDR "Enables Limesdr_Signal_Source. R
|
||||
add_feature_info(ENABLE_FMCOMMS2 ENABLE_FMCOMMS2 "Enables Fmcomms2_Signal_Source for FMCOMMS2/3/4 devices. Requires gr-iio and libad9361-dev.")
|
||||
add_feature_info(ENABLE_PLUTOSDR ENABLE_PLUTOSDR "Enables Plutosdr_Signal_Source for using ADALM-PLUTO boards. Requires gr-iio.")
|
||||
add_feature_info(ENABLE_AD9361 ENABLE_AD9361 "Enables Ad9361_Fpga_Signal_Source for devices with the AD9361 chipset. Requires libiio and libad9361-dev.")
|
||||
add_feature_info(ENABLE_AD936X_SDR ENABLE_AD9361 "Enables Ad936x_Iio_Signal_Source to access AD936X front-ends using libiio. Requires libiio and libad9361-dev.")
|
||||
add_feature_info(ENABLE_RAW_UDP ENABLE_RAW_UDP "Enables Custom_UDP_Signal_Source for custom UDP packet sample source. Requires libpcap.")
|
||||
add_feature_info(ENABLE_FLEXIBAND ENABLE_FLEXIBAND "Enables Flexiband_Signal_Source for using Teleorbit's Flexiband RF front-end. Requires gr-teleorbit.")
|
||||
add_feature_info(ENABLE_ARRAY ENABLE_ARRAY "Enables Raw_Array_Signal_Source and Array_Signal_Conditioner for using CTTC's antenna array. Requires gr-dbfcttc.")
|
||||
|
@ -12,6 +12,10 @@ if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
||||
set(OPT_DRIVER_HEADERS gr_complex_ip_packet_source.h)
|
||||
endif()
|
||||
|
||||
if(ENABLE_AD936X_SDR)
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc)
|
||||
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h)
|
||||
endif()
|
||||
|
||||
set(SIGNAL_SOURCE_GR_BLOCKS_SOURCES
|
||||
fifo_reader.cc
|
||||
|
@ -0,0 +1,96 @@
|
||||
/*!
|
||||
* \file ad936x_iio_source.cc
|
||||
*
|
||||
* \brief Unpacks capture files in the LabSat 2 (ls2), LabSat 3 (ls3), or LabSat
|
||||
* 3 Wideband (LS3W) formats.
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "ad936x_iio_source.h"
|
||||
#include "INIReader.h"
|
||||
#include "command_event.h"
|
||||
#include "gnss_sdr_make_unique.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <exception>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
|
||||
ad936x_iio_source_sptr ad936x_iio_make_source_sptr(Concurrent_Queue<pmt::pmt_t> *queue,
|
||||
std::string pluto_device_uri,
|
||||
std::string board_type,
|
||||
long long bandwidth_,
|
||||
long long sample_rate_,
|
||||
std::vector<std::string> ch_list,
|
||||
std::vector<std::string> ch_gain_mode,
|
||||
std::vector<double> ch_gain_db,
|
||||
std::vector<long int> ch_freq_hz,
|
||||
int ch_sample_size,
|
||||
int ch_sample_bits_shift)
|
||||
{
|
||||
return ad936x_iio_source_sptr(new ad936x_iio_source(*queue,
|
||||
pluto_device_uri,
|
||||
board_type,
|
||||
bandwidth_,
|
||||
sample_rate_,
|
||||
ch_list,
|
||||
ch_gain_mode,
|
||||
ch_gain_db,
|
||||
ch_freq_hz,
|
||||
ch_sample_size,
|
||||
ch_sample_bits_shift));
|
||||
}
|
||||
|
||||
|
||||
ad936x_iio_source::ad936x_iio_source(Concurrent_Queue<pmt::pmt_t> *queue,
|
||||
std::string pluto_device_uri,
|
||||
std::string board_type,
|
||||
long long bandwidth_,
|
||||
long long sample_rate_,
|
||||
std::vector<std::string> ch_list,
|
||||
std::vector<std::string> ch_gain_mode,
|
||||
std::vector<double> ch_gain_db,
|
||||
std::vector<long int> ch_freq_hz,
|
||||
int ch_sample_size,
|
||||
int ch_sample_bits_shift) : gr::block("ad936x_iio_source",
|
||||
gr::io_signature::make(0, 0, 0),
|
||||
gr::io_signature::make(1, 3, sizeof(gr_complex)))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ad936x_iio_source::~ad936x_iio_source()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int ad936x_iio_source::general_work(int noutput_items,
|
||||
__attribute__((unused)) gr_vector_int &ninput_items,
|
||||
__attribute__((unused)) gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
std::vector<gr_complex *> out;
|
||||
for (auto &output_item : output_items)
|
||||
{
|
||||
out.push_back(reinterpret_cast<gr_complex *>(output_item));
|
||||
}
|
||||
std::cout << "Warning!!\n";
|
||||
return 0;
|
||||
}
|
100
src/algorithms/signal_source/gnuradio_blocks/ad936x_iio_source.h
Normal file
100
src/algorithms/signal_source/gnuradio_blocks/ad936x_iio_source.h
Normal file
@ -0,0 +1,100 @@
|
||||
/*!
|
||||
* \file ad936x_iio_source.h
|
||||
*
|
||||
* \brief signal source to receive samples from the AD936x FE family over libiio, including special custom functionalities in FPGA firmware.
|
||||
* \author Javier Arribas jarribas (at) cttc.es
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2022 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_AD9361_IIO_SOURCE_H
|
||||
#define GNSS_SDR_AD9361_IIO_SOURCE_H
|
||||
|
||||
#include "concurrent_queue.h"
|
||||
#include "gnss_block_interface.h"
|
||||
#include <gnuradio/block.h>
|
||||
#include <iio.h>
|
||||
#include <pmt/pmt.h>
|
||||
#include <ad9361.h> //multichip sync and high level functions
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
/** \addtogroup Signal_Source
|
||||
* \{ */
|
||||
/** \addtogroup Signal_Source_gnuradio_blocks
|
||||
* \{ */
|
||||
|
||||
|
||||
class ad936x_iio_source;
|
||||
|
||||
using ad936x_iio_source_sptr = gnss_shared_ptr<ad936x_iio_source>;
|
||||
|
||||
ad936x_iio_source_sptr ad936x_iio_make_source_sptr(
|
||||
Concurrent_Queue<pmt::pmt_t> *queue,
|
||||
std::string pluto_device_uri,
|
||||
std::string board_type,
|
||||
long long bandwidth_,
|
||||
long long sample_rate_,
|
||||
std::vector<std::string> ch_list,
|
||||
std::vector<std::string> ch_gain_mode,
|
||||
std::vector<double> ch_gain_db,
|
||||
std::vector<long int> ch_freq_hz,
|
||||
int ch_sample_size,
|
||||
int ch_sample_bits_shift);
|
||||
|
||||
/*!
|
||||
* \brief This class implements conversion between Labsat 2, 3 and 3 Wideband
|
||||
* formats to gr_complex
|
||||
*/
|
||||
class ad936x_iio_source : public gr::block
|
||||
{
|
||||
public:
|
||||
~ad936x_iio_source();
|
||||
|
||||
int general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend ad936x_iio_source_sptr ad936x_iio_make_source_sptr(
|
||||
Concurrent_Queue<pmt::pmt_t> *queue,
|
||||
std::string pluto_device_uri,
|
||||
std::string board_type,
|
||||
long long bandwidth_,
|
||||
long long sample_rate_,
|
||||
std::vector<std::string> ch_list,
|
||||
std::vector<std::string> ch_gain_mode,
|
||||
std::vector<double> ch_gain_db,
|
||||
std::vector<long int> ch_freq_hz,
|
||||
int ch_sample_size,
|
||||
int ch_sample_bits_shift);
|
||||
|
||||
ad936x_iio_source(Concurrent_Queue<pmt::pmt_t> *queue,
|
||||
std::string pluto_device_uri,
|
||||
std::string board_type,
|
||||
long long bandwidth_,
|
||||
long long sample_rate_,
|
||||
std::vector<std::string> ch_list,
|
||||
std::vector<std::string> ch_gain_mode,
|
||||
std::vector<double> ch_gain_db,
|
||||
std::vector<long int> ch_freq_hz,
|
||||
int ch_sample_size,
|
||||
int ch_sample_bits_shift);
|
||||
};
|
||||
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
#endif // GNSS_SDR_AD9361_IIO_SOURCE_H
|
Loading…
Reference in New Issue
Block a user