bladerf: prepare functions to control DC offset / IQ balance (WIP)

wip-signat
Dimitri Stolnikov 9 years ago
parent 15d3699d72
commit df443ff5bd
  1. 39
      lib/bladerf/bladerf_source_c.cc
  2. 6
      lib/bladerf/bladerf_source_c.h

@ -38,6 +38,7 @@
#include "arg_helpers.h"
#include "bladerf_source_c.h"
#include "osmosdr/source.h"
/*
* Default size of sample FIFO, in entries.
@ -558,6 +559,44 @@ std::string bladerf_source_c::get_antenna( size_t chan )
return "RX";
}
void bladerf_source_c::set_dc_offset_mode( int mode, size_t chan )
{
std::cerr << __FUNCTION__ << " mode: " << mode << std::endl; /* TODO: remove */
if ( osmosdr::source::DCOffsetOff == mode ) {
//_src->set_auto_dc_offset( false, chan );
//_src->set_dc_offset( std::complex<double>(0.0, 0.0), chan ); /* TODO: reset to default for off-state */
} else if ( osmosdr::source::DCOffsetManual == mode ) {
//_src->set_auto_dc_offset( false, chan ); /* disable auto mode, but keep correcting with last known values */
} else if ( osmosdr::source::DCOffsetAutomatic == mode ) {
//_src->set_auto_dc_offset( true, chan );
}
}
void bladerf_source_c::set_dc_offset( const std::complex<double> &offset, size_t chan )
{
std::cerr << __FUNCTION__ << " offset: " << offset.real() << " " << offset.imag() << std::endl; /* TODO: remove */
}
void bladerf_source_c::set_iq_balance_mode( int mode, size_t chan )
{
std::cerr << __FUNCTION__ << " mode: " << mode << std::endl; /* TODO: remove */
if ( osmosdr::source::IQBalanceOff == mode ) {
//_src->set_auto_iq_balance( false, chan );
//_src->set_iq_balance( std::complex<double>(0.0, 0.0), chan ); /* TODO: reset to default for off-state */
} else if ( osmosdr::source::IQBalanceManual == mode ) {
//_src->set_auto_iq_balance( false, chan ); /* disable auto mode, but keep correcting with last known values */
} else if ( osmosdr::source::IQBalanceAutomatic == mode ) {
//_src->set_auto_iq_balance( true, chan );
}
}
void bladerf_source_c::set_iq_balance( const std::complex<double> &balance, size_t chan )
{
std::cerr << __FUNCTION__ << " balance: " << balance.real() << " " << balance.imag() << std::endl; /* TODO: remove */
}
double bladerf_source_c::set_bandwidth( double bandwidth, size_t chan )
{
int ret;

@ -102,6 +102,12 @@ public:
std::string set_antenna( const std::string & antenna, size_t chan = 0 );
std::string get_antenna( size_t chan = 0 );
void set_dc_offset_mode( int mode, size_t chan = 0 );
void set_dc_offset( const std::complex<double> &offset, size_t chan = 0 );
void set_iq_balance_mode( int mode, size_t chan = 0 );
void set_iq_balance( const std::complex<double> &balance, size_t chan = 0 );
double set_bandwidth( double bandwidth, size_t chan = 0 );
double get_bandwidth( size_t chan = 0 );
osmosdr::freq_range_t get_bandwidth_range( size_t chan = 0 );

Loading…
Cancel
Save