diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2014-11-27 16:38:25 +0100 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2014-11-27 16:38:25 +0100 |
commit | 20fd6a8c34339125dc509dc33ae7c3b1ed6e1959 (patch) | |
tree | 7315ba3835ed33ea6454cf8e18fc3925c6837e16 | |
parent | 163cad2e96195745c76631eec3a32197f20c787c (diff) |
airspy: implement DC bias control
use with -a "airspy,bias=1" to enable DC bias on antenna input
-rw-r--r-- | grc/gen_osmosdr_blocks.py | 2 | ||||
-rw-r--r-- | lib/airspy/airspy_source_c.cc | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/grc/gen_osmosdr_blocks.py b/grc/gen_osmosdr_blocks.py index 07d9d79..c002508 100644 --- a/grc/gen_osmosdr_blocks.py +++ b/grc/gen_osmosdr_blocks.py @@ -250,7 +250,7 @@ Lines ending with ... mean it's possible to bind devices together by specifying netsdr=127.0.0.1[:50000][,nchan=2] sdr-ip=127.0.0.1[:50000] sdr-iq=/dev/ttyUSB0 - airspy=0 + airspy=0[,bias=0|1] #end if hackrf=0[,buffers=32] bladerf=0[,fpga='/path/to/the/bitstream.rbf'] diff --git a/lib/airspy/airspy_source_c.cc b/lib/airspy/airspy_source_c.cc index 2bfef77..bc33fed 100644 --- a/lib/airspy/airspy_source_c.cc +++ b/lib/airspy/airspy_source_c.cc @@ -123,6 +123,13 @@ airspy_source_c::airspy_source_c (const std::string &args) set_if_gain( 0 ); /* preset to a reasonable default (non-GRC use case) */ + if ( dict.count( "bias" ) ) + { + bool bias = boost::lexical_cast<bool>( dict["bias"] ); + int ret = airspy_set_rf_bias(_dev, (uint8_t)bias); + AIRSPY_THROW_ON_ERROR(ret, "Failed to enable DC bias") + } + _fifo = new boost::circular_buffer<gr_complex>(5000000); if (!_fifo) { throw std::runtime_error( std::string(__FUNCTION__) + " " + |